--- uae/src/sdlgfx.c 2018/04/24 17:05:25 1.1.1.1 +++ uae/src/sdlgfx.c 2018/04/24 17:14:08 1.1.1.3 @@ -37,7 +37,6 @@ #include "debug.h" #include "picasso96.h" -#define DEBUG /* Uncomment for debugging output */ /* #define DEBUG */ @@ -263,8 +262,8 @@ int graphics_setup (void) /* Initialize the SDL library */ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { - fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError()); - return 0; + fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError()); + return 0; } return 1; @@ -273,7 +272,6 @@ int graphics_setup (void) static void graphics_subinit (void) { - int i, j; Uint32 uiSDLVidModFlags; #ifdef DEBUG @@ -305,7 +303,7 @@ static void graphics_subinit (void) fprintf(stderr, "Bytes per Line: %d\n", prSDLScreen->pitch); #endif SDL_LockSurface(prSDLScreen); - memset(prSDLScreen->pixels, 0xff, current_width * current_height * prSDLScreen->format->BytesPerPixel); + memset(prSDLScreen->pixels, 0, current_width * current_height * prSDLScreen->format->BytesPerPixel); SDL_UnlockSurface(prSDLScreen); SDL_UpdateRect(prSDLScreen, 0, 0, current_width, current_height); /* Set UAE window title and icon name */ @@ -397,9 +395,9 @@ int graphics_init (void) } } } - if (bitdepth == 0) + if (bitdepth == 0) { - fprintf(stderr, "No video mode found!\n"); + fprintf(stderr, "No video mode found!\n"); return 0; } } @@ -434,7 +432,7 @@ void graphics_leave (void) graphics_subshutdown (); - SDL_Quit(); + SDL_VideoQuit(); dumpcustom (); } @@ -705,23 +703,23 @@ static int keycode2amiga(SDL_keysym *prK int iAmigaKeycode = kc_decode(prKeySym); if (iAmigaKeycode == -1) { - switch (currprefs.keyboard_lang) - { - case KBD_LANG_FR: - return decode_fr(prKeySym); - case KBD_LANG_US: - return decode_us(prKeySym); - case KBD_LANG_DE: - return decode_de(prKeySym); - case KBD_LANG_SE: - return decode_se (prKeySym); - case KBD_LANG_IT: - return decode_it (prKeySym); - case KBD_LANG_ES: - return decode_es (prKeySym); - default: - return -1; - } + switch (currprefs.keyboard_lang) + { + case KBD_LANG_FR: + return decode_fr(prKeySym); + case KBD_LANG_US: + return decode_us(prKeySym); + case KBD_LANG_DE: + return decode_de(prKeySym); + case KBD_LANG_SE: + return decode_se (prKeySym); + case KBD_LANG_IT: + return decode_it (prKeySym); + case KBD_LANG_ES: + return decode_es (prKeySym); + default: + return -1; + } } return iAmigaKeycode; } @@ -751,7 +749,7 @@ void handle_events (void) #endif uae_quit(); break; - case SDL_KEYDOWN: + case SDL_KEYDOWN: #ifdef DEBUG fprintf(stderr, "Event: key down\n"); #endif @@ -1104,6 +1102,8 @@ static void set_window_for_picasso (void current_width = picasso_vidinfo.width; current_height = picasso_vidinfo.height; + graphics_subshutdown (); + graphics_subinit (); // XResizeWindow (display, mywin, current_width, current_height); }