1 /** 2 * @file lighting.h 3 * 4 * Interface of light and vision. 5 */ 6 #ifndef __LIGHTING_H__ 7 #define __LIGHTING_H__ 8 9 DEVILUTION_BEGIN_NAMESPACE 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 typedef struct LightListStruct { 16 int _lx; 17 int _ly; 18 int _lradius; 19 int _lid; 20 bool _ldel; 21 bool _lunflag; 22 int _lunx; 23 int _luny; 24 int _lunr; 25 int _xoff; 26 int _yoff; 27 bool _lflags; 28 } LightListStruct; 29 30 extern LightListStruct VisionList[MAXVISION]; 31 extern BYTE lightactive[MAXLIGHTS]; 32 extern LightListStruct LightList[MAXLIGHTS]; 33 extern int numlights; 34 extern int numvision; 35 extern char lightmax; 36 extern BOOL dolighting; 37 extern int visionid; 38 extern BYTE *pLightTbl; 39 extern BOOL lightflag; 40 41 void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum); 42 void DoUnVision(int nXPos, int nYPos, int nRadius); 43 void DoVision(int nXPos, int nYPos, int nRadius, BOOL doautomap, BOOL visible); 44 void FreeLightTable(); 45 void InitLightTable(); 46 void MakeLightTable(); 47 #ifdef _DEBUG 48 void ToggleLighting(); 49 #endif 50 void InitLightMax(); 51 void InitLighting(); 52 int AddLight(int x, int y, int r); 53 void AddUnLight(int i); 54 void ChangeLightRadius(int i, int r); 55 void ChangeLightXY(int i, int x, int y); 56 void ChangeLightOff(int i, int x, int y); 57 void ChangeLight(int i, int x, int y, int r); 58 void ProcessLightList(); 59 void SavePreLighting(); 60 void InitVision(); 61 int AddVision(int x, int y, int r, BOOL mine); 62 void ChangeVisionRadius(int id, int r); 63 void ChangeVisionXY(int id, int x, int y); 64 void ProcessVisionList(); 65 void lighting_color_cycling(); 66 67 /* rdata */ 68 69 extern const char CrawlTable[2749]; 70 extern const BYTE vCrawlTable[23][30]; 71 72 #ifdef __cplusplus 73 } 74 #endif 75 76 DEVILUTION_END_NAMESPACE 77 78 #endif /* __LIGHTING_H__ */ 79