From: Holger Schemel Date: Sat, 7 May 2022 22:52:39 +0000 (+0200) Subject: fixed bug with referencing out-of-scope structures X-Git-Tag: 4.3.2.2~43 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=150d316a89345044484cdcb2d875c682008fff64;p=rocksndiamonds.git fixed bug with referencing out-of-scope structures --- 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)