summaryrefslogtreecommitdiffstats
path: root/src/audio
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-06-24 23:47:06 +0200
committerSergeanur <s.anureev@yandex.ua>2021-06-24 23:47:06 +0200
commite671fe682d48cc61b9d31373914269da2757aef7 (patch)
treeeed8d9fb806564ea3bd272c75e9af88063a6e747 /src/audio
parentMerge branch miami into lcs (diff)
parentFrontend fix (diff)
downloadre3-e671fe682d48cc61b9d31373914269da2757aef7.tar
re3-e671fe682d48cc61b9d31373914269da2757aef7.tar.gz
re3-e671fe682d48cc61b9d31373914269da2757aef7.tar.bz2
re3-e671fe682d48cc61b9d31373914269da2757aef7.tar.lz
re3-e671fe682d48cc61b9d31373914269da2757aef7.tar.xz
re3-e671fe682d48cc61b9d31373914269da2757aef7.tar.zst
re3-e671fe682d48cc61b9d31373914269da2757aef7.zip
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/AudioManager.cpp10
-rw-r--r--src/audio/MusicManager.cpp4
-rw-r--r--src/audio/PolRadio.cpp8
3 files changed, 20 insertions, 2 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index abbce8bb..b9d46d2c 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -442,6 +442,9 @@ cAudioManager::IsAudioInitialised() const
void
cAudioManager::ServiceSoundEffects()
{
+#ifdef FIX_BUGS
+ if(CTimer::GetLogicalFramesPassed() != 0)
+#endif
m_bFifthFrameFlag = (m_FrameCounter++ % 5) == 0;
if (m_nUserPause && !m_nPreviousUserPause) {
for (int32 i = 0; i < NUM_CHANNELS; i++)
@@ -795,9 +798,9 @@ cAudioManager::AddReleasingSounds()
}
if (!toProcess[i]) {
if (sample.m_nCounter <= 255 || !sample.m_nLoopsRemaining) {
- if (!sample.m_nReleasingVolumeDivider)
+ if (sample.m_nReleasingVolumeDivider == 0)
continue;
- if (!sample.m_nLoopCount) {
+ if (sample.m_nLoopCount == 0) {
if (sample.m_nVolumeChange == -1) {
sample.m_nVolumeChange = sample.m_nVolume / sample.m_nReleasingVolumeDivider;
if (sample.m_nVolumeChange <= 0)
@@ -809,6 +812,9 @@ cAudioManager::AddReleasingSounds()
}
sample.m_nVolume -= sample.m_nVolumeChange;
}
+#ifdef FIX_BUGS
+ if(CTimer::GetLogicalFramesPassed() != 0)
+#endif
--sample.m_nReleasingVolumeDivider;
if (m_bFifthFrameFlag) {
if (sample.m_nReleasingVolumeModificator < 20)
diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp
index b8501339..dad45371 100644
--- a/src/audio/MusicManager.cpp
+++ b/src/audio/MusicManager.cpp
@@ -1317,7 +1317,11 @@ cMusicManager::DisplayRadioStationName()
}
else {
if (cDisplay == 0) return;
+#ifdef FIX_BUGS
+ cDisplay -= CTimer::GetLogicalFramesPassed();
+#else
cDisplay--;
+#endif
}
CFont::SetJustifyOff();
diff --git a/src/audio/PolRadio.cpp b/src/audio/PolRadio.cpp
index ba6497ce..fb2b06b4 100644
--- a/src/audio/PolRadio.cpp
+++ b/src/audio/PolRadio.cpp
@@ -137,7 +137,11 @@ cAudioManager::ServicePoliceRadio()
if (!crimeReport) {
if (wantedLevel != 0) {
if (nLastSeen != 0)
+#ifdef FIX_BUGS
+ nLastSeen -= CTimer::GetLogicalFramesPassed();
+#else
--nLastSeen;
+#endif
else {
nLastSeen = m_anRandomTable[1] % 1000 + 2000;
SetupSuspectLastSeenReport();
@@ -176,7 +180,11 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
}
if (m_sPoliceRadioQueue.policeChannelTimer == 0) bChannelOpen = FALSE;
if (cWait) {
+#ifdef FIX_BUGS
+ cWait -= CTimer::GetLogicalFramesPassed();
+#else
--cWait;
+#endif
return;
}
if (g_nMissionAudioSfx != NO_SAMPLE && !bChannelOpen) {