annotate LightsStack.cpp @ 271:1f0af5cac2dd

_42ECB5_PlayerAttacksActor
author Nomad
date Mon, 18 Feb 2013 13:07:25 +0200
parents 9c0607679772
children 0aeac0b9ca30
rev   line source
0
Ritor1
parents:
diff changeset
1 #include <string>
Ritor1
parents:
diff changeset
2 #include "Lights.h"
Ritor1
parents:
diff changeset
3
Ritor1
parents:
diff changeset
4 #include "mm7_data.h"
Ritor1
parents:
diff changeset
5
Ritor1
parents:
diff changeset
6 //----- (00467D88) --------------------------------------------------------
Ritor1
parents:
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)
Ritor1
parents:
diff changeset
8 {
Ritor1
parents:
diff changeset
9 if (uNumLightsActive >= 400)
Ritor1
parents:
diff changeset
10 {
Ritor1
parents:
diff changeset
11 MessageBoxW(nullptr, L"Too many mobile lights!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\MobileLightStack.cpp:51", 0);
Ritor1
parents:
diff changeset
12 return false;
Ritor1
parents:
diff changeset
13 }
Ritor1
parents:
diff changeset
14
Ritor1
parents:
diff changeset
15 pLights[uNumLightsActive].vPosition.x = x;
Ritor1
parents:
diff changeset
16 pLights[uNumLightsActive].vPosition.y = y;
Ritor1
parents:
diff changeset
17 pLights[uNumLightsActive].vPosition.z = z;
Ritor1
parents:
diff changeset
18 pLights[uNumLightsActive].uRadius = uRadius;
Ritor1
parents:
diff changeset
19 pLights[uNumLightsActive].field_C = (((uRadius < 0) - 1) & 0x3E) - 31;
Ritor1
parents:
diff changeset
20 pLights[uNumLightsActive].uSectorID = uSectorID;
Ritor1
parents:
diff changeset
21 pLights[uNumLightsActive].field_10 = uRadius * uRadius >> 5;
Ritor1
parents:
diff changeset
22 pLights[uNumLightsActive].uLightColorR = r;
Ritor1
parents:
diff changeset
23 pLights[uNumLightsActive].uLightColorG = g;
Ritor1
parents:
diff changeset
24 pLights[uNumLightsActive].uLightColorB = b;
Ritor1
parents:
diff changeset
25 pLights[uNumLightsActive++].uLightType = uLightType;
Ritor1
parents:
diff changeset
26
Ritor1
parents:
diff changeset
27 return true;
Ritor1
parents:
diff changeset
28 }