summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-05-02 15:45:24 +0200
committerSergeanur <s.anureev@yandex.ua>2020-05-02 15:45:24 +0200
commit853dab23f53418a12218df1ac7a3c14c75beb2ee (patch)
treeac6970b7fb77452d2789606af917c2114a81cbf4
parentAudioManager.cpp autoformat (diff)
downloadre3-853dab23f53418a12218df1ac7a3c14c75beb2ee.tar
re3-853dab23f53418a12218df1ac7a3c14c75beb2ee.tar.gz
re3-853dab23f53418a12218df1ac7a3c14c75beb2ee.tar.bz2
re3-853dab23f53418a12218df1ac7a3c14c75beb2ee.tar.lz
re3-853dab23f53418a12218df1ac7a3c14c75beb2ee.tar.xz
re3-853dab23f53418a12218df1ac7a3c14c75beb2ee.tar.zst
re3-853dab23f53418a12218df1ac7a3c14c75beb2ee.zip
-rw-r--r--src/audio/AudioManager.cpp75
1 files changed, 31 insertions, 44 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index e7a7a9b4..7e177226 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -9694,54 +9694,41 @@ cAudioManager::UpdateReflections()
CColPoint colpoint;
CEntity *ent;
- if (m_FrameCounter & 7) {
- if (((uint8)m_FrameCounter + 1) & 7) {
- if (((uint8)m_FrameCounter + 2) & 7) {
- if (((uint8)m_FrameCounter + 3) & 7) {
- if (!(((uint8)m_FrameCounter + 4) & 7)) {
- m_avecReflectionsPos[4] = camPos;
- m_avecReflectionsPos[4].z += 50.f;
- if (CWorld::ProcessVerticalLine(camPos, m_avecReflectionsPos[4].z, colpoint, ent, true, false, false, false, true, false, nil)) {
- m_afReflectionsDistances[4] = colpoint.point.z - camPos.z;
- } else {
- m_afReflectionsDistances[4] = 50.0f;
- }
- }
- } else {
- m_avecReflectionsPos[3] = camPos;
- m_avecReflectionsPos[3].x += 50.f;
- if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[3], colpoint, ent, true, false, false, true, false, true, true)) {
- m_afReflectionsDistances[3] = Distance(camPos, colpoint.point);
- } else {
- m_afReflectionsDistances[3] = 50.0f;
- }
- }
- } else {
- m_avecReflectionsPos[2] = camPos;
- m_avecReflectionsPos[2].x -= 50.f;
- if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[2], colpoint, ent, true, false, false, true, false, true, true)) {
- m_afReflectionsDistances[2] = Distance(camPos, colpoint.point);
- } else {
- m_afReflectionsDistances[2] = 50.0f;
- }
- }
- } else {
- m_avecReflectionsPos[1] = camPos;
- m_avecReflectionsPos[1].y -= 50.f;
- if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[1], colpoint, ent, true, false, false, true, false, true, true)) {
- m_afReflectionsDistances[1] = Distance(camPos, colpoint.point);
- } else {
- m_afReflectionsDistances[1] = 50.0f;
- }
- }
- } else {
+ if (m_FrameCounter % 8 == 0) {
m_avecReflectionsPos[0] = camPos;
m_avecReflectionsPos[0].y += 50.f;
- if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[0], colpoint, ent, true, false, false, true, false, true, true)) {
+ if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[0], colpoint, ent, true, false, false, true, false, true, true))
m_afReflectionsDistances[0] = Distance(camPos, colpoint.point);
- } else {
+ else
m_afReflectionsDistances[0] = 50.0f;
- }
+ } else if ((m_FrameCounter + 1) % 8 == 0) {
+ 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))
+ m_afReflectionsDistances[1] = Distance(camPos, colpoint.point);
+ else
+ m_afReflectionsDistances[1] = 50.0f;
+ } else if ((m_FrameCounter + 2) % 8 == 0) {
+ 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))
+ m_afReflectionsDistances[2] = Distance(camPos, colpoint.point);
+ else
+ m_afReflectionsDistances[2] = 50.0f;
+ } else if ((m_FrameCounter + 3) % 8 == 0) {
+ 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))
+ m_afReflectionsDistances[3] = Distance(camPos, colpoint.point);
+ else
+ m_afReflectionsDistances[3] = 50.0f;
+ } else if ((m_FrameCounter + 4) % 8 == 0) {
+ 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))
+ m_afReflectionsDistances[4] = colpoint.point.z - camPos.z;
+ else
+ m_afReflectionsDistances[4] = 50.0f;
}
}