changeset 2228:b65e71eadd1b

add this->field_0 = 0; in OtherOverlay::Reset()
author Ritor1
date Fri, 21 Feb 2014 18:02:20 +0600
parents e87b5709a502
children afca92154795
files Actor.cpp AudioPlayer.cpp Overlays.cpp
diffstat 3 files changed, 36 insertions(+), 72 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Thu Feb 20 22:26:13 2014 +0600
+++ b/Actor.cpp	Fri Feb 21 18:02:20 2014 +0600
@@ -1387,27 +1387,19 @@
   {
     case 1:
       if ( a3 )
-      {
         pOtherOverlayList->_4418B6(904, v4, 0, (int)(sub_43AE12(a3) * 65536.0), 0);
-      }
       return;
     case 2:
       if ( a3 )
-      {
         pOtherOverlayList->_4418B6(905, v4, 0, (int)(sub_43AE12(a3) * 65536.0), 0);
-      }
       return;
     case 3:
       if ( a3 )
-      {
         pOtherOverlayList->_4418B6(906, v4, 0, (int)(sub_43AE12(a3) * 65536.0), 0);
-      }
       return;
     case 4:
       if ( a3 )
-      {
         pOtherOverlayList->_4418B6(907, v4, 0, (int)(sub_43AE12(a3) * 65536.0), 0);
-      }
       return;
     case 5:
       pOtherOverlayList->_4418B6(901, v4, 0, PID(OBJECT_Actor,uActorID), 0);
--- a/AudioPlayer.cpp	Thu Feb 20 22:26:13 2014 +0600
+++ b/AudioPlayer.cpp	Fri Feb 21 18:02:20 2014 +0600
@@ -1393,12 +1393,7 @@
 //----- (004AAFCF) --------------------------------------------------------
 void AudioPlayer::UpdateSounds()
 {
-  //AudioPlayer *pAudioPlayer; // edi@1
   int v2; // ebx@1
-  //unsigned __int8 v3; // zf@1
-  //int *v4; // eax@2
-  //unsigned __int8 v5; // sf@4
-  //AudioPlayer_3DSample *v6; // esi@5
   int v7; // ebx@6
   int v8; // ebx@9
   int v9; // ebx@10
@@ -1420,31 +1415,8 @@
   int v25; // eax@32
   float v26; // ST10_4@34
   float v27; // ST08_4@34
-  //MixerChannel *v28; // esi@38
-  //unsigned __int8 v29; // of@43
-  //MixerChannel *v30; // esi@44
-  //int v31; // eax@45
-  //SpriteObject *v32; // eax@49
-  //Actor *v33; // edi@50
-  //int v34; // eax@50
-  //unsigned int v35; // edx@51
-  //unsigned int v36; // ecx@51
-  //SpriteObject *v37; // edi@53
   int v38; // eax@53
-  //BLVDoor *v39; // edi@56
-  //int v40; // eax@57
-  //int v41; // eax@60
-  //MixerChannel *v42; // edi@65
-  //int v43; // ebx@68
-  //LevelDecoration *v44; // esi@68
-  //int v45; // ST1C_4@68
-  //int v46; // edi@68
-  //int v47; // eax@68
-  //DecorationDesc *v48; // edi@69
-  //__int16 v49; // ax@69
-  //__int16 v50; // ax@70
   __int16 v51; // ax@71
-  //__int16 v52; // ax@73
   signed int v53; // eax@88
   RenderVertexSoft a1; // [sp+24h] [bp-48h]@1
   float v55; // [sp+54h] [bp-18h]@22
@@ -1452,7 +1424,6 @@
   int uNumRepeats; // [sp+5Ch] [bp-10h]@15
   float v58; // [sp+60h] [bp-Ch]@23
   int v59; // [sp+64h] [bp-8h]@4
-  //AudioPlayer *thisa; // [sp+68h] [bp-4h]@1
 
   //pAudioPlayer = this;
   v2 = 0;
@@ -1960,7 +1931,7 @@
     } */
   }
 
-  if (pCurrentScreen != SCREEN_GAME) //отключение звука декораций при переключенииокна игры
+  if (pCurrentScreen != SCREEN_GAME) //отключение звука декораций при переключении окна игры
   {
     if (AIL_sample_status(pMixerChannels[4].hSample) == AIL::Sample::Playing)
       AIL_end_sample(pMixerChannels[4].hSample);
@@ -1973,7 +1944,7 @@
       //v59 = 0;
   for (uint i = 0; i < _6807E0_num_decorations_with_sounds_6807B8; ++i)
   {
-        LODWORD(v56) = 1;
+    LODWORD(v56) = 1;
         //v43 = _6807B8_level_decorations_ids[v59];
         //v44 = &pLevelDecorations[_6807B8_level_decorations_ids[v59]];
         //v45 = abs(v44->vPosition.z - pParty->vPosition.z);
@@ -1982,7 +1953,7 @@
     LevelDecoration* decor = &pLevelDecorations[_6807B8_level_decorations_ids[i]];
     if (int_get_vector_length(abs(decor->vPosition.x - pParty->vPosition.x),
                               abs(decor->vPosition.y - pParty->vPosition.y),
-                              abs(decor->vPosition.z - pParty->vPosition.z)) > 8192)
+                              abs(decor->vPosition.z - pParty->vPosition.z)) > 0x2000)
       continue;
 
     DecorationDesc* decor_desc = &pDecorationList->pDecorations[decor->uDecorationDescID];
