summaryrefslogtreecommitdiffstats
path: root/src/rw
diff options
context:
space:
mode:
Diffstat (limited to 'src/rw')
-rw-r--r--src/rw/VisibilityPlugins.cpp20
-rw-r--r--src/rw/VisibilityPlugins.h3
2 files changed, 23 insertions, 0 deletions
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index 916696de..32461d1c 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -2,6 +2,7 @@
#include "RwHelper.h"
#include "templates.h"
+#include "main.h"
#include "Entity.h"
#include "ModelInfo.h"
#include "Lights.h"
@@ -14,6 +15,9 @@
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaList;
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaEntityList;
+#ifdef NEW_RENDERER
+CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaBuildingList;
+#endif
int32 CVisibilityPlugins::ms_atomicPluginOffset = -1;
int32 CVisibilityPlugins::ms_framePluginOffset = -1;
@@ -158,6 +162,12 @@ CVisibilityPlugins::Initialise(void)
#endif // ASPECT_RATIO_SCALE
m_alphaEntityList.head.item.sort = 0.0f;
m_alphaEntityList.tail.item.sort = 100000000.0f;
+
+#ifdef NEW_RENDERER
+ m_alphaBuildingList.Init(NUMALPHAENTITYLIST);
+ m_alphaBuildingList.head.item.sort = 0.0f;
+ m_alphaBuildingList.tail.item.sort = 100000000.0f;
+#endif
}
void
@@ -165,12 +175,18 @@ CVisibilityPlugins::Shutdown(void)
{
m_alphaList.Shutdown();
m_alphaEntityList.Shutdown();
+#ifdef NEW_RENDERER
+ m_alphaBuildingList.Shutdown();
+#endif
}
void
CVisibilityPlugins::InitAlphaEntityList(void)
{
m_alphaEntityList.Clear();
+#ifdef NEW_RENDERER
+ m_alphaBuildingList.Clear();
+#endif
}
bool
@@ -179,6 +195,10 @@ CVisibilityPlugins::InsertEntityIntoSortedList(CEntity *e, float dist)
AlphaObjectInfo item;
item.entity = e;
item.sort = dist;
+#ifdef NEW_RENDERER
+ if(gbNewRenderer && e->IsBuilding())
+ return !!m_alphaBuildingList.InsertSorted(item);
+#endif
bool ret = !!m_alphaEntityList.InsertSorted(item);
// if(!ret)
// printf("list full %d\n", m_alphaEntityList.Count());
diff --git a/src/rw/VisibilityPlugins.h b/src/rw/VisibilityPlugins.h
index 0721dfcc..f092de5a 100644
--- a/src/rw/VisibilityPlugins.h
+++ b/src/rw/VisibilityPlugins.h
@@ -22,6 +22,9 @@ public:
static CLinkList<AlphaObjectInfo> m_alphaList;
static CLinkList<AlphaObjectInfo> m_alphaEntityList;
+#ifdef NEW_RENDERER
+ static CLinkList<AlphaObjectInfo> m_alphaBuildingList;
+#endif
static RwCamera *ms_pCamera;
static RwV3d *ms_pCameraPosn;
static float ms_cullCompsDist;