diff AudioPlayer.cpp @ 24:352b15291822

18.01.13 (PlaySound work)
author Ritor1
date Fri, 18 Jan 2013 17:30:54 +0600
parents 66319a734368
children 739d8f3b50f9
line wrap: on
line diff
--- a/AudioPlayer.cpp	Fri Jan 18 09:44:49 2013 +0600
+++ b/AudioPlayer.cpp	Fri Jan 18 17:30:54 2013 +0600
@@ -737,6 +737,7 @@
   int v102; // [sp+90h] [bp+1Ch]@60
   int v103; // [sp+90h] [bp+1Ch]@68
 
+  uVolume = 120; //Ritor1:It's temporary
   pAudioPlayer = this;
   v35 = this->bPlayerReady == 0;
   //pAudioPlayer = this;
@@ -2099,7 +2100,7 @@
   char v4; // dl@5
   int v5; // ebx@6
   AudioPlayer_3DSample *p3DSample; // edi@7
-  int v7; // edx@14
+  //int v7; // edx@14
   int v8; // ecx@14
   void *v9; // ecx@15
 
@@ -2124,7 +2125,7 @@
     if ( ReadWindowsRegistryInt("Disable3DSound", 0) != 1 )
     {
       v5 = 0;
-      pAudioPlayer->CheckA3DSupport(v4);
+      pAudioPlayer->CheckA3DSupport(0);// pAudioPlayer->CheckA3DSupport(v4);
       if ( pAudioPlayer->uNum3DSamples > 0 )
       {
         p3DSample = pAudioPlayer->p3DSamples;
@@ -2146,10 +2147,11 @@
         pAudioPlayer->h3DSoundProvider = 0;
       }
     }
+    v8 = (int)&pAudioPlayer->hAILRedbook;
     if ( pAudioPlayer->hAILRedbook )
     {
       AIL_redbook_stop(pAudioPlayer->hAILRedbook);
-      AIL_redbook_set_volume((HREDBOOK)v8, v7);
+      AIL_redbook_set_volume((HREDBOOK)v8, pAudioPlayer->sRedbookVolume);
       AIL_redbook_close(pAudioPlayer->hAILRedbook);
     }
     AIL_shutdown();
@@ -2514,20 +2516,20 @@
 //----- (004A96BE) --------------------------------------------------------
 void ReleaseSoundData(void *_this)
 {
-  int v1; // esi@1
+  int pID; // esi@1
   char *v2; // eax@1
 
-  v1 = 0;
+  pID = 0;
   v2 = (char *)&pSounds[0].pSoundData;
   while ( *(void **)v2 != _this )
   {
     v2 += 128;
-    ++v1;
+    ++pID;
     if ( (signed int)v2 >= (signed int)&pAudioPlayer->p3DSamples[6].field_8 )
       return;
   }
   pAllocator->FreeChunk(_this);
-  memset(&pSounds[v1], 0, 0x80u);
+  memset(&pSounds[pID], 0, 0x80u);
 }
 
 //----- (004A96FF) --------------------------------------------------------
@@ -2639,7 +2641,10 @@
 
   FindSound_BinSearch(0, pAudioPlayer->uNumSoundHeaders, pSoundName_);
   if ( uFindSound_BinSearch_ResultID == -1 )
-    goto LABEL_22;
+  {
+    result = 0;
+    return result;
+  }
   v6 = &pAudioPlayer->pSoundHeaders[uFindSound_BinSearch_ResultID];
   pDecompressedSize = &v6->uDecompressedSize;
   v8 = v6->uDecompressedSize;
@@ -2684,7 +2689,7 @@
       while ( *(int *)v13 );
       uLastLoadedSoundID = v12;
     }
-    v16 = pSounds[v12].field_4;
+    v16 = pSounds[v12].SoundName;
     strcpy((char *)v16, pSoundName_);
     v14 = uLastLoadedSoundID++ << 7;
     pSoundList->uTotalLoadedSoundSize += v11;
@@ -2693,7 +2698,6 @@
   }
   else
   {
-LABEL_22:
     result = 0;
   }
   return result;