summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-08-16 13:31:40 +0200
committerSergeanur <s.anureev@yandex.ua>2021-08-16 13:31:40 +0200
commit176cadff05e5a90e453bfb46f2a6331175b1454b (patch)
tree4a37f35eb94f6e1115ff055e3f2e5fdf0418241b
parentMerge branch 'master' into miami (diff)
parentFix ped comments playing at full volume behind the wall (diff)
downloadre3-176cadff05e5a90e453bfb46f2a6331175b1454b.tar
re3-176cadff05e5a90e453bfb46f2a6331175b1454b.tar.gz
re3-176cadff05e5a90e453bfb46f2a6331175b1454b.tar.bz2
re3-176cadff05e5a90e453bfb46f2a6331175b1454b.tar.lz
re3-176cadff05e5a90e453bfb46f2a6331175b1454b.tar.xz
re3-176cadff05e5a90e453bfb46f2a6331175b1454b.tar.zst
re3-176cadff05e5a90e453bfb46f2a6331175b1454b.zip
-rw-r--r--src/audio/AudioLogic.cpp22
-rw-r--r--src/audio/AudioManager.h5
2 files changed, 20 insertions, 7 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index eb14963c..564881b8 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -5243,7 +5243,10 @@ cAudioManager::SetupPedComments(cPedParams &params, uint16 sound)
pedComment.m_nEntityIndex = m_sQueueSample.m_nEntityIndex;
pedComment.m_vecPos = m_sQueueSample.m_vecPos;
pedComment.m_fDistance = m_sQueueSample.m_fDistance;
- pedComment.m_bVolume = m_sQueueSample.m_nVolume;
+ pedComment.m_nVolume = m_sQueueSample.m_nVolume;
+#if defined(EXTERNAL_3D_SOUND) && defined(FIX_BUGS)
+ pedComment.m_nEmittingVolume = emittingVol;
+#endif
m_sPedComments.Add(&pedComment);
}
}
@@ -7826,7 +7829,10 @@ cAudioManager::DebugPlayPedComment(int32 sound)
pedComment.m_nProcess = 10;
pedComment.m_nEntityIndex = 0;
pedComment.m_fDistance = 0.0f;
- pedComment.m_bVolume = 99;
+ pedComment.m_nVolume = 99;
+#if defined(EXTERNAL_3D_SOUND) && defined(FIX_BUGS)
+ pedComment.m_nEmittingVolume = 99;
+#endif
pedComment.m_vecPos = CWorld::Players[0].m_pPed->GetPosition();
@@ -7840,7 +7846,7 @@ cPedComments::Add(tPedComment *com)
if (m_nCommentsInBank[m_nActiveBank] >= NUM_PED_COMMENTS_SLOTS) {
index = m_nIndexMap[m_nActiveBank][NUM_PED_COMMENTS_SLOTS - 1];
- if (m_asPedComments[m_nActiveBank][index].m_bVolume > com->m_bVolume)
+ if (m_asPedComments[m_nActiveBank][index].m_nVolume > com->m_nVolume)
return;
} else {
index = m_nCommentsInBank[m_nActiveBank]++;
@@ -7851,7 +7857,7 @@ cPedComments::Add(tPedComment *com)
uint32 i = 0;
if (index != 0) {
for (i = 0; i < index; i++) {
- if (m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][i]].m_bVolume < m_asPedComments[m_nActiveBank][index].m_bVolume) {
+ if (m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][i]].m_nVolume < m_asPedComments[m_nActiveBank][index].m_nVolume) {
break;
}
}
@@ -7897,7 +7903,7 @@ cPedComments::Process()
AudioManager.m_sQueueSample.m_nSampleIndex = sampleIndex;
AudioManager.m_sQueueSample.m_nBankIndex = SFX_BANK_PED_COMMENTS;
AudioManager.m_sQueueSample.m_nReleasingVolumeModificator = 3;
- AudioManager.m_sQueueSample.m_nVolume = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]].m_bVolume;
+ AudioManager.m_sQueueSample.m_nVolume = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]].m_nVolume;
AudioManager.m_sQueueSample.m_fDistance = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]].m_fDistance;
AudioManager.m_sQueueSample.m_nLoopCount = 1;
#ifndef GTA_PS2
@@ -7905,8 +7911,12 @@ cPedComments::Process()
AudioManager.m_sQueueSample.m_nLoopEnd = -1;
#endif
#ifdef EXTERNAL_3D_SOUND
+ #ifdef FIX_BUGS
+ AudioManager.m_sQueueSample.m_nEmittingVolume = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]].m_nEmittingVolume;
+ #else
AudioManager.m_sQueueSample.m_nEmittingVolume = MAX_VOLUME;
-#endif
+ #endif // FIX_BUGS
+#endif // EXTERNAL_3D_SOUND
AudioManager.m_sQueueSample.m_fSpeedMultiplier = 3.0f;
AudioManager.m_sQueueSample.m_SoundIntensity = 40.0f;
AudioManager.m_sQueueSample.m_bReleasingSoundFlag = TRUE;
diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h
index f213230a..94443ce2 100644
--- a/src/audio/AudioManager.h
+++ b/src/audio/AudioManager.h
@@ -70,8 +70,11 @@ public:
int32 m_nEntityIndex;
CVector m_vecPos;
float m_fDistance;
- uint8 m_bVolume;
+ uint8 m_nVolume;
int8 m_nProcess;
+#if defined(EXTERNAL_3D_SOUND) && defined(FIX_BUGS)
+ uint8 m_nEmittingVolume;
+#endif
};
VALIDATE_SIZE(tPedComment, 28);