[hatari-devel] Hatari's SDL2-port screen update bug |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi,
Hatari SDL GUI behaves wrongly with SDL2.
The reason is this in screen.c:
-------------------------------
#if WITH_SDL2
....
void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w,
Sint32 h)
{
SDL_Rect rect = { x, y, w, h };
SDL_UpdateRects(screen, 1, &rect);
}
#endif
-------------------------------
It doesn't take into account SDL1 zero-sized rect special
case which means that whole screen should be redraw.
As result, e.g. Hatari dialogs aren't in some cases shown
with SDL2 until user blindly interacts with them first.
These are places where Hatari would like to do
full screen update:
-------------------------------
$ grep 'SDL_UpdateRect[^s].*0)' $(find -type f)
../main.c: SDL_UpdateRect(sdlscrn, 0, 0, 0, 0);
../gui-sdl/dlgAlert.c: SDL_UpdateRect(sdlscrn, 0,0, 0,0);
../gui-sdl/dlgScreen.c: SDL_UpdateRect(sdlscrn, 0,0,0,0);
../gui-sdl/sdlgui.c: SDL_UpdateRect(pSdlGuiScrn, 0,0,0,0);
../gui-sdl/sdlgui.c: SDL_UpdateRect(pSdlGuiScrn, 0,0,0,0);
../gui-sdl/sdlgui.c: SDL_UpdateRect(pSdlGuiScrn, 0, 0, 0, 0);
../gui-sdl/dlgHalt.c: SDL_UpdateRect(sdlscrn, 0,0, 0,0);
-------------------------------
My proposal to handle this would be separate function
for updating the whole screen which has different
implementation for SDL1 & SDL2.
Thomas, could you look into that?
- Eero