diff Engine/Graphics/Render.cpp @ 2562:b8a56afc6ba1

new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
author Ritor1
date Sun, 17 May 2015 22:42:13 +0600
parents 98057834c9a0
children 30eb6dcac768
line wrap: on
line diff
--- a/Engine/Graphics/Render.cpp	Thu May 14 19:29:28 2015 +0600
+++ b/Engine/Graphics/Render.cpp	Sun May 17 22:42:13 2015 +0600
@@ -48,7 +48,7 @@
 int uNumSpritesDrawnThisFrame; // weak
 
 RenderVertexSoft array_507D30[50];
-RenderVertexSoft array_50AC10[50];
+RenderVertexSoft VertexRenderList[50];//array_50AC10
 RenderVertexSoft array_73D150[20];
 
 RenderVertexD3D3 d3d_vertex_buffer[50];
@@ -366,8 +366,8 @@
       pTilePolygon->field_50 = (8 * (0 | (0 << 6))) | 6;
       for (unsigned int k = 0; k < pTilePolygon->uNumVertices; ++k)
       {
-        memcpy(&array_50AC10[k], &array_73D150[k], sizeof(struct RenderVertexSoft));
-        array_50AC10[k]._rhw = 1.0 / (array_73D150[k].vWorldViewPosition.x + 0.0000001000000011686097);
+        memcpy(&VertexRenderList[k], &array_73D150[k], sizeof(struct RenderVertexSoft));
+        VertexRenderList[k]._rhw = 1.0 / (array_73D150[k].vWorldViewPosition.x + 0.0000001000000011686097);
       }
 //shading (затенение)----------------------------------------------------------------------------
       //uint norm_idx = pTerrainNormalIndices[2 * (z * 128 + x) + 1];
@@ -383,13 +383,13 @@
         norm = 0;
       else
         norm = &pTerrainNormals[norm_idx];
-      if (for_refactoring)
-      {
+	  if (lights_flag)
+	  {
         //MessageBoxA(nullptr, "Ritor1: function StackLights_TerrainFace needed refactoring and result - slows", "", 0);
         //__debugbreak();
 
-      pEngine->pLightmapBuilder->StackLights_TerrainFace(norm, &Light_tile_dist, array_50AC10, 4, 1);//Ritor1: slows
-      //pDecalBuilder->_49BE8A(pTilePolygon, norm, &Light_tile_dist, array_50AC10, 4, 1);
+      pEngine->pLightmapBuilder->StackLights_TerrainFace(norm, &Light_tile_dist, VertexRenderList, 4, 1);//Ritor1: slows
+      //pDecalBuilder->_49BE8A(pTilePolygon, norm, &Light_tile_dist, VertexRenderList, 4, 1);
       }
       unsigned int a5 = 4;
 
@@ -406,20 +406,20 @@
                    || (double)pODMRenderParams->shading_dist_mist < array_73D150[2].vWorldViewPosition.x
                    || (double)pODMRenderParams->shading_dist_mist < array_73D150[3].vWorldViewPosition.x;
 
-      int v33 = 0;
+      int uClipFlag = 0;
       static stru154 static_sub_0048034E_stru_154;
-      pEngine->pLightmapBuilder->std__vector_000004_size = 0;
-      if ( stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 )
+      pEngine->pLightmapBuilder->StationaryLightsCount = 0;
+      if ( Lights.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 )
       {
         if ( neer_clip )
-          v33 = 3;
+          uClipFlag = 3;
         else
-          v33 = far_clip != 0 ? 5 : 0;
+          uClipFlag = far_clip != 0 ? 5 : 0;
         static_sub_0048034E_stru_154.ClassifyPolygon(norm, Light_tile_dist);
         if ( pDecalBuilder->uNumDecals > 0 )
-          pDecalBuilder->ApplyDecals(31 - pTilePolygon->dimming_level, 4, &static_sub_0048034E_stru_154, a5, array_50AC10, 0, *(float *)&v33, -1);
-        if ( stru_F8AD28.uNumLightsApplied > 0 )
-          pEngine->pLightmapBuilder->ApplyLights(&stru_F8AD28, &static_sub_0048034E_stru_154, a5, array_50AC10, 0, v33);
+          pDecalBuilder->ApplyDecals(31 - pTilePolygon->dimming_level, 4, &static_sub_0048034E_stru_154, a5, VertexRenderList, 0, *(float *)&uClipFlag, -1);
+        if ( Lights.uNumLightsApplied > 0 )
+          pEngine->pLightmapBuilder->ApplyLights(&Lights, &static_sub_0048034E_stru_154, a5, VertexRenderList, 0, uClipFlag);
       }
 
       if ( !byte_4D864C || ~pEngine->uFlags & 0x80 )
@@ -2007,18 +2007,18 @@
   v6 = 0;
   if ( this->uNumD3DSceneBegins && (signed int)uNumVertices >= 3 )
   {
-    //v54 = pEngine->pLightmapBuilder->std__vector_000004_size;
-    if ( pEngine->pLightmapBuilder->std__vector_000004_size)
+    //v54 = pEngine->pLightmapBuilder->StationaryLightsCount;
+    if ( pEngine->pLightmapBuilder->StationaryLightsCount)
       a2 = -1;
     pEngine->AlterGamma_ODM(a4, &a2);
     if ( byte_4D864C && pEngine->uFlags & GAME_FLAGS_1_01_lightmap_related)
     {
-      v8 = ::GetActorTintColor(a3->dimming_level, 0, array_50AC10[0].vWorldViewPosition.x, 0, 0);
-      pEngine->pLightmapBuilder->DrawLightmaps(/*v8, 0*/);
+      v8 = ::GetActorTintColor(a3->dimming_level, 0, VertexRenderList[0].vWorldViewPosition.x, 0, 0);
+      pEngine->pLightmapBuilder->DrawLightmaps(v8/*, 0*/);
     }
     else
     {
-      if ( !pEngine->pLightmapBuilder->std__vector_000004_size || byte_4D864C && pEngine->uFlags & 2 )
+      if ( !pEngine->pLightmapBuilder->StationaryLightsCount || byte_4D864C && pEngine->uFlags & 2 )
       {
         ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP));
         ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_CW));
