Fixed RenderLogicalSize

Different handling if screen is Picasso or not
This commit is contained in:
Dimitris Panokostas 2017-02-22 22:25:55 +01:00
parent a34d164691
commit a50967d334
2 changed files with 25 additions and 20 deletions

9
.gitignore vendored
View file

@ -34,4 +34,11 @@ VisualGDB/VisualGDB/Release/Amiberry-sdl2
VisualGDB/VisualGDB/Debug/Amiberry-sdl2
*.npa00-25509379
*.npa00-01e2471b
*.npa00-d8f9b35e
*.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

View file

@ -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();
}