diff AudioPlayer.cpp @ 328:8e23edf57e27

little fix
author Ritor1
date Wed, 20 Feb 2013 17:37:33 +0600
parents ce39b96acf5c
children 50875632e776 5fd328336048
line wrap: on
line diff
--- a/AudioPlayer.cpp	Wed Feb 20 11:27:06 2013 +0600
+++ b/AudioPlayer.cpp	Wed Feb 20 17:37:33 2013 +0600
@@ -45,17 +45,9 @@
 
 float pSoundVolumeLevels[10] = 
 {
-  0.0,
-  0.10999999940395,
-  0.21999999880791,
-  0.33000001311302,
-  0.43999999761581,
-  0.55000001192093,
-  0.66000002622604,
-  0.76999998092651,
-  0.87999999523163,
-  0.99000000953674
-}; // idb
+  0.0000000f, 0.1099999f, 0.2199999f, 0.3300000f, 0.4399999f,
+ 0.5500000f, 0.6600000f, 0.7699999f, 0.8799999f, 0.9900000f
+};
 
 
 
@@ -541,7 +533,7 @@
   if (!bNoSound && bPlayerReady && hAILRedbook && uMusicVolimeMultiplier)
   {
     AIL_redbook_stop(hAILRedbook);
-    AIL_redbook_set_volume(hAILRedbook, (signed)(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0));
+    AIL_redbook_set_volume(hAILRedbook, (signed)pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
     AIL_redbook_track_info(hAILRedbook, eTrack, &uCurrentMusicTrackStartMS, &uCurrentMusicTrackEndMS);
     AIL_redbook_play(hAILRedbook, uCurrentMusicTrackStartMS + 1, uCurrentMusicTrackEndMS);
     uCurrentMusicTrackLength = ((uCurrentMusicTrackEndMS - uCurrentMusicTrackStartMS) * 128) / 1000;
@@ -560,20 +552,15 @@
 }
 
 //----- (004AA214) --------------------------------------------------------
-void AudioPlayer::SetMasterVolume(unsigned int uVolume)
+void AudioPlayer::SetMasterVolume(float fVolume)
 {
-  AudioPlayer *v2; // esi@1
-  _DIG_DRIVER *hDrv; // eax@2
-
-  v2 = this;
-  if ( this->bPlayerReady )
+  if ( bPlayerReady )
   {
-    hDrv = this->hDigDriver;
-    this->uMasterVolume = uVolume;
-    if ( hDrv )
-      AIL_set_digital_master_volume(hDrv, uVolume);
-    if ( v2->b3DSoundInitialized )
-      v2->s3DSoundVolume = (signed __int64)((double)(signed int)uVolume * 0.5);
+    uMasterVolume = fVolume;
+    if ( hDigDriver )
+      AIL_set_digital_master_volume(hDigDriver, fVolume);
+    if ( b3DSoundInitialized )
+      s3DSoundVolume = fVolume * 0.5f;
   }
 }
 // 4D8304: using guessed type int __stdcall AIL_set_digital_master_volume(int, int);
@@ -1972,9 +1959,9 @@
     uNumRedbookTracks = AIL_redbook_tracks(hAILRedbook);
   }
   pAudioPlayer->sRedbookVolume = AIL_redbook_volume(hAILRedbook);
-  pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0);
+  pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
   if ( bPlayerReady && hAILRedbook )
-    AIL_redbook_set_volume(hAILRedbook, (unsigned __int64)(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0) >> 32);
+    AIL_redbook_set_volume(hAILRedbook, (unsigned __int64)(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f) >> 32);
   LoadAudioSnd();
 }