changeset 92:9a2fa2f2cce0

minor fixes
author Nomad
date Thu, 01 Nov 2012 11:58:02 +0200
parents b39bdc150e90
children c97dfd4b9600
files Indoor.cpp LightmapBuilder.cpp mm7_4.cpp
diffstat 3 files changed, 15 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Mon Oct 29 01:36:20 2012 +0200
+++ b/Indoor.cpp	Thu Nov 01 11:58:02 2012 +0200
@@ -453,8 +453,8 @@
   //char v21; // dl@27
   //unsigned int v22; // eax@44
   unsigned int v23; // eax@35
-  DWORD v24; // eax@37
-  int v25; // eax@38
+  //DWORD v24; // eax@37
+  //int v25; // eax@38
   //char *v26; // edi@38
   IDirect3DTexture2 *v27; // eax@42
   Texture *v28; // [sp+Ch] [bp-1Ch]@15
@@ -503,7 +503,7 @@
       static_vertices_F7C228[i].vWorldPosition.y = pIndoor->pVertices[pFace->pVertexIDs[i]].y;
       static_vertices_F7C228[i].vWorldPosition.z = pIndoor->pVertices[pFace->pVertexIDs[i]].z;
       static_vertices_F7C228[i].u = (signed short)pFace->pVertexUIDs[i];
-      static_vertices_F7C228[i].v = (signed short)pFace->pVertexUIDs[i];
+      static_vertices_F7C228[i].v = (signed short)pFace->pVertexVIDs[i];
     }
 
     if (!pVertices ||
@@ -568,19 +568,21 @@
 
         if (pFace->Animated())
         {
-          v24 = GetTickCount() / 4;
-          v25 = v24 - stru_5C6E00->uIntegerHalfPi;
-
+          //auto v24 = GetTickCount() / 4;
+          //auto v25 = v24 - stru_5C6E00->uIntegerHalfPi;
+          uint eightSeconds = GetTickCount() % 8000;
+          float angle = (eightSeconds / 8000.0f) * 2 * 3.1415f;
+
+          //animte lava back and forth
           for (uint i = 0; i < uNumVerticesa; ++i)
-            array_507D30[i].v += (double)(pBitmaps_LOD->pTextures[pFace->uBitmapID].uHeightMinus1 & (unsigned int)(stru_5C6E00->SinCos(v25) >> 8));
+            //array_507D30[i].v += (double)(pBitmaps_LOD->pTextures[pFace->uBitmapID].uHeightMinus1 & (unsigned int)(stru_5C6E00->SinCos(v25) >> 8));
+            array_507D30[i].v += pBitmaps_LOD->pTextures[pFace->uBitmapID].uHeightMinus1 * cosf(angle);
 
           v23 = pFace->uBitmapID;
           goto LABEL_42;
         }
-        else
+        else if (pFace->uAttributes & 0x4000)
         {
-          if (pFace->uAttributes & 0x4000)
-          {
             v23 = pTextureFrameTable->GetFrameTexture(
                             pFace->uBitmapID,
                             pBLVRenderParams->field_0_timer_);
@@ -591,7 +593,6 @@
                     else
                       pRenderer->DrawIndoorPolygon(uNumVerticesa, pFace, v27, v28, 8 * uFaceID | 6, v17, 0);
                     return;
-          }
         }
       }
     }
--- a/LightmapBuilder.cpp	Mon Oct 29 01:36:20 2012 +0200
+++ b/LightmapBuilder.cpp	Thu Nov 01 11:58:02 2012 +0200
@@ -264,6 +264,7 @@
     }
   }
 
+  __debugbreak(); // foil
   if (!pGame->pStru9Instance->_4980B9(a9, uNumVertices,
                                       a7->field_4.x, a7->field_4.y, a7->field_4.z,
                                       v11->pVertices, &v11->uNumVertices))
--- a/mm7_4.cpp	Mon Oct 29 01:36:20 2012 +0200
+++ b/mm7_4.cpp	Thu Nov 01 11:58:02 2012 +0200
@@ -7244,7 +7244,7 @@
 }
 
 //----- (004A597D) --------------------------------------------------------
-void __cdecl Present_NoColorKey()
+void Present_NoColorKey()
 {
   //unsigned __int16 *v0; // eax@4
   unsigned __int16 *v1; // esi@4
@@ -7334,7 +7334,7 @@
         auto uHalfWidth = v20 = (pViewport->uViewportZ - pViewport->uViewportX) / 2;
         v13 = v24;
 
-        for (uint y = pViewport->uViewportY; y < pViewport->uViewportW; ++y)
+        for (uint y = pViewport->uViewportY; y < pViewport->uViewportW + 1; ++y)
         {
           //memcpy(pDst + pViewport->uViewportX + y * Dst.lPitch / 2,
           //       pSrc + pViewport->uViewportX + y * 640, (pViewport->uViewportZ - pViewport->uViewportX) * sizeof(__int16));