diff --git a/project.hxp b/project.hxp index 658c29f1b..eb426fc8b 100644 --- a/project.hxp +++ b/project.hxp @@ -493,6 +493,13 @@ class Project extends HXProject */ static final FEATURE_VIDEO_SUBTITLES:FeatureFlag = "FEATURE_VIDEO_SUBTITLES"; + /** + * `-DFEATURE_DEBUG_DISPLAY` + * If this flag is enabled, the game will be able to show a framerate counter with the memory and current FPS + * This flag is disabled on non debug mobile builds + */ + static final FEATURE_DEBUG_DISPLAY:FeatureFlag = "FEATURE_DEBUG_DISPLAY"; + // // CONFIGURATION FUNCTIONS // @@ -892,6 +899,10 @@ class Project extends HXProject // It's kept off for desktop due to the low ASTC support on desktop GPUs (which seem to be only among Intergrated Graphics). FEATURE_COMPRESSED_TEXTURES.apply(this, isMobile() && isRelease() && !isIOSSimulator()); + // Turns the debug display off if you are on a non debug mobile build + // Desktop (Native and Web) always has it | Used for mobile debugging purposes + FEATURE_DEBUG_DISPLAY.apply(this, !isMobile() || FEATURE_DEBUG_FUNCTIONS.isEnabled(this)); + renderFlagsTable(); } diff --git a/source/funkin/Preferences.hx b/source/funkin/Preferences.hx index 664fb767e..92239f78f 100644 --- a/source/funkin/Preferences.hx +++ b/source/funkin/Preferences.hx @@ -137,14 +137,13 @@ class Preferences /** * If enabled, an FPS and memory counter will be displayed even if this is not a debug build. - * Always disabled on mobile. * @default `Off` */ public static var debugDisplay(get, set):DebugDisplayMode; static function get_debugDisplay():DebugDisplayMode { - #if mobile + #if !FEATURE_DEBUG_DISPLAY return DebugDisplayMode.Off; #end diff --git a/source/funkin/ui/options/PreferencesMenu.hx b/source/funkin/ui/options/PreferencesMenu.hx index a19d7bfe8..5e272974c 100644 --- a/source/funkin/ui/options/PreferencesMenu.hx +++ b/source/funkin/ui/options/PreferencesMenu.hx @@ -148,7 +148,7 @@ class PreferencesMenu extends Page createPrefItemCheckbox('Subtitles', 'When enabled, subtitles appear during some songs and cutscenes.', function(value:Bool):Void { Preferences.subtitles = value; }, Preferences.subtitles); - #if !mobile + #if FEATURE_DEBUG_DISPLAY // note: technically we can do DebugDisplayMode.Advanced => DebugDisplayMode.Advanced, etc. here, but that's a bit headache inducing. createPrefItemEnum('Debug Display', 'When enabled, FPS and other debug stats are displayed.', [ "Advanced" => DebugDisplayMode.Advanced, @@ -157,10 +157,11 @@ class PreferencesMenu extends Page ], (key:String, value:DebugDisplayMode) -> { Preferences.debugDisplay = value; }, Preferences.debugDisplay); - createPrefItemPercentage('Debug Display BG', "Adjust the debug display's background opacity.", function(value:Int):Void { Preferences.debugDisplayBGOpacity = value; }, Preferences.debugDisplayBGOpacity); + #end + #if !mobile createPrefItemCheckbox('Pause on Unfocus', 'When enabled, the game automatically pauses when losing focus.', function(value:Bool):Void { Preferences.autoPause = value; }, Preferences.autoPause);