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.cpp54
1 files changed, 28 insertions, 26 deletions
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index f8b1f6b2..def3b23e 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -11,32 +11,24 @@
#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)
@@ -603,6 +595,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;