summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioManager.h
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-06-12 18:19:31 +0200
committerSergeanur <s.anureev@yandex.ua>2021-06-24 20:32:44 +0200
commit939d0c59a3994a564b2257b8d9e5ec107b1b7933 (patch)
treec765f6d491ead937dd7741133cf390aba380ced9 /src/audio/AudioManager.h
parentFix typo (diff)
downloadre3-939d0c59a3994a564b2257b8d9e5ec107b1b7933.tar
re3-939d0c59a3994a564b2257b8d9e5ec107b1b7933.tar.gz
re3-939d0c59a3994a564b2257b8d9e5ec107b1b7933.tar.bz2
re3-939d0c59a3994a564b2257b8d9e5ec107b1b7933.tar.lz
re3-939d0c59a3994a564b2257b8d9e5ec107b1b7933.tar.xz
re3-939d0c59a3994a564b2257b8d9e5ec107b1b7933.tar.zst
re3-939d0c59a3994a564b2257b8d9e5ec107b1b7933.zip
Diffstat (limited to 'src/audio/AudioManager.h')
-rw-r--r--src/audio/AudioManager.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h
index a3ae4cfb..70302745 100644
--- a/src/audio/AudioManager.h
+++ b/src/audio/AudioManager.h
@@ -17,8 +17,10 @@ public:
uint8 m_nVolume;
float m_fDistance;
int32 m_nLoopCount;
+#ifndef GTA_PS2
int32 m_nLoopStart;
int32 m_nLoopEnd;
+#endif
uint8 m_nEmittingVolume;
float m_fSpeedMultiplier;
float m_fSoundIntensity;
@@ -498,6 +500,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) == 19220, "cAudioManager: error");
#endif