changeset 2330:5133eea7a4ca

Merge
author Grumpy7
date Tue, 01 Apr 2014 23:44:27 +0200
parents 4791895e4396 (current diff) 846e28e41fb4 (diff)
children 9551756f46c4
files
diffstat 4 files changed, 47 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/DecalBuilder.cpp	Tue Apr 01 23:43:05 2014 +0200
+++ b/DecalBuilder.cpp	Tue Apr 01 23:44:27 2014 +0200
@@ -244,7 +244,7 @@
 {
   //DecalBuilder *v12; // esi@1
   Decal *v13; // edi@2
-  int *v14; // eax@2
+  //int *v14; // eax@2
   //double v15; // st7@4
   //double v16; // st7@4
   //int v17; // eax@4
@@ -280,11 +280,11 @@
   if ( a6 == 0.0 )
     return 1;
   v13 = &this->std__vector_pDecals[this->field_308008];
-  v14 = &this->std__vector_pDecals[this->field_308008].field_C1C;
+  //v14 = &this->std__vector_pDecals[this->field_308008].field_C1C;
   this->std__vector_pDecals[this->field_308008].field_C18 = (DecalBuilder_stru0 *)a4;
-  *v14 = 0;
+  this->std__vector_pDecals[this->field_308008].field_C1C = 0;
   if ( a3 & 2 )
-    *v14 = 1;
+    this->std__vector_pDecals[this->field_308008].field_C1C = 1;
   //v15 = a6 - a8;
   this->field_30C028 = a6 - a8;
   //v16 = sqrt((a6 + a6 - this->field_30C028) * this->field_30C028);
--- a/Indoor.cpp	Tue Apr 01 23:43:05 2014 +0200
+++ b/Indoor.cpp	Tue Apr 01 23:44:27 2014 +0200
@@ -516,7 +516,7 @@
         if (stru_F8AD28.uNumLightsApplied > 0 && !pFace->Indoor_sky())
           pGame->pLightmapBuilder->ApplyLights(&stru_F8AD28, &stru_F7B60C, uNumVerticesa, array_507D30, pVertices, 0);
 
-        if (pDecalBuilder->uNumDecals > 0)
+        if (pDecalBuilder->uNumDecals > 0)//отрисовка пятен крови
           pDecalBuilder->ApplyDecals(a4a, 1, &stru_F7B60C, uNumVerticesa, array_507D30, pVertices, 0, pFace->uSectorID);
 
         if (pFace->Fluid())
--- a/LightmapBuilder.cpp	Tue Apr 01 23:43:05 2014 +0200
+++ b/LightmapBuilder.cpp	Tue Apr 01 23:44:27 2014 +0200
@@ -240,7 +240,7 @@
   if (!v11->uNumVertices)
     return true;
 
-  v45 = _45C6D6(uNumVertices, a9, v11);//освещён ли фейс(есть ошибка)
+  v45 = _45C6D6(uNumVertices, a9, v11);
   if ( v45 != uNumVertices && v45 > 0 )
     _45C4B9(uNumVertices, a9, v11);
   //v59 = v11->uNumVertices;
@@ -340,7 +340,7 @@
   char v26; // [sp+1Eh] [bp-2h]@17
   char v27; // [sp+1Fh] [bp-1h]@17
 
-  __debugbreak();//Ritor1: needed cleaning
+  //__debugbreak();//Ritor1: needed cleaning
 
   v4 = pLightmap;
   v5 = 0;
@@ -487,7 +487,7 @@
                   : pLightmap->pVertices[i].vWorldPosition.z - a3[j].vWorldPosition.z;
               if ( v11 < 2.0 )
               {
-                v12 = v9 + v11 + v10;//Ritor1: Ошибка: В ИДА сюда заходит в данже рядом с факелом, а у нас нет, причину не нашёл
+                v12 = v9 + v11 + v10;
                 if ( v12 < v16 )
                 {
                   v16 = v12;
--- a/Render.cpp	Tue Apr 01 23:43:05 2014 +0200
+++ b/Render.cpp	Tue Apr 01 23:44:27 2014 +0200
@@ -7335,17 +7335,11 @@
 //----- (004A68EF) --------------------------------------------------------
 void Render::DrawMasked(signed int a2, signed int a3, Texture *pTexture, unsigned __int16 mask)
 {
-  Texture *v4; // edi@2
   unsigned int v5; // ebx@4
-  //unsigned __int16 *v6; // eax@4
-  signed int v7; // edx@5
-  int v8; // edx@6
-  signed int v9; // edx@7
   int v10; // edx@8
   signed int v11; // edx@9
   signed int v12; // esi@12
   signed int v13; // esi@15
-  unsigned int v14; // edx@17
   signed int v15; // esi@18
   unsigned __int8 *v16; // ebx@22
   char v17; // zf@28
@@ -7354,65 +7348,54 @@
   int v20; // [sp+1Ch] [bp-4h]@4
   int v21; // [sp+28h] [bp+8h]@24
   unsigned int v22; // [sp+2Ch] [bp+Ch]@22
-  unsigned int pTexturea; // [sp+30h] [bp+10h]@11
 
   if (!uNumSceneBegins || !pTexture)
     return;
 
-    v4 = pTexture;
-
-      if ( pTexture->pPalette16 )
-      {
-        v5 = pTexture->uTextureHeight;
-        //v6 = &this->pTargetSurface[a2 + a3 * this->uTargetSurfacePitch];
-        v19 = pTexture->pLevelOfDetail0_prolly_alpha_mask;
-        v20 = pTexture->uTextureWidth;
-        v18 = pTexture->uTextureWidth;
-        int clipped_out_x = a2;
-        int clipped_out_y = a3;
-        if ( this->bClip )
-        {
-          v7 = this->uClipX;
-          if ( a2 < v7 )
-          {
-            v8 = v7 - a2;
-            v19 += v8;
-            v20 += a2 - this->uClipX;
-            //v6 += v8;
-            clipped_out_x = uClipX;
-          }
-          v9 = this->uClipY;
-          v5 = pTexture->uTextureHeight;
-          if ( a3 < v9 )
-          {
-            v10 = v9 - a3;
-            v19 += v18 * v10;
-            v5 = a3 - this->uClipY + pTexture->uTextureHeight;
-            v4 = pTexture;
-            //v6 += this->uTargetSurfacePitch * v10;
-            clipped_out_y = uClipY;
-          }
-          v11 = this->uClipX;
-          if ( v11 < a2 )
-            v11 = a2;
-          pTexturea = this->uClipZ;
-          if ( v11 + v20 > (signed int)pTexturea )
-          {
-            v12 = this->uClipX;
-            if ( v12 < a2 )
-              v12 = a2;
-            v20 = pTexturea - v12;
+  if ( pTexture->pPalette16 )
+  {
+    v5 = pTexture->uTextureHeight;
+    //v6 = &this->pTargetSurface[a2 + a3 * this->uTargetSurfacePitch];
+    v19 = pTexture->pLevelOfDetail0_prolly_alpha_mask;
+    v20 = pTexture->uTextureWidth;
+    v18 = pTexture->uTextureWidth;
+    int clipped_out_x = a2;
+    int clipped_out_y = a3;
+    if ( this->bClip )
+    {
+      if ( a2 < this->uClipX )
+      {
+        v19 += this->uClipX - a2;
+        v20 += a2 - this->uClipX;
+        clipped_out_x = uClipX;
+      }
+      v5 = pTexture->uTextureHeight;
+      if ( a3 < this->uClipY )
+      {
+        v10 = this->uClipY - a3;
+        v19 += v18 * v10;
+        v5 = a3 - this->uClipY + pTexture->uTextureHeight;
+        clipped_out_y = uClipY;
+      }
+      v11 = this->uClipX;
+      if ( this->uClipX < a2 )
+        v11 = a2;
+      if ( v11 + v20 > (signed int)this->uClipZ )
+      {
+        v12 = this->uClipX;
+        if ( v12 < a2 )
+          v12 = a2;
+            v20 = this->uClipZ - v12;
           }
           v13 = this->uClipY;
-          if ( v13 < a3 )
+          if ( this->uClipY < a3 )
             v13 = a3;
-          v14 = this->uClipW;
-          if ( (signed int)(v5 + v13) > (signed int)v14 )
+          if ( (signed int)(v5 + v13) > (signed int)this->uClipW )
           {
             v15 = this->uClipY;
-            if ( v15 < a3 )
+            if ( this->uClipY < a3 )
               v15 = a3;
-            v5 = v14 - v15;
+            v5 = this->uClipW - v15;
           }
         }
         
@@ -7422,7 +7405,7 @@
           for (int x = 0; x < v20; ++x)
           {
                 if ( *v16 )
-                  WritePixel16(clipped_out_x + x, clipped_out_y + y, v4->pPalette16[*v16] & mask);
+                  WritePixel16(clipped_out_x + x, clipped_out_y + y, pTexture->pPalette16[*v16] & mask);
                 ++v16;
           }
             v16 += v18 - v20;