summaryrefslogtreecommitdiffstats
path: root/src/rw/VisibilityPlugins.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rw/VisibilityPlugins.cpp')
-rw-r--r--src/rw/VisibilityPlugins.cpp63
1 files changed, 35 insertions, 28 deletions
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index f8b1f6b2..5438ed0f 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -11,40 +11,37 @@
#define FADE_DISTANCE 20.0f
-/*
-CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaList;
-CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaEntityList;
-
-int32 CVisibilityPlugins::ms_atomicPluginOffset = -1;
-int32 CVisibilityPlugins::ms_framePluginOffset = -1;
-int32 CVisibilityPlugins::ms_clumpPluginOffset = -1;
-*/
-CLinkList<CVisibilityPlugins::AlphaObjectInfo> &CVisibilityPlugins::m_alphaList = *(CLinkList<CVisibilityPlugins::AlphaObjectInfo>*)0x8F42E4;
-CLinkList<CVisibilityPlugins::AlphaObjectInfo> &CVisibilityPlugins::m_alphaEntityList = *(CLinkList<CVisibilityPlugins::AlphaObjectInfo>*)0x943084;
-
-int32 &CVisibilityPlugins::ms_atomicPluginOffset = *(int32*)0x600124;
-int32 &CVisibilityPlugins::ms_framePluginOffset = *(int32*)0x600128;
-int32 &CVisibilityPlugins::ms_clumpPluginOffset = *(int32*)0x60012C;
-
-RwCamera *&CVisibilityPlugins::ms_pCamera = *(RwCamera**)0x8F2514;
-RwV3d *&CVisibilityPlugins::ms_pCameraPosn = *(RwV3d**)0x8F6270;
-float &CVisibilityPlugins::ms_cullCompsDist = *(float*)0x8F2BC4;
-float &CVisibilityPlugins::ms_vehicleLod0Dist = *(float*)0x885B28;
-float &CVisibilityPlugins::ms_vehicleLod1Dist = *(float*)0x885B30;
-float &CVisibilityPlugins::ms_vehicleFadeDist = *(float*)0x8E28B4;
-float &CVisibilityPlugins::ms_bigVehicleLod0Dist = *(float*)0x8E2A84;
-float &CVisibilityPlugins::ms_bigVehicleLod1Dist = *(float*)0x8E2A8C;
-float &CVisibilityPlugins::ms_pedLod0Dist = *(float*)0x8F2BD4;
-float &CVisibilityPlugins::ms_pedLod1Dist = *(float*)0x8F2BD8;
-float &CVisibilityPlugins::ms_pedFadeDist = *(float*)0x8E2C34;
+CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaList;// = *(CLinkList<CVisibilityPlugins::AlphaObjectInfo>*)0x8F42E4;
+CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaEntityList;// = *(CLinkList<CVisibilityPlugins::AlphaObjectInfo>*)0x943084;
+
+int32 CVisibilityPlugins::ms_atomicPluginOffset = -1;// = *(int32*)0x600124;
+int32 CVisibilityPlugins::ms_framePluginOffset = -1;// = *(int32*)0x600128;
+int32 CVisibilityPlugins::ms_clumpPluginOffset = -1;// = *(int32*)0x60012C;
+
+RwCamera *CVisibilityPlugins::ms_pCamera;// = *(RwCamera**)0x8F2514;
+RwV3d *CVisibilityPlugins::ms_pCameraPosn;// = *(RwV3d**)0x8F6270;
+float CVisibilityPlugins::ms_cullCompsDist;// = *(float*)0x8F2BC4;
+float CVisibilityPlugins::ms_vehicleLod0Dist;// = *(float*)0x885B28;
+float CVisibilityPlugins::ms_vehicleLod1Dist;// = *(float*)0x885B30;
+float CVisibilityPlugins::ms_vehicleFadeDist;// = *(float*)0x8E28B4;
+float CVisibilityPlugins::ms_bigVehicleLod0Dist;// = *(float*)0x8E2A84;
+float CVisibilityPlugins::ms_bigVehicleLod1Dist;// = *(float*)0x8E2A8C;
+float CVisibilityPlugins::ms_pedLod0Dist;// = *(float*)0x8F2BD4;
+float CVisibilityPlugins::ms_pedLod1Dist;// = *(float*)0x8F2BD8;
+float CVisibilityPlugins::ms_pedFadeDist;// = *(float*)0x8E2C34;
void
CVisibilityPlugins::Initialise(void)
{
- m_alphaList.Init(20);
+ m_alphaList.Init(NUMALPHALIST);
m_alphaList.head.item.sort = 0.0f;
m_alphaList.tail.item.sort = 100000000.0f;
- m_alphaEntityList.Init(150);
+#ifdef ASPECT_RATIO_SCALE
+ // default 150 if not enough for bigger FOVs
+ m_alphaEntityList.Init(NUMALPHAENTITYLIST * 3);
+#else
+ m_alphaEntityList.Init(NUMALPHAENTITYLIST);
+#endif // ASPECT_RATIO_SCALE
m_alphaEntityList.head.item.sort = 0.0f;
m_alphaEntityList.tail.item.sort = 100000000.0f;
}
@@ -603,6 +600,16 @@ CVisibilityPlugins::DefaultVisibilityCB(RpClump *clump)
}
bool
+CVisibilityPlugins::MloVisibilityCB(RpClump *clump)
+{
+ RwFrame *frame = RpClumpGetFrame(clump);
+ CMloModelInfo *modelInfo = (CMloModelInfo*)GetFrameHierarchyId(frame);
+ if (sq(modelInfo->field_34) < GetDistanceSquaredFromCamera(frame))
+ return false;
+ return CVisibilityPlugins::FrustumSphereCB(clump);
+}
+
+bool
CVisibilityPlugins::FrustumSphereCB(RpClump *clump)
{
RwSphere sphere;