Mercurial > mm7
annotate LightsStack.cpp @ 2279:a01d3cf9ff83
mm7 game sound
author | Ritor1 |
---|---|
date | Fri, 14 Mar 2014 22:26:52 +0600 |
parents | aff7a7b072b7 |
children | d04017f3d2fa |
rev | line source |
---|---|
2253
aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents:
1262
diff
changeset
|
1 #define _CRT_SECURE_NO_WARNINGS |
0 | 2 #include <string> |
3 #include "Lights.h" | |
4 | |
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, char uLightType) | |
8 { | |
9 if (uNumLightsActive >= 400) | |
10 { | |
11 MessageBoxW(nullptr, L"Too many mobile lights!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\MobileLightStack.cpp:51", 0); | |
12 return false; | |
13 } | |
14 | |
15 pLights[uNumLightsActive].vPosition.x = x; | |
16 pLights[uNumLightsActive].vPosition.y = y; | |
17 pLights[uNumLightsActive].vPosition.z = z; | |
18 pLights[uNumLightsActive].uRadius = uRadius; | |
19 pLights[uNumLightsActive].field_C = (((uRadius < 0) - 1) & 0x3E) - 31; | |
20 pLights[uNumLightsActive].uSectorID = uSectorID; | |
21 pLights[uNumLightsActive].field_10 = uRadius * uRadius >> 5; | |
22 pLights[uNumLightsActive].uLightColorR = r; | |
23 pLights[uNumLightsActive].uLightColorG = g; | |
24 pLights[uNumLightsActive].uLightColorB = b; | |
25 pLights[uNumLightsActive++].uLightType = uLightType; | |
26 | |
27 return true; | |
28 } |