diff Engine/Graphics/LightmapBuilder.cpp @ 2508:491f0babd563

use_music_folder
author Ritor1
date Thu, 02 Oct 2014 11:52:31 +0600
parents 68cdef6879a0
children f6de3e15d4a5
line wrap: on
line diff
--- a/Engine/Graphics/LightmapBuilder.cpp	Thu Sep 25 10:40:16 2014 +0600
+++ b/Engine/Graphics/LightmapBuilder.cpp	Thu Oct 02 11:52:31 2014 +0600
@@ -31,12 +31,29 @@
 //----- (0045DF13) --------------------------------------------------------
 Lightmap::Lightmap()
 {
-  field_C18 = 0;
+  uNumVertices = -1;
+  for (uint i = 0; i < 64; ++i)
+    pVertices[i].flt_2C = 0.0f;
+  this->field_C18 = 0;
+  //this->vdestructor_ptr = &Lightmap_pvdtor;
 }
 
 //----- (0045BB06) --------------------------------------------------------
 LightmapBuilder::LightmapBuilder()
 {
+  char *v2; // eax@1
+  signed int v3; // ecx@1
+
+  for ( int i = 0; i < 512; ++i )
+    this->std__vector_000004[i] = Lightmap();
+  this->std__vector_000004_size = 0;
+
+  for ( int i = 0; i < 768; ++i )
+    this->std__vector_183808[i] = Lightmap();
+  this->std__vector_183808_size = 0;
+
+  for ( int i = 0; i < 256; i++ )
+    this->field_3C8C34[i].flt_2C = 0.0f;
 }
 
 //----- (0045BC07) --------------------------------------------------------
@@ -542,12 +559,9 @@
   if (!pLight->uRadius)
     return false;
 
-  if (pLight->vPosition.x > a2->pBounding.x1 - pLight->uRadius &&
-      pLight->vPosition.x < a2->pBounding.x2 + pLight->uRadius &&
-      pLight->vPosition.y > a2->pBounding.y1 - pLight->uRadius &&
-      pLight->vPosition.y < a2->pBounding.y2 + pLight->uRadius &&
-      pLight->vPosition.z > a2->pBounding.z1 - pLight->uRadius &&
-      pLight->vPosition.z < a2->pBounding.z2 + pLight->uRadius)
+  if (pLight->vPosition.x > a2->pBounding.x1 - pLight->uRadius && pLight->vPosition.x < a2->pBounding.x2 + pLight->uRadius &&
+      pLight->vPosition.y > a2->pBounding.y1 - pLight->uRadius && pLight->vPosition.y < a2->pBounding.y2 + pLight->uRadius &&
+      pLight->vPosition.z > a2->pBounding.z1 - pLight->uRadius && pLight->vPosition.z < a2->pBounding.z2 + pLight->uRadius)
   {
     v13 = (double)pLight->vPosition.z * a2->pFacePlane.vNormal.z +
           (double)pLight->vPosition.y * a2->pFacePlane.vNormal.y +
@@ -745,11 +759,6 @@
 {
   float v7; // esi@1
   int v8; // eax@1
-//  int v9; // ebx@1
-//  unsigned int v10; // ecx@1
-//  int v11; // edx@2
-//  int v12; // edx@4
-//  unsigned int v13; // edx@6
   double v14; // st7@7
   double result; // st7@8
   double v16; // st7@9
@@ -859,13 +868,8 @@
 {
   int result; // eax@0
   int v10; // ecx@8
-  //unsigned int v12; // ebx@11
-  //RenderD3D *v13; // ecx@11
   char v14; // dl@11
 
-  //__debugbreak();
-
-  result = (int)pFace;
   v10 = (pFace->pFacePlane.dist
               + pLight->vPosition.x * pFace->pFacePlane.vNormal.x
               + pLight->vPosition.y * pFace->pFacePlane.vNormal.y
@@ -907,11 +911,10 @@
       }
     }
     ++*pSlot;
-    LOBYTE(result) = 1;
+    return true;
   }
   else
-    LOBYTE(result) = 0;
-  return result;
+    return false;
 }
 // 4E94D2: using guessed type char _4E94D2_light_type;
 
