00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GE_LIGHT_H
00023 #define GE_LIGHT_H
00024
00025 #include <Assert.h>
00026
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
00039
00040 #define MAX_DYNAMIC_LIGHTS 64 // Maximum number of moving lights in map
00041 #define MAX_LTYPES 24 // Max number of ltypes
00042
00043
00044 #define MAX_LMAP_SIZE 36
00045
00046 typedef struct
00047 {
00048 geBoolean Active;
00049 GE_RGBA Color;
00050 geVec3d Pos;
00051 geFloat Radius;
00052
00053
00054 uint32 FColorR;
00055 uint32 FColorG;
00056 uint32 FColorB;
00057
00058 geBoolean CastShadow;
00059 } Light_DLight;
00060
00061 typedef struct Light_LightInfo
00062 {
00063
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];
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
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