diff LightsStack.cpp @ 0:9c0607679772

init
author Ritor1
date Sat, 12 Jan 2013 09:45:18 +0600
parents
children 0aeac0b9ca30
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LightsStack.cpp	Sat Jan 12 09:45:18 2013 +0600
@@ -0,0 +1,28 @@
+#include <string>
+#include "Lights.h"
+
+#include "mm7_data.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;
+}