summaryrefslogtreecommitdiffstats
path: root/src/rw
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-10 10:04:20 +0200
committeraap <aap@papnet.eu>2020-05-10 10:04:20 +0200
commite9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274 (patch)
treebab6161fcd3d49bd6805619cb304d6958d1147a1 /src/rw
parentMerge pull request #528 from Nick007J/miami (diff)
downloadre3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.tar
re3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.tar.gz
re3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.tar.bz2
re3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.tar.lz
re3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.tar.xz
re3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.tar.zst
re3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.zip
Diffstat (limited to 'src/rw')
-rw-r--r--src/rw/VisibilityPlugins.cpp19
-rw-r--r--src/rw/VisibilityPlugins.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index 14f68e52..93a478e5 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -218,6 +218,25 @@ CVisibilityPlugins::RenderAlphaAtomic(RpAtomic *atomic, int alpha)
return atomic;
}
+//--MIAMI: done
+RpAtomic*
+CVisibilityPlugins::RenderWeaponCB(RpAtomic *atomic)
+{
+ RwMatrix *m;
+ RwV3d view;
+ float maxdist, distsq;
+ CSimpleModelInfo *mi;
+
+ mi = GetAtomicModelInfo(atomic);
+ m = RwFrameGetLTM(RpAtomicGetFrame(atomic));
+ RwV3dSub(&view, RwMatrixGetPos(m), ms_pCameraPosn);
+ maxdist = mi->GetLodDistance(0);
+ distsq = RwV3dDotProduct(&view, &view);
+ if(distsq < maxdist*maxdist)
+ AtomicDefaultRenderCallBack(atomic);
+ return atomic;
+}
+
RpAtomic*
CVisibilityPlugins::RenderFadingAtomic(RpAtomic *atomic, float camdist)
{
diff --git a/src/rw/VisibilityPlugins.h b/src/rw/VisibilityPlugins.h
index b367d7ee..e2fc4d19 100644
--- a/src/rw/VisibilityPlugins.h
+++ b/src/rw/VisibilityPlugins.h
@@ -46,6 +46,7 @@ public:
static RpAtomic *RenderWheelAtomicCB(RpAtomic *atomic);
static RpAtomic *RenderObjNormalAtomic(RpAtomic *atomic);
static RpAtomic *RenderAlphaAtomic(RpAtomic *atomic, int alpha);
+ static RpAtomic *RenderWeaponCB(RpAtomic *atomic);
static RpAtomic *RenderFadingAtomic(RpAtomic *atm, float dist);
static RpAtomic *RenderVehicleHiDetailCB(RpAtomic *atomic);