Change to use pattern matching

This commit is contained in:
teinarss
2021-02-28 19:00:32 +01:00
committed by reaperrr
parent 7c0e4b25ae
commit d60c05eff3
35 changed files with 63 additions and 122 deletions

View File

@@ -354,14 +354,13 @@ namespace OpenRA.Platforms.Default
public void SetHardwareCursor(IHardwareCursor cursor)
{
VerifyThreadAffinity();
var c = cursor as Sdl2HardwareCursor;
if (c == null)
SDL.SDL_ShowCursor((int)SDL.SDL_bool.SDL_FALSE);
else
if (cursor is Sdl2HardwareCursor c)
{
SDL.SDL_ShowCursor((int)SDL.SDL_bool.SDL_TRUE);
SDL.SDL_SetCursor(c.Cursor);
}
else
SDL.SDL_ShowCursor((int)SDL.SDL_bool.SDL_FALSE);
}
public void SetRelativeMouseMode(bool mode)