changeset 61:6c2cefdaea3e

Слияние
author Ritor1
date Tue, 22 Jan 2013 18:41:17 +0600
parents b9d70af644f3 (current diff) 63cfe63ac4c5 (diff)
children 80484cf3a683
files GUIWindow.cpp LightmapBuilder.cpp Outdoor.cpp ParticleEngine.cpp Render.cpp mm7_2.cpp mm7_5.cpp
diffstat 6 files changed, 46 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/GUIWindow.cpp	Tue Jan 22 01:11:32 2013 +0600
+++ b/GUIWindow.cpp	Tue Jan 22 18:41:17 2013 +0600
@@ -1369,7 +1369,7 @@
     if ( v13 < 0 )
       v13 = 0;
     pFont->DrawTextLine(uDefaultColor, v11 + v13, v12, Stra, 640);
-    v12 += LOBYTE(pFont->uFontHeight) - uLineSpacing;
+    v12 += pFont->uFontHeight - uLineSpacing;
     result = strtok(0, "\n");
   }
   return result;
--- a/Outdoor.cpp	Tue Jan 22 01:11:32 2013 +0600
+++ b/Outdoor.cpp	Tue Jan 22 18:41:17 2013 +0600
@@ -235,6 +235,11 @@
 
 //----- (00488F2E) --------------------------------------------------------
 int OutdoorLocation::GetHeightOnTerrain(int sX, int sZ)
+   /*       ,      . 
+          ( Y)    ,      . 
+           X  Z       . 
+       Terrain::getHeight;       X  Z    , 
+        ,     .*/
 {
   int result; // eax@5
 
@@ -707,7 +712,7 @@
 }
 
 //----- (0047C7C2) --------------------------------------------------------
