summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioManager.cpp
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2019-06-12 19:56:45 +0200
committerFilip Gawin <filip.gawin@zoho.com>2019-06-29 14:03:39 +0200
commitd4b566ecb28084ccb37f5bee9e023b968e12c1c9 (patch)
tree43b5a9703a333b6881140c4fe390aa9ac8f3b264 /src/audio/AudioManager.cpp
parentfix (diff)
downloadre3-d4b566ecb28084ccb37f5bee9e023b968e12c1c9.tar
re3-d4b566ecb28084ccb37f5bee9e023b968e12c1c9.tar.gz
re3-d4b566ecb28084ccb37f5bee9e023b968e12c1c9.tar.bz2
re3-d4b566ecb28084ccb37f5bee9e023b968e12c1c9.tar.lz
re3-d4b566ecb28084ccb37f5bee9e023b968e12c1c9.tar.xz
re3-d4b566ecb28084ccb37f5bee9e023b968e12c1c9.tar.zst
re3-d4b566ecb28084ccb37f5bee9e023b968e12c1c9.zip
Diffstat (limited to '')
-rw-r--r--src/audio/AudioManager.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index 757ffa79..5a290d28 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -10,8 +10,21 @@ cAudioManager::PlayerJustLeftCar(void)
// UNUSED: This is a perfectly empty function.
}
+void
+cAudioManager::GetPhrase(uint32 *phrase, uint32 *prevPhrase,
+ eAudioSamples sample, uint32 maxOffset)
+{
+ *phrase = (uint32)sample +
+ (uint32)m_anRandomTable[m_sQueueSample.m_nEntityIndex & 3] %
+ maxOffset;
+ if(*phrase == *prevPhrase && ++*phrase >= (uint32)sample + maxOffset)
+ *phrase = (uint32)sample;
+ *prevPhrase = *phrase;
+}
+
WRAPPER void cAudioManager::Service() { EAXJMP(0x57A2A0); }
STARTPATCHES
InjectHook(0x56AD20, &cAudioManager::PlayerJustLeftCar, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
+ InjectHook(0x570DB0, &cAudioManager::GetPhrase, PATCH_JUMP);
+ENDPATCHES