Mercurial > mm7
comparison Lights.h @ 0:9c0607679772
init
author | Ritor1 |
---|---|
date | Sat, 12 Jan 2013 09:45:18 +0600 |
parents | |
children | 61343380715b |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:9c0607679772 |
---|---|
1 #pragma once | |
2 #include "OSAPI.h" // messagebox | |
3 | |
4 #include "VectorTypes.h" | |
5 | |
6 | |
7 /* 257 */ | |
8 #pragma pack(push, 1) | |
9 struct StationaryLight | |
10 { | |
11 Vec3_short_ vPosition; | |
12 __int16 uRadius; | |
13 unsigned __int8 uLightColorR; | |
14 unsigned __int8 uLightColorG; | |
15 unsigned __int8 uLightColorB; | |
16 char uLightType; | |
17 }; | |
18 #pragma pack(pop) | |
19 | |
20 | |
21 | |
22 | |
23 #pragma pack(push, 1) | |
24 struct MobileLight | |
25 { | |
26 Vec3_short_ vPosition; | |
27 __int16 uRadius; | |
28 unsigned __int8 uLightColorR; | |
29 unsigned __int8 uLightColorG; | |
30 unsigned __int8 uLightColorB; | |
31 char uLightType; | |
32 __int16 field_C; | |
33 __int16 uSectorID; | |
34 __int16 field_10; | |
35 }; | |
36 #pragma pack(pop) | |
37 | |
38 | |
39 | |
40 /* | |
41 #pragma pack(push, 1) | |
42 struct LightStack<T> | |
43 { | |
44 int field_0; | |
45 char T[400]; | |
46 unsigned int uNumLightsActive; | |
47 }; | |
48 #pragma pack(pop)*/ | |
49 | |
50 | |
51 | |
52 /* 260 */ | |
53 #pragma pack(push, 1) | |
54 struct LightsStack_StationaryLight_ | |
55 { | |
56 //----- (004AD385) -------------------------------------------------------- | |
57 LightsStack_StationaryLight_() | |
58 { | |
59 uNumLightsActive = 0; | |
60 } | |
61 | |
62 //----- (004AD395) -------------------------------------------------------- | |
63 virtual ~LightsStack_StationaryLight_() | |
64 { | |
65 uNumLightsActive = 0; | |
66 } | |
67 | |
68 //----- (004AD39D) -------------------------------------------------------- | |
69 inline unsigned int GetNumLights() | |
70 { | |
71 return uNumLightsActive; | |
72 } | |
73 | |
74 //----- (004AD3C8) -------------------------------------------------------- | |
75 inline bool AddLight(__int16 x, __int16 y, __int16 z, __int16 a5, unsigned char r, unsigned char g, unsigned char b, char uLightType) | |
76 { | |
77 unsigned int v9; // eax@1 | |
78 std::string v11; // [sp-18h] [bp-18h]@3 | |
79 | |
80 v9 = this->uNumLightsActive; | |
81 if ( (signed int)v9 >= 400 ) | |
82 { | |
83 MessageBoxW(nullptr, L"Too many stationary lights!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\StationaryLightStack.cpp:45", 0); | |
84 return false; | |
85 } | |
86 | |
87 auto pLight = &pLights[uNumLightsActive++]; | |
88 pLight->vPosition.x = x; | |
89 pLight->vPosition.y = y; | |
90 pLight->vPosition.z = z; | |
91 pLight->uRadius = a5; | |
92 pLight->uLightColorR = (unsigned __int8)r; | |
93 pLight->uLightColorG = g; | |
94 pLight->uLightColorB = b; | |
95 pLight->uLightType = uLightType; | |
96 return true; | |
97 } | |
98 | |
99 | |
100 | |
101 void (__thiscall ***vdestructor_ptr)(LightsStack_StationaryLight_ *, bool); | |
102 StationaryLight pLights[400]; | |
103 unsigned int uNumLightsActive; | |
104 }; | |
105 #pragma pack(pop) | |
106 | |
107 | |
108 | |
109 | |
110 /* 261 */ | |
111 #pragma pack(push, 1) | |
112 struct LightsStack_MobileLight_ | |
113 { | |
114 //----- (00467D45) -------------------------------------------------------- | |
115 inline LightsStack_MobileLight_() | |
116 { | |
117 this->uNumLightsActive = 0; | |
118 //this->vdestructor_ptr = &pLightsStack_MobileLight__pvdtor; | |
119 } | |
120 //----- (00467D55) -------------------------------------------------------- | |
121 virtual ~LightsStack_MobileLight_() | |
122 { | |
123 this->uNumLightsActive = 0; | |
124 } | |
125 | |
126 bool AddLight(__int16 x, __int16 y, __int16 z, __int16 uSectorID, int uRadius, unsigned __int8 r, unsigned __int8 g, unsigned __int8 b, char a10); | |
127 | |
128 | |
129 | |
130 void (__thiscall ***vdestructor_ptr)(LightsStack_MobileLight_ *, bool); | |
131 MobileLight pLights[400]; | |
132 unsigned int uNumLightsActive; | |
133 }; | |
134 #pragma pack(pop) |