annotate LightsStack.cpp @ 1870:7a193504f18e

Actor::AI_SpellAttack adding accidentally removed random position for meteor shower
author Grumpy7
date Wed, 16 Oct 2013 05:59:21 +0200
parents 0aeac0b9ca30
children aff7a7b072b7
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
Ritor1
parents:
diff changeset
5 //----- (00467D88) --------------------------------------------------------
Ritor1
parents:
diff changeset
6 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
7 {
Ritor1
parents:
diff changeset
8 if (uNumLightsActive >= 400)
Ritor1
parents:
diff changeset
9 {
Ritor1
parents:
diff changeset
10 MessageBoxW(nullptr, L"Too many mobile lights!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\MobileLightStack.cpp:51", 0);
Ritor1
parents:
diff changeset
11 return false;
Ritor1
parents:
diff changeset
12 }
Ritor1
parents:
diff changeset
13
Ritor1
parents:
diff changeset
14 pLights[uNumLightsActive].vPosition.x = x;
Ritor1
parents:
diff changeset
15 pLights[uNumLightsActive].vPosition.y = y;
Ritor1
parents:
diff changeset
16 pLights[uNumLightsActive].vPosition.z = z;
Ritor1
parents:
diff changeset
17 pLights[uNumLightsActive].uRadius = uRadius;
Ritor1
parents:
diff changeset
18 pLights[uNumLightsActive].field_C = (((uRadius < 0) - 1) & 0x3E) - 31;
Ritor1
parents:
diff changeset
19 pLights[uNumLightsActive].uSectorID = uSectorID;
Ritor1
parents:
diff changeset
20 pLights[uNumLightsActive].field_10 = uRadius * uRadius >> 5;
Ritor1
parents:
diff changeset
21 pLights[uNumLightsActive].uLightColorR = r;
Ritor1
parents:
diff changeset
22 pLights[uNumLightsActive].uLightColorG = g;
Ritor1
parents:
diff changeset
23 pLights[uNumLightsActive].uLightColorB = b;
Ritor1
parents:
diff changeset
24 pLights[uNumLightsActive++].uLightType = uLightType;
Ritor1
parents:
diff changeset
25
Ritor1
parents:
diff changeset
26 return true;
Ritor1
parents:
diff changeset
27 }