summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-09-02 07:00:04 +0200
committerSergeanur <s.anureev@yandex.ua>2021-09-02 07:00:04 +0200
commitc41239ed5e44cfd4f54d9478c1b08efd94e1338e (patch)
tree56724c2ba5edcda874508fe37bebf9864c95a019
parentAudio: fix types for IsSampleBankLoaded/IsPedCommentLoaded, reverse ProcessSpecial from PS2 (diff)
downloadre3-c41239ed5e44cfd4f54d9478c1b08efd94e1338e.tar
re3-c41239ed5e44cfd4f54d9478c1b08efd94e1338e.tar.gz
re3-c41239ed5e44cfd4f54d9478c1b08efd94e1338e.tar.bz2
re3-c41239ed5e44cfd4f54d9478c1b08efd94e1338e.tar.lz
re3-c41239ed5e44cfd4f54d9478c1b08efd94e1338e.tar.xz
re3-c41239ed5e44cfd4f54d9478c1b08efd94e1338e.tar.zst
re3-c41239ed5e44cfd4f54d9478c1b08efd94e1338e.zip
-rw-r--r--src/audio/AudioLogic.cpp16
-rw-r--r--src/audio/AudioManager.h4
2 files changed, 11 insertions, 9 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 0101d94f..4b232126 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -3865,7 +3865,7 @@ cAudioManager::SetupPedComments(cPedParams &params, uint16 sound)
break;
}
m_sQueueSample.m_nVolume = ComputeVolume(Vol, maxDist, m_sQueueSample.m_fDistance);
- pedComment.m_nProcess = 10;
+ pedComment.m_nLoadingTimeout = 10;
if (m_sQueueSample.m_nVolume > 0) {
pedComment.m_nEntityIndex = m_sQueueSample.m_nEntityIndex;
pedComment.m_vecPos = m_sQueueSample.m_vecPos;
@@ -3880,7 +3880,7 @@ cAudioManager::SetupPedComments(cPedParams &params, uint16 sound)
#ifdef GTA_PS2
else {
m_sQueueSample.m_nVolume = MAX_VOLUME;
- pedComment.m_nProcess = 40;
+ pedComment.m_nLoadingTimeout = 40;
}
#endif
}
@@ -6290,11 +6290,13 @@ cPedComments::Process()
if (m_nPedCommentCount[m_nActiveQueue]) {
sampleIndex = m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nSampleIndex;
- switch (SampleManager.IsPedCommentLoaded(sampleIndex)) // yes, this was a switch
+ switch (SampleManager.IsPedCommentLoaded(sampleIndex))
{
case LOADING_STATUS_NOT_LOADED:
SampleManager.LoadPedComment(sampleIndex);
- // BUG? no break, VC has break in here
+#ifdef GTA_PS2 // on PC ped comment is loaded at once
+ break;
+#endif
case LOADING_STATUS_LOADED:
AudioManager.m_sQueueSample.m_nEntityIndex = m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nEntityIndex;
AudioManager.m_sQueueSample.m_nCounter = 0;
@@ -6391,7 +6393,7 @@ cPedComments::Process()
if (CTimer::GetIsSlowMotionActive())
AudioManager.m_sQueueSample.m_nFrequency >>= 1;
#endif
- m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nProcess = -1;
+ m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nLoadingTimeout = -1;
AudioManager.AddSampleToRequestedQueue();
break;
case LOADING_STATUS_LOADING: break;
@@ -6408,8 +6410,8 @@ cPedComments::Process()
m_nActiveQueue = 0;
}
for (uint8 i = 0; i < m_nPedCommentCount[queue]; i++) {
- if (m_aPedCommentQueue[queue][m_aPedCommentOrderList[queue][i]].m_nProcess > 0) {
- m_aPedCommentQueue[queue][m_aPedCommentOrderList[queue][i]].m_nProcess--;
+ if (m_aPedCommentQueue[queue][m_aPedCommentOrderList[queue][i]].m_nLoadingTimeout > 0) {
+ m_aPedCommentQueue[queue][m_aPedCommentOrderList[queue][i]].m_nLoadingTimeout--;
Add(&m_aPedCommentQueue[queue][m_aPedCommentOrderList[queue][i]]);
}
}
diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h
index 70ced49a..79839871 100644
--- a/src/audio/AudioManager.h
+++ b/src/audio/AudioManager.h
@@ -96,7 +96,7 @@ public:
CVector m_vecPos;
float m_fDistance;
uint8 m_nVolume;
- int8 m_nProcess;
+ int8 m_nLoadingTimeout; // how many iterations we gonna wait until dropping the sample if it's still not loaded (only useful on PS2)
#if defined(EXTERNAL_3D_SOUND) && defined(FIX_BUGS)
uint8 m_nEmittingVolume;
#endif
@@ -116,7 +116,7 @@ public:
{
for (int i = 0; i < NUM_PED_COMMENTS_SLOTS; i++)
for (int j = 0; j < NUM_SOUND_QUEUES; j++) {
- m_aPedCommentQueue[j][i].m_nProcess = -1;
+ m_aPedCommentQueue[j][i].m_nLoadingTimeout = -1;
m_aPedCommentOrderList[j][i] = NUM_PED_COMMENTS_SLOTS;
}