view LightsStack.cpp @ 52:0f4ed4f0f472

BLV minimap: 1/3
author Nomad
date Wed, 24 Oct 2012 17:02:44 +0200
parents 8b8875f5b359
children 5159d2e6f559
line wrap: on
line source

#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, int *a10)
{
  unsigned int v10; // eax@1
  int v11; // esi@2
  MobileLight *result; // eax@2
  std::string v13; // [sp-18h] [bp-1Ch]@3
  const char *v14; // [sp-8h] [bp-Ch]@3
  int v15; // [sp-4h] [bp-8h]@3

  v10 = this->uNumLightsActive;
  if ( (signed int)v10 >= 400 )
  {
    MessageBoxW(nullptr, L"Too many mobile lights!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\MobileLightStack.cpp:51", 0);
    result = 0;
  }
  else
  {
    v11 = uRadius;
    result = &this->pLights[v10];
    result->vPosition.x = x;
    result->vPosition.y = y;
    result->vPosition.z = z;
    result->uRadius = v11;
    result->field_C = (((v11 < 0) - 1) & 0x3E) - 31;
    result->uSectorID = uSectorID;
    result->field_10 = v11 * v11 >> 5;
    result->uLightColorR = r;
    result->uLightColorG = g;
    result->uLightColorB = b;
    result->field_B = (char)a10;
    ++this->uNumLightsActive;
    LOBYTE(result) = 1;
  }
  return (bool)result;
}