-void OutdoorLocationTerrain::Release()
+void OutdoorLocationTerrain::Release()// 
 {
   if (pHeightmap)
   {
@@ -736,7 +741,7 @@
 //----- (0047C80A) --------------------------------------------------------
 int OutdoorLocationTerrain::_47C80A(int a2, int a3, int a4, int a5)
 {
-  OutdoorLocationTerrain *v5; // ebx@1
+  OutdoorLocationTerrain *pOutLocTerrain; // ebx@1
   double v6; // st7@1
   double v7; // st7@2
   double v8; // st7@2
@@ -747,7 +752,7 @@
   int v13; // edi@7
   int v14; // edx@9
   int v15; // eax@15
-  unsigned __int8 *v16; // ebx@15
+  unsigned __int8 *pMapHeight; // ebx@15
   int v17; // eax@15
   int v18; // ecx@15
   int v19; // esi@15
@@ -774,7 +779,7 @@
   int v40; // [sp+18h] [bp-30h]@15
   int v41; // [sp+1Ch] [bp-2Ch]@15
   int v42; // [sp+20h] [bp-28h]@15
-  OutdoorLocationTerrain *v43; // [sp+24h] [bp-24h]@1
+  OutdoorLocationTerrain *pOutLocTerrain2; // [sp+24h] [bp-24h]@1
   int v44; // [sp+28h] [bp-20h]@21
   float v45; // [sp+2Ch] [bp-1Ch]@1
   float v46; // [sp+30h] [bp-18h]@1
@@ -792,9 +797,9 @@
 
   v46 = -64.0;
   v47 = -64.0;
-  v5 = this;
+  pOutLocTerrain = this;
   v45 = 64.0;
-  v43 = this;
+  pOutLocTerrain2 = this;
   v6 = sqrt(12288.0);
   if ( v6 != 0.0 )
   {
@@ -835,17 +840,17 @@
         {
           if ( v13 >= 0 && result >= -32256 && v13 <= 127 && result <= 32768 )
           {
-            v15 = v5->field_10;
+            v15 = pOutLocTerrain->field_10;
             v55 = v15;
-            v16 = v5->pHeightmap;
-            v17 = (int)(&v16[v13 * v15] + v14);
+            pMapHeight = pOutLocTerrain->pHeightmap;
+            v17 = (int)(&pMapHeight[v13 * v15] + v14);
             v18 = -v13;
             v19 = (64 - v13) << 9;
             v20 = 32 * *(char *)v17;
             v21 = 32 * *(char *)(v17 + 1);
             v22 = (v18 + 63) << 9;
             v41 = v22;
-            v23 = (int)(&v16[v55 * (v48 + 1)] + v50);
+            v23 = (int)(&pMapHeight[v55 * (v48 + 1)] + v50);
             v24 = v22 - v19;
             v40 = 32 * *(char *)v23;
             v42 = 32 * *(char *)(v23 + 1);
@@ -869,9 +874,9 @@
               v31 = 0.0;
             if ( v31 > 31.0 )
               v31 = 31.0;
-            v44 = 2 * (v50 + v48 * v43->field_10);
-            v5 = v43;
-            *((char *)v43->ptr_C + v44 + 1) = (signed __int64)v31;
+            v44 = 2 * (v50 + v48 * pOutLocTerrain2->field_10);
+            pOutLocTerrain = pOutLocTerrain2;
+            *((char *)pOutLocTerrain2->ptr_C + v44 + 1) = (signed __int64)v31;
             v32 = v49 - (v49 - 512);
             v33 = (double)-((v42 - v40) * (v19 - v41));
             v52 = v33;
@@ -893,7 +898,7 @@
             if ( v38 > 31.0 )
               v38 = 31.0;
             v13 = v48;
-            *((char *)v43->ptr_C + v44) = (signed __int64)v38;
+            *((char *)pOutLocTerrain2->ptr_C + v44) = (signed __int64)v38;
             v14 = v50;
             result = v49;
           }
@@ -1038,12 +1043,12 @@
   void *v6; // eax@5
 
   v1 = this;
-  v2 = pAllocator->AllocNamedChunk(this->pHeightmap, 0x4000u, "HMAP");
+  v2 = pAllocator->AllocNamedChunk(this->pHeightmap, 0x4000u, "HMAP");// 
   v1->pHeightmap = (unsigned __int8 *)v2;
   if ( v2
-    && (v4 = pAllocator->AllocNamedChunk(v1->pTilemap, 0x4000u, "TMAP"),
+    && (v4 = pAllocator->AllocNamedChunk(v1->pTilemap, 0x4000u, "TMAP"),// 
         (v1->pTilemap = (unsigned __int8 *)v4) != 0)
-    && (v5 = pAllocator->AllocNamedChunk(v1->pAttributemap, 0x4000u, "AMAP"),
+    && (v5 = pAllocator->AllocNamedChunk(v1->pAttributemap, 0x4000u, "AMAP"),// 
         (v1->pAttributemap = (unsigned __int8 *)v5) != 0) )
   {
     v6 = pAllocator->AllocNamedChunk(v1->ptr_C, 0x8000u, "DMAP");
@@ -1177,7 +1182,7 @@
 }
 
 //----- (0047D0A6) --------------------------------------------------------
-bool OutdoorLocation::Load(char *pFilename, ODMFace *File, size_t pNumItems, int thisa)
+bool OutdoorLocation::Load(char *pFilename, ODMFace *File, size_t pNumItems, int thisa)// 
 {
   //OutdoorLocation *pOutdoorLocation; // esi@1
   /*bool result; // eax@9
@@ -2447,7 +2452,7 @@
 {
   int result; // eax@5
 
-  if ( (uX & 0x80000000u) != 0 || (signed int)uX > 127 || (uZ & 0x80000000u) != 0 || (signed int)uZ > 127 )
+  if ( (signed int)uX < 0 || (signed int)uX > 127 || (signed int)uZ < 0 || (signed int)uZ > 127 )
     result = 0;
   else
     result = 32 * *(&this->pTerrain.pHeightmap[128 * uZ] + uX);
--- a/ParticleEngine.cpp	Tue Jan 22 01:11:32 2013 +0600
+++ b/ParticleEngine.cpp	Tue Jan 22 18:41:17 2013 +0600
@@ -748,11 +748,7 @@
             v14.uScreenSpaceX = v13->uScreenSpaceX;
             v14.uScreenSpaceY = v13->uScreenSpaceY;
             v14.sZValue = v13->sZValue;
-            pRenderer->MakeParticleBillboardAndPush_ODM(
-              &v14,
-              0,
-              v13->uLightColor,
-              v13->_rotation);
+            pRenderer->MakeParticleBillboardAndPush_ODM(&v14, 0, v13->uLightColor, v13->_rotation);
             return;
           }
           if ( BYTE1(v8) & 2 )
@@ -763,11 +759,7 @@
               v1->pLines.pLineVertices[2 * v9].pos.x = (double)*(signed int *)(v7 - 18);
               v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].pos.y = (double)*(signed int *)(v7 - 14);
               v15 = *(short *)v7;
-              v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].pos.z = 1.0
-                                                                       - 1.0
-                                                                       / ((double)v15
-                                                                        * 1000.0
-                                                                        / (double)pOutdoorCamera->shading_dist_mist);
+              v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].pos.z = 1.0 - 1.0 / ((double)v15 * 1000.0 / (double)pOutdoorCamera->shading_dist_mist);
               v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].rhw = 1.0;
               v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].diffuse = *(int *)(v7 + 18);
               v1->pLines.pLineVertices[2 * v1->pLines.uNumLines].specular = 0;
@@ -776,11 +768,7 @@
               v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].pos.x = (double)*(signed int *)(v7 - 10);
               v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].pos.y = (double)*(signed int *)(v7 - 6);
               v15 = *(short *)v7;
-              v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].pos.z = 1.0
-                                                                           - 1.0
-                                                                           / ((double)v15
-                                                                            * 1000.0
-                                                                            / (double)pOutdoorCamera->shading_dist_mist);
+              v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].pos.z = 1.0 - 1.0 / ((double)v15 * 1000.0 / (double)pOutdoorCamera->shading_dist_mist);
               v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].rhw = 1.0;
               v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].diffuse = *(int *)(v7 + 18);
               v1->pLines.pLineVertices[2 * v1->pLines.uNumLines + 1].specular = 0;
@@ -795,11 +783,7 @@
             v14.uScreenSpaceX = *(int *)(v7 - 18);
             v14.uScreenSpaceY = *(int *)(v7 - 14);
             v14.sZValue = *(int *)(v7 - 2);
-            pRenderer->MakeParticleBillboardAndPush_ODM(
-              &v14,
-              pBitmaps_LOD->pHardwareTextures[*(int *)(v7 - 46)],
-              *(int *)(v7 + 18),
-              *(int *)(v7 - 22));
+            pRenderer->MakeParticleBillboardAndPush_ODM(&v14, pBitmaps_LOD->pHardwareTextures[*(int *)(v7 - 46)], *(int *)(v7 + 18), *(int *)(v7 - 22));
           }
           if ( *(v7 - 81) & 8 )
           {
@@ -808,10 +792,7 @@
             v14.uScreenSpaceX = *(int *)(v7 - 18);
             v14.uScreenSpaceY = *(int *)(v7 - 14);
             v14.sZValue = *(int *)(v7 - 2);
-            pRenderer->MakeParticleBillboardAndPush_ODM(
-              &v14,
-              pSprites_LOD->pHardwareSprites[*(int *)(v7 - 46)].pTexture,
-              *(int *)(v7 + 18),
+            pRenderer->MakeParticleBillboardAndPush_ODM(&v14, pSprites_LOD->pHardwareSprites[*(int *)(v7 - 46)].pTexture, *(int *)(v7 + 18),
               *(int *)(v7 - 22));
           }
         }
--- a/Render.cpp	Tue Jan 22 01:11:32 2013 +0600
+++ b/Render.cpp	Tue Jan 22 18:41:17 2013 +0600
@@ -1593,18 +1593,18 @@
         v105 = v79;
         v111 = v75 - v77;
         do
-        {
+        {//    
 		  *(float *)&v106 = (double)v105;
-          *(float *)((char *)&ptr_801A08->vWorldPosition.x + v127) = *(float *)&v106;
+          *(float *)((char *)&ptr_801A08->vWorldPosition.x + v127) = *(float *)&v106;//x
           v105 = (64 - *(int *)((char *)terrain_76D9C8 + v70)) << 9;
-          *(float *)((char *)&ptr_801A08->vWorldPosition.y + v127) = (double)v105;
+          *(float *)((char *)&ptr_801A08->vWorldPosition.y + v127) = (double)v105;//y
           v105 = pOutdoor->GetHeightOnTerrain(v112, *(int *)((char *)terrain_76D9C8 + v70));
-          *(float *)((char *)&ptr_801A08->vWorldPosition.z + v127) = (double)v105;
-          *(float *)((char *)&ptr_801A04->vWorldPosition.x + v127) = *(float *)&v106;
+          *(float *)((char *)&ptr_801A08->vWorldPosition.z + v127) = (double)v105;//z
+          *(float *)((char *)&ptr_801A04->vWorldPosition.x + v127) = *(float *)&v106;//x
           v105 = (63 - *(int *)((char *)terrain_76D9C8 + v70)) << 9;
-          *(float *)((char *)&ptr_801A04->vWorldPosition.y + v127) = (double)v105;
+          *(float *)((char *)&ptr_801A04->vWorldPosition.y + v127) = (double)v105;//y
           v105 = pOutdoor->GetHeightOnTerrain(v112, *(int *)((char *)terrain_76D9C8 + v70) + 1);
-          *(float *)((char *)&ptr_801A04->vWorldPosition.z + v127) = (double)v105;
+          *(float *)((char *)&ptr_801A04->vWorldPosition.z + v127) = (double)v105;//z
           if ( !byte_4D864C || !(pGame->uFlags & 0x80) )
           {
             a1->ViewTransform((RenderVertexSoft *)(char *)ptr_801A08 + v127, 1);
@@ -2878,11 +2878,7 @@
         {
           billboard.sZValue = v7;
           billboard.uFlags = v2;
-          pRenderer->TransformBillboard(
-            &billboard,
-            &pSprites_LOD->pHardwareSprites[v6],
-            v8,
-            (RenderBillboard *)(v1 - 40));
+          pRenderer->TransformBillboard(&billboard, &pSprites_LOD->pHardwareSprites[v6], v8, (RenderBillboard *)(v1 - 40));
         }
         else
         {
@@ -8228,11 +8224,11 @@
   if ( a1->uNumD3DSceneBegins )
   {
     v5 = a2;
-    v6 = (double)a2->sZValue; //Ritor1:begin pBillboardRenderListD3D
+    v6 = (double)a2->sZValue;
     v31 = v6;
     v7 = v6;
     v8 = Billboard_ProbablyAddToListAndSortByZOrder(v7);
-    if ( v5->uTintColor )
+    if ( BYTE3(v5->uTintColor) )
       pBillboardRenderListD3D[v8].uOpacity = RenderBillboardD3D::Opaque_3;
     else
       pBillboardRenderListD3D[v8].uOpacity = RenderBillboardD3D::Transparent;
@@ -11083,10 +11079,10 @@
 //----- (004A1C1E) --------------------------------------------------------
 void DoRenderBillboards_D3D()
 {
-  ErrD3D(pRenderer->pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, 3));
-  ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 1));
+  ErrD3D(pRenderer->pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, 3u));
+  ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 1u));
   ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 0));
-  ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, 1));
+  ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, 1u));
 
   for (uint i = pRenderer->uNumBillboardsToDraw - 1; i != (uint)-1; --i)
   {
--- a/mm7_2.cpp	Tue Jan 22 01:11:32 2013 +0600
+++ b/mm7_2.cpp	Tue Jan 22 18:41:17 2013 +0600
@@ -12980,7 +12980,7 @@
   bDialogueUI_InitializeActor_NPC_ID = 0;
   OnMapLoad();
   pGameLoadingUI_ProgressBar->Progress();
-  memset(&pRenderer->pBillboardRenderListD3D, 0, sizeof(pRenderer->pBillboardRenderListD3D));//Ritor1: fix
+memset(&pRenderer->pBillboardRenderListD3D, 0, sizeof(pRenderer->pBillboardRenderListD3D));
   pGameLoadingUI_ProgressBar->Release();
   _flushall();
 }
--- a/mm7_5.cpp	Tue Jan 22 01:11:32 2013 +0600
+++ b/mm7_5.cpp	Tue Jan 22 18:41:17 2013 +0600
@@ -16446,8 +16446,8 @@
     pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1;
     pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1;
     pColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B);
-    sprintf(pTmpBuf, format_4E2D80, pColor, pStr);
-    pWindow.DrawText(pFontCreate, 0, 0, 0, pTmpBuf, 3, 0, 0); //DrawTitleText
+    sprintf(pTmpBuf, format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n"
+    pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3);
     pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0);
   }
 LABEL_132: