--- hatari/src/gui-sdl/sdlgui.c 2019/04/01 07:13:52 1.1.1.5 +++ hatari/src/gui-sdl/sdlgui.c 2019/04/01 07:15:01 1.1.1.6 @@ -6,7 +6,7 @@ A tiny graphical user interface for Hatari. */ -const char SDLGui_rcsid[] = "Hatari $Id: sdlgui.c,v 1.1.1.5 2019/04/01 07:13:52 root Exp $"; +const char SDLGui_rcsid[] = "Hatari $Id: sdlgui.c,v 1.1.1.6 2019/04/01 07:15:01 root Exp $"; #include #include @@ -79,6 +79,12 @@ int SDLGui_Init(void) { SDL_Color blackWhiteColors[2] = {{255, 255, 255, 0}, {0, 0, 0, 0}}; + if (pSmallFontGfx && pBigFontGfx) + { + /* already initialized */ + return 0; + } + /* Initialize the font graphics: */ pSmallFontGfx = SDLGui_LoadXBM(font5x8_width, font5x8_height, font5x8_bits); pBigFontGfx = SDLGui_LoadXBM(font10x16_width, font10x16_height, font10x16_bits); @@ -154,6 +160,15 @@ int SDLGui_SetScreen(SDL_Surface *pScrn) return 0; } +/*-----------------------------------------------------------------------*/ +/* + Return character size for current font in given arguments. +*/ +void SDLGui_GetFontSize(int *width, int *height) +{ + *width = fontwidth; + *height = fontheight; +} /*-----------------------------------------------------------------------*/ /* @@ -172,7 +187,7 @@ void SDLGui_CenterDlg(SGOBJ *dlg) /* Draw a text string. */ -static void SDLGui_Text(int x, int y, const char *txt) +void SDLGui_Text(int x, int y, const char *txt) { int i; char c; @@ -796,6 +811,9 @@ int SDLGui_DoDialog(SGOBJ *dlg, SDL_Even } break; + case SDL_JOYAXISMOTION: + case SDL_JOYBALLMOTION: + case SDL_JOYHATMOTION: case SDL_MOUSEMOTION: break;