From ac2f91f828da06ed3f6ddac051c68a62b2d5c3af Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Wed, 1 Apr 2026 01:11:13 +0200 Subject: [PATCH] Don't render HUD map if invisible Very nice on debug builds since you can avoid huge FPS drops by hiding the map now. --- src/d/d_meter_map.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/d/d_meter_map.cpp b/src/d/d_meter_map.cpp index 8f31ef3e21..7e55d899fd 100644 --- a/src/d/d_meter_map.cpp +++ b/src/d/d_meter_map.cpp @@ -593,6 +593,14 @@ void dMeterMap_c::_draw() { dComIfGd_set2DOpa(this); } #else +#if TARGET_PC + // Optimization: don't draw map if it's off-screen/invisible. + // Especially useful in debug builds on Hyrule field etc., it's slow! + if ((!mMapIsInside && mSlidePositionOffset == getDispPosOutSide_OffsetX()) || mMapAlpha == 0) { + return; + } +#endif + mMap->_draw(); dComIfGd_set2DOpa(this); #endif