diff Render.cpp @ 709:af08fc9e29c8

Items (blue dots) on minimap fixed
author Nomad
date Thu, 21 Mar 2013 12:37:49 +0200
parents e0a1fccc89b1
children 735dab8d3c9a 737d7fec67f0
line wrap: on
line diff
--- a/Render.cpp	Thu Mar 21 10:35:13 2013 +0200
+++ b/Render.cpp	Thu Mar 21 12:37:49 2013 +0200
@@ -4749,10 +4749,10 @@
   v1->field_4002C = 0;
   v1->pActiveZBuffer = 0;
   v1->pDefaultZBuffer = 0;
-  v1->field_20_clipy = 0;
-  v1->field_1C_clipx = 0;
-  v1->field_24_width = 639;
-  v1->field_28_height = 479;
+  v1->raster_clip_y = 0;
+  v1->raster_clip_x = 0;
+  v1->raster_clip_z = 639;
+  v1->raster_clip_w = 479;
   v1->field_4003C = (int)&unk_4EED80;
   v1->field_40040 = dword_4EED78;
   v1->uClipZ = 640;
@@ -6294,7 +6294,7 @@
 
 
 //----- (004A0BEE) --------------------------------------------------------
-char Render::Line2D(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned __int16 uColor)
+char Render::RasterLine2D(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned __int16 uColor)
 {
   int v6; // edi@1
   int v7; // edx@5
@@ -6333,18 +6333,18 @@
   int uZa; // [sp+2Ch] [bp+10h]@38
 
   v36 = 0i64;
-  v6 = this->field_1C_clipx;
+  v6 = this->raster_clip_x;
   v35 = this;
   if ( (signed int)uX < v6 )
     HIDWORD(v36) = 8;
-  v34 = this->field_24_width;
-  if ( (signed int)uX > this->field_24_width )
+  v34 = this->raster_clip_z;
+  if ( (signed int)uX > this->raster_clip_z )
     HIDWORD(v36) |= 4u;
-  v7 = this->field_20_clipy;
+  v7 = this->raster_clip_y;
   v8 = uY;
   if ( (signed int)uY < v7 )
     HIDWORD(v36) |= 2u;
-  v9 = this->field_28_height;
+  v9 = this->raster_clip_w;
   if ( (signed int)uY > v9 )
     HIDWORD(v36) |= 1u;
   v10 = uZ;
@@ -6447,7 +6447,7 @@
       v13 = (signed int)((uW - uY) * (v6 - uX)) / (signed int)(uZ - uX);
       v14 = v35;
       v8 = v13 + uY;
-      uX = v35->field_1C_clipx;
+      uX = v35->raster_clip_x;
       goto LABEL_24;
     }
     v10 = v6;
@@ -6457,26 +6457,26 @@
 LABEL_24:
   if ( (BYTE4(v36) ^ (unsigned __int8)v36) & 4 )
   {
-    v15 = v14->field_24_width;
+    v15 = v14->raster_clip_z;
     if ( BYTE4(v36) & 4 )
     {
       v14 = v35;
       v8 += (signed int)((v11 - v8) * (v15 - uX)) / (signed int)(v10 - uX);
-      uX = v35->field_24_width;
+      uX = v35->raster_clip_z;
     }
     else
     {
       v16 = (signed int)((v8 - v11) * (v15 - v10)) / (signed int)(uX - v10);
-      v10 = v14->field_24_width;
+      v10 = v14->raster_clip_z;
       v11 += v16;
     }
   }
-  v17 = v14->field_20_clipy;
+  v17 = v14->raster_clip_y;
   v37 = 0;
-  uYa = v14->field_20_clipy;
+  uYa = v14->raster_clip_y;
   if ( (signed int)v8 < v17 )
     v37 = 2;
-  v18 = v14->field_28_height;
+  v18 = v14->raster_clip_w;
   if ( (signed int)v8 > v18 )
     v37 |= 1u;
   if ( (signed int)v11 >= v17 )
@@ -6495,7 +6495,7 @@
       {
         uX += (signed int)((v10 - uX) * (uYa - v8)) / (signed int)(v11 - v8);
         LOBYTE(v12) = (char)v35;
-        v8 = v35->field_20_clipy;
+        v8 = v35->raster_clip_y;
       }
       else
       {
@@ -6510,14 +6510,14 @@
     {
       if ( v37 & 1 )
       {
-        uX += (signed int)((v10 - uX) * (v35->field_28_height - v8)) / (signed int)(v11 - v8);
+        uX += (signed int)((v10 - uX) * (v35->raster_clip_w - v8)) / (signed int)(v11 - v8);
         LOBYTE(v12) = (char)v35;
-        v8 = v35->field_28_height;
+        v8 = v35->raster_clip_w;
       }
       else
       {
-        v12 = (signed int)((uX - v10) * (v35->field_28_height - v11)) / (signed int)(v8 - v11);
-        v11 = v35->field_28_height;
+        v12 = (signed int)((uX - v10) * (v35->raster_clip_w - v11)) / (signed int)(v8 - v11);
+        v11 = v35->raster_clip_w;
         v10 += v12;
       }
     }
@@ -6537,12 +6537,12 @@
 
 
 //----- (004A0E97) --------------------------------------------------------
-void Render::Clip_v2(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
-{
-  this->field_1C_clipx = uX;
-  this->field_20_clipy = uY;
-  this->field_24_width = uZ;
-  this->field_28_height = uW;
+void Render::SetRasterClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
+{
+  this->raster_clip_x = uX;
+  this->raster_clip_y = uY;
+  this->raster_clip_z = uZ;
+  this->raster_clip_w = uW;
 }