This repository was archived by the owner on Sep 3, 2026. It is now read-only.
forked from Nommy228/Might-and-Magic-Trilogy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLightsStack.cpp
More file actions
57 lines (49 loc) · 1.97 KB
/
Copy pathLightsStack.cpp
File metadata and controls
57 lines (49 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define _CRT_SECURE_NO_WARNINGS
#include <string>
#include "Lights.h"
#include "OSAPI.h"
//----- (00467D88) --------------------------------------------------------
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)
{
if (uNumLightsActive >= 400)
{
MessageBoxW(nullptr, L"Too many mobile lights!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\MobileLightStack.cpp:51", 0);
return false;
}
pLights[uNumLightsActive].vPosition.x = x;
pLights[uNumLightsActive].vPosition.y = y;
pLights[uNumLightsActive].vPosition.z = z;
pLights[uNumLightsActive].uRadius = uRadius;
pLights[uNumLightsActive].field_C = (((uRadius < 0) - 1) & 0x3E) - 31;
pLights[uNumLightsActive].uSectorID = uSectorID;
pLights[uNumLightsActive].field_10 = uRadius * uRadius >> 5;
pLights[uNumLightsActive].uLightColorR = r;
pLights[uNumLightsActive].uLightColorG = g;
pLights[uNumLightsActive].uLightColorB = b;
pLights[uNumLightsActive++].uLightType = uLightType;
return true;
}
bool LightsStack_StationaryLight_::AddLight( __int16 x, __int16 y, __int16 z, __int16 a5, unsigned char r, unsigned char g, unsigned char b, char uLightType )
{
//unsigned int v9; // eax@1
//std::string v11; // [sp-18h] [bp-18h]@3
//v9 = this->uNumLightsActive;
if ( (signed int)this->uNumLightsActive >= 400 )
{
MessageBoxW(nullptr, L"Too many stationary lights!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\StationaryLightStack.cpp:45", 0);
return false;
}
StationaryLight* pLight = &pLights[uNumLightsActive++];
pLight->vPosition.x = x;
pLight->vPosition.y = y;
pLight->vPosition.z = z;
pLight->uRadius = a5;
pLight->uLightColorR = (unsigned __int8)r;
pLight->uLightColorG = g;
pLight->uLightColorB = b;
pLight->uLightType = uLightType;
return true;
}