changeset 190:d7bd52a35e52

24.12.12
author Ritor1
date Mon, 24 Dec 2012 07:48:44 +0600
parents cdb5d83a9fd8
children d625cbdf34f0 222a09fccca1
files Player.cpp Render.cpp mm7_2.cpp
diffstat 3 files changed, 41 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Fri Dec 21 00:22:57 2012 +0600
+++ b/Player.cpp	Mon Dec 24 07:48:44 2012 +0600
@@ -589,7 +589,7 @@
   int v20[5]; // [sp+Ch] [bp-1Ch]@7
   Player *pPlayer2; // [sp+20h] [bp-8h]@1
   int pPlayerNum; // [sp+24h] [bp-4h]@1
-  int v23; // [sp+30h] [bp+8h]@4
+  int pSoundId; // [sp+30h] [bp+8h]@4
 
   pPlayer = this;
   pPlayer2 = this;
@@ -603,7 +603,7 @@
   while ( pPlayerNum <= 4 );
   v4 = a2;//102
   v5 = 0;
-  v23 = 0;
+  pSoundId = 0;
   v6 = &byte_4ED3D8[8 * v4];//byte_4ED280
   if ( uVoicesVolumeMultiplier )
   {
@@ -623,12 +623,12 @@
       v11 = v20[v9 % v5];
       if ( LOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[pVoiceID]) )
       {
-        v23 = rand() % SLOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[pVoiceID])
+        pSoundId = rand() % SLOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[pVoiceID])
             + 2 * (v11 + 50 * pPlayer2->uVoiceID)
             + 4998;
         v12 = 8 * pPlayerNum + 312;
         LOBYTE(v12) = v12 | 4;
-        pAudioPlayer->PlaySound((SoundID)v23, v12, 0, -1, 0, 0, (signed __int64)(pSoundVolumeLevels[(char)uVoicesVolumeMultiplier] * 128.0), 0);
+        pAudioPlayer->PlaySound((SoundID)pSoundId, v12, 0, -1, 0, 0, (signed __int64)(pSoundVolumeLevels[(char)uVoicesVolumeMultiplier] * 128.0), 0);
       }
     }
   }
@@ -646,7 +646,7 @@
     v15 = rand();
     pPlayerNum = 0;
     pExpression = v20[v15 % v13];
-    if ( pExpression == 21 && v23 )
+    if ( pExpression == 21 && pSoundId )
     {
       v17 = 0;
       if ( (signed int)pSoundList->uNumSounds <= 0 )
@@ -657,7 +657,7 @@
       else
       {
         pSoundID = (char *)&pSoundList->pSounds->uSoundID;
-        while ( *(int *)pSoundID != v23 )
+        while ( *(int *)pSoundID != pSoundId )
         {
           ++v17;
           pSoundID += 120;
--- a/Render.cpp	Fri Dec 21 00:22:57 2012 +0600
+++ b/Render.cpp	Mon Dec 24 07:48:44 2012 +0600
@@ -11090,11 +11090,8 @@
       SetBillboardBlendOptions(p->uOpacity);
     
     ErrD3D(pRenderer->pRenderD3D->pDevice->SetTexture(0, p->pTexture));
-    ErrD3D(pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN,
-        D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1,
-        p->pQuards,
-        p->uNumVertices,
-        D3DDP_DONOTLIGHT | D3DDP_DONOTUPDATEEXTENTS));
+    ErrD3D(pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1,
+        p->pQuards, p->uNumVertices, D3DDP_DONOTLIGHT | D3DDP_DONOTUPDATEEXTENTS));
   }
 
   if (pRenderer->bFogEnabled)
--- a/mm7_2.cpp	Fri Dec 21 00:22:57 2012 +0600
+++ b/mm7_2.cpp	Mon Dec 24 07:48:44 2012 +0600
@@ -11419,9 +11419,9 @@
   char v12; // di@10
   unsigned __int64 v13; // qtt@10
   unsigned int v14; // ecx@10
-  __int64 v15; // qax@10
+  __int64 pOurHour; // qax@10
   int v16; // edi@10
-  signed int v17; // ebx@22
+  signed int pHour; // ebx@22
   //const char *v18; // ST14_4@32
   int v19; // eax@32
   const char *v20; // ST18_4@32
@@ -11437,12 +11437,13 @@
   int v29; // [sp+18h] [bp-6Ch]@8
   unsigned int v30; // [sp+1Ch] [bp-68h]@8
   unsigned int v31; // [sp+20h] [bp-64h]@8*/
-  __int64 v32; // [sp+60h] [bp-24h]@10
-  int v33; // [sp+68h] [bp-1Ch]@10
+  int pMinutes; // [sp+60h] [bp-24h]@10
+  int pMonthNum; // [sp+68h] [bp-1Ch]@10
   unsigned int pSaveFiles; // [sp+70h] [bp-14h]@10
