annotate Lights.h @ 10:5983336e1300

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