diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-08-18 14:31:58 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-08-18 14:31:58 +0200 |
commit | 5c562c3adc06044a17cabb9c4785795b0d2d7fa7 (patch) | |
tree | b3b4c2c43f26d5c2615828f05a2cbacdd4bcf67a /src | |
parent | update librw (diff) | |
download | re3-5c562c3adc06044a17cabb9c4785795b0d2d7fa7.tar re3-5c562c3adc06044a17cabb9c4785795b0d2d7fa7.tar.gz re3-5c562c3adc06044a17cabb9c4785795b0d2d7fa7.tar.bz2 re3-5c562c3adc06044a17cabb9c4785795b0d2d7fa7.tar.lz re3-5c562c3adc06044a17cabb9c4785795b0d2d7fa7.tar.xz re3-5c562c3adc06044a17cabb9c4785795b0d2d7fa7.tar.zst re3-5c562c3adc06044a17cabb9c4785795b0d2d7fa7.zip |
Diffstat (limited to '')
-rw-r--r-- | src/audio/AudioLogic.cpp | 2 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 4 | ||||
-rw-r--r-- | src/audio/MusicManager.cpp | 4 | ||||
-rw-r--r-- | src/audio/PolRadio.cpp | 36 |
4 files changed, 23 insertions, 23 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 7ccd7134..04df506d 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -6054,7 +6054,7 @@ cPedComments::Process() uint8 actualUsedBank; tPedComment *comment; - if (AudioManager.m_nUserPause != 0) return; + if (AudioManager.m_nUserPause) return; if (m_nCommentsInBank[m_nActiveBank]) { sampleIndex = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]].m_nSampleIndex; diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index 3b413965..ed920cab 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -245,8 +245,8 @@ public: cMissionAudio m_sMissionAudio; int32 m_anRandomTable[5]; uint8 m_nTimeSpent; - uint8 m_nUserPause; - uint8 m_nPreviousUserPause; + bool8 m_nUserPause; + bool8 m_nPreviousUserPause; uint32 m_FrameCounter; cAudioManager(); diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp index 9872589a..0752a5d8 100644 --- a/src/audio/MusicManager.cpp +++ b/src/audio/MusicManager.cpp @@ -363,14 +363,14 @@ cMusicManager::GetRadioInCar(void) CVehicle *veh = FindPlayerVehicle(); if (veh != nil){ if (UsesPoliceRadio(veh)) { - if (m_nRadioInCar == NO_TRACK || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0)) + if (m_nRadioInCar == NO_TRACK || (CReplay::IsPlayingBack() && !AudioManager.m_nUserPause)) return POLICE_RADIO; return m_nRadioInCar; } else return veh->m_nRadioStation; } } - if (m_nRadioInCar == NO_TRACK || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0)) + if (m_nRadioInCar == NO_TRACK || (CReplay::IsPlayingBack() && !AudioManager.m_nUserPause)) return RADIO_OFF; return m_nRadioInCar; } diff --git a/src/audio/PolRadio.cpp b/src/audio/PolRadio.cpp index 4c84829a..6b663d0d 100644 --- a/src/audio/PolRadio.cpp +++ b/src/audio/PolRadio.cpp @@ -26,7 +26,7 @@ char SubZo2Label[8]; char SubZo3Label[8]; uint32 g_nMissionAudioSfx = TOTAL_AUDIO_SAMPLES; -int8 g_nMissionAudioPlayingStatus = 2; +int8 g_nMissionAudioPlayingStatus = PLAY_STATUS_FINISHED; uint8 gSpecialSuspectLastSeenReport; uint32 gMinTimeToNextReport[NUM_CRIME_TYPES]; @@ -109,8 +109,8 @@ void cAudioManager::SetMissionScriptPoliceAudio(uint32 sfx) { if (!m_bIsInitialised) return; - if (g_nMissionAudioPlayingStatus != 1) { - g_nMissionAudioPlayingStatus = 0; + if (g_nMissionAudioPlayingStatus != PLAY_STATUS_PLAYING) { + g_nMissionAudioPlayingStatus = PLAY_STATUS_STOPPED; g_nMissionAudioSfx = sfx; } } @@ -151,7 +151,7 @@ cAudioManager::ServicePoliceRadio() if(!m_bIsInitialised) return; - if(m_nUserPause == 0) { + if(!m_nUserPause) { bool8 crimeReport = SetupCrimeReport(); #ifdef FIX_BUGS // Crash at 0x5fe6ef if(CReplay::IsPlayingBack() || !FindPlayerPed() || !FindPlayerPed()->m_pWanted) @@ -185,20 +185,20 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel) static int cWait = 0; static bool8 bChannelOpen = FALSE; - static uint8 bMissionAudioPhysicalPlayingStatus = 0; + static uint8 bMissionAudioPhysicalPlayingStatus = PLAY_STATUS_STOPPED; static int32 PoliceChannelFreq = 5500; if (!m_bIsInitialised) return; - if (m_nUserPause != 0) { + if (m_nUserPause) { if (SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO)) SampleManager.StopChannel(CHANNEL_POLICE_RADIO); - if (g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && bMissionAudioPhysicalPlayingStatus == 1 && + if (g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && bMissionAudioPhysicalPlayingStatus == PLAY_STATUS_PLAYING && SampleManager.IsStreamPlaying(1)) { SampleManager.PauseStream(TRUE, 1); } } else { if (m_nPreviousUserPause && g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && - bMissionAudioPhysicalPlayingStatus == 1) { + bMissionAudioPhysicalPlayingStatus == PLAY_STATUS_PLAYING) { SampleManager.PauseStream(FALSE, 1); } if (m_sPoliceRadioQueue.policeChannelTimer == 0) bChannelOpen = FALSE; @@ -211,17 +211,17 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel) return; } if (g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && !bChannelOpen) { - if (g_nMissionAudioPlayingStatus) { - if (g_nMissionAudioPlayingStatus == 1 && !bMissionAudioPhysicalPlayingStatus && + if (g_nMissionAudioPlayingStatus != PLAY_STATUS_STOPPED) { + if (g_nMissionAudioPlayingStatus == PLAY_STATUS_PLAYING && bMissionAudioPhysicalPlayingStatus == PLAY_STATUS_STOPPED && SampleManager.IsStreamPlaying(1)) { - bMissionAudioPhysicalPlayingStatus = 1; + bMissionAudioPhysicalPlayingStatus = PLAY_STATUS_PLAYING; } - if (bMissionAudioPhysicalPlayingStatus == 1) { + if (bMissionAudioPhysicalPlayingStatus == PLAY_STATUS_PLAYING) { if (SampleManager.IsStreamPlaying(1)) { DoPoliceRadioCrackle(); } else { - bMissionAudioPhysicalPlayingStatus = 2; - g_nMissionAudioPlayingStatus = 2; + bMissionAudioPhysicalPlayingStatus = PLAY_STATUS_FINISHED; + g_nMissionAudioPlayingStatus = PLAY_STATUS_FINISHED; g_nMissionAudioSfx = TOTAL_AUDIO_SAMPLES; cWait = 30; } @@ -231,13 +231,13 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel) SampleManager.PreloadStreamedFile(g_nMissionAudioSfx, 1); SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, TRUE, 1); SampleManager.StartPreloadedStreamedFile(1); - g_nMissionAudioPlayingStatus = 1; - bMissionAudioPhysicalPlayingStatus = 0; + g_nMissionAudioPlayingStatus = PLAY_STATUS_PLAYING; + bMissionAudioPhysicalPlayingStatus = PLAY_STATUS_STOPPED; return; } } if (bChannelOpen) DoPoliceRadioCrackle(); - if ((g_nMissionAudioSfx == TOTAL_AUDIO_SAMPLES || g_nMissionAudioPlayingStatus != 1) && + if ((g_nMissionAudioSfx == TOTAL_AUDIO_SAMPLES || g_nMissionAudioPlayingStatus != PLAY_STATUS_PLAYING) && !SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO) && m_sPoliceRadioQueue.policeChannelTimer) { if (m_sPoliceRadioQueue.policeChannelTimer) { sample = m_sPoliceRadioQueue.crimesSamples[m_sPoliceRadioQueue.policeChannelCounterSeconds]; @@ -292,7 +292,7 @@ cAudioManager::SetupCrimeReport() float quarterX; float quarterY; int i; - int32 sampleIndex; + uint32 sampleIndex; bool8 processed = FALSE; if (MusicManager.m_nMusicMode == MUSICMODE_CUTSCENE) return FALSE; |