-  __int64 v35; // [sp+74h] [bp-10h]@10
-  int pFilesID; // [sp+7Ch] [bp-8h]@10
+  __int64 pAMPM2; // [sp+74h] [bp-10h]@10
+  int pYear; // [sp+7Ch] [bp-8h]@10
   int a4; // [sp+80h] [bp-4h]@1
+  int pFilesID;
 
   v1 = 255;
   a4 = a1;
@@ -11488,50 +11489,50 @@
     pMapID = pMapStats->GetMapInfo(pSavegameHeader[v6].pLocationName);
     pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[pMapID].pName, 3);
     v8 = (signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60;
-    HIDWORD(v32) = (unsigned __int64)((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) >> 32;
+    pMinutes = (int)((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) >> 32;
     v9 = v8;
     v8 /= 60i64;
-    v35 = v8;
+    pAMPM2 = v8;
     v10 = (unsigned int)v8 / 24;
     pSaveFiles = v10;
     v11 = (unsigned int)(v10 / 7);
     v12 = v11;
     LODWORD(v13) = (unsigned int)v11 >> 2;
     HIDWORD(v13) = HIDWORD(v11);
-    v33 = v13 % 12;
-    pFilesID = v13 / 12;
-    v32 = (signed __int64)__PAIR__(HIDWORD(v32), v9) % 60;
-    v15 = v35 % 24;
-    v14 = (unsigned __int64)(v35 % 24) >> 32;
-    LODWORD(v35) = v35 % 24;
-    HIDWORD(v15) = pSaveFiles % 28;
-    pFilesID += 1168;
+    pMonthNum = v13 % 12;
+    pYear = v13 / 12;
+    pMinutes = (int)__PAIR__(pMinutes, v9) % 60;
+    pOurHour = pAMPM2 % 24;
+    v14 = (unsigned __int64)(pAMPM2 % 24) >> 32;
+    LODWORD(pAMPM2) = pAMPM2 % 24;
+    HIDWORD(pOurHour) = pSaveFiles % 28;
+    pYear += 1168;//год начала
     v16 = v12 & 3;
     pWindow.uFrameY = pGUIWindow_CurrentMenu->uFrameY + 261;
-    HIDWORD(v35) = (v14 & 0x80000000u) == 0 && ((signed int)v14 > 0 || (unsigned int)v15 >= 12)
-                && (signed int)v14 <= 0 && ((v14 & 0x80000000u) != 0 || (unsigned int)v15 < 24);
-    if ( (v14 & 0x80000000u) != 0 || (signed int)v14 <= 0 && (unsigned int)v15 <= 12 )
-    {
-      if ( !(v14 | (unsigned int)v15) )
+    HIDWORD(pAMPM2) = v14 == 0 && ((signed int)v14 > 0 || (unsigned int)pOurHour >= 12)
+                && (signed int)v14 <= 0 && (v14 != 0 || (unsigned int)pOurHour < 24);
+    if ( v14  != 0 || (signed int)v14 <= 0 && (unsigned int)pOurHour <= 12 )
+    {
+      if ( !(v14 | (unsigned int)pOurHour) )
       {
         pSaveFiles = 0;
-        v17 = 12;
+        pHour = 12;
         goto LABEL_23;
       }
     }
     else
     {
-      v14 = (__PAIR__(v14, (unsigned int)v15) - 12) >> 32;
-      LODWORD(v15) = v15 - 12;
-    }
-    v17 = v15;
+      v14 = (__PAIR__(v14, (unsigned int)pOurHour) - 12) >> 32;
+      LODWORD(pOurHour) = pOurHour - 12;
+    }
+    pHour = pOurHour;
     pSaveFiles = v14;
 LABEL_23:
-    auto _d = aDayNames[HIDWORD(v15) % 7];
-    auto _a = aAMPMNames[HIDWORD(v35)];
-    auto _m = aMonthNames[v33];
-    sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, pFilesID);
-    sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)v32, _a, 7 * v16 + HIDWORD(v15) % 7 + 1, _m, pFilesID);
+    auto day = aDayNames[HIDWORD(pOurHour) % 7];
+    auto ampm = aAMPMNames[HIDWORD(pAMPM2)];
+    auto month = aMonthNames[pMonthNum];
+    //sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, pFilesID);
+    sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", day, pHour, pMinutes, ampm, 7 * v16 + HIDWORD(pOurHour) % 7 + 1, month, pYear);
     pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pTmpBuf, 3u);
     v1 = 255;
   }
@@ -11578,7 +11579,7 @@
       if ( pFilesID >= (signed int)pSaveFiles )
         break;
       short clr;
-      HIDWORD(v35) = clr = (pFilesID == uLoadGameUI_SelectedSlot ? GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, v1, 0x64) : 0);
+      HIDWORD(pAMPM2) = clr = (pFilesID == uLoadGameUI_SelectedSlot ? GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, v1, 0x64) : 0);
       if ( pGUIWindow_CurrentMenu->field_40 != 1 || pFilesID != uLoadGameUI_SelectedSlot )
       {
         pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1B, a4, clr, pSlotName, 185, 0);