diff Engine/Graphics/Render.cpp @ 2536:400edd7b0407

DrawTextureIndexed() func
author Ritor1
date Mon, 16 Feb 2015 00:48:08 +0600
parents 3a36de426f5f
children 407263babde8
line wrap: on
line diff
--- a/Engine/Graphics/Render.cpp	Sun Feb 15 23:39:07 2015 +0600
+++ b/Engine/Graphics/Render.cpp	Mon Feb 16 00:48:08 2015 +0600
@@ -7702,7 +7702,7 @@
 }
 
 //----- (004A5EB2) --------------------------------------------------------
-void Render::DrawTextureIndexed(unsigned int uX, unsigned int uY, Texture *a4)
+void Render::DrawTextureIndexed(signed int x, signed int y, Texture *tex)
 {
   int v5; // ebx@4
   unsigned int v8; // edx@6
@@ -7717,59 +7717,59 @@
 
   if ( this->uNumSceneBegins )
   {
-    if ( a4 )
-    {
-      if ( a4->pPalette16 )
-      {
-        v5 = a4->uTextureHeight;
+    if ( tex )
+    {
+      if ( tex->pPalette16 )
+      {
+        v5 = tex->uTextureHeight;
         //pTarget = &this->pTargetSurface[uX + uY * this->uTargetSurfacePitch];
-        v19 = a4->pLevelOfDetail0_prolly_alpha_mask;
-        v20 = a4->uTextureWidth;
-        v18 = a4->uTextureWidth;
-
-        int clipped_out_x = uX;
-        int clipped_out_y = uY;
+        v19 = tex->pLevelOfDetail0_prolly_alpha_mask;
+        v20 = tex->uTextureWidth;
+        v18 = tex->uTextureWidth;
+
+        int clipped_out_x = x;
+        int clipped_out_y = y;
         if ( this->bClip )
         {
-          if ( (signed int)uX < (signed int)this->uClipX )
+          if ( (signed int)x < (signed int)this->uClipX )
           {
-            v8 = this->uClipX - uX;
+            v8 = this->uClipX - x;
             v19 += v8;
-            v20 += uX - this->uClipX;
+            v20 += x - this->uClipX;
             clipped_out_x = uClipX;
           }
 
-          v5 = a4->uTextureHeight;
-          if ( (signed int)uY < (signed int)this->uClipY )
+          v5 = tex->uTextureHeight;
+          if ( (signed int)y < (signed int)this->uClipY )
           {
-            v10 = this->uClipY - uY;
+            v10 = this->uClipY - y;
             v19 += v18 * v10;
-            v5 = uY - this->uClipY + a4->uTextureHeight;
+            v5 = y - this->uClipY + tex->uTextureHeight;
             //v4 = a4;
             clipped_out_y = uClipY;
           }
 
           v11 = this->uClipX;
-          if ( (signed int)this->uClipX < (signed int)uX )
-            v11 = uX;
+          if ( (signed int)this->uClipX < (signed int)x )
+            v11 = x;
 
           if ( (signed int)(v11 + v20) > (signed int)this->uClipZ )
           {
             v12 = this->uClipX;
-            if ( (signed int)this->uClipX < (signed int)uX )
-              v12 = uX;
+            if ( (signed int)this->uClipX < (signed int)x )
+              v12 = x;
             v20 = this->uClipZ - v12;
           }
 
           v13 = this->uClipY;
-          if ( (signed int)this->uClipY < (signed int)uY )
-            v13 = uY;
+          if ( (signed int)this->uClipY < (signed int)y )
+            v13 = y;
 
           if ( (signed int)(v5 + v13) > (signed int)uClipW )
           {
             v15 = this->uClipY;
-            if ( (signed int)this->uClipY < (signed int)uY )
-              v15 = uY;
+            if ( (signed int)this->uClipY < (signed int)y )
+              v15 = y;
             v5 = uClipW - v15;
           }
         }
@@ -7778,8 +7778,8 @@
         {
           for (int x = 0; x < v20; ++x)
           {
-            if ( a4->pPalette16[*v19] != 0x7FF )// 2047
-              WritePixel16(clipped_out_x + x, clipped_out_y + y, a4->pPalette16[*v19]);
+            if ( tex->pPalette16[*v19] != 0x7FF )// 2047
+              WritePixel16(clipped_out_x + x, clipped_out_y + y, tex->pPalette16[*v19]);
             ++v19;
           }
           v19 += v18 - v20;