changeset 1286:d8033eb56d7e

Слияние
author Ritor1
date Sat, 15 Jun 2013 23:58:32 +0600
parents 62f4cdaa726b (diff) 89210052dbb4 (current diff)
children 6bbd50bda571 dcc52e17b517
files mm7_2.cpp
diffstat 9 files changed, 57 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Sat Jun 15 21:23:33 2013 +0400
+++ b/Indoor.cpp	Sat Jun 15 23:58:32 2013 +0600
@@ -348,8 +348,8 @@
 		  if ( pNode->field_C._viewport_space_y <= pNode->field_C._viewport_space_w )
 		  {
 			//v5 = (char *)&pBspRenderer->nodes[0].field_C.array_3D8[pNode->field_C._viewport_space_y + v7];
-			v5 = &pNode->field_C.array_3D8[pNode->field_C._viewport_space_y];
-			v8 = &pNode->field_C.array_18[pNode->field_C._viewport_space_y];
+			v5 = &pNode->field_C.viewport_right_side[pNode->field_C._viewport_space_y];
+			v8 = &pNode->field_C.viewport_left_side[pNode->field_C._viewport_space_y];
 			do
 			{
 				v1[v4 + *v8] = 255;
@@ -875,29 +875,29 @@
                   v120 = 2 * stru_F8A590._viewport_space_y;
                   while ( 1 )
                   {
-                    a1 = *(__int16 *)((char *)stru_F8A590.array_18 + v24);
+                    a1 = *(__int16 *)((char *)stru_F8A590.viewport_left_side + v24);
                     sub_4AE313(a1, v21, &stru_F81018.field_0);
                     if ( LOBYTE(viewparams->field_20) )
                     {
                       v27 = v111 * (v24 - pBLVRenderParams->uViewportY);
                       pZPixel = &pBLVRenderParams->pTargetZBuffer[2
-                                                               * (*(__int16 *)((char *)stru_F8A590.array_18 + v24)
+                                                               * (*(__int16 *)((char *)stru_F8A590.viewport_left_side + v24)
                                                                 + 320 * (v24 - pBLVRenderParams->uViewportY))
                                                                - pBLVRenderParams->uViewportX];
                       pColorPixel = &pBLVRenderParams->pRenderTarget[v27
-                                                                  + 2 * *(__int16 *)((char *)stru_F8A590.array_18 + v24)
+                                                                  + 2 * *(__int16 *)((char *)stru_F8A590.viewport_left_side + v24)
                                                                   - pBLVRenderParams->uViewportX];
                       v26 = &pBLVRenderParams->pRenderTarget[v27
-                                                          + 2 * *(__int16 *)((char *)stru_F8A590.array_3D8 + v24)
+                                                          + 2 * *(__int16 *)((char *)stru_F8A590.viewport_right_side + v24)
                                                           - pBLVRenderParams->uViewportX];
                       v23 = v119;
                     }
                     else
                     {
-                      v25 = *(__int16 *)((char *)stru_F8A590.array_18 + v24);
+                      v25 = *(__int16 *)((char *)stru_F8A590.viewport_left_side + v24);
                       pZPixel = &pBLVRenderParams->pTargetZBuffer[v25 + v23];
                       pColorPixel = &pBLVRenderParams->pRenderTarget[v25 + v110];
-                      v26 = &pBLVRenderParams->pRenderTarget[v110 + *(__int16 *)((char *)stru_F8A590.array_3D8 + v24)];
+                      v26 = &pBLVRenderParams->pRenderTarget[v110 + *(__int16 *)((char *)stru_F8A590.viewport_right_side + v24)];
                     }
                     v131 = (unsigned int)v26;
                     HIWORD(v28) = HIWORD(stru_F81018.field_0.field_0);
@@ -1610,8 +1610,8 @@
               v6 = 640 * stru_F8A590._viewport_space_y;
               do
               {
-                v5[v6 + stru_F8A590.array_18[v4]] = -1;
-                v7 = v6 + stru_F8A590.array_3D8[v4];
+                v5[v6 + stru_F8A590.viewport_left_side[v4]] = -1;
+                v7 = v6 + stru_F8A590.viewport_right_side[v4];
                 v6 += 640;
                 v5[v7] = -1;
                 ++v4;
--- a/Indoor_stuff.h	Sat Jun 15 21:23:33 2013 +0400
+++ b/Indoor_stuff.h	Sat Jun 15 23:58:32 2013 +0600
@@ -16,8 +16,8 @@
   int field_C;
   int field_10;
   int field_14;
-  __int16 array_18[480];
-  __int16 array_3D8[480];
+  __int16 viewport_left_side[480];
+  __int16 viewport_right_side[480];
 };
 #pragma pack(pop)
 extern BspRenderer_stru2 stru_F8A590;
--- a/UIHouses.cpp	Sat Jun 15 21:23:33 2013 +0400
+++ b/UIHouses.cpp	Sat Jun 15 23:58:32 2013 +0600
@@ -561,10 +561,10 @@
 void PlayHouseSound(unsigned int uHouseID, HouseSoundID sound)
 {
     //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) )
-    if ( pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uRoomSoundId )
+    if ( pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId )
         pAudioPlayer->PlaySound(
         //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)),
-        (SoundID)(sound + 100 * (pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uRoomSoundId + 300)),
+        (SoundID)(sound + 100 * (pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId + 300)),
         806, 0, -1, 0, 0, 0, 0);
 }
 
--- a/UITransition.cpp	Sat Jun 15 21:23:33 2013 +0400
+++ b/UITransition.cpp	Sat Jun 15 23:58:32 2013 +0600
@@ -102,7 +102,7 @@
 LABEL_20:
   pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Transition, 0, sHouseName.data());
   //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_C) )
-  if ( pAnimatedRooms[p2DEvents[anim_id - 1].uAnimationID].uRoomSoundId )
+  if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId )
     PlayHouseSound(anim_id, HouseSound_Greeting);
   if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
     pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
--- a/mm7_1.cpp	Sat Jun 15 21:23:33 2013 +0400
+++ b/mm7_1.cpp	Sat Jun 15 23:58:32 2013 +0600
@@ -2415,7 +2415,7 @@
   {
     v62 = stru_50B700._screen_space_x[v55] << 16;
     v54 = ((stru_50B700._screen_space_x[v13] - stru_50B700._screen_space_x[v55]) << 16) / (stru_50B700._screen_space_y[v13] - stru_50B700._screen_space_y[v55]);
-    a2->array_18[min_y] = LOWORD(stru_50B700._screen_space_x[v55]);
+    a2->viewport_left_side[min_y] = LOWORD(stru_50B700._screen_space_x[v55]);
   }
   v15 = v65;
   v61 = v65;
@@ -2452,7 +2452,7 @@
   {
     v61 = stru_50B700._screen_space_x[v20] << 16;
     v53 = ((stru_50B700._screen_space_x[v19] - stru_50B700._screen_space_x[v20]) << 16) / stru_50B700._screen_space_y[v19] - stru_50B700._screen_space_y[v20];
-    a2->array_3D8[max_y] = LOWORD(stru_50B700._screen_space_x[v20]);
+    a2->viewport_right_side[max_y] = LOWORD(stru_50B700._screen_space_x[v20]);
   }
   v22 = min_y;
   if ( min_y <= max_y )
@@ -2502,18 +2502,18 @@
 	  //v34 = (char *)a2->array_18 - (char *)a2->array_3D8;
 	  //v35 = *(__int16 *)((char *)&a2->array_3D8[v70] + v34);
       //v35 = HIWORD(v62);
-      a2->array_18[v70] = HIWORD(v62);
-      a2->array_3D8[v70] = HIWORD(v61);
+      a2->viewport_left_side[v70] = HIWORD(v62);
+      a2->viewport_right_side[v70] = HIWORD(v61);
       //v34 = &a2->array_3D8[v70];
       //v35 = a2->array_3D8[v70];
-      if ( a2->array_18[v70] > a2->array_3D8[v70] )
+      if ( a2->viewport_left_side[v70] > a2->viewport_right_side[v70] )
       {
-        v36 = a2->array_18[v70] ^ a2->array_3D8[v70];
-        v37 = a2->array_3D8[v70];
-        a2->array_18[v70] = v36;
+        v36 = a2->viewport_left_side[v70] ^ a2->viewport_right_side[v70];
+        v37 = a2->viewport_right_side[v70];
+        a2->viewport_left_side[v70] = v36;
         v38 = v37 ^ v36;
-        a2->array_18[v70] ^= v38;
-        a2->array_3D8[v70] = v38;
+        a2->viewport_left_side[v70] ^= v38;
+        a2->viewport_right_side[v70] = v38;
       }
       //++v56;
       v62 += v54;
@@ -2537,7 +2537,7 @@
     //v57 = *(__int16 *)((char *)v42 + a3a);
     for ( v71 = min_y; v71 <= max_y; ++v71 )
     {
-      if ( a2->array_18[v71] >= a3->array_18[v71] && a2->array_18[v71] <= a3->array_3D8[v71] )
+      if ( a2->viewport_left_side[v71] >= a3->viewport_left_side[v71] && a2->viewport_left_side[v71] <= a3->viewport_right_side[v71] )
         break;
       //++v57;
       ++min_y;
@@ -2551,7 +2551,7 @@
   //v58 = *(__int16 *)((char *)v43 + a3a);
   for ( v72 = max_y; v72 >= min_y; --v72 )
   {
-    if ( a2->array_3D8[v72] >= a3->array_18[v72] && a2->array_18[v72] <= a3->array_3D8[v72] )
+    if ( a2->viewport_right_side[v72] >= a3->viewport_left_side[v72] && a2->viewport_left_side[v72] <= a3->viewport_right_side[v72] )
       break;
     //--v58;
     --max_y;
@@ -2567,20 +2567,20 @@
   for ( v46 = max_y - min_y + 1; v46; --v46 )
   {
     //v47 = *(__int16 *)((char *)v45 + a3b);
-    if ( a2->array_18[v59] < a3->array_18[v59] )
-      a2->array_18[v59] = a3->array_18[v59];
-    if ( a2->array_3D8[v59] > a3->array_3D8[v59] )
-      a2->array_3D8[v59] = a3->array_3D8[v59];
+    if ( a2->viewport_left_side[v59] < a3->viewport_left_side[v59] )
+      a2->viewport_left_side[v59] = a3->viewport_left_side[v59];
+    if ( a2->viewport_right_side[v59] > a3->viewport_right_side[v59] )
+      a2->viewport_right_side[v59] = a3->viewport_right_side[v59];
     ++v59;
     //++v45;
   }
   a2->_viewport_space_y = min_y;
   a2->_viewport_space_w = max_y;
-  a2->field_8 = a2->array_18[min_y];
-  //v48 = a2->array_3D8[v7];
+  a2->field_8 = a2->viewport_left_side[min_y];
+  //v48 = a2->viewport_right_side[v7];
   a2->field_10 = min_y;
   a2->field_14 = min_y;
-  a2->field_C = a2->array_3D8[min_y];
+  a2->field_C = a2->viewport_right_side[min_y];
   v49 = min_y + 1;
   if ( v49 <= max_y )
   {
@@ -2588,14 +2588,14 @@
     for ( v49; v49 <= max_y; ++v49 )
     {
       //v51 = a2->array_18[v49];
-      if ( a2->array_18[v49] < a2->field_8 )
+      if ( a2->viewport_left_side[v49] < a2->field_8 )
       {
-        a2->field_8 = a2->array_18[v49];
+        a2->field_8 = a2->viewport_left_side[v49];
         a2->field_10 = v49;
       }
-      if ( a2->array_3D8[v49] > a2->field_C )
+      if ( a2->viewport_right_side[v49] > a2->field_C )
       {
-        a2->field_C = a2->array_3D8[v49];
+        a2->field_C = a2->viewport_right_side[v49];
         a2->field_14 = v49;
       }
       //++v50;
--- a/mm7_2.cpp	Sat Jun 15 21:23:33 2013 +0400
+++ b/mm7_2.cpp	Sat Jun 15 23:58:32 2013 +0600
@@ -9920,7 +9920,7 @@
             v127 = v9;
             v126 = v124;
 LABEL_268:
-            v116 = word_4EE088_sound_ids[v2->spell_id];
+            v116 = word_4EE088_sound_ids[v2->spell_id - 1];
 LABEL_269:
             v125 = v116 + 1;
             goto LABEL_29;
--- a/mm7_3.cpp	Sat Jun 15 21:23:33 2013 +0400
+++ b/mm7_3.cpp	Sat Jun 15 23:58:32 2013 +0600
@@ -1627,9 +1627,9 @@
     auto v67 = GetTickCount() / 500;
     if (dword_720CDC != v67 )
     {
-      dword_4F8580[3 * dword_4F8580[0] + 1] = pParty->vPosition.x;
-      dword_4F8580[3 * dword_4F8580[0] + 2] = pParty->vPosition.y;
-      dword_4F8580[3 * dword_4F8580[0]++ + 3] = pParty->vPosition.z;
+      dword_4F8580[3 * dword_4F8580[1]] = pParty->vPosition.x;
+      dword_4F8580[3 * dword_4F8580[2]] = pParty->vPosition.y;
+      dword_4F8580[3 * dword_4F8580[3]] = pParty->vPosition.z;
       if ( dword_4F8580[0] > 60 )
         dword_4F8580[0] = 1;
     }
@@ -11041,13 +11041,13 @@
   {
     if ( i < y || i > w )
     {
-      array_18[i] = 640;
-      array_3D8[i] = -1;
+      viewport_left_side[i] = 640;
+      viewport_right_side[i] = -1;
     }
     else
     {
-      array_18[i] = x;
-      array_3D8[i] = z;
+      viewport_left_side[i] = x;
+      viewport_right_side[i] = z;
     } 
   }
 }
--- a/mm7_4.cpp	Sat Jun 15 21:23:33 2013 +0400
+++ b/mm7_4.cpp	Sat Jun 15 23:58:32 2013 +0600
@@ -4512,29 +4512,29 @@
                 v101 = 2 * stru_F8A590._viewport_space_y;
                 while ( 1 )
                 {
-                  a1 = *(__int16 *)((char *)stru_F8A590.array_18 + v12);
+                  a1 = *(__int16 *)((char *)stru_F8A590.viewport_left_side + v12);
                   sub_4AE313(a1, result, &stru_F81018.field_0);
                   if ( LOBYTE(viewparams->field_20) )
                   {
                     v15 = v95 * (v12 - pBLVRenderParams->uViewportY);
                     v119 = &pBLVRenderParams->pTargetZBuffer[2
-                                                          * (*(__int16 *)((char *)stru_F8A590.array_18 + v12)
+                                                          * (*(__int16 *)((char *)stru_F8A590.viewport_left_side + v12)
                                                            + 320 * (v12 - pBLVRenderParams->uViewportY))
                                                           - pBLVRenderParams->uViewportX];
                     v16 = &pBLVRenderParams->pRenderTarget[v15
-                                                        + 2 * *(__int16 *)((char *)stru_F8A590.array_18 + v12)
+                                                        + 2 * *(__int16 *)((char *)stru_F8A590.viewport_left_side + v12)
                                                         - pBLVRenderParams->uViewportX];
                     v14 = &pBLVRenderParams->pRenderTarget[v15
-                                                        + 2 * *(__int16 *)((char *)stru_F8A590.array_3D8 + v12)
+                                                        + 2 * *(__int16 *)((char *)stru_F8A590.viewport_right_side + v12)
                                                         - pBLVRenderParams->uViewportX];
                     v123 = (unsigned int)v16;
                   }
                   else
                   {
-                    v13 = *(__int16 *)((char *)stru_F8A590.array_18 + v12);
+                    v13 = *(__int16 *)((char *)stru_F8A590.viewport_left_side + v12);
                     v119 = &pBLVRenderParams->pTargetZBuffer[v13 + v99];
                     v123 = (unsigned int)&pBLVRenderParams->pRenderTarget[v13 + v11];
-                    v14 = &pBLVRenderParams->pRenderTarget[v11 + *(__int16 *)((char *)stru_F8A590.array_3D8 + v12)];
+                    v14 = &pBLVRenderParams->pRenderTarget[v11 + *(__int16 *)((char *)stru_F8A590.viewport_right_side + v12)];
                   }
                   v117 = (unsigned int)v14;
                   HIWORD(v17) = HIWORD(stru_F81018.field_0.field_0);
@@ -5000,7 +5000,7 @@
             v56 = 640 * stru_F8A590._viewport_space_y;
             for ( i = &stru_F83B80[stru_F8A590._viewport_space_y]; ; v14 = i )
             {
-              sub_4AE1E7(v12, *(__int16 *)((char *)stru_F8A590.array_18 + v13), v12);
+              sub_4AE1E7(v12, *(__int16 *)((char *)stru_F8A590.viewport_left_side + v13), v12);
               v14->field_0 += (GetTickCount() << 11) - (pBLVRenderParams->vPartyPos.x << 16);
               v15 = GetTickCount();
               v16 = v14->field_0;
@@ -5011,10 +5011,10 @@
               v52 = (unsigned __int64)(v17 * (signed __int64)-pBLVRenderParams->sSineY) >> 16;
               v53 = (unsigned __int64)(v17 * (signed __int64)pBLVRenderParams->sCosineY) >> 16;
               v18 = v14->field_28;
-              v19 = *(__int16 *)((char *)stru_F8A590.array_18 + v13);
+              v19 = *(__int16 *)((char *)stru_F8A590.viewport_left_side + v13);
               LOWORD(v18) = 0;
               v46 = stru_F8AD28.field_0 | v18;
-              v61 = *(__int16 *)((char *)stru_F8A590.array_3D8 + v13) - v19;
+              v61 = *(__int16 *)((char *)stru_F8A590.viewport_right_side + v13) - v19;
               if ( LOBYTE(viewparams->field_20) )
               {
                 v63 = &pBLVRenderParams->pTargetZBuffer[2 * (v19 + 320 * (v13 - pBLVRenderParams->uViewportY))
--- a/mm7_6.cpp	Sat Jun 15 21:23:33 2013 +0400
+++ b/mm7_6.cpp	Sat Jun 15 23:58:32 2013 +0600
@@ -2781,8 +2781,8 @@
     if (pCastSpell->forced_spell_skill_level)
       uRequiredMana = 0;
     else 
-      uRequiredMana = pSpellDatas[pCastSpell->spellnum].mana_per_skill[v731 - 1];
-    sRecoveryTime = pSpellDatas[pCastSpell->spellnum].recovery_per_skill[v731 - 1];
+      uRequiredMana = pSpellDatas[pCastSpell->spellnum - 1].mana_per_skill[v731 - 1];
+    sRecoveryTime = pSpellDatas[pCastSpell->spellnum - 1].recovery_per_skill[v731 - 1];
 
     if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 ||
         LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0)