New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix FrameStatisticsViaTouch
to work as described in the wiki
#6040
Conversation
Why would we want only one of four boolean envvars to work like this? |
If you're commenting on the Would having a helper function make the default more clear? bool ParseBooleanEnvironmentVariable(string name, bool defaultValue) |
I guess I partially misunderstood what this was going for, but this implementation doesn't seem to match the wiki either, since this 100% should not be default-enabled in release builds, which it would be right now, because: osu-framework/osu.Framework/Game.cs Lines 269 to 279 in 0bf4656
while the wiki says:
If you're angling android for this, I'd rather just finally fix android debug builds not properly being marked as debug builds. |
It seems you're looking at some other branch, I've changed the conditional to
Completely forgot that |
@@ -23,7 +23,7 @@ static FrameworkEnvironment() | |||
StartupExecutionMode = Enum.TryParse<ExecutionMode>(Environment.GetEnvironmentVariable("OSU_EXECUTION_MODE"), true, out var mode) ? mode : null; | |||
NoTestTimeout = Environment.GetEnvironmentVariable("OSU_TESTS_NO_TIMEOUT") == "1"; | |||
ForceTestGC = Environment.GetEnvironmentVariable("OSU_TESTS_FORCED_GC") == "1"; | |||
FrameStatisticsViaTouch = Environment.GetEnvironmentVariable("OSU_FRAME_STATISTICS_VIA_TOUCH") == "1"; | |||
FrameStatisticsViaTouch = Environment.GetEnvironmentVariable("OSU_FRAME_STATISTICS_VIA_TOUCH") != "0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get that this is flipping the default, but it reads really awkwardly. I'd prefer leaving the comparison as =="1"
but adding a pre-check for empty string / null. Or something else that isn't this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably okay
https://github.com/ppy/osu-framework/wiki/Environment-variables#osu_frame_statistics_via_touch
I think it makes more sense to have it as described in the wiki. A hybrid solution would be to default to enabled on debug, and disabled on release (the envvar would always override the default in the case).
Currently there's no way to disable touch frame statistics in debug builds (one can only enable them in release builds).