changeset 1422:6bbcb91b3b7d

m
author Ritor1
date Tue, 30 Jul 2013 09:33:52 +0600
parents 204cce84300b
children 350959f13283
files AudioPlayer.cpp
diffstat 1 files changed, 13 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/AudioPlayer.cpp	Fri Jul 26 18:11:36 2013 +0600
+++ b/AudioPlayer.cpp	Tue Jul 30 09:33:52 2013 +0600
@@ -535,52 +535,35 @@
 //----- (004AA258) --------------------------------------------------------
 void AudioPlayer::_4AA258(int a2)
 {
-  AudioPlayer *v2; // esi@1
-  int v3; // edi@4
-  AudioPlayer_3DSample *v4; // ebx@5
-  int v5; // ebx@11
-  MixerChannel *v6; // edi@12
-
-  v2 = this;
+  __debugbreak();
   if ( this->bPlayerReady )
   {
-    if ( this->b3DSoundInitialized && a2 && (v3 = 0, this->uNum3DSamples > 0) )
+    if ( this->b3DSoundInitialized && a2 && this->uNum3DSamples > 0 )
     {
-      v4 = this->p3DSamples;
-      while ( v4->field_4 != a2 || AIL_3D_sample_status(v4->hSample) != 4 )
+      for ( uint i = 0; i < this->uNum3DSamples; ++i )
       {
-        ++v3;
-        ++v4;
-        if ( v3 >= v2->uNum3DSamples )
-          goto LABEL_9;
+        if ( this->p3DSamples[i].field_4 == a2 && AIL_3D_sample_status(this->p3DSamples[i].hSample) == 4 )
+          AIL_end_3D_sample(this->p3DSamples[i].hSample);
       }
-      AIL_end_3D_sample(v2->p3DSamples[v3].hSample);
+      goto LABEL_9;
     }
     else
     {
 LABEL_9:
-      if ( v2->hDigDriver )
+      if ( this->hDigDriver )
       {
-        if ( a2 )
+        if ( a2 && this->uMixerChannels > 0 )
         {
-          v5 = 0;
-          if ( v2->uMixerChannels > 0 )
+          for ( uint i = 0; i < this->uMixerChannels; ++i )
           {
-            v6 = v2->pMixerChannels;
-            do
+            if ( this->pMixerChannels[i].source_pid == a2 )
             {
-              if ( v6->source_pid == a2 )
+              if ( AIL_sample_status(this->pMixerChannels[i].hSample) == AIL::Sample::Playing)
               {
-                if ( AIL_sample_status(v6->hSample) == AIL::Sample::Playing)
-                {
-                  AIL_end_sample(v6->hSample);
-                  FreeChannel(v6);
-                }
+                AIL_end_sample(this->pMixerChannels[i].hSample);
+                FreeChannel(&this->pMixerChannels[i]);
               }
-              ++v5;
-              ++v6;
             }
-            while ( v5 < v2->uMixerChannels );
           }
         }
       }