Mercurial > might-and-magic-trilogy
comparison LightsStack.cpp @ 0:8b8875f5b359
Initial commit
author | Nomad |
---|---|
date | Fri, 05 Oct 2012 16:07:14 +0200 |
parents | |
children | 5159d2e6f559 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:8b8875f5b359 |
---|---|
1 #include <string> | |
2 #include "Lights.h" | |
3 | |
4 #include "mm7_data.h" | |
5 | |
6 //----- (00467D88) -------------------------------------------------------- | |
7 bool LightsStack_MobileLight_::AddLight(__int16 x, __int16 y, __int16 z, __int16 uSectorID, int uRadius, unsigned __int8 r, unsigned __int8 g, unsigned __int8 b, int *a10) | |
8 { | |
9 unsigned int v10; // eax@1 | |
10 int v11; // esi@2 | |
11 MobileLight *result; // eax@2 | |
12 std::string v13; // [sp-18h] [bp-1Ch]@3 | |
13 const char *v14; // [sp-8h] [bp-Ch]@3 | |
14 int v15; // [sp-4h] [bp-8h]@3 | |
15 | |
16 v10 = this->uNumLightsActive; | |
17 if ( (signed int)v10 >= 400 ) | |
18 { | |
19 MessageBoxW(nullptr, L"Too many mobile lights!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\MobileLightStack.cpp:51", 0); | |
20 result = 0; | |
21 } | |
22 else | |
23 { | |
24 v11 = uRadius; | |
25 result = &this->pLights[v10]; | |
26 result->vPosition.x = x; | |
27 result->vPosition.y = y; | |
28 result->vPosition.z = z; | |
29 result->uRadius = v11; | |
30 result->field_C = (((v11 < 0) - 1) & 0x3E) - 31; | |
31 result->uSectorID = uSectorID; | |
32 result->field_10 = v11 * v11 >> 5; | |
33 result->uLightColorR = r; | |
34 result->uLightColorG = g; | |
35 result->uLightColorB = b; | |
36 result->field_B = (char)a10; | |
37 ++this->uNumLightsActive; | |
38 LOBYTE(result) = 1; | |
39 } | |
40 return (bool)result; | |
41 } |