summaryrefslogtreecommitdiffstats
path: root/src/audio
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-08-16 08:59:08 +0200
committerSergeanur <s.anureev@yandex.ua>2021-08-16 08:59:08 +0200
commitab03fbb6c83ad7f9afeb287e0898fd05805ec565 (patch)
tree47dcf0e520ae3d55344d558e1ce16b373ef2e480 /src/audio
parentsome CAutomobile fixes (diff)
downloadre3-ab03fbb6c83ad7f9afeb287e0898fd05805ec565.tar
re3-ab03fbb6c83ad7f9afeb287e0898fd05805ec565.tar.gz
re3-ab03fbb6c83ad7f9afeb287e0898fd05805ec565.tar.bz2
re3-ab03fbb6c83ad7f9afeb287e0898fd05805ec565.tar.lz
re3-ab03fbb6c83ad7f9afeb287e0898fd05805ec565.tar.xz
re3-ab03fbb6c83ad7f9afeb287e0898fd05805ec565.tar.zst
re3-ab03fbb6c83ad7f9afeb287e0898fd05805ec565.zip
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/AudioLogic.cpp4
-rw-r--r--src/audio/AudioManager.cpp11
2 files changed, 10 insertions, 5 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 2a683409..9e36f709 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -7722,7 +7722,7 @@ cAudioManager::ProcessWeather(int32 id)
vol += 40;
}
m_sQueueSample.m_nVolume = vol;
- if (TheCamera.SoundDistUp < 20.f)
+ if (TheCamera.SoundDistUp < 20.0f)
m_sQueueSample.m_nVolume <<= 1;
if (iSound == 4)
iSound = 0;
@@ -7741,7 +7741,7 @@ cAudioManager::ProcessWeather(int32 id)
if (CWeather::Rain > 0.0f && (!CCullZones::CamNoRain() || !CCullZones::PlayerNoRain())) {
m_sQueueSample.m_nSampleIndex = SFX_RAIN;
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RAIN);
- m_sQueueSample.m_nVolume = (int32)(25.f * CWeather::Rain);
+ m_sQueueSample.m_nVolume = (uint8)(25.0f * CWeather::Rain);
m_sQueueSample.m_nCounter = 4;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_nReleasingVolumeModificator = 0;
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index 78b56550..9b1337c9 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -694,18 +694,20 @@ cAudioManager::AddReflectionsToRequestedQueue()
void
cAudioManager::UpdateReflections()
{
- const CVector &camPos = TheCamera.GetPosition();
+ CVector camPos;
CColPoint colpoint;
CEntity *ent;
if (m_FrameCounter % 8 == 0) {
+ camPos = TheCamera.GetPosition();
m_avecReflectionsPos[0] = camPos;
- m_avecReflectionsPos[0].y += 50.f;
+ m_avecReflectionsPos[0].y += 50.0f;
if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[0], colpoint, ent, true, false, false, true, false, true, true))
m_afReflectionsDistances[0] = Distance(camPos, colpoint.point);
else
m_afReflectionsDistances[0] = 50.0f;
} else if ((m_FrameCounter + 1) % 8 == 0) {
+ camPos = TheCamera.GetPosition();
m_avecReflectionsPos[1] = camPos;
m_avecReflectionsPos[1].y -= 50.0f;
if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[1], colpoint, ent, true, false, false, true, false, true, true))
@@ -713,6 +715,7 @@ cAudioManager::UpdateReflections()
else
m_afReflectionsDistances[1] = 50.0f;
} else if ((m_FrameCounter + 2) % 8 == 0) {
+ camPos = TheCamera.GetPosition();
m_avecReflectionsPos[2] = camPos;
m_avecReflectionsPos[2].x -= 50.0f;
if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[2], colpoint, ent, true, false, false, true, false, true, true))
@@ -720,6 +723,7 @@ cAudioManager::UpdateReflections()
else
m_afReflectionsDistances[2] = 50.0f;
} else if ((m_FrameCounter + 3) % 8 == 0) {
+ camPos = TheCamera.GetPosition();
m_avecReflectionsPos[3] = camPos;
m_avecReflectionsPos[3].x += 50.0f;
if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[3], colpoint, ent, true, false, false, true, false, true, true))
@@ -727,6 +731,7 @@ cAudioManager::UpdateReflections()
else
m_afReflectionsDistances[3] = 50.0f;
} else if ((m_FrameCounter + 4) % 8 == 0) {
+ camPos = TheCamera.GetPosition();
m_avecReflectionsPos[4] = camPos;
m_avecReflectionsPos[4].z += 50.0f;
if (CWorld::ProcessVerticalLine(camPos, m_avecReflectionsPos[4].z, colpoint, ent, true, false, false, false, true, false, nil))
@@ -763,7 +768,7 @@ cAudioManager::AddReleasingSounds()
}
}
if (!toProcess[i]) {
- if (sample.m_nCounter <= 255 || !sample.m_nLoopsRemaining) {
+ if (sample.m_nCounter <= 255 || sample.m_nLoopsRemaining == 0) {
if (sample.m_nReleasingVolumeDivider == 0)
continue;
if (sample.m_nLoopCount == 0) {