changeset 582:88dd54e6e44a

Слияние
author Ritor1
date Wed, 06 Mar 2013 16:51:39 +0600
parents 2d4204de7a8c (diff) f90753ebabe3 (current diff)
children a436924b31c3 ac6fe92c7e36
files
diffstat 4 files changed, 108 insertions(+), 125 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Wed Mar 06 06:41:36 2013 +0200
+++ b/Indoor.cpp	Wed Mar 06 16:51:39 2013 +0600
@@ -372,20 +372,19 @@
     _this.uFlags |= INDOOR_CAMERA_DRAW_D3D_OUTLINES;
 
   _this.field_0_timer = pEventTimer->uTotalGameTimeElapsed;
-  _this.vPosition.x = pParty->vPosition.x - ((unsigned __int64)(stru_5C6E00->Cos(pParty->sRotationY) * (signed __int64)pParty->y_rotation_granularity) >> 16);
-  v2 = stru_5C6E00->Sin(pParty->sRotationY);
-  v3 = (unsigned __int64)(v2 * (signed __int64)pParty->y_rotation_granularity) >> 16;
   _this.field_1C_mb_fov = 65;
-  _this.vPosition.y = pParty->vPosition.y - v3;
+  _this.vPosition.x = pParty->vPosition.x - ((stru_5C6E00->Cos(pParty->sRotationY) * (signed __int64)pParty->y_rotation_granularity) >> 16);
+  _this.vPosition.y = pParty->vPosition.y - ((stru_5C6E00->Sin(pParty->sRotationY) * (signed __int64)pParty->y_rotation_granularity) >> 16);
+  _this.vPosition.z = pParty->vPosition.z + pParty->sEyelevel;
+  _this.sRotationX = pParty->sRotationX;
   _this.sRotationY = pParty->sRotationY;
-  _this.sRotationX = pParty->sRotationX;
   _this.pRenderTarget = pRenderer->pTargetSurface;
   _this.uViewportX = pViewport->uScreenX;
   _this.uViewportY = pViewport->uScreenY;
   _this.uViewportZ = pViewport->uScreenZ;
   _this.uViewportW = pViewport->uScreenW;
   _this.field_3C = pViewport->field_30;
-  _this.vPosition.z = pParty->vPosition.z + pParty->sEyelevel;
+
   _this.uTargetWidth = 640;
   _this.uTargetHeight = 480;
   _this.pTargetZ = pRenderer->pActiveZBuffer;
@@ -507,15 +506,8 @@
     if (!pVertices ||
         (pGame->pStru9Instance->_498377(a4, 4u, pVertices, static_vertices_F7C228, &uNumVerticesa), uNumVerticesa) )
     {
-      if (pGame->pIndoorCameraD3D->_437285_prolly_colide_vertices_against_frustrum(
-                     static_vertices_F7C228,
-                     &uNumVerticesa,
-                     static_vertices_F7B628,
-                     pGame->pIndoorCameraD3D->std__vector_000034_prolly_frustrum,
-                     4,
-                     false,
-                     0) != 1
-                || uNumVerticesa )
+      if (pGame->pIndoorCameraD3D->_437285_prolly_colide_vertices_against_frustrum(static_vertices_F7C228, &uNumVerticesa,
+                     static_vertices_F7B628, pGame->pIndoorCameraD3D->std__vector_000034_prolly_frustrum, 4, false, 0) != 1 || uNumVerticesa )
       {
         a4a = SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel);
         v17 = (248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) | (((248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) | ((248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) << 8)) << 8);
@@ -535,26 +527,12 @@
           stru_F7B60C.face_plane.dist = pFace->pFacePlane.dist;
         }
 
-        if (stru_F8AD28.uNumLightsApplied > 0 &&
-            !(pFace->uAttributes & 0x400000))
-          pGame->pLightmapBuilder->ApplyLights(
-                    &stru_F8AD28,
-                    &stru_F7B60C,
-                    uNumVerticesa,
-                    array_507D30,
-                    pVertices,
-                    0);
+        if (stru_F8AD28.uNumLightsApplied > 0 && !pFace->uAttributes)
+            //!(pFace->uAttributes & 0x400000))
+          pGame->pLightmapBuilder->ApplyLights(&stru_F8AD28, &stru_F7B60C, uNumVerticesa, array_507D30, pVertices, 0);
 
         if (pDecalBuilder->uNumDecals > 0)
