Mercurial > mm7
comparison AudioPlayer.cpp @ 24:352b15291822
18.01.13 (PlaySound work)
author | Ritor1 |
---|---|
date | Fri, 18 Jan 2013 17:30:54 +0600 |
parents | 66319a734368 |
children | 739d8f3b50f9 |
comparison
equal
deleted
inserted
replaced
23:75d706037de4 | 24:352b15291822 |
---|---|
735 signed int v100; // [sp+90h] [bp+1Ch]@32 | 735 signed int v100; // [sp+90h] [bp+1Ch]@32 |
736 int v101; // [sp+90h] [bp+1Ch]@52 | 736 int v101; // [sp+90h] [bp+1Ch]@52 |
737 int v102; // [sp+90h] [bp+1Ch]@60 | 737 int v102; // [sp+90h] [bp+1Ch]@60 |
738 int v103; // [sp+90h] [bp+1Ch]@68 | 738 int v103; // [sp+90h] [bp+1Ch]@68 |
739 | 739 |
740 uVolume = 120; //Ritor1:It's temporary | |
740 pAudioPlayer = this; | 741 pAudioPlayer = this; |
741 v35 = this->bPlayerReady == 0; | 742 v35 = this->bPlayerReady == 0; |
742 //pAudioPlayer = this; | 743 //pAudioPlayer = this; |
743 pRenderVertexSoft.flt_2C = 0.0; | 744 pRenderVertexSoft.flt_2C = 0.0; |
744 LODWORD(v93) = 10000; | 745 LODWORD(v93) = 10000; |
2097 int v2; // edi@1 | 2098 int v2; // edi@1 |
2098 MixerChannel *pMixerChannel; // ebx@3 | 2099 MixerChannel *pMixerChannel; // ebx@3 |
2099 char v4; // dl@5 | 2100 char v4; // dl@5 |
2100 int v5; // ebx@6 | 2101 int v5; // ebx@6 |
2101 AudioPlayer_3DSample *p3DSample; // edi@7 | 2102 AudioPlayer_3DSample *p3DSample; // edi@7 |
2102 int v7; // edx@14 | 2103 //int v7; // edx@14 |
2103 int v8; // ecx@14 | 2104 int v8; // ecx@14 |
2104 void *v9; // ecx@15 | 2105 void *v9; // ecx@15 |
2105 | 2106 |
2106 pAudioPlayer = this; | 2107 pAudioPlayer = this; |
2107 v2 = 0; | 2108 v2 = 0; |
2122 while ( v2 < pAudioPlayer->uMixerChannels ); | 2123 while ( v2 < pAudioPlayer->uMixerChannels ); |
2123 } | 2124 } |
2124 if ( ReadWindowsRegistryInt("Disable3DSound", 0) != 1 ) | 2125 if ( ReadWindowsRegistryInt("Disable3DSound", 0) != 1 ) |
2125 { | 2126 { |
2126 v5 = 0; | 2127 v5 = 0; |
2127 pAudioPlayer->CheckA3DSupport(v4); | 2128 pAudioPlayer->CheckA3DSupport(0);// pAudioPlayer->CheckA3DSupport(v4); |
2128 if ( pAudioPlayer->uNum3DSamples > 0 ) | 2129 if ( pAudioPlayer->uNum3DSamples > 0 ) |
2129 { | 2130 { |
2130 p3DSample = pAudioPlayer->p3DSamples; | 2131 p3DSample = pAudioPlayer->p3DSamples; |
2131 do | 2132 do |
2132 { | 2133 { |
2144 { | 2145 { |
2145 AIL_close_3D_provider(pAudioPlayer->h3DSoundProvider); | 2146 AIL_close_3D_provider(pAudioPlayer->h3DSoundProvider); |
2146 pAudioPlayer->h3DSoundProvider = 0; | 2147 pAudioPlayer->h3DSoundProvider = 0; |
2147 } | 2148 } |
2148 } | 2149 } |
2150 v8 = (int)&pAudioPlayer->hAILRedbook; | |
2149 if ( pAudioPlayer->hAILRedbook ) | 2151 if ( pAudioPlayer->hAILRedbook ) |
2150 { | 2152 { |
2151 AIL_redbook_stop(pAudioPlayer->hAILRedbook); | 2153 AIL_redbook_stop(pAudioPlayer->hAILRedbook); |
2152 AIL_redbook_set_volume((HREDBOOK)v8, v7); | 2154 AIL_redbook_set_volume((HREDBOOK)v8, pAudioPlayer->sRedbookVolume); |
2153 AIL_redbook_close(pAudioPlayer->hAILRedbook); | 2155 AIL_redbook_close(pAudioPlayer->hAILRedbook); |
2154 } | 2156 } |
2155 AIL_shutdown(); | 2157 AIL_shutdown(); |
2156 pSoundList->Release(); | 2158 pSoundList->Release(); |
2157 v9 = *(void **)&pAudioPlayer->field_C78[0]; | 2159 v9 = *(void **)&pAudioPlayer->field_C78[0]; |
2512 | 2514 |
2513 | 2515 |
2514 //----- (004A96BE) -------------------------------------------------------- | 2516 //----- (004A96BE) -------------------------------------------------------- |
2515 void ReleaseSoundData(void *_this) | 2517 void ReleaseSoundData(void *_this) |
2516 { | 2518 { |
2517 int v1; // esi@1 | 2519 int pID; // esi@1 |
2518 char *v2; // eax@1 | 2520 char *v2; // eax@1 |
2519 | 2521 |
2520 v1 = 0; | 2522 pID = 0; |
2521 v2 = (char *)&pSounds[0].pSoundData; | 2523 v2 = (char *)&pSounds[0].pSoundData; |
2522 while ( *(void **)v2 != _this ) | 2524 while ( *(void **)v2 != _this ) |
2523 { | 2525 { |
2524 v2 += 128; | 2526 v2 += 128; |
2525 ++v1; | 2527 ++pID; |
2526 if ( (signed int)v2 >= (signed int)&pAudioPlayer->p3DSamples[6].field_8 ) | 2528 if ( (signed int)v2 >= (signed int)&pAudioPlayer->p3DSamples[6].field_8 ) |
2527 return; | 2529 return; |
2528 } | 2530 } |
2529 pAllocator->FreeChunk(_this); | 2531 pAllocator->FreeChunk(_this); |
2530 memset(&pSounds[v1], 0, 0x80u); | 2532 memset(&pSounds[pID], 0, 0x80u); |
2531 } | 2533 } |
2532 | 2534 |
2533 //----- (004A96FF) -------------------------------------------------------- | 2535 //----- (004A96FF) -------------------------------------------------------- |
2534 SoundHeader *__fastcall FindSound_BinSearch(unsigned int uStart, unsigned int uEnd, const char *pName) | 2536 SoundHeader *__fastcall FindSound_BinSearch(unsigned int uStart, unsigned int uEnd, const char *pName) |
2535 { | 2537 { |
2637 if (pSounds[i].uID == uID) | 2639 if (pSounds[i].uID == uID) |
2638 return pSounds[i].pSoundData; | 2640 return pSounds[i].pSoundData; |
2639 | 2641 |
2640 FindSound_BinSearch(0, pAudioPlayer->uNumSoundHeaders, pSoundName_); | 2642 FindSound_BinSearch(0, pAudioPlayer->uNumSoundHeaders, pSoundName_); |
2641 if ( uFindSound_BinSearch_ResultID == -1 ) | 2643 if ( uFindSound_BinSearch_ResultID == -1 ) |
2642 goto LABEL_22; | 2644 { |
2645 result = 0; | |
2646 return result; | |
2647 } | |
2643 v6 = &pAudioPlayer->pSoundHeaders[uFindSound_BinSearch_ResultID]; | 2648 v6 = &pAudioPlayer->pSoundHeaders[uFindSound_BinSearch_ResultID]; |
2644 pDecompressedSize = &v6->uDecompressedSize; | 2649 pDecompressedSize = &v6->uDecompressedSize; |
2645 v8 = v6->uDecompressedSize; | 2650 v8 = v6->uDecompressedSize; |
2646 v19 = v6->uDecompressedSize; | 2651 v19 = v6->uDecompressedSize; |
2647 if ( v3 == (SoundData *)-1 ) | 2652 if ( v3 == (SoundData *)-1 ) |
2682 ++v12; | 2687 ++v12; |
2683 } | 2688 } |
2684 while ( *(int *)v13 ); | 2689 while ( *(int *)v13 ); |
2685 uLastLoadedSoundID = v12; | 2690 uLastLoadedSoundID = v12; |
2686 } | 2691 } |
2687 v16 = pSounds[v12].field_4; | 2692 v16 = pSounds[v12].SoundName; |
2688 strcpy((char *)v16, pSoundName_); | 2693 strcpy((char *)v16, pSoundName_); |
2689 v14 = uLastLoadedSoundID++ << 7; | 2694 v14 = uLastLoadedSoundID++ << 7; |
2690 pSoundList->uTotalLoadedSoundSize += v11; | 2695 pSoundList->uTotalLoadedSoundSize += v11; |
2691 pSounds[uLastLoadedSoundID].pSoundData = v3; | 2696 pSounds[uLastLoadedSoundID].pSoundData = v3; |
2692 result = v3; | 2697 result = v3; |
2693 } | 2698 } |
2694 else | 2699 else |
2695 { | 2700 { |
2696 LABEL_22: | |
2697 result = 0; | 2701 result = 0; |
2698 } | 2702 } |
2699 return result; | 2703 return result; |
2700 } | 2704 } |