@@ -2031,19 +2031,19 @@
 		for (uint i = 0; i < uNumVertices; ++i)
 		{
 		
-		  d3d_vertex_buffer[i].pos.x = array_50AC10[i].vWorldViewProjX;
-		  d3d_vertex_buffer[i].pos.y = array_50AC10[i].vWorldViewProjY;
-		  d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((array_50AC10[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist);
-		  d3d_vertex_buffer[i].rhw = 1.0 / (array_50AC10[i].vWorldViewPosition.x + 0.0000001);
-		  d3d_vertex_buffer[i].diffuse = ::GetActorTintColor(a3->dimming_level, 0, array_50AC10[i].vWorldViewPosition.x, 0, 0);
+		  d3d_vertex_buffer[i].pos.x = VertexRenderList[i].vWorldViewProjX;
+		  d3d_vertex_buffer[i].pos.y = VertexRenderList[i].vWorldViewProjY;
+		  d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((VertexRenderList[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist);
+		  d3d_vertex_buffer[i].rhw = 1.0 / (VertexRenderList[i].vWorldViewPosition.x + 0.0000001);
+		  d3d_vertex_buffer[i].diffuse = ::GetActorTintColor(a3->dimming_level, 0, VertexRenderList[i].vWorldViewPosition.x, 0, 0);
           pEngine->AlterGamma_ODM(a4, &d3d_vertex_buffer[i].diffuse);
 
 		  if ( this->bUsingSpecular )
-            d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_specular(0, 0, array_50AC10[i].vWorldViewPosition.x);
+            d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_specular(0, 0, VertexRenderList[i].vWorldViewPosition.x);
           else
             d3d_vertex_buffer[i].specular = 0;
-		  d3d_vertex_buffer[i].texcoord.x = array_50AC10[i].u;
-		  d3d_vertex_buffer[i].texcoord.y = array_50AC10[i].v;
+		  d3d_vertex_buffer[i].texcoord.x = VertexRenderList[i].u;
+		  d3d_vertex_buffer[i].texcoord.y = VertexRenderList[i].v;
 		  
 		}
 
@@ -2070,17 +2070,17 @@
 		for (uint i = 0; i < uNumVertices; ++i)
 		{
 		
-		  d3d_vertex_buffer[i].pos.x = array_50AC10[i].vWorldViewProjX;
-		  d3d_vertex_buffer[i].pos.y = array_50AC10[i].vWorldViewProjY;
-		  d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((array_50AC10[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist);
-		  d3d_vertex_buffer[i].rhw = 1.0 / (array_50AC10[i].vWorldViewPosition.x + 0.0000001);
-		  d3d_vertex_buffer[i].diffuse = GetActorTintColor(a3->dimming_level, 0, array_50AC10[i].vWorldViewPosition.x, 0, 0);
+		  d3d_vertex_buffer[i].pos.x = VertexRenderList[i].vWorldViewProjX;
+		  d3d_vertex_buffer[i].pos.y = VertexRenderList[i].vWorldViewProjY;
+		  d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((VertexRenderList[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist);
+		  d3d_vertex_buffer[i].rhw = 1.0 / (VertexRenderList[i].vWorldViewPosition.x + 0.0000001);
+		  d3d_vertex_buffer[i].diffuse = GetActorTintColor(a3->dimming_level, 0, VertexRenderList[i].vWorldViewPosition.x, 0, 0);
           if ( this->bUsingSpecular )
-            d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_specular(0, 0, array_50AC10[i].vWorldViewPosition.x);
+            d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_specular(0, 0, VertexRenderList[i].vWorldViewPosition.x);
           else
             d3d_vertex_buffer[i].specular = 0;
-		  d3d_vertex_buffer[i].texcoord.x = array_50AC10[i].u;
-		  d3d_vertex_buffer[i].texcoord.y = array_50AC10[i].v;
+		  d3d_vertex_buffer[i].texcoord.x = VertexRenderList[i].u;
+		  d3d_vertex_buffer[i].texcoord.y = VertexRenderList[i].v;
 		  
 		}
 	  
@@ -2098,7 +2098,7 @@
         //v50 = (const char *)v5->pRenderD3D->pDevice;
         ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE));
         //(*(void (**)(void))(*(int *)v50 + 88))();
-        pEngine->pLightmapBuilder->DrawLightmaps(/*-1, 0*/);
+        pEngine->pLightmapBuilder->DrawLightmaps(-1/*, 0*/);
 	    for (uint i = 0; i < uNumVertices; ++i)
 		{
 		  d3d_vertex_buffer[i].diffuse = a2;
@@ -4553,44 +4553,44 @@
       this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO);
      }
 
-     pVertices[0].pos.x = array_50AC10[0].vWorldViewProjX;
-     pVertices[0].pos.y = array_50AC10[0].vWorldViewProjY;
-     pVertices[0].pos.z = 1.0 - 1.0 / (1000 * array_50AC10[0].vWorldViewPosition.x / (double)pODMRenderParams->shading_dist_mist);
-     pVertices[0].rhw = 1.0 / (array_50AC10[0].vWorldViewPosition.x + 0.0000001000000011686097);
-     pVertices[0].diffuse = GetActorTintColor(a3->field_58, 0, array_50AC10[0].vWorldViewPosition.x, 0, 0);
+     pVertices[0].pos.x = VertexRenderList[0].vWorldViewProjX;
+     pVertices[0].pos.y = VertexRenderList[0].vWorldViewProjY;
+     pVertices[0].pos.z = 1.0 - 1.0 / (1000 * VertexRenderList[0].vWorldViewPosition.x / (double)pODMRenderParams->shading_dist_mist);
+     pVertices[0].rhw = 1.0 / (VertexRenderList[0].vWorldViewPosition.x + 0.0000001000000011686097);
+     pVertices[0].diffuse = GetActorTintColor(a3->field_58, 0, VertexRenderList[0].vWorldViewPosition.x, 0, 0);
      pVertices[0].specular = 0;
-     pVertices[0].texcoord.x = array_50AC10[0].u;
-     pVertices[0].texcoord.y = array_50AC10[0].v;
+     pVertices[0].texcoord.x = VertexRenderList[0].u;
+     pVertices[0].texcoord.y = VertexRenderList[0].v;
  
-     pVertices[1].pos.x = array_50AC10[3].vWorldViewProjX;
-     pVertices[1].pos.y = array_50AC10[3].vWorldViewProjY;
-     pVertices[1].pos.z = 1.0 - 1.0 / (1000 * array_50AC10[3].vWorldViewPosition.x / (double)pODMRenderParams->shading_dist_mist);
-     pVertices[1].rhw = 1.0 / (array_50AC10[3].vWorldViewPosition.x + 0.0000001000000011686097);
-     pVertices[1].diffuse = GetActorTintColor(a3->field_58, 0, array_50AC10[3].vWorldViewPosition.x, 0, 0);
+     pVertices[1].pos.x = VertexRenderList[3].vWorldViewProjX;
+     pVertices[1].pos.y = VertexRenderList[3].vWorldViewProjY;
+     pVertices[1].pos.z = 1.0 - 1.0 / (1000 * VertexRenderList[3].vWorldViewPosition.x / (double)pODMRenderParams->shading_dist_mist);
+     pVertices[1].rhw = 1.0 / (VertexRenderList[3].vWorldViewPosition.x + 0.0000001000000011686097);
+     pVertices[1].diffuse = GetActorTintColor(a3->field_58, 0, VertexRenderList[3].vWorldViewPosition.x, 0, 0);
      pVertices[1].specular = 0;
-     pVertices[1].texcoord.x = array_50AC10[3].u;
-     pVertices[1].texcoord.y = array_50AC10[3].v;
-
-     pVertices[2].pos.x = array_50AC10[1].vWorldViewProjX;
-     pVertices[2].pos.y = array_50AC10[1].vWorldViewProjY;
-     pVertices[2].pos.z = 1.0 - 1.0 / (1000 * array_50AC10[1].vWorldViewPosition.x / (double)pODMRenderParams->shading_dist_mist);
-     pVertices[2].rhw = 1.0 / (array_50AC10[1].vWorldViewPosition.x + 0.0000001000000011686097);
-     pVertices[2].diffuse = GetActorTintColor(a3->field_58, 0, array_50AC10[1].vWorldViewPosition.x, 0, 0);
+     pVertices[1].texcoord.x = VertexRenderList[3].u;
+     pVertices[1].texcoord.y = VertexRenderList[3].v;
+
+     pVertices[2].pos.x = VertexRenderList[1].vWorldViewProjX;
+     pVertices[2].pos.y = VertexRenderList[1].vWorldViewProjY;
+     pVertices[2].pos.z = 1.0 - 1.0 / (1000 * VertexRenderList[1].vWorldViewPosition.x / (double)pODMRenderParams->shading_dist_mist);
+     pVertices[2].rhw = 1.0 / (VertexRenderList[1].vWorldViewPosition.x + 0.0000001000000011686097);
+     pVertices[2].diffuse = GetActorTintColor(a3->field_58, 0, VertexRenderList[1].vWorldViewPosition.x, 0, 0);
      pVertices[2].specular = 0;
-     pVertices[2].texcoord.x = array_50AC10[1].u;
-     pVertices[2].texcoord.y = array_50AC10[1].v;
+     pVertices[2].texcoord.x = VertexRenderList[1].u;
+     pVertices[2].texcoord.y = VertexRenderList[1].v;
 
      memcpy(pVertices + 3, pVertices + 2, sizeof(RenderVertexD3D3));
      memcpy(pVertices + 4, pVertices + 1, sizeof(RenderVertexD3D3));
 
-     pVertices[5].pos.x = array_50AC10[2].vWorldViewProjX;
-     pVertices[5].pos.y = array_50AC10[2].vWorldViewProjY;
-     pVertices[5].pos.z = 1.0 - 1.0 / (1000 * array_50AC10[2].vWorldViewPosition.x / (double)pODMRenderParams->shading_dist_mist);
-     pVertices[5].rhw = 1.0 / (array_50AC10[2].vWorldViewPosition.x + 0.0000001000000011686097);
-     pVertices[5].diffuse = GetActorTintColor(a3->field_58, 0, array_50AC10[2].vWorldViewPosition.x, 0, 0);
+     pVertices[5].pos.x = VertexRenderList[2].vWorldViewProjX;
+     pVertices[5].pos.y = VertexRenderList[2].vWorldViewProjY;
+     pVertices[5].pos.z = 1.0 - 1.0 / (1000 * VertexRenderList[2].vWorldViewPosition.x / (double)pODMRenderParams->shading_dist_mist);
+     pVertices[5].rhw = 1.0 / (VertexRenderList[2].vWorldViewPosition.x + 0.0000001000000011686097);
+     pVertices[5].diffuse = GetActorTintColor(a3->field_58, 0, VertexRenderList[2].vWorldViewPosition.x, 0, 0);
      pVertices[5].specular = 0;
-     pVertices[5].texcoord.x = array_50AC10[2].u;
-     pVertices[5].texcoord.y = array_50AC10[2].v;
+     pVertices[5].texcoord.x = VertexRenderList[2].u;
+     pVertices[5].texcoord.y = VertexRenderList[2].v;
 
 
      this->pRenderD3D->pDevice->SetTexture(0, pTexture);
@@ -4616,15 +4616,15 @@
 
   /*  v9 = pEngine->pLightmapBuilder;
     v65 = v9;
-    v10 = v9->std__vector_000004_size;*/
+    v10 = v9->StationaryLightsCount;*/
     if ( byte_4D864C && pEngine->uFlags & GAME_FLAGS_1_01_lightmap_related)
     {
-      v11 = ::GetActorTintColor(a4->dimming_level, 0, array_50AC10[0].vWorldViewPosition.x, 0, 0);
-      pEngine->pLightmapBuilder->DrawLightmaps(/*v11, 0*/);
+      v11 = ::GetActorTintColor(a4->dimming_level, 0, VertexRenderList[0].vWorldViewPosition.x, 0, 0);
+      pEngine->pLightmapBuilder->DrawLightmaps(v11/*, 0*/);
     }
     else
     {
-      if (transparent || !pEngine->pLightmapBuilder->std__vector_000004_size || 
+      if (transparent || !pEngine->pLightmapBuilder->StationaryLightsCount || 
           byte_4D864C && pEngine->uFlags & 2 )
       {
         if (clampAtTextureBorders)
@@ -4652,21 +4652,21 @@
 		for (uint i = 0; i < uNumVertices; ++i)
 		{
 		
-		  d3d_vertex_buffer[i].pos.x = array_50AC10[i].vWorldViewProjX;
-		  d3d_vertex_buffer[i].pos.y = array_50AC10[i].vWorldViewProjY;
-		  d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((array_50AC10[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist);
-		  d3d_vertex_buffer[i].rhw = 1.0 / (array_50AC10[i].vWorldViewPosition.x + 0.0000001);
-		  d3d_vertex_buffer[i].diffuse = ::GetActorTintColor(a4->dimming_level, 0, array_50AC10[i].vWorldViewPosition.x, 0, 0);
+		  d3d_vertex_buffer[i].pos.x = VertexRenderList[i].vWorldViewProjX;
+		  d3d_vertex_buffer[i].pos.y = VertexRenderList[i].vWorldViewProjY;
+		  d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((VertexRenderList[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist);
+		  d3d_vertex_buffer[i].rhw = 1.0 / (VertexRenderList[i].vWorldViewPosition.x + 0.0000001);
+		  d3d_vertex_buffer[i].diffuse = ::GetActorTintColor(a4->dimming_level, 0, VertexRenderList[i].vWorldViewPosition.x, 0, 0);
           if ( this->bUsingSpecular )
           {
-            d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_specular(0, 0, array_50AC10[i].vWorldViewPosition.x);
+            d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_specular(0, 0, VertexRenderList[i].vWorldViewPosition.x);
           }
           else
           {
             d3d_vertex_buffer[i].specular = 0;
 		  }
-		  d3d_vertex_buffer[i].texcoord.x = array_50AC10[i].u;
-		  d3d_vertex_buffer[i].texcoord.y = array_50AC10[i].v;
+		  d3d_vertex_buffer[i].texcoord.x = VertexRenderList[i].u;
+		  d3d_vertex_buffer[i].texcoord.y = VertexRenderList[i].v;
 		}
 
 		this->pRenderD3D->pDevice->SetTexture(0, a5);
@@ -4683,14 +4683,14 @@
 		for (uint i = 0; i < uNumVertices; ++i)
 		{
 		
-		  d3d_vertex_buffer[i].pos.x = array_50AC10[i].vWorldViewProjX;
-		  d3d_vertex_buffer[i].pos.y = array_50AC10[i].vWorldViewProjY;
-		  d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((array_50AC10[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist);
-		  d3d_vertex_buffer[i].rhw = 1.0 / (array_50AC10[i].vWorldViewPosition.x + 0.0000001);
-		  d3d_vertex_buffer[i].diffuse = GetActorTintColor(a4->dimming_level, 0, array_50AC10[i].vWorldViewPosition.x, 0, 0);
+		  d3d_vertex_buffer[i].pos.x = VertexRenderList[i].vWorldViewProjX;
+		  d3d_vertex_buffer[i].pos.y = VertexRenderList[i].vWorldViewProjY;
+		  d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((VertexRenderList[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist);
+		  d3d_vertex_buffer[i].rhw = 1.0 / (VertexRenderList[i].vWorldViewPosition.x + 0.0000001);
+		  d3d_vertex_buffer[i].diffuse = GetActorTintColor(a4->dimming_level, 0, VertexRenderList[i].vWorldViewPosition.x, 0, 0);
           if ( this->bUsingSpecular )
           {
-            d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_specular(0, 0, array_50AC10[i].vWorldViewPosition.x);
+            d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_specular(0, 0, VertexRenderList[i].vWorldViewPosition.x);
           }
           else
           {
@@ -4698,8 +4698,8 @@
 		  }
           //__debugbreak(); // warning C4700: uninitialized local variable 'v20' used
 		  //d3d_vertex_buffer[i].specular = v20;
-		  d3d_vertex_buffer[i].texcoord.x = array_50AC10[i].u;
-		  d3d_vertex_buffer[i].texcoord.y = array_50AC10[i].v;
+		  d3d_vertex_buffer[i].texcoord.x = VertexRenderList[i].u;
+		  d3d_vertex_buffer[i].texcoord.y = VertexRenderList[i].v;
 		}
         ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, FALSE));
         ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP));
@@ -4715,7 +4715,7 @@
         //v63 = (const char *)v7->pRenderD3D->pDevice;
         ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE));
         //(*(void (**)(void))(*(int *)v63 + 88))();
-        pEngine->pLightmapBuilder->DrawLightmaps(/*-1, 0*/);
+        pEngine->pLightmapBuilder->DrawLightmaps(-1/*, 0*/);
 	    for (uint i = 0; i < uNumVertices; ++i)
 	    {
 		  d3d_vertex_buffer[i].diffuse = -1;
@@ -4790,18 +4790,18 @@
     }
     for ( uint i = 0; i < uNumVertices; ++i )
     {
-      pVertices[i].pos.x = array_50AC10[i].vWorldViewProjX;
-      pVertices[i].pos.y = array_50AC10[i].vWorldViewProjY;
+      pVertices[i].pos.x = VertexRenderList[i].vWorldViewProjX;
+      pVertices[i].pos.y = VertexRenderList[i].vWorldViewProjY;
       pVertices[i].pos.z = 0.99989998;
-      pVertices[i].rhw = array_50AC10[i]._rhw;
-
-      pVertices[i].diffuse = ::GetActorTintColor(31, 0, array_50AC10[i].vWorldViewPosition.x, 1, 0);
+      pVertices[i].rhw = VertexRenderList[i]._rhw;
+
+      pVertices[i].diffuse = ::GetActorTintColor(31, 0, VertexRenderList[i].vWorldViewPosition.x, 1, 0);
       v7 = 0;
       if (this->bUsingSpecular)
-        v7 = sub_47C3D7_get_fog_specular(0, 1, array_50AC10[i].vWorldViewPosition.x);
+        v7 = sub_47C3D7_get_fog_specular(0, 1, VertexRenderList[i].vWorldViewPosition.x);
       pVertices[i].specular = v7;
-      pVertices[i].texcoord.x = array_50AC10[i].u;
-      pVertices[i].texcoord.y = array_50AC10[i].v;
+      pVertices[i].texcoord.x = VertexRenderList[i].u;
+      pVertices[i].texcoord.y = VertexRenderList[i].v;
     }
     pRenderD3D->pDevice->SetTexture(0, pTexture);
     pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1,
@@ -5023,12 +5023,12 @@
   if ( (signed int)pSkyPolygon.uNumVertices > 0 )
   {
     v28 = (double)SLODWORD(v76);
-    LODWORD(v76) = (int)(char *)array_50AC10 + 28;
+    LODWORD(v76) = (int)(char *)VertexRenderList + 28;
 	uint i = 0;
     for ( v78 = pSkyPolygon.uNumVertices; v78; --v78 )
     {
       ++LODWORD(v73);
-      memcpy(&array_50AC10[i], &array_507D30[i], 0x30u);
+      memcpy(&VertexRenderList[i], &array_507D30[i], 0x30u);
       LODWORD(v76) += 48;
       if ( v28 < array_507D30[i].vWorldViewProjY | v28 == array_507D30[i].vWorldViewProjY
         || v28 >= array_507D30[i + 1].vWorldViewProjY )
@@ -5046,7 +5046,7 @@
         v33 = (array_507D30[i].vWorldViewProjX - array_507D30[i + 1].vWorldViewProjX) * v28 / (array_507D30[i].vWorldViewProjY - array_507D30[i + 1].vWorldViewProjY)
             + array_507D30[i].vWorldViewProjX;
       }
-      array_50AC10[i + 1].vWorldViewProjX = v33;
+      VertexRenderList[i + 1].vWorldViewProjX = v33;
       ++LODWORD(v73);
       *(unsigned int *)LODWORD(v76) = v28;
       LODWORD(v76) += 48;
@@ -5055,13 +5055,13 @@
   }
   if ( SLODWORD(v73) <= 0 )
     goto LABEL_40;
-  //v34 = (char *)&array_50AC10[0].vWorldViewProjY;
+  //v34 = (char *)&VertexRenderList[0].vWorldViewProjY;
   uint j = 0;
   v65 = v77 >> 14;
   //HIDWORD(v69) = LODWORD(v73);
   for ( int t = (int)LODWORD(v73); t > 1; t-- )
   {
-    v35 = (const void *)(v72 * (v70 - (unsigned __int64)(signed __int64)array_50AC10[j].vWorldViewProjY));
+    v35 = (const void *)(v72 * (v70 - (unsigned __int64)(signed __int64)VertexRenderList[j].vWorldViewProjY));
 
     //v78 = pSkyPolygon.ptr_38->viewing_angle_from_west_east;
     //v81 = (const void *)fixpoint_mul(pSkyPolygon.ptr_38->viewing_angle_from_west_east, v35);
@@ -5075,8 +5075,8 @@
     v75 = (RenderVertexSoft *)((char *)v81 + pSkyPolygon.ptr_38->angle_from_east);
     //v81 = (const void *)pSkyPolygon.v_18.z;
     v78 = fixpoint_mul(pSkyPolygon.v_18.z, (int)v35);
-    v37 = (const void *)(v72 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)array_50AC10[j].vWorldViewProjX));
-    v38 = (signed __int64)(array_50AC10[j].vWorldViewProjY - 1.0);
+    v37 = (const void *)(v72 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)VertexRenderList[j].vWorldViewProjX));
+    v38 = (signed __int64)(VertexRenderList[j].vWorldViewProjY - 1.0);
     v81 = 0;
     LODWORD(v76) = v38;
     v39 = v72 * (v70 - v38);
@@ -5103,7 +5103,7 @@
     {
       v79 = (void *)pSkyPolygon.v_18.z;
       v78 = 2 * LODWORD(v76);
-      v81 = (const void *)fixpoint_mul(pSkyPolygon.v_18.z, (((double)v70 - ((double)(2 * LODWORD(v76)) - array_50AC10[j].vWorldViewProjY))
+      v81 = (const void *)fixpoint_mul(pSkyPolygon.v_18.z, (((double)v70 - ((double)(2 * LODWORD(v76)) - VertexRenderList[j].vWorldViewProjY))
                                                                                          * (double)v72));
       X = (int)((char *)v81 + pSkyPolygon.v_18.x);
     }
@@ -5128,11 +5128,11 @@
     //v44 = HIDWORD(v69)-- == 1;
     //v45 = (double)(v66 + ((signed int)fixpoint_mul(v43, v42 / X) >> 4)) * 0.000015259022;
     //v78 = v63 + ((signed int)fixpoint_mul((int)v75, v42 / X) >> 4);
-    array_50AC10[j].u = ((double)(v66 + ((signed int)fixpoint_mul(v43, v42 / X) >> 4)) * 0.000015259022) * (1.0 / (double)pSkyPolygon.pTexture->uTextureWidth);
-    array_50AC10[j].v = ((double)(v66 + ((signed int)fixpoint_mul(v43, v42 / X) >> 4)) * 0.000015259022) * v68;
+    VertexRenderList[j].u = ((double)(v66 + ((signed int)fixpoint_mul(v43, v42 / X) >> 4)) * 0.000015259022) * (1.0 / (double)pSkyPolygon.pTexture->uTextureWidth);
+    VertexRenderList[j].v = ((double)(v66 + ((signed int)fixpoint_mul(v43, v42 / X) >> 4)) * 0.000015259022) * v68;
     //v46 = (double)(signed int)v79;
-    array_50AC10[j].vWorldViewPosition.x = 0.000015258789 * (double)(signed int)v79;
-    array_50AC10[j]._rhw = 65536.0 / (double)(signed int)v79;
+    VertexRenderList[j].vWorldViewPosition.x = 0.000015258789 * (double)(signed int)v79;
+    VertexRenderList[j]._rhw = 65536.0 / (double)(signed int)v79;
 	++j;
   }
   //while ( !v44 );
@@ -5143,10 +5143,10 @@
     v48 = (double)SLODWORD(v80);
     for ( HIDWORD(v69) = LODWORD(v73); HIDWORD(v69); --HIDWORD(v69) )
     {
-      if ( v48 >= array_50AC10[i].vWorldViewProjY )
+      if ( v48 >= VertexRenderList[i].vWorldViewProjY )
       {
         ++i;
-        memcpy(&array_507D30[i], &array_50AC10[i], 0x30u);
+        memcpy(&array_507D30[i], &VertexRenderList[i], 0x30u);
       }
     }
   }
@@ -5158,10 +5158,10 @@
     v51 = (double)SLODWORD(v80);
     for ( v80 = v73; v80 != 0.0; --LODWORD(v80) )
     {
-      if ( v51 <= array_50AC10[pNumVertices].vWorldViewProjY )
+      if ( v51 <= VertexRenderList[pNumVertices].vWorldViewProjY )
       {
         ++pNumVertices;
-        memcpy(&array_507D30[pNumVertices], &array_50AC10[pNumVertices], 0x30u);
+        memcpy(&array_507D30[pNumVertices], &VertexRenderList[pNumVertices], 0x30u);
       }
     }
   }
@@ -5176,7 +5176,7 @@
 
   int sCorrectedColor = uColor;
 
-  if (pEngine->pLightmapBuilder->std__vector_000004_size)
+  if (pEngine->pLightmapBuilder->StationaryLightsCount)
     sCorrectedColor = -1;
   pEngine->AlterGamma_BLV(pFace, &sCorrectedColor);
 
@@ -5210,11 +5210,11 @@
       ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN,
               D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1,
               d3d_vertex_buffer, uNumVertices, 28));
-      pEngine->pLightmapBuilder->DrawLightmaps(/*-1, 0*/);
+      pEngine->pLightmapBuilder->DrawLightmaps(-1/*, 0*/);
   }
   else
   {
-    if (!pEngine->pLightmapBuilder->std__vector_000004_size || byte_4D864C && pEngine->uFlags & 2)
+    if (!pEngine->pLightmapBuilder->StationaryLightsCount || byte_4D864C && pEngine->uFlags & 2)
     {
       for (uint i = 0; i < uNumVertices; ++i)
       {
@@ -5255,7 +5255,7 @@
               d3d_vertex_buffer, uNumVertices, 28));
 
       ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE));
-      pEngine->pLightmapBuilder->DrawLightmaps(/*-1, 0*/);
+      pEngine->pLightmapBuilder->DrawLightmaps(-1/*, 0*/);
 
       for (uint i = 0; i < uNumVertices; ++i)
         d3d_vertex_buffer[i].diffuse = sCorrectedColor;
@@ -8153,7 +8153,7 @@
     return 0;
   for (uint i = 0; i < num_vertices; ++i)// есть ли пограничные вершины
   {
-    if ( array_50AC10[i].vWorldViewPosition.x > 8.0 )
+    if ( VertexRenderList[i].vWorldViewPosition.x > 8.0 )
     {
       bFound = true;
       break;
@@ -8162,10 +8162,10 @@
   if ( !bFound )
     return 0;
 
-  memcpy(&array_50AC10[num_vertices], &array_50AC10[0], sizeof(array_50AC10[0]));
+  memcpy(&VertexRenderList[num_vertices], &VertexRenderList[0], sizeof(VertexRenderList[0]));
+  next_vertices_flag = false;
   current_vertices_flag = false;
-  next_vertices_flag = false;
-  if ( array_50AC10[0].vWorldViewPosition.x <= 8.0 )
+  if ( VertexRenderList[0].vWorldViewPosition.x <= 8.0 )
     current_vertices_flag = true;
   //check for near clip plane(проверка по ближней границе)
   //   
@@ -8181,28 +8181,28 @@
   int out_num_vertices = 0;
   for (uint i = 0; i < num_vertices; ++i)
   {
-    next_vertices_flag = array_50AC10[i + 1].vWorldViewPosition.x <= 8.0;//
+    next_vertices_flag = VertexRenderList[i + 1].vWorldViewPosition.x <= 8.0;//
     if ( current_vertices_flag ^ next_vertices_flag )
     {
       if ( next_vertices_flag )//следующая вершина за ближней границей
       {
         //t = near_clip - v0.x / v1.x - v0.x    (формула получения точки пересечения отрезка с плоскостью)
-        t = (8.0 - array_50AC10[i].vWorldViewPosition.x) / (array_50AC10[i + 1].vWorldViewPosition.x - array_50AC10[i].vWorldViewPosition.x);
+        t = (8.0 - VertexRenderList[i].vWorldViewPosition.x) / (VertexRenderList[i + 1].vWorldViewPosition.x - VertexRenderList[i].vWorldViewPosition.x);
         array_507D30[out_num_vertices].vWorldViewPosition.x = 8.0;
-        array_507D30[out_num_vertices].vWorldViewPosition.y = array_50AC10[i].vWorldViewPosition.y + (array_50AC10[i + 1].vWorldViewPosition.y - array_50AC10[i].vWorldViewPosition.y) * t;
-        array_507D30[out_num_vertices].vWorldViewPosition.z = array_50AC10[i].vWorldViewPosition.z + (array_50AC10[i + 1].vWorldViewPosition.z - array_50AC10[i].vWorldViewPosition.z) * t;
-        array_507D30[out_num_vertices].u = array_50AC10[i].u + (array_50AC10[i + 1].u - array_50AC10[i].u) * t;
-        array_507D30[out_num_vertices].v = array_50AC10[i].v + (array_50AC10[i + 1].v - array_50AC10[i].v) * t;
+        array_507D30[out_num_vertices].vWorldViewPosition.y = VertexRenderList[i].vWorldViewPosition.y + (VertexRenderList[i + 1].vWorldViewPosition.y - VertexRenderList[i].vWorldViewPosition.y) * t;
+        array_507D30[out_num_vertices].vWorldViewPosition.z = VertexRenderList[i].vWorldViewPosition.z + (VertexRenderList[i + 1].vWorldViewPosition.z - VertexRenderList[i].vWorldViewPosition.z) * t;
+        array_507D30[out_num_vertices].u = VertexRenderList[i].u + (VertexRenderList[i + 1].u - VertexRenderList[i].u) * t;
+        array_507D30[out_num_vertices].v = VertexRenderList[i].v + (VertexRenderList[i + 1].v - VertexRenderList[i].v) * t;
         array_507D30[out_num_vertices]._rhw = 1.0 / 8.0;
       }
       else// текущая вершина за ближней границей
       {
-        t = (8.0 - array_50AC10[i].vWorldViewPosition.x) / (array_50AC10[i].vWorldViewPosition.x - array_50AC10[i + 1].vWorldViewPosition.x);
+        t = (8.0 - VertexRenderList[i].vWorldViewPosition.x) / (VertexRenderList[i].vWorldViewPosition.x - VertexRenderList[i + 1].vWorldViewPosition.x);
         array_507D30[out_num_vertices].vWorldViewPosition.x = 8.0;
-        array_507D30[out_num_vertices].vWorldViewPosition.y = array_50AC10[i].vWorldViewPosition.y + (array_50AC10[i].vWorldViewPosition.y - array_50AC10[i + 1].vWorldViewPosition.y) * t;
-        array_507D30[out_num_vertices].vWorldViewPosition.z = array_50AC10[i].vWorldViewPosition.z + (array_50AC10[i].vWorldViewPosition.z - array_50AC10[i + 1].vWorldViewPosition.z) * t;
-        array_507D30[out_num_vertices].u = array_50AC10[i].u + (array_50AC10[i].u - array_50AC10[i + 1].u) * t;
-        array_507D30[out_num_vertices].v = array_50AC10[i].v + (array_50AC10[i].v - array_50AC10[i + 1].v) * t;
+        array_507D30[out_num_vertices].vWorldViewPosition.y = VertexRenderList[i].vWorldViewPosition.y + (VertexRenderList[i].vWorldViewPosition.y - VertexRenderList[i + 1].vWorldViewPosition.y) * t;
+        array_507D30[out_num_vertices].vWorldViewPosition.z = VertexRenderList[i].vWorldViewPosition.z + (VertexRenderList[i].vWorldViewPosition.z - VertexRenderList[i + 1].vWorldViewPosition.z) * t;
+        array_507D30[out_num_vertices].u = VertexRenderList[i].u + (VertexRenderList[i].u - VertexRenderList[i + 1].u) * t;
+        array_507D30[out_num_vertices].v = VertexRenderList[i].v + (VertexRenderList[i].v - VertexRenderList[i + 1].v) * t;
         array_507D30[out_num_vertices]._rhw = 1.0 / 8.0;
       }
       //array_507D30[out_num_vertices]._rhw = 0x3E000000u;
@@ -8210,7 +8210,7 @@
     }
     if ( !next_vertices_flag )
     {
-      memcpy(&array_507D30[out_num_vertices], &array_50AC10[i + 1], sizeof(array_50AC10[i + 1]));
+      memcpy(&array_507D30[out_num_vertices], &VertexRenderList[i + 1], sizeof(VertexRenderList[i + 1]));
       out_num_vertices++;
     }
     current_vertices_flag = next_vertices_flag;
@@ -8230,16 +8230,16 @@
 
   bFound = false;
 
-  memcpy(&array_50AC10[uNumVertices], &array_50AC10[0], sizeof(array_50AC10[uNumVertices]));
+  memcpy(&VertexRenderList[uNumVertices], &VertexRenderList[0], sizeof(VertexRenderList[uNumVertices]));
   depth_num_vertices = 0;
   current_vertices_flag = false;
-  if ( array_50AC10[0].vWorldViewPosition.x >= pODMRenderParams->shading_dist_mist )
+  if ( VertexRenderList[0].vWorldViewPosition.x >= pODMRenderParams->shading_dist_mist )
     current_vertices_flag = true;//настоящая вершина больше границы видимости
   if ( (signed int)uNumVertices <= 0 )
     return 0;
   for (uint i = 0; i < uNumVertices; ++i)// есть ли пограничные вершины
   {
-    if ( array_50AC10[i].vWorldViewPosition.x < pODMRenderParams->shading_dist_mist )
+    if ( VertexRenderList[i].vWorldViewPosition.x < pODMRenderParams->shading_dist_mist )
     {
       bFound = true;
       break;
@@ -8260,40 +8260,40 @@
 
   for ( uint i = 0; i < uNumVertices; ++i )
   {
-    next_vertices_flag = array_50AC10[i + 1].vWorldViewPosition.x >= pODMRenderParams->shading_dist_mist;
+    next_vertices_flag = VertexRenderList[i + 1].vWorldViewPosition.x >= pODMRenderParams->shading_dist_mist;
     if ( current_vertices_flag ^ next_vertices_flag )//одна из граней за границей видимости
     {
       if ( next_vertices_flag )//следующая вершина больше границы видимости(настоящая вершина меньше границы видимости) - v3
       {
         //t = far_clip - v2.x / v3.x - v2.x (формула получения точки пересечения отрезка с плоскостью)
-        t = (pODMRenderParams->shading_dist_mist - array_50AC10[i].vWorldViewPosition.x) / (array_50AC10[i].vWorldViewPosition.x - array_50AC10[i + 1].vWorldViewPosition.x);
+        t = (pODMRenderParams->shading_dist_mist - VertexRenderList[i].vWorldViewPosition.x) / (VertexRenderList[i].vWorldViewPosition.x - VertexRenderList[i + 1].vWorldViewPosition.x);
         array_507D30[depth_num_vertices].vWorldViewPosition.x = pODMRenderParams->shading_dist_mist;
         //New_y = v2.y + (v3.y - v2.y)*t
-        array_507D30[depth_num_vertices].vWorldViewPosition.y = array_50AC10[i].vWorldViewPosition.y + (array_50AC10[i].vWorldViewPosition.y - array_50AC10[i + 1].vWorldViewPosition.y) * t;
+        array_507D30[depth_num_vertices].vWorldViewPosition.y = VertexRenderList[i].vWorldViewPosition.y + (VertexRenderList[i].vWorldViewPosition.y - VertexRenderList[i + 1].vWorldViewPosition.y) * t;
         //New_z = v2.z + (v3.z - v2.z)*t
-        array_507D30[depth_num_vertices].vWorldViewPosition.z = array_50AC10[i].vWorldViewPosition.z + (array_50AC10[i].vWorldViewPosition.z - array_50AC10[i + 1].vWorldViewPosition.z) * t;
-        array_507D30[depth_num_vertices].u = array_50AC10[i].u + (array_50AC10[i].u - array_50AC10[i + 1].u) * t;
-        array_507D30[depth_num_vertices].v = array_50AC10[i].v + (array_50AC10[i].v - array_50AC10[i + 1].v) * t;
+        array_507D30[depth_num_vertices].vWorldViewPosition.z = VertexRenderList[i].vWorldViewPosition.z + (VertexRenderList[i].vWorldViewPosition.z - VertexRenderList[i + 1].vWorldViewPosition.z) * t;
+        array_507D30[depth_num_vertices].u = VertexRenderList[i].u + (VertexRenderList[i].u - VertexRenderList[i + 1].u) * t;
+        array_507D30[depth_num_vertices].v = VertexRenderList[i].v + (VertexRenderList[i].v - VertexRenderList[i + 1].v) * t;
         array_507D30[depth_num_vertices]._rhw = 1.0 / pODMRenderParams->shading_dist_mist;
       }
       else//настоящая вершина больше границы видимости(следующая вершина меньше границы видимости) - v0
       {
         //t = far_clip - v1.x / v0.x - v1.x
-        t = (pODMRenderParams->shading_dist_mist - array_50AC10[i].vWorldViewPosition.x) / (array_50AC10[i + 1].vWorldViewPosition.x - array_50AC10[i].vWorldViewPosition.x);
+        t = (pODMRenderParams->shading_dist_mist - VertexRenderList[i].vWorldViewPosition.x) / (VertexRenderList[i + 1].vWorldViewPosition.x - VertexRenderList[i].vWorldViewPosition.x);
         array_507D30[depth_num_vertices].vWorldViewPosition.x = pODMRenderParams->shading_dist_mist;
         //New_y = (v0.y - v1.y)*t + v1.y
-        array_507D30[depth_num_vertices].vWorldViewPosition.y = array_50AC10[i].vWorldViewPosition.y + (array_50AC10[i + 1].vWorldViewPosition.y - array_50AC10[i].vWorldViewPosition.y) * t;
+        array_507D30[depth_num_vertices].vWorldViewPosition.y = VertexRenderList[i].vWorldViewPosition.y + (VertexRenderList[i + 1].vWorldViewPosition.y - VertexRenderList[i].vWorldViewPosition.y) * t;
         //New_z = (v0.z - v1.z)*t + v1.z
-        array_507D30[depth_num_vertices].vWorldViewPosition.z = array_50AC10[i].vWorldViewPosition.z + (array_50AC10[i + 1].vWorldViewPosition.z - array_50AC10[i].vWorldViewPosition.z) * t;
-        array_507D30[depth_num_vertices].u = array_50AC10[i].u + (array_50AC10[i + 1].u - array_50AC10[i].u) * t;
-        array_507D30[depth_num_vertices].v = array_50AC10[i].v + (array_50AC10[i + 1].v - array_50AC10[i].v) * t;
+        array_507D30[depth_num_vertices].vWorldViewPosition.z = VertexRenderList[i].vWorldViewPosition.z + (VertexRenderList[i + 1].vWorldViewPosition.z - VertexRenderList[i].vWorldViewPosition.z) * t;
+        array_507D30[depth_num_vertices].u = VertexRenderList[i].u + (VertexRenderList[i + 1].u - VertexRenderList[i].u) * t;
+        array_507D30[depth_num_vertices].v = VertexRenderList[i].v + (VertexRenderList[i + 1].v - VertexRenderList[i].v) * t;
         array_507D30[depth_num_vertices]._rhw = 1.0 / pODMRenderParams->shading_dist_mist;
       }
       ++depth_num_vertices;
     }
     if ( !next_vertices_flag )//оба в границе видимости
     {
-      memcpy(&array_507D30[depth_num_vertices], &array_50AC10[i + 1], sizeof(array_507D30[depth_num_vertices]));
+      memcpy(&array_507D30[depth_num_vertices], &VertexRenderList[i + 1], sizeof(array_507D30[depth_num_vertices]));
       depth_num_vertices++;
     }
     current_vertices_flag = next_vertices_flag;
@@ -8442,8 +8442,8 @@
               array_77EC08[pODMRenderParams->uNumPolygons].field_50 = v27;
               for ( int vertex_id = 0; vertex_id < pOutdoor->pBModels[model_id].pFaces[face_id].uNumVertices; ++vertex_id)
               {
-                memcpy(&array_50AC10[vertex_id], &array_73D150[vertex_id], sizeof(array_50AC10[vertex_id]));
-                array_50AC10[vertex_id]._rhw = 1.0 / (array_73D150[vertex_id].vWorldViewPosition.x + 0.0000001);
+                memcpy(&VertexRenderList[vertex_id], &array_73D150[vertex_id], sizeof(VertexRenderList[vertex_id]));
+                VertexRenderList[vertex_id]._rhw = 1.0 / (array_73D150[vertex_id].vWorldViewPosition.x + 0.0000001);
               }
               static stru154 static_RenderBuildingsD3D_stru_73C834;
               /*static bool __init_flag = false;
@@ -8458,9 +8458,9 @@
               v40 = (int)&pOutdoor->pBModels[model_id].pFaces[face_id];
               pEngine->pLightmapBuilder->ApplyLights_OutdoorFace(&pOutdoor->pBModels[model_id].pFaces[face_id]);
               pDecalBuilder->ApplyDecals_OutdoorFace(&pOutdoor->pBModels[model_id].pFaces[face_id]);
-              pEngine->pLightmapBuilder->std__vector_000004_size = 0;
+              pEngine->pLightmapBuilder->StationaryLightsCount = 0;
               int v31 = 0;
-              if ( stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 )
+              if ( Lights.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 )
               {
                 v31 = v50 ? 3 : v49 != 0 ? 5 : 0;
                 static_RenderBuildingsD3D_stru_73C834.GetFacePlaneAndClassify(&pOutdoor->pBModels[model_id].pFaces[face_id], &pOutdoor->pBModels[model_id].pVertices);
@@ -8468,11 +8468,11 @@
                 {
                   v40 = -1;
                   pDecalBuilder->ApplyDecals(31 - array_77EC08[pODMRenderParams->uNumPolygons].dimming_level, 2, &static_RenderBuildingsD3D_stru_73C834,
-                                       pOutdoor->pBModels[model_id].pFaces[face_id].uNumVertices, array_50AC10, 0, (char)v31, -1);
+                                       pOutdoor->pBModels[model_id].pFaces[face_id].uNumVertices, VertexRenderList, 0, (char)v31, -1);
                 }
               }
-              if ( stru_F8AD28.uNumLightsApplied > 0 )
-                pEngine->pLightmapBuilder->ApplyLights(&stru_F8AD28, &static_RenderBuildingsD3D_stru_73C834, uNumVertices, array_50AC10, 0, (char)v31);
+              if ( Lights.uNumLightsApplied > 0 )
+                pEngine->pLightmapBuilder->ApplyLights(&Lights, &static_RenderBuildingsD3D_stru_73C834, uNumVertices, VertexRenderList, 0, (char)v31);
               if ( v50 )
               {
                 array_77EC08[pODMRenderParams->uNumPolygons].uNumVertices = ODM_NearClip(pOutdoor->pBModels[model_id].pFaces[face_id].uNumVertices);
@@ -8568,17 +8568,17 @@
   //  |8,351                468,351 |
   // 1._____________________________.2
   // 
-    array_50AC10[0].vWorldViewProjX = (double)(signed int)pViewport->uViewportTL_X;//8
-    array_50AC10[0].vWorldViewProjY = (double)(signed int)pViewport->uViewportTL_Y;//8
-
-    array_50AC10[1].vWorldViewProjX = (double)(signed int)pViewport->uViewportTL_X;//8
-    array_50AC10[1].vWorldViewProjY = (double)v38;//247
-
-    array_50AC10[2].vWorldViewProjX = (double)(signed int)pViewport->uViewportBR_X;//468
-    array_50AC10[2].vWorldViewProjY = (double)v38;//247
-
-    array_50AC10[3].vWorldViewProjX = (double)(signed int)pViewport->uViewportBR_X;//468
-    array_50AC10[3].vWorldViewProjY = (double)(signed int)pViewport->uViewportTL_Y;//8
+    VertexRenderList[0].vWorldViewProjX = (double)(signed int)pViewport->uViewportTL_X;//8
+    VertexRenderList[0].vWorldViewProjY = (double)(signed int)pViewport->uViewportTL_Y;//8
+
+    VertexRenderList[1].vWorldViewProjX = (double)(signed int)pViewport->uViewportTL_X;//8
+    VertexRenderList[1].vWorldViewProjY = (double)v38;//247
+
+    VertexRenderList[2].vWorldViewProjX = (double)(signed int)pViewport->uViewportBR_X;//468
+    VertexRenderList[2].vWorldViewProjY = (double)v38;//247
+
+    VertexRenderList[3].vWorldViewProjX = (double)(signed int)pViewport->uViewportBR_X;//468
+    VertexRenderList[3].vWorldViewProjY = (double)(signed int)pViewport->uViewportTL_Y;//8
 
     pSkyPolygon.sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed;//7168
     pSkyPolygon.sTextureDeltaV = 224 * pMiscTimer->uTotalGameTimeElapsed;//7168
@@ -8592,19 +8592,19 @@
       // направление на север и/или юг (либо на восток и/или запад), значению 65536 еденицам(0х10000) соответствует угол 90.
       // две переменные хранят данные по углу обзора. field_14 по западу и востоку. field_20 по югу и северу
       // от -25080 до 25080
-      v39 = fixpoint_mul(pSkyPolygon.ptr_38->viewing_angle_from_west_east, v33 * (v30 - floor(array_50AC10[i].vWorldViewProjY + 0.5)));
+      v39 = fixpoint_mul(pSkyPolygon.ptr_38->viewing_angle_from_west_east, v33 * (v30 - floor(VertexRenderList[i].vWorldViewProjY + 0.5)));
       v35 = v39 + pSkyPolygon.ptr_38->angle_from_north;
 
-      v39 = fixpoint_mul(pSkyPolygon.ptr_38->viewing_angle_from_north_south, v33 * (v30 - floor(array_50AC10[i].vWorldViewProjY + 0.f)));
+      v39 = fixpoint_mul(pSkyPolygon.ptr_38->viewing_angle_from_north_south, v33 * (v30 - floor(VertexRenderList[i].vWorldViewProjY + 0.f)));
       v36 = v39 + pSkyPolygon.ptr_38->angle_from_east;
 
-      v9 = fixpoint_mul(pSkyPolygon.v_18.z, v33 * (v30 - floor(array_50AC10[i].vWorldViewProjY + 0.5)));
+      v9 = fixpoint_mul(pSkyPolygon.v_18.z, v33 * (v30 - floor(VertexRenderList[i].vWorldViewProjY + 0.5)));
       v10 = pSkyPolygon.v_18.x + v9;
       if ( v10 > 0 )
         v10 = 0;
-      v13 = v33 * (pViewport->uScreenCenterX - (signed __int64)array_50AC10[i].vWorldViewProjX);
+      v13 = v33 * (pViewport->uScreenCenterX - (signed __int64)VertexRenderList[i].vWorldViewProjX);
       v34 = -pSkyPolygon.field_24;
-      v32 = (signed __int64)array_50AC10[i].vWorldViewProjY - 1.0;
+      v32 = (signed __int64)VertexRenderList[i].vWorldViewProjY - 1.0;
       v14 = v33 * (v30 - v32);
       while ( 1 )
       {
@@ -8630,20 +8630,20 @@
         v18 = pODMRenderParams->shading_dist_mist;
       v37 = v35 + fixpoint_mul(pSkyPolygon.ptr_38->angle_from_west, v13);
       v35 = 224 * pMiscTimer->uTotalGameTimeElapsed + ((signed int)fixpoint_mul(v37, v18) >> 3);
-      array_50AC10[i].u = (double)v35 / ((double)pSkyPolygon.pTexture->uTextureWidth * 65536.0);
+      VertexRenderList[i].u = (double)v35 / ((double)pSkyPolygon.pTexture->uTextureWidth * 65536.0);
 
       v36 = v36 + fixpoint_mul(pSkyPolygon.ptr_38->angle_from_south, v13);
       v35 = 224 * pMiscTimer->uTotalGameTimeElapsed + ((signed int)fixpoint_mul(v36, v18) >> 3);
-      array_50AC10[i].v = (double)v35 / ((double)pSkyPolygon.pTexture->uTextureHeight * 65536.0);
-
-      array_50AC10[i].vWorldViewPosition.x = (double)0x2000;//pODMRenderParams->shading_dist_mist 8192
-      array_50AC10[i]._rhw = 1.0 / (double)(v18 >> 16);
+      VertexRenderList[i].v = (double)v35 / ((double)pSkyPolygon.pTexture->uTextureHeight * 65536.0);
+
+      VertexRenderList[i].vWorldViewPosition.x = (double)0x2000;//pODMRenderParams->shading_dist_mist 8192
+      VertexRenderList[i]._rhw = 1.0 / (double)(v18 >> 16);
     }
     pRenderer->DrawOutdoorSkyPolygon(pSkyPolygon.uNumVertices, &pSkyPolygon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPolygon.uTileBitmapID]);
-    array_50AC10[0].vWorldViewProjY = (double)v10;
-    array_50AC10[1].vWorldViewProjY = array_50AC10[1].vWorldViewProjY + 30.0;
-    array_50AC10[2].vWorldViewProjY = array_50AC10[2].vWorldViewProjY + 30.0;
-    array_50AC10[3].vWorldViewProjY = (double)v10;
+    VertexRenderList[0].vWorldViewProjY = (double)v10;
+    VertexRenderList[1].vWorldViewProjY = VertexRenderList[1].vWorldViewProjY + 30.0;
+    VertexRenderList[2].vWorldViewProjY = VertexRenderList[2].vWorldViewProjY + 30.0;
+    VertexRenderList[3].vWorldViewProjY = (double)v10;
     pRenderer->DrawOutdoorSkyPolygon(pSkyPolygon.uNumVertices, &pSkyPolygon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPolygon.uTileBitmapID]);
     return;
   }