summaryrefslogtreecommitdiffstats
path: root/src/render/Occlusion.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-19 10:23:08 +0200
committeraap <aap@papnet.eu>2020-05-19 10:23:08 +0200
commit62db8cd9b0030f042403e996b20c3ceca5cd4f7a (patch)
treea528e7b7f79e13a0e9915b67ab3448915391037c /src/render/Occlusion.cpp
parentsome less certainly fps fixes (diff)
downloadre3-62db8cd9b0030f042403e996b20c3ceca5cd4f7a.tar
re3-62db8cd9b0030f042403e996b20c3ceca5cd4f7a.tar.gz
re3-62db8cd9b0030f042403e996b20c3ceca5cd4f7a.tar.bz2
re3-62db8cd9b0030f042403e996b20c3ceca5cd4f7a.tar.lz
re3-62db8cd9b0030f042403e996b20c3ceca5cd4f7a.tar.xz
re3-62db8cd9b0030f042403e996b20c3ceca5cd4f7a.tar.zst
re3-62db8cd9b0030f042403e996b20c3ceca5cd4f7a.zip
Diffstat (limited to '')
-rw-r--r--src/render/Occlusion.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/render/Occlusion.cpp b/src/render/Occlusion.cpp
index b33b1d01..1c4e4266 100644
--- a/src/render/Occlusion.cpp
+++ b/src/render/Occlusion.cpp
@@ -2,6 +2,42 @@
#include "Occlusion.h"
+int32 COcclusion::NumOccludersOnMap;
+int16 COcclusion::FarAwayList;
+int16 COcclusion::NearbyList;
+int16 COcclusion::ListWalkThroughFA;
+int16 COcclusion::PreviousListWalkThroughFA;
+COccluder COcclusion::aOccluders[NUMOCCLUSIONVOLUMES];
+
+void
+COcclusion::Init(void)
+{
+ NumOccludersOnMap = 0;
+ FarAwayList = -1;
+ NearbyList = -1;
+ ListWalkThroughFA = -1;
+ PreviousListWalkThroughFA = -1;
+}
+
+void
+COcclusion::AddOne(float x, float y, float z, float width, float length, float height, float angle)
+{
+ if(NumOccludersOnMap >= NUMOCCLUSIONVOLUMES)
+ return;
+
+ aOccluders[NumOccludersOnMap].x = x;
+ aOccluders[NumOccludersOnMap].y = y;
+ aOccluders[NumOccludersOnMap].z = z;
+ aOccluders[NumOccludersOnMap].width = width;
+ aOccluders[NumOccludersOnMap].length = length;
+ aOccluders[NumOccludersOnMap].height = height;
+ while(angle < 0.0f) angle += 360.0f;
+ while(angle > 360.0f) angle -= 360.0f;
+ aOccluders[NumOccludersOnMap].angle = angle * UINT16_MAX/360.0f;
+ aOccluders[NumOccludersOnMap].listIndex = FarAwayList;
+ FarAwayList = NumOccludersOnMap++;
+}
+
void
COcclusion::ProcessBeforeRendering(void)
{