Remove a few more SDL calls from core library

This commit is contained in:
Ted John 2017-04-01 19:50:07 +01:00 committed by Gymnasiast
parent cf0dcb4753
commit 08ae74293d
3 changed files with 10 additions and 10 deletions

View File

@ -420,11 +420,11 @@ namespace OpenRCT2
void RunFixedFrame() void RunFixedFrame()
{ {
_uncapTick = 0; _uncapTick = 0;
uint32 currentTick = SDL_GetTicks(); uint32 currentTick = platform_get_ticks();
uint32 ticksElapsed = currentTick - _lastTick; uint32 ticksElapsed = currentTick - _lastTick;
if (ticksElapsed < UPDATE_TIME_MS) if (ticksElapsed < UPDATE_TIME_MS)
{ {
SDL_Delay(UPDATE_TIME_MS - ticksElapsed); platform_sleep(UPDATE_TIME_MS - ticksElapsed);
_lastTick += UPDATE_TIME_MS; _lastTick += UPDATE_TIME_MS;
} }
else else
@ -441,7 +441,7 @@ namespace OpenRCT2
void RunVariableFrame() void RunVariableFrame()
{ {
uint32 currentTick = SDL_GetTicks(); uint32 currentTick = platform_get_ticks();
if (_uncapTick == 0) if (_uncapTick == 0)
{ {
_uncapTick = currentTick; _uncapTick = currentTick;

View File

@ -15,7 +15,9 @@
#pragma endregion #pragma endregion
#include "../config/Config.h" #include "../config/Config.h"
#include "../Context.h"
#include "../game.h" #include "../game.h"
#include "../input.h"
#include "../interface/viewport.h" #include "../interface/viewport.h"
#include "../localisation/date.h" #include "../localisation/date.h"
#include "../localisation/localisation.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_y = command_z = esi = new_sprite_index = ebp = 0;
command_x = 0x8000; 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; ebx = autoposition << 16 | staffType << 8 | GAME_COMMAND_FLAG_APPLY;
game_command_callback = game_command_callback_hire_new_staff_member; game_command_callback = game_command_callback_hire_new_staff_member;

View File

@ -55,12 +55,6 @@ SDL_PixelFormat *gBufferTextureFormat = NULL;
SDL_Color gPalette[256]; SDL_Color gPalette[256];
uint32 gPaletteHWMapped[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() void platform_draw()
{ {
if (!gOpenRCT2Headless) { if (!gOpenRCT2Headless) {