diff mm7_3.cpp @ 840:6dd2b94efce7

DrawFan
author Ritor1
date Fri, 29 Mar 2013 10:43:46 +0600
parents d061180f2b42
children 2825b5a9b562
line wrap: on
line diff
--- a/mm7_3.cpp	Thu Mar 28 00:37:58 2013 +0400
+++ b/mm7_3.cpp	Fri Mar 29 10:43:46 2013 +0600
@@ -6035,12 +6035,12 @@
   array_50AC10[1].vWorldViewProjY = v38;
 
   array_50AC10[2].vWorldViewProjX = pViewport->uViewportBR_X;
-  array_50AC10[2].vWorldViewProjY = pViewport->uViewportTL_Y;
+  array_50AC10[2].vWorldViewProjY = v38;
 
   array_50AC10[3].vWorldViewProjX = pViewport->uViewportBR_X;
-  array_50AC10[3].vWorldViewProjY = v38;
-
-  /*v36 = (double)(pViewport->uViewportZ - pViewport->uViewportX) * 0.5;
+  array_50AC10[3].vWorldViewProjY = pViewport->uViewportTL_Y;
+
+  v36 = (double)(pViewport->uViewportBR_X - pViewport->uViewportTL_X) * 0.5;
   v33 = 65536 / (signed int)(v36 / tan(0.6457717418670654) + 0.5);
 
   for (int i = 0; i < _this.uNumVertices; ++i)
@@ -6060,10 +6060,10 @@
       v10 = 0;
       v39 = 0;
     }
-    v11 = (signed __int64)array_50AC10[i].vWorldViewProjX;
+    //v11 = (signed __int64)array_50AC10[i].vWorldViewProjX;
     v38 = v10;
     v12 = array_50AC10[i].vWorldViewProjY - 1.0;
-    v13 = v33 * (pViewport->uScreenCenterX - v11);
+    v13 = v33 * (pViewport->uScreenCenterX - (signed __int64)array_50AC10[i].vWorldViewProjX);
     v34 = -_this.field_24;
     v32 = (signed __int64)v12;
     v14 = v33 * (v30 - v32);
@@ -6083,7 +6083,7 @@
       }
       v37 = abs(v34 >> 14);
       v15 = abs(v10);
-      if ( v37 <= v15 || v32 <= pViewport->uViewportY )
+      if ( v37 <= v15 || v32 <= pViewport->uViewportTL_Y )
       {
         if ( v39 <= 0 )
           break;
@@ -6108,38 +6108,28 @@
     v36 += ((unsigned __int64)(_this.ptr_38->field_1C * v13) >> 16);
     v35 = 224 * pMiscTimer->uTotalGameTimeElapsed + (signed int)((unsigned __int64)(v37 * v18) >> 16) / 8;
     v36 = 224 * pMiscTimer->uTotalGameTimeElapsed + (signed int)((unsigned __int64)(v36 * v18) >> 16) / 8;
-	*/
+
     //array_50AC10[i].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
-    //array_50AC10[i]._rhw = 1;
-    //array_50AC10[i].u = (double)v35 / (65536.0 * pBitmaps_LOD->pTextures[pOutdoor->uSky_TextureID].uTextureWidth);
-    //array_50AC10[i].v = (double)v36 / (65536.0 * pBitmaps_LOD->pTextures[pOutdoor->uSky_TextureID].uTextureWidth);
-    //}
-    if ( _this.uNumVertices > 0)
-    {
-      float t = (GetTickCount() % 96000) / 96000.0f;
-
-      array_50AC10[0].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
-      array_50AC10[0]._rhw = 1;
-      array_50AC10[0].u = 0;
-      array_50AC10[0].v = 0 + t;
-
-      array_50AC10[1].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
-      array_50AC10[1]._rhw = 1;
-      array_50AC10[1].u = 0;
-      array_50AC10[1].v = 1 + t;
-
-      array_50AC10[2].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
-      array_50AC10[2]._rhw = 1;
-      array_50AC10[2].u = 1;
-      array_50AC10[2].v = 0 + t;
-
-      array_50AC10[3].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
-      array_50AC10[3]._rhw = 1;
-      array_50AC10[3].u = 1;
-      array_50AC10[3].v = 1 + t;
-      pRenderer->DrawStrip(_this.uNumVertices, &_this, pBitmaps_LOD->pHardwareTextures[_this.uTileBitmapID]);
+    //array_50AC10[i].vWorldPosition.x = v36 / (_this.pTexture->uTextureHeight * 65536.0);
+    //array_50AC10[i].vWorldPosition.y = 1.0 / (pOutdoorCamera->shading_dist_mist >> 16);
+    //array_50AC10[i].vWorldPosition.z = v35 / (_this.pTexture->uTextureWidth * 65536.0);
+    array_50AC10[i]._rhw = 1;
+    //array_50AC10[i].u = (double)v35 / (65536.0 * _this.pTexture->uTextureWidth);
+    //array_50AC10[i].v = (double)v36 / (65536.0 * _this.pTexture->uTextureHeight);
+    //float t = (GetTickCount() % 96000) / 96000.0f;
+    //array_50AC10[i].u += t;
+    if ( i  == _this.uNumVertices - 1 )
+    {
+      pRenderer->DrawFan(_this.uNumVertices, &_this, pBitmaps_LOD->pHardwareTextures[_this.uTileBitmapID]);
+
+      //array_50AC10[0].vWorldViewProjY = v38;
+      //array_50AC10[1].vWorldViewProjY = array_50AC10[1].vWorldViewProjY + 30.0;
+      //array_50AC10[2].vWorldViewProjY = array_50AC10[2].vWorldViewProjY + 30.0;
+      //array_50AC10[3].vWorldViewProjY = v38;
+
+      pRenderer->DrawFan(_this.uNumVertices, &_this, pBitmaps_LOD->pHardwareTextures[_this.uTileBitmapID]);
       return;
-    //}
+    }
   }
 }