From 1b5dbc4b411d58c04d867a4f330f06ca3e4ef1cf Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sat, 12 Jun 2021 19:59:28 +0300 Subject: Add macros to set sample loop offsets --- src/audio/AudioManager.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/audio/AudioManager.h') diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index d5b3ce15..5494ca41 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -544,6 +544,23 @@ public: #endif }; +/* + Manual loop points are not on PS2 so let's have these macros to avoid massive ifndefs. + Setting these manually was pointless anyway since they never change from sdt values. + What were they thinking? +*/ +#ifndef GTA_PS2 +#define RESET_LOOP_OFFSETS \ + m_sQueueSample.m_nLoopStart = 0; \ + m_sQueueSample.m_nLoopEnd = -1; +#define SET_LOOP_OFFSETS(sample) \ + m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(sample); \ + m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(sample); +#else +#define RESET_LOOP_OFFSETS +#define SET_LOOP_OFFSETS(sample) +#endif + #if defined(AUDIO_MSS) && !defined(PS2_AUDIO_CHANNELS) static_assert(sizeof(cAudioManager) == 0x5558, "cAudioManager: error"); #endif -- cgit v1.2.3