From 150d316a89345044484cdcb2d875c682008fff64 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 8 May 2022 00:52:39 +0200 Subject: [PATCH] fixed bug with referencing out-of-scope structures --- src/libgame/sdl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 1614b1e2..b75f2c8c 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -151,6 +151,9 @@ static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay) dst_rect1 = &dst_rect_screen; #if defined(HAS_SCREEN_KEYBOARD) + SDL_Rect src_rect_up = { 0, 0, video.width, video.height }; + SDL_Rect dst_rect_up = dst_rect_screen; + if (video.shifted_up || video.shifted_up_delay) { int time_current = SDL_GetTicks(); @@ -171,8 +174,9 @@ static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay) video.shifted_up_delay = 0; } - SDL_Rect src_rect_up = { 0, pos, video.width, video.height - pos }; - SDL_Rect dst_rect_up = { xoff, yoff, video.width, video.height - pos }; + src_rect_up.y = pos; + src_rect_up.h = video.height - pos; + dst_rect_up.h = video.height - pos; if (video.screen_rendering_mode == SPECIAL_RENDERING_TARGET || video.screen_rendering_mode == SPECIAL_RENDERING_DOUBLE) -- 2.34.1