changeset 852:e3609dd06c15

m
author Ritor1
date Sat, 30 Mar 2013 09:40:05 +0600
parents 6f7c2ab9ce4f
children 7ada14f991f5
files Render.cpp Render.h mm7_3.cpp
diffstat 3 files changed, 13 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/Render.cpp	Fri Mar 29 18:42:00 2013 +0600
+++ b/Render.cpp	Sat Mar 30 09:40:05 2013 +0600
@@ -7599,60 +7599,12 @@
 // 4D864C: using guessed type char byte_4D864C;
 
 //----- (004A2DA3) --------------------------------------------------------
-void Render::DrawStrip(unsigned int uNumVertices, struct stru148 *a3, IDirect3DTexture2 *pTexture)
-{
-  //int v4; // ebx@1
-  int v7; // eax@7
-  float v12; // ST3C_4@8
- int i;
-
-  //v4 = (int)this;
- if (!this->uNumD3DSceneBegins)
-   return;
-
- if (uNumVertices >= 3)
- {
-  this->pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP);
-  if (this->bUsingSpecular)
-  {
-   this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE);
-   this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE);
-   this->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO);
-  }
-  
-  for (i = 0; i < uNumVertices; ++i)
-  {
-   pVertices[i].pos.x = array_50AC10[i].vWorldViewProjX;
-   pVertices[i].pos.y = array_50AC10[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, true, false);
-   v7 = 0;
-   if (this->bUsingSpecular)
-   {
-    v12 = array_50AC10[i].vWorldViewPosition.x;
-    v7 = sub_47C3D7_get_fog_related_stuff(0, 1, v12);
-   }
-   pVertices[i].specular = v7;
-   pVertices[i].texcoord.x = array_50AC10[i].u;
-   pVertices[i].texcoord.y = array_50AC10[i].v;
-  }
-  pRenderer->pRenderD3D->pDevice->SetTexture(0, pTexture);
-  pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, 
-    pVertices, uNumVertices, D3DDP_DONOTUPDATEEXTENTS | D3DDP_DONOTLIGHT);
- }
-}
-
-//----- (004A2DA3) --------------------------------------------------------
-void Render::DrawFan(unsigned int uNumVertices, stru148 *a3, IDirect3DTexture2 *pTexture)
-{
-  //int v4; // ebx@1
+void Render::DrawSkyPolygon(unsigned int uNumVertices, stru148 *a3, IDirect3DTexture2 *pTexture)
+{
   int v7; // eax@7
   float v13; // ST3C_4@8
   int i;
 
-  //v4 = (int)this;
   if ( !this->uNumD3DSceneBegins )
     return;
   if ( uNumVertices >= 3 )
--- a/Render.h	Fri Mar 29 18:42:00 2013 +0600
+++ b/Render.h	Sat Mar 30 09:40:05 2013 +0600
@@ -322,8 +322,7 @@
   unsigned int GetActorTintColor(float a2, int tint, int a4, int a5, RenderBillboard *a6);
   void DrawPolygon(unsigned int uNumVertices, stru148 *a3, ODMFace *a4, IDirect3DTexture2 *pTexture);
   void DrawTerrainPolygon(unsigned int uNumVertices, stru148 *a4, IDirect3DTexture2 *a5, bool transparent, bool clampAtTextureBorders);
-  void DrawStrip(unsigned int uNumVertices, struct stru148 *a3, IDirect3DTexture2 *pTexture);
-  void DrawFan(unsigned int uNumVertices, stru148 *a3, IDirect3DTexture2 *a4);
+  void DrawSkyPolygon(unsigned int uNumVertices, stru148 *a3, IDirect3DTexture2 *pTexture);
   void _4A2ED5(signed int a2, stru148 *a3, IDirect3DTexture2 *pHwTex);
   void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, Texture *pTex, int uPackedID, unsigned int uColor, int a8);
   void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle);
--- a/mm7_3.cpp	Fri Mar 29 18:42:00 2013 +0600
+++ b/mm7_3.cpp	Sat Mar 30 09:40:05 2013 +0600
@@ -6113,21 +6113,22 @@
     //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]._rhw = 1.0;// / (pOutdoorCamera->shading_dist_mist >> 16);
     //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;
+    array_50AC10[i].v += 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]);
+      pRenderer->DrawSkyPolygon(_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->DrawSkyPolygon(_this.uNumVertices, &_this, pBitmaps_LOD->pHardwareTextures[_this.uTileBitmapID]);
       return;
     }
   }