Skip to content

Commit

Permalink
Merge branch 'master' into path-approximation
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach authored Nov 13, 2023
2 parents ef74d57 + 5c5c6c5 commit aefd351
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion osu.Framework.Templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Templates to use when starting off with osu!framework. Create a fully-testable,
```bash
# install (or update) template package.
# this only needs to be done once
dotnet new install ppy.osu.Framework.Templates
dotnet new -i ppy.osu.Framework.Templates

## IMPORTANT: Do not use spaces or hyphens in your project name for the following commands.
## This does not play nice with the templating system.
Expand Down
23 changes: 19 additions & 4 deletions osu.Framework/FrameworkEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public static class FrameworkEnvironment
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";
NoTestTimeout = parseBool(Environment.GetEnvironmentVariable("OSU_TESTS_NO_TIMEOUT")) ?? false;
ForceTestGC = parseBool(Environment.GetEnvironmentVariable("OSU_TESTS_FORCED_GC")) ?? false;
FrameStatisticsViaTouch = parseBool(Environment.GetEnvironmentVariable("OSU_FRAME_STATISTICS_VIA_TOUCH")) ?? true;
PreferredGraphicsSurface = Enum.TryParse<GraphicsSurfaceType>(Environment.GetEnvironmentVariable("OSU_GRAPHICS_SURFACE"), true, out var surface) ? surface : null;
PreferredGraphicsRenderer = Environment.GetEnvironmentVariable("OSU_GRAPHICS_RENDERER")?.ToLowerInvariant();

Expand All @@ -33,7 +33,22 @@ static FrameworkEnvironment()
if (int.TryParse(Environment.GetEnvironmentVariable("OSU_GRAPHICS_STAGING_BUFFER_TYPE"), out int stagingBufferImplementation))
StagingBufferType = stagingBufferImplementation;

NoStructuredBuffers = Environment.GetEnvironmentVariable("OSU_GRAPHICS_NO_SSBO") == "1";
NoStructuredBuffers = parseBool(Environment.GetEnvironmentVariable("OSU_GRAPHICS_NO_SSBO")) ?? false;
}

private static bool? parseBool(string? value)
{
switch (value)
{
case "0":
return false;

case "1":
return true;

default:
return bool.TryParse(value, out bool b) ? b : null;
}
}
}
}
2 changes: 1 addition & 1 deletion osu.Framework/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ protected override void LoadComplete()

FrameStatistics.BindValueChanged(e => performanceOverlay.State = e.NewValue, true);

if (FrameworkEnvironment.FrameStatisticsViaTouch || DebugUtils.IsDebugBuild)
if (FrameworkEnvironment.FrameStatisticsViaTouch && DebugUtils.IsDebugBuild)
{
base.AddInternal(new FrameStatisticsTouchReceptor(this)
{
Expand Down
3 changes: 2 additions & 1 deletion osu.Framework/Platform/SDL2Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ public virtual void Create()
SDL.SDL_SetHint(SDL.SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "1");
SDL.SDL_SetHint(SDL.SDL_HINT_IME_SHOW_UI, "1");
SDL.SDL_SetHint(SDL.SDL_HINT_MOUSE_RELATIVE_MODE_CENTER, "0");
SDL.SDL_SetHint(SDL.SDL_HINT_TOUCH_MOUSE_EVENTS, "0");
SDL.SDL_SetHint(SDL.SDL_HINT_TOUCH_MOUSE_EVENTS, "0"); // disable touch events generating synthetic mouse events on desktop platforms
SDL.SDL_SetHint(SDL.SDL_HINT_MOUSE_TOUCH_EVENTS, "0"); // disable mouse events generating synthetic touch events on mobile platforms

// we want text input to only be active when SDL2DesktopWindowTextInput is active.
// SDL activates it by default on some platforms: https://github.com/libsdl-org/SDL/blob/release-2.0.16/src/video/SDL_video.c#L573-L582
Expand Down

0 comments on commit aefd351

Please sign in to comment.