From 08ae74293d69fe20cf51b98740fdd1d99335e3be Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 1 Apr 2017 19:50:07 +0100 Subject: [PATCH] Remove a few more SDL calls from core library --- src/openrct2/Context.cpp | 6 +++--- src/openrct2/peep/staff.c | 8 +++++++- src/openrct2/platform/shared.c | 6 ------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 244749363b..be0c330b48 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -420,11 +420,11 @@ namespace OpenRCT2 void RunFixedFrame() { _uncapTick = 0; - uint32 currentTick = SDL_GetTicks(); + uint32 currentTick = platform_get_ticks(); uint32 ticksElapsed = currentTick - _lastTick; if (ticksElapsed < UPDATE_TIME_MS) { - SDL_Delay(UPDATE_TIME_MS - ticksElapsed); + platform_sleep(UPDATE_TIME_MS - ticksElapsed); _lastTick += UPDATE_TIME_MS; } else @@ -441,7 +441,7 @@ namespace OpenRCT2 void RunVariableFrame() { - uint32 currentTick = SDL_GetTicks(); + uint32 currentTick = platform_get_ticks(); if (_uncapTick == 0) { _uncapTick = currentTick; diff --git a/src/openrct2/peep/staff.c b/src/openrct2/peep/staff.c index 1fcc42e2f2..566b699f68 100644 --- a/src/openrct2/peep/staff.c +++ b/src/openrct2/peep/staff.c @@ -15,7 +15,9 @@ #pragma endregion #include "../config/Config.h" +#include "../Context.h" #include "../game.h" +#include "../input.h" #include "../interface/viewport.h" #include "../localisation/date.h" #include "../localisation/localisation.h" @@ -546,7 +548,11 @@ uint16 hire_new_staff_member(uint8 staffType) command_y = command_z = esi = new_sprite_index = ebp = 0; command_x = 0x8000; - sint32 autoposition = gConfigGeneral.auto_staff_placement == ((SDL_GetModState() & KMOD_SHIFT) == 0); + sint32 autoposition = gConfigGeneral.auto_staff_placement; + if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_SHIFT_Z) { + autoposition = autoposition ^ 1; + } + ebx = autoposition << 16 | staffType << 8 | GAME_COMMAND_FLAG_APPLY; game_command_callback = game_command_callback_hire_new_staff_member; diff --git a/src/openrct2/platform/shared.c b/src/openrct2/platform/shared.c index fe722e34ab..5fc8094a8e 100644 --- a/src/openrct2/platform/shared.c +++ b/src/openrct2/platform/shared.c @@ -55,12 +55,6 @@ SDL_PixelFormat *gBufferTextureFormat = NULL; SDL_Color gPalette[256]; uint32 gPaletteHWMapped[256]; -bool gSteamOverlayActive = false; - -static const sint32 _fullscreen_modes[] = { 0, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP }; -static uint32 _lastGestureTimestamp; -static float _gestureRadius; - void platform_draw() { if (!gOpenRCT2Headless) {