Debug Display on Mobile Debug Builds
This commit is contained in:
+11
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ class PreferencesMenu extends Page<OptionsState.OptionsMenuPageName>
|
||||
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<OptionsState.OptionsMenuPageName>
|
||||
], (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);
|
||||
|
||||
Reference in New Issue
Block a user