comparison Engine/Graphics/LightsStack.cpp @ 2496:5abd8fc8f1c6

for ITEM_ARTIFACT_LADYS_ESCORT
author Ritor1
date Thu, 18 Sep 2014 17:38:54 +0600
parents
children
comparison
equal deleted inserted replaced
2495:7b076fe64f23 2496:5abd8fc8f1c6
1 #define _CRTDBG_MAP_ALLOC
2 #include <stdlib.h>
3 #include <crtdbg.h>
4
5 #define _CRT_SECURE_NO_WARNINGS
6 #include <string>
7 #include "Lights.h"
8 #include "OSAPI.h"
9
10
11 //----- (00467D88) --------------------------------------------------------
12 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)
13 {
14 if (uNumLightsActive >= 400)
15 {
16 MessageBoxW(nullptr, L"Too many mobile lights!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\MobileLightStack.cpp:51", 0);
17 return false;
18 }
19
20 pLights[uNumLightsActive].vPosition.x = x;
21 pLights[uNumLightsActive].vPosition.y = y;
22 pLights[uNumLightsActive].vPosition.z = z;
23 pLights[uNumLightsActive].uRadius = uRadius;
24 pLights[uNumLightsActive].field_C = (((uRadius < 0) - 1) & 0x3E) - 31;
25 pLights[uNumLightsActive].uSectorID = uSectorID;
26 pLights[uNumLightsActive].field_10 = uRadius * uRadius >> 5;
27 pLights[uNumLightsActive].uLightColorR = r;
28 pLights[uNumLightsActive].uLightColorG = g;
29 pLights[uNumLightsActive].uLightColorB = b;
30 pLights[uNumLightsActive++].uLightType = uLightType;
31
32 return true;
33 }
34
35 bool LightsStack_StationaryLight_::AddLight( __int16 x, __int16 y, __int16 z, __int16 a5, unsigned char r, unsigned char g, unsigned char b, char uLightType )
36 {
37 //unsigned int v9; // eax@1
38 //std::string v11; // [sp-18h] [bp-18h]@3
39
40 //v9 = this->uNumLightsActive;
41 if ( (signed int)this->uNumLightsActive >= 400 )
42 {
43 MessageBoxW(nullptr, L"Too many stationary lights!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\StationaryLightStack.cpp:45", 0);
44 return false;
45 }
46
47 StationaryLight* pLight = &pLights[uNumLightsActive++];
48 pLight->vPosition.x = x;
49 pLight->vPosition.y = y;
50 pLight->vPosition.z = z;
51 pLight->uRadius = a5;
52 pLight->uLightColorR = (unsigned __int8)r;
53 pLight->uLightColorG = g;
54 pLight->uLightColorB = b;
55 pLight->uLightType = uLightType;
56 return true;
57 }