annotate LightsStack.cpp @ 124:acf7f12714a7

Party skills
author Nomad
date Fri, 16 Nov 2012 13:56:53 +0200
parents 5159d2e6f559
children
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include <string>
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include "Lights.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 //----- (00467D88) --------------------------------------------------------
59
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
7 bool LightsStack_MobileLight_::AddLight(__int16 x, __int16 y, __int16 z, __int16 uSectorID, int uRadius, unsigned __int8 r, unsigned __int8 g, unsigned __int8 b, char uLightType)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 {
59
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
9 if (uNumLightsActive >= 400)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 MessageBoxW(nullptr, L"Too many mobile lights!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\MobileLightStack.cpp:51", 0);
59
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
12 return false;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 }
59
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
14
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
15 pLights[uNumLightsActive].vPosition.x = x;
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
16 pLights[uNumLightsActive].vPosition.y = y;
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
17 pLights[uNumLightsActive].vPosition.z = z;
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
18 pLights[uNumLightsActive].uRadius = uRadius;
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
19 pLights[uNumLightsActive].field_C = (((uRadius < 0) - 1) & 0x3E) - 31;
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
20 pLights[uNumLightsActive].uSectorID = uSectorID;
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
21 pLights[uNumLightsActive].field_10 = uRadius * uRadius >> 5;
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
22 pLights[uNumLightsActive].uLightColorR = r;
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
23 pLights[uNumLightsActive].uLightColorG = g;
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
24 pLights[uNumLightsActive].uLightColorB = b;
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
25 pLights[uNumLightsActive++].uLightType = uLightType;
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
26
5159d2e6f559 BLV render
Nomad
parents: 0
diff changeset
27 return true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 }