From 31f32eb8fe7e5e39fb449968afce809c13509099 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 12 Dec 2016 22:24:21 +0100 Subject: [PATCH] fixed some compilation errors for SDL 1.2 target --- src/libgame/sdl.c | 11 ++++++++--- src/libgame/system.c | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 7221c7af..a11452bb 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -37,8 +37,10 @@ static boolean limit_screen_updates = FALSE; /* functions from SGE library */ void sge_Line(SDL_Surface *, Sint16, Sint16, Sint16, Sint16, Uint32); +#if defined(USE_TOUCH_INPUT_OVERLAY) /* functions to draw overlay graphics for touch device input */ static void DrawTouchInputOverlay(); +#endif void SDLLimitScreenUpdates(boolean enable) { @@ -205,8 +207,11 @@ static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay) SDL_RenderCopy(sdl_renderer, sdl_texture_target, src_rect2, dst_rect2); } +#if defined(USE_TOUCH_INPUT_OVERLAY) // draw overlay graphics for touch device input, if needed DrawTouchInputOverlay(); +#endif + #endif // global synchronization point of the game to align video frame delay @@ -565,10 +570,10 @@ static boolean SDLCreateScreen(boolean fullscreen) it will crash if flags are *not* set to SDL_RENDERER_SOFTWARE (because it will try to use accelerated graphics and apparently fails miserably) */ int renderer_flags = SDL_RENDERER_SOFTWARE; -#endif #endif SDLSetScreenSizeAndOffsets(video.width, video.height); +#endif int width = video.width; int height = video.height; @@ -2685,9 +2690,9 @@ boolean SDLReadJoystick(int nr, int *x, int *y, boolean *b1, boolean *b2) return TRUE; } +#if defined(USE_TOUCH_INPUT_OVERLAY) static void DrawTouchInputOverlay() { -#if defined(USE_TOUCH_INPUT_OVERLAY) static SDL_Texture *texture = NULL; static boolean initialized = FALSE; static boolean deactivated = TRUE; @@ -2777,5 +2782,5 @@ static void DrawTouchInputOverlay() SDL_Rect dst_rect = { xpos, ypos, width_scaled, height_scaled }; SDL_RenderCopy(sdl_renderer, texture, &src_rect, &dst_rect); -#endif } +#endif diff --git a/src/libgame/system.c b/src/libgame/system.c index 5443e87d..3b206b26 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -379,7 +379,9 @@ void LimitScreenUpdates(boolean enable) void InitVideoDisplay(void) { SDLInitVideoDisplay(); +#if defined(TARGET_SDL2) SDLSetDisplaySize(); +#endif } void CloseVideoDisplay(void) -- 2.34.1