Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

Light.h

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  Light.h                                                                             */
00003 /*                                                                                      */
00004 /*  Author: John Pollard                                                                */
00005 /*  Description: Handles lightmaps, dynamic light, fog, etc                             */
00006 /*                                                                                      */
00007 /*  The contents of this file are subject to the Genesis3D Public License               */
00008 /*  Version 1.01 (the "License"); you may not use this file except in                   */
00009 /*  compliance with the License. You may obtain a copy of the License at                */
00010 /*  http://www.genesis3d.com                                                            */
00011 /*                                                                                      */
00012 /*  Software distributed under the License is distributed on an "AS IS"                 */
00013 /*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */
00014 /*  the License for the specific language governing rights and limitations              */
00015 /*  under the License.                                                                  */
00016 /*                                                                                      */
00017 /*  The Original Code is Genesis3D, released March 25, 1999.                            */
00018 /*  Genesis3D Version 1.1 released November 15, 1999                                 */
00019 /*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */
00020 /*                                                                                      */
00021 /****************************************************************************************/
00022 #ifndef GE_LIGHT_H
00023 #define GE_LIGHT_H
00024 
00025 #include <Assert.h>
00026 //#include <Windows.h>
00027 
00028 #include "Genesis.h"
00029 #include "BaseType.h"
00030 #include "System.h"
00031 #include "DCommon.h"
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 //=====================================================================================
00038 //      Defines / Structure defines
00039 //=====================================================================================
00040 #define MAX_DYNAMIC_LIGHTS              64      // Maximum number of moving lights in map
00041 #define MAX_LTYPES                              24      // Max number of ltypes
00042 //#define       MAX_LMAP_SIZE                   128
00043 //#define       MAX_LMAP_SIZE                   18
00044 #define MAX_LMAP_SIZE                   36
00045 
00046 typedef struct
00047 {
00048         geBoolean       Active;                                 // Is this light in use?
00049         GE_RGBA         Color;                                  // Color of light (0...255.0f)
00050         geVec3d         Pos;                                    // Position of this light
00051         geFloat         Radius;                                 // Intensity of this light (Radius)
00052 
00053         // Fixed point color
00054         uint32          FColorR;
00055         uint32          FColorG;
00056         uint32          FColorB;
00057 
00058         geBoolean       CastShadow;
00059 } Light_DLight;
00060 
00061 typedef struct Light_LightInfo
00062 {
00063         // Intensity tables, for animated styles
00064         BOOL                    LTypeDynamic[MAX_LTYPES];
00065         int32                   LTypeIntensities[MAX_LTYPES];
00066         uint8                   LTypeIntensities2[MAX_LTYPES];
00067 
00068         char                    LTypeTable[MAX_LTYPES][70];
00069         int32                   IPos[MAX_LTYPES];                 // Ref position in ltype table
00070 
00071         Light_DLight    DynamicLights[MAX_DYNAMIC_LIGHTS];
00072         int32                   NumDynamicLights;
00073 } Light_LightInfo;
00074 
00075 typedef struct tag_light
00076 {
00077         int light;
00078    GE_RGBA color;
00079    int style;
00080    geVec3d origin;
00081 } light;
00082 
00083 //=====================================================================================
00084 //      Function ProtoTypes
00085 //=====================================================================================
00086 geBoolean       Light_EngineInit(geEngine *Engine);
00087 void            Light_EngineShutdown(geEngine *Engine);
00088 geBoolean       Light_WorldInit(geWorld *World);
00089 void            Light_WorldShutdown(geWorld *World);
00090 geBoolean       Light_SetEngine(geEngine *Engine);
00091 geBoolean       Light_SetWorld(geWorld *World);
00092 geBoolean       Light_SetGBSP(World_BSP *BSP);
00093 
00094 Light_DLight *Light_WorldAddLight(geWorld *World);
00095 void            Light_WorldRemoveLight(geWorld *World, Light_DLight *DLight);
00096 geBoolean        Light_SetupLights(geWorld *World);
00097 geBoolean       Light_SetAttributes(    Light_DLight *Light, 
00098                                                                 const geVec3d *Pos, 
00099                                                                 const GE_RGBA *RGBA, 
00100                                                                 geFloat Radius,
00101                                                                 geBoolean CastShadow);
00102 geBoolean       Light_WorldSetLTypeTable(geWorld *World, int32 LType, const char *Table);
00103 
00104 char            Light_WorldGetLTypeCurrent(geWorld *World, int32 LType);
00105 void            Light_SetupLightmap(DRV_LInfo *LInfo, BOOL *Dynamic);
00106 geBoolean       Light_GetLightmapRGB(Surf_SurfInfo *Surf, geVec3d *Pos, GE_RGBA *RGBA);
00107 geBoolean       Light_GetLightmapRGBBlended(Surf_SurfInfo *Surf, geVec3d *Pos, GE_RGBA *RGBA);
00108 void            Light_FogVerts(const geFog *Fog, const geVec3d *POV, const geVec3d *Verts, Surf_TexVert *TexVerts, int32 NumVerts);
00109 
00110 #ifdef __cplusplus
00111 }
00112 #endif
00113 
00114 #endif

Generated on Tue Sep 30 12:35:57 2003 for GTestAndEngine by doxygen 1.3.2