-          pDecalBuilder->ApplyDecals(
-                    a4a,
-                    1,
-                    &stru_F7B60C,
-                    uNumVerticesa,
-                    array_507D30,
-                    pVertices,
-                    0,
-                    pFace->uSectorID);
+          pDecalBuilder->ApplyDecals(a4a, 1, &stru_F7B60C, uNumVerticesa, array_507D30, pVertices, 0, pFace->uSectorID);
 
         if (pFace->Animated() &&
             pFace->uBitmapID == pRenderer->hd_water_tile_id )
@@ -579,18 +557,16 @@
           v23 = pFace->uBitmapID;
           goto LABEL_42;
         }
-        else if (pFace->uAttributes & 0x4000)
+        else if (pFace->uAttributes)//(pFace->uAttributes & 0x4000)
         {
-            v23 = pTextureFrameTable->GetFrameTexture(
-                            pFace->uBitmapID,
-                            pBLVRenderParams->field_0_timer_);
+          v23 = pTextureFrameTable->GetFrameTexture(pFace->uBitmapID, pBLVRenderParams->field_0_timer_);
 LABEL_42:
-                    v27 = pBitmaps_LOD->pHardwareTextures[v23];
-                    if (pFace->uAttributes & 0x400000)
-                      _479A53_draw_some_blv_poly(uNumVerticesa, uFaceID);
-                    else
-                      pRenderer->DrawIndoorPolygon(uNumVerticesa, pFace, v27, v28, 8 * uFaceID | 6, v17, 0);
-                    return;
+          v27 = pBitmaps_LOD->pHardwareTextures[v23];
+          if (pFace->uAttributes & 0x400000)
+            _479A53_draw_some_blv_poly(uNumVerticesa, uFaceID);
+          else
+            pRenderer->DrawIndoorPolygon(uNumVerticesa, pFace, v27, v28, 8 * uFaceID | 6, v17, 0);
+          return;
         }
       }
     }
--- a/MM7.vcxproj.filters	Wed Mar 06 06:41:36 2013 +0200
+++ b/MM7.vcxproj.filters	Wed Mar 06 16:51:39 2013 +0600
@@ -149,7 +149,6 @@
     <ClInclude Include="stru314.h" />
     <ClInclude Include="SaveLoad.h" />
     <ClInclude Include="stru287.h" />
-    <ClInclude Include="stru179.h" />
     <ClInclude Include="Awards.h" />
     <ClInclude Include="Autonotes.h" />
     <ClInclude Include="stru160.h" />
@@ -201,7 +200,6 @@
     <ClInclude Include="resource.h" />
     <ClInclude Include="stru346.h" />
     <ClInclude Include="texts.h" />
-    <ClInclude Include="SpriteObject.h" />
   </ItemGroup>
   <ItemGroup>
     <Filter Include="lib">
--- a/Render.cpp	Wed Mar 06 06:41:36 2013 +0200
+++ b/Render.cpp	Wed Mar 06 16:51:39 2013 +0600
@@ -1744,8 +1744,7 @@
 
   v63 = 0;
   // basic optimizations
