summaryrefslogtreecommitdiffstats
path: root/src/rw
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-01-25 10:30:34 +0100
committerGitHub <noreply@github.com>2021-01-25 10:30:34 +0100
commitd6544933aaa391072178532dbb6872d0e3c479f8 (patch)
tree8d924704b6f622bb50275ca1565b55a51e8cfb62 /src/rw
parentAdd cmake option for sanitizers (diff)
parentCVehicleModelInfo (diff)
downloadre3-d6544933aaa391072178532dbb6872d0e3c479f8.tar
re3-d6544933aaa391072178532dbb6872d0e3c479f8.tar.gz
re3-d6544933aaa391072178532dbb6872d0e3c479f8.tar.bz2
re3-d6544933aaa391072178532dbb6872d0e3c479f8.tar.lz
re3-d6544933aaa391072178532dbb6872d0e3c479f8.tar.xz
re3-d6544933aaa391072178532dbb6872d0e3c479f8.tar.zst
re3-d6544933aaa391072178532dbb6872d0e3c479f8.zip
Diffstat (limited to 'src/rw')
-rw-r--r--src/rw/VisibilityPlugins.cpp42
-rw-r--r--src/rw/VisibilityPlugins.h3
2 files changed, 45 insertions, 0 deletions
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index c50531c6..754c8778 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -455,6 +455,14 @@ CVisibilityPlugins::RenderVehicleHiDetailAlphaCB_BigVehicle(RpAtomic *atomic)
RpAtomic*
CVisibilityPlugins::RenderVehicleHiDetailCB_Boat(RpAtomic *atomic)
{
+ if(DistToCameraSq < ms_vehicleLod0Dist)
+ RENDERCALLBACK(atomic);
+ return atomic;
+}
+
+RpAtomic*
+CVisibilityPlugins::RenderVehicleHiDetailCB_Boat_Far(RpAtomic *atomic)
+{
if(DistToCameraSq < ms_bigVehicleLod1Dist)
RENDERCALLBACK(atomic);
return atomic;
@@ -474,6 +482,40 @@ CVisibilityPlugins::RenderVehicleHiDetailAlphaCB_Boat(RpAtomic *atomic)
}
RpAtomic*
+CVisibilityPlugins::RenderVehicleLoDetailCB_Boat(RpAtomic *atomic)
+{
+ RpClump *clump;
+ int32 alpha;
+
+ clump = RpAtomicGetClump(atomic);
+ if(DistToCameraSq >= ms_vehicleLod0Dist){
+ alpha = GetClumpAlpha(clump);
+ if(alpha == 255)
+ RENDERCALLBACK(atomic);
+ else
+ RenderAlphaAtomic(atomic, alpha);
+ }
+ return atomic;
+}
+
+RpAtomic*
+CVisibilityPlugins::RenderVehicleLoDetailCB_Boat_Far(RpAtomic *atomic)
+{
+ RpClump *clump;
+ int32 alpha;
+
+ clump = RpAtomicGetClump(atomic);
+ if(DistToCameraSq >= ms_bigVehicleLod1Dist){
+ alpha = GetClumpAlpha(clump);
+ if(alpha == 255)
+ RENDERCALLBACK(atomic);
+ else
+ RenderAlphaAtomic(atomic, alpha);
+ }
+ return atomic;
+}
+
+RpAtomic*
CVisibilityPlugins::RenderVehicleLowDetailCB_BigVehicle(RpAtomic *atomic)
{
RwFrame *clumpframe;
diff --git a/src/rw/VisibilityPlugins.h b/src/rw/VisibilityPlugins.h
index 13365c7a..f188096c 100644
--- a/src/rw/VisibilityPlugins.h
+++ b/src/rw/VisibilityPlugins.h
@@ -61,6 +61,9 @@ public:
static RpAtomic *RenderVehicleHiDetailAlphaCB_BigVehicle(RpAtomic *atomic);
static RpAtomic *RenderVehicleHiDetailCB_Boat(RpAtomic *atomic);
static RpAtomic *RenderVehicleHiDetailAlphaCB_Boat(RpAtomic *atomic);
+ static RpAtomic *RenderVehicleHiDetailCB_Boat_Far(RpAtomic *atomic);
+ static RpAtomic *RenderVehicleLoDetailCB_Boat(RpAtomic *atomic);
+ static RpAtomic *RenderVehicleLoDetailCB_Boat_Far(RpAtomic *atomic);
static RpAtomic *RenderVehicleLowDetailCB_BigVehicle(RpAtomic *atomic);
static RpAtomic *RenderVehicleLowDetailAlphaCB_BigVehicle(RpAtomic *atomic);
static RpAtomic *RenderVehicleReallyLowDetailCB(RpAtomic *atomic);