@@ -993,53 +996,18 @@
 {
   StationaryLight *v8; // edi@1
   bool result; // eax@1
-//  unsigned int v10; // esi@2
   RenderVertexSoft *v11; // ebx@2
   float v12; // eax@3
   float v13; // eax@4
-//  double v14; // st7@11
   double maxz; // st7@11
   double v16; // st7@11
   double v17; // st6@11
-//  __int16 v18; // fps@11
-//  char v19; // c0@11
   char v20; // c2@11
-//  char v21; // c3@11
-//  double v22; // st6@12
-//  __int16 v23; // fps@12
-//  char v24; // c0@12
-//  char v25; // c2@12
-//  char v26; // c3@12
-//  double v27; // st7@13
-//  double v28; // st6@13
-//  __int16 v29; // fps@13
-//  char v30; // c0@13
-//  char v31; // c2@13
-//  char v32; // c3@13
-//  double v33; // st6@14
-//  __int16 v34; // fps@14
-//  char v35; // c0@14
-//  char v36; // c2@14
-//  char v37; // c3@14
-//  double v38; // st7@15
-//  double v39; // st6@15
-//  __int16 v40; // fps@15
-//  char v41; // c0@15
-//  char v42; // c2@15
-//  char v43; // c3@15
-//  double v44; // st6@16
-//  __int16 v45; // fps@16
-//  char v46; // c0@16
-//  char v47; // c2@16
-//  char v48; // c3@16
   Vec3_float_ *v49; // esi@17
-//  double v50; // st7@17
-//  double v51; // st6@17
   signed int v52; // ecx@17
   unsigned int *v53; // esi@18
   int v54; // eax@18
   unsigned int v55; // ebx@18
-  //RenderD3D *v56; // ecx@18
   char v57; // dl@18
   std::string v58; // [sp-18h] [bp-38h]@10
   const char *v59; // [sp-8h] [bp-28h]@10
@@ -1272,42 +1240,9 @@
 //----- (0045D74F) --------------------------------------------------------
 bool LightmapBuilder::DrawLightmaps(int *indices)
 {
-  //char v3; // zf@1
-//  IDirect3DDevice3 *v4; // eax@2
-//  HRESULT v5; // eax@2
-  //char *v6; // eax@2
-  //struct IDirect3DTexture2 *v7; // edi@4
-//  HRESULT v8; // eax@8
-//  HRESULT v9; // eax@8
-//  HRESULT v10; // eax@8
-//  HRESULT v11; // eax@8
-//  HRESULT v12; // eax@8
-  //int *v13; // eax@8
-  //float v14; // ecx@15
-  //IDirect3DDevice3 *v15; // eax@21
-  //HRESULT v16; // eax@21
-  //IDirect3DDevice3 *v17; // eax@21
-  //HRESULT v18; // eax@21
-  //IDirect3DDevice3 *v19; // eax@21
-  //HRESULT v20; // eax@21
-  //IDirect3DDevice3 *v21; // eax@21
-  //HRESULT v22; // eax@21
-  //IDirect3DDevice3 *v23; // eax@23
   std::string v25; // [sp+44h] [bp-44h]@12
-//  signed int v26; // [sp+48h] [bp-40h]@21
-//  signed int v27; // [sp+4Ch] [bp-3Ch]@21
   Lightmap *v28; // [sp+50h] [bp-38h]@2
-//  int v29; // [sp+54h] [bp-34h]@2
-  //float v30; // [sp+58h] [bp-30h]@2
   Vec3_float_ arg4;
-  //int arg4; // [sp+68h] [bp-20h]@8
-  //float v32; // [sp+6Ch] [bp-1Ch]@8
-  //float v33; // [sp+70h] [bp-18h]@8
-//  int v34; // [sp+74h] [bp-14h]@19
-//  int v35; // [sp+78h] [bp-10h]@2
-  //int *v36; // [sp+7Ch] [bp-Ch]@10
-  //int a1; // [sp+80h] [bp-8h]@12
-  //float v38; // [sp+84h] [bp-4h]@1
 
   if (std__vector_000004_size == 0)
     return true;
@@ -1365,11 +1300,8 @@
 {
   double v10; // st7@4
   double v14; // st7@7
-//  __int16 v15; // fps@8
   double v18; // st3@8
   signed int v24; // [sp-1Ch] [bp-670h]@13
-//  const char *v25; // [sp-18h] [bp-66Ch]@13
-//  int v26; // [sp-14h] [bp-668h]@13
   RenderVertexD3D3 a2[32]; // [sp+0h] [bp-654h]@7