@@ -2015,7 +1986,7 @@
           {
             v53 = 8 * _6807B8_level_decorations_ids[i];
             LOBYTE(v53) = v53 | OBJECT_Decoration;
-            PlaySound((SoundID)decor_desc->uSoundID, v53, uNumRepeats, -1, 0, 0, 0, 0);//звуки корабля, плескания воды
+            PlaySound((SoundID)decor_desc->uSoundID, v53, uNumRepeats, -1, 0, 0, 0, 0);//sound of Boat and water(звуки корабля, плескания воды)
           }
           continue;
         }
@@ -2099,7 +2070,7 @@
   dir_y = abs(y - pParty->vPosition.y);
   dir_x = abs(x - pParty->vPosition.x);
   length = int_get_vector_length(dir_x, dir_y, dir_z);
-  if ( length <= 8192 )
+  if ( length <= 0x2000 )
     return 114 - (unsigned __int64)(signed __int64)((double)length * 0.0001220703125 * 100.0);
   else
     return 0;
@@ -2439,39 +2410,39 @@
 
   if (!pSoundList->pSL_Sounds)
     return;
- 
-    //v4 = &pSoundList->pSounds[pChannel->uSourceTrackIdx];
-    if ( pSoundList->pSL_Sounds[pChannel->uSourceTrackIdx].eType == SOUND_DESC_SWAP)
+
+  //v4 = &pSoundList->pSounds[pChannel->uSourceTrackIdx];
+  if ( pSoundList->pSL_Sounds[pChannel->uSourceTrackIdx].eType == SOUND_DESC_SWAP)
+  {
+    if ( pSoundList->pSL_Sounds[pChannel->uSourceTrackIdx].pSoundData[0] && 
+       !(pSoundList->pSL_Sounds[pChannel->uSourceTrackIdx].uFlags & SOUND_DESC_SYSTEM) )
     {
-      if ( pSoundList->pSL_Sounds[pChannel->uSourceTrackIdx].pSoundData[0] && 
-          !(pSoundList->pSL_Sounds[pChannel->uSourceTrackIdx].uFlags & SOUND_DESC_SYSTEM) )
+      num_playing_channels = 0;
+      num_same_sound_on_channels = 0;
+      if ( this->uMixerChannels <= 0 )
+        goto LABEL_16;
+      for ( uint i = 0; i < uMixerChannels; i++ )
       {
-        num_playing_channels = 0;
-        num_same_sound_on_channels = 0;
-        if ( this->uMixerChannels <= 0 )
-          goto LABEL_16;
-        for ( uint i = 0; i < uMixerChannels; i++ )
+        if ( pChannel->uSourceTrackID == pMixerChannels[i].uSourceTrackID )
         {
-          if ( pChannel->uSourceTrackID == pMixerChannels[i].uSourceTrackID )
-          {
-            v14[num_same_sound_on_channels++] = i;
-            if ( AIL_sample_status((HSAMPLE)pMixerChannels[i].hSample) == AIL::Sample::Playing)
-              ++num_playing_channels;
-          }
+          v14[num_same_sound_on_channels++] = i;
+          if ( AIL_sample_status((HSAMPLE)pMixerChannels[i].hSample) == AIL::Sample::Playing)
+            ++num_playing_channels;
         }
-        if ( !num_playing_channels )
+      }
+      if ( !num_playing_channels )
+      {
+LABEL_16:
+        pSoundList->UnloadSound(pChannel->uSourceTrackIdx, 1);
+        for ( v10 = 0; v10 < num_same_sound_on_channels; v10++ )
         {
-LABEL_16:
-          pSoundList->UnloadSound(pChannel->uSourceTrackIdx, 1);
-          for ( v10 = 0; v10 < num_same_sound_on_channels; v10++ )
-          {
-            v12 = 16 * (v14[v10] + 47);
-            pMixerChannels[v14[v10]].uSourceTrackID = 0;
-            *(unsigned int *)((char *)&bEAXSupported + v12) = 0;
-          }
+          v12 = 16 * (v14[v10] + 47);
+          pMixerChannels[v14[v10]].uSourceTrackID = 0;
+          *(unsigned int *)((char *)&bEAXSupported + v12) = 0;
         }
       }
     }
+  }
 }
 
 //----- (004ABF23) --------------------------------------------------------
--- a/Overlays.cpp	Thu Feb 20 22:26:13 2014 +0600
+++ b/Overlays.cpp	Fri Feb 21 18:02:20 2014 +0600
@@ -289,14 +289,15 @@
 //----- (0045855F) --------------------------------------------------------
 void OtherOverlay::Reset()
 {
-  this->field_10 = 65536;
-  this->field_A = 0;
+  this->field_0 = 0;
+  this->field_2 = 0;
+  this->field_4 = 0;
+  this->field_6 = 0;
   this->field_8 = 0;
-  this->field_6 = 0;
-  this->field_4 = 0;
-  this->field_2 = 0;
+  this->field_A = 0;
   this->field_C = 0;
   this->field_E = 0;
+  this->field_10 = 65536;
 }
 
 //----- (004584B8) --------------------------------------------------------