-  unsigned int uStartX, uEndX,
-               uStartZ, uEndZ;
+  unsigned int uStartX, uEndX, uStartZ, uEndZ;
   if (pIndoorCamera->sRotationY >= 0 && pIndoorCamera->sRotationY <= 1024)
   {
     uStartX = 0, uEndX = 128;
--- a/mm7_3.cpp	Wed Mar 06 06:41:36 2013 +0200
+++ b/mm7_3.cpp	Wed Mar 06 16:51:39 2013 +0600
@@ -6166,47 +6166,38 @@
   array_50AC10[3].vWorldViewProjX = pViewport->uViewportZ;
   array_50AC10[3].vWorldViewProjY = v38;
 
-  v36 = (double)(pViewport->uViewportZ - pViewport->uViewportX) * 0.5;
+  /*v36 = (double)(pViewport->uViewportZ - pViewport->uViewportX) * 0.5;
   v33 = 65536 / (signed int)(v36 / tan(0.6457717418670654) + 0.5);
 
   for (int i = 0; i < _this.uNumVertices; ++i)
   {
-     v29 = floorf(array_50AC10[i].vWorldViewProjY + 0.5f);
-     v39 = (unsigned __int64)(_this.ptr_38->field_14 * v33 * (v30 - v29)) / 65536;
-     v8 = v39 + _this.ptr_38->field_C;
-
-     v39 = (unsigned __int64)(_this.ptr_38->field_20 * v33 * (v30 - v29)) / 65536;
-     v36 = v39 + _this.ptr_38->field_18;
-
-      v9 = (unsigned __int64)(_this.v_18.z * v33 * (v30 - v29)) / 65536;
-      v10 = _this.v_18.x + v9;
-      v39 = _this.v_18.x + v9;
-      if ( _this.v_18.x + v9 > 0 )
-      {
-        v10 = 0;
-        v39 = 0;
-      }
-      v11 = (signed __int64)array_50AC10[i].vWorldViewProjX;
-      v38 = v10;
-      v12 = array_50AC10[i].vWorldViewProjY - 1.0;
-      v13 = v33 * (pViewport->uScreenCenterX - v11);
-      v34 = -_this.field_24;
-      v32 = (signed __int64)v12;
-      v14 = v33 * (v30 - v32);
-      while ( 1 )
-      {
-        v40 = v14;
-        if ( !v10 )
-          goto LABEL_12;
-        v37 = abs(v34 >> 14);
-        v15 = abs(v10);
-        if ( v37 <= v15 || v32 <= pViewport->uViewportY )
-        {
-          if ( v39 <= 0 )
-            break;
-        }
-        v14 = v40;
-LABEL_12:
+    v29 = floorf(array_50AC10[i].vWorldViewProjY + 0.5f);
+    v39 = (unsigned __int64)(_this.ptr_38->field_14 * v33 * (v30 - v29)) / 65536;
+    v8 = v39 + _this.ptr_38->field_C;
+
+    v39 = (unsigned __int64)(_this.ptr_38->field_20 * v33 * (v30 - v29)) / 65536;
+    v36 = v39 + _this.ptr_38->field_18;
+
+    v9 = (unsigned __int64)(_this.v_18.z * v33 * (v30 - v29)) / 65536;
+    v10 = _this.v_18.x + v9;
+    v39 = _this.v_18.x + v9;
+    if ( _this.v_18.x + v9 > 0 )
+    {
+      v10 = 0;
+      v39 = 0;
+    }
+    v11 = (signed __int64)array_50AC10[i].vWorldViewProjX;
+    v38 = v10;
+    v12 = array_50AC10[i].vWorldViewProjY - 1.0;
+    v13 = v33 * (pViewport->uScreenCenterX - v11);
+    v34 = -_this.field_24;
+    v32 = (signed __int64)v12;
+    v14 = v33 * (v30 - v32);
+    while ( 1 )
+    {
+      //v40 = v14;
+      if ( !v10 )
+      {
         v37 = _this.v_18.z;
         v16 = (unsigned __int64)(_this.v_18.z * (signed __int64)v14) >> 16;
         --v32;
@@ -6216,47 +6207,66 @@
         v38 = _this.v_18.x + v16;
         break;
       }
-      LODWORD(v17) = v34 << 16;
-      HIDWORD(v17) = v34 >> 16;
-      v18 = v17 / v38;
-      if ( v18 < 0 )
-        v18 = pOutdoorCamera->shading_dist_mist;
-
-      v37 += ((unsigned __int64)(_this.ptr_38->field_10 * v13) >> 16);
-      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.0 / (double)(v17 / 65536);
-      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);
-    }
-
-     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]);
-        return;
+      v37 = abs(v34 >> 14);
+      v15 = abs(v10);
+      if ( v37 <= v15 || v32 <= pViewport->uViewportY )
+      {
+        if ( v39 <= 0 )
+          break;
+      }
+      //v14 = v40;
+      v37 = _this.v_18.z;
+      v16 = (unsigned __int64)(_this.v_18.z * v14) >> 16;
+      --v32;
+      v14 += v33;
+      v10 = _this.v_18.x + v16;
+      v39 = _this.v_18.x + v16;
+      v38 = _this.v_18.x + v16;
+      break;
+    }
+    LODWORD(v17) = v34 << 16;
+    HIDWORD(v17) = v34 >> 16;
+    v18 = v17 / v38;
+    if ( v18 < 0 )
+      v18 = pOutdoorCamera->shading_dist_mist;
+
+    v37 += ((unsigned __int64)(_this.ptr_38->field_10 * v13) >> 16);
+    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]);
+      return;
+    //}
+  }
 }