From a50967d334033c50575e32ea8458f443de9642ed Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Wed, 22 Feb 2017 22:25:55 +0100 Subject: [PATCH] Fixed RenderLogicalSize Different handling if screen is Picasso or not --- .gitignore | 9 ++++++++- src/osdep/pandora_gfx.cpp | 36 +++++++++++++++++------------------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index e3bc48af..b7255f28 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,11 @@ VisualGDB/VisualGDB/Release/Amiberry-sdl2 VisualGDB/VisualGDB/Debug/Amiberry-sdl2 *.npa00-25509379 *.npa00-01e2471b -*.npa00-d8f9b35e \ No newline at end of file +*.npa00-d8f9b35e +VisualGDB/VisualGDB/Debug/build68k +VisualGDB/VisualGDB/Debug/genblitter +VisualGDB/VisualGDB/Release/build68k +VisualGDB/VisualGDB/Release/genblitter +VisualGDB/VisualGDB/Release/genlinetoscr +VisualGDB/VisualGDB/Release/gencpu +VisualGDB/VisualGDB/Release/gencomp \ No newline at end of file diff --git a/src/osdep/pandora_gfx.cpp b/src/osdep/pandora_gfx.cpp index 7ce17083..f2d9a1d5 100644 --- a/src/osdep/pandora_gfx.cpp +++ b/src/osdep/pandora_gfx.cpp @@ -81,6 +81,17 @@ bool isModeAspectRatioExact(SDL_DisplayMode* mode) return false; } +static void updateScreen() +{ + // Update the texture from the surface + SDL_UpdateTexture(texture, nullptr, screen->pixels, screen->pitch); + SDL_RenderClear(renderer); + // Copy the texture on the renderer + SDL_RenderCopy(renderer, texture, nullptr, nullptr); + // Update the window surface (show the renderer) + SDL_RenderPresent(renderer); +} + static void open_screen(struct uae_prefs* p) { int width; @@ -110,7 +121,10 @@ static void open_screen(struct uae_prefs* p) screen = SDL_CreateRGBSurface(0, width, height, 16, 0, 0, 0, 0); check_error_sdl(screen == nullptr, "Unable to create a surface"); - SDL_RenderSetLogicalSize(renderer, width, height*2); + if (screen_is_picasso) + SDL_RenderSetLogicalSize(renderer, width, height); + else + SDL_RenderSetLogicalSize(renderer, width, height*2); // Initialize SDL Texture for the renderer texture = SDL_CreateTexture(renderer, @@ -120,13 +134,7 @@ static void open_screen(struct uae_prefs* p) height); check_error_sdl(texture == nullptr, "Unable to create texture"); - // Update the texture from the surface - SDL_UpdateTexture(texture, nullptr, screen->pixels, screen->pitch); - SDL_RenderClear(renderer); - // Copy the texture on the renderer - SDL_RenderCopy(renderer, texture, nullptr, nullptr); - // Update the window surface (show the renderer) - SDL_RenderPresent(renderer); + updateScreen(); if (screen != nullptr) { @@ -213,17 +221,7 @@ void flush_screen() } } -#ifdef WITH_LOGGING - RefreshLiveInfo(); -#endif - - // Update the texture from the surface - SDL_UpdateTexture(texture, nullptr, screen->pixels, screen->pitch); - // Copy the texture on the renderer - SDL_RenderCopy(renderer, texture, nullptr, nullptr); - // Update the window surface (show the renderer) - SDL_RenderPresent(renderer); - + updateScreen(); init_row_map(); }