From 33172f34e4f736780ab8f644c5e5b7545dd89dce Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Sun, 15 Dec 2019 00:42:44 +0100 Subject: [PATCH] Fix blitter reinitialization, always call Blitter::free on surface reload --- src/common/FBSurfaceSDL2.cxx | 2 ++ src/common/sdl_blitter/BilinearBlitter.cxx | 2 +- src/common/sdl_blitter/HqBlitter.cxx | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/FBSurfaceSDL2.cxx b/src/common/FBSurfaceSDL2.cxx index 275ae116f..7bb78d344 100644 --- a/src/common/FBSurfaceSDL2.cxx +++ b/src/common/FBSurfaceSDL2.cxx @@ -185,6 +185,7 @@ void FBSurfaceSDL2::free() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FBSurfaceSDL2::reload() { + free(); reinitializeBlitter(); } @@ -195,6 +196,7 @@ void FBSurfaceSDL2::resize(uInt32 width, uInt32 height) if(mySurface) SDL_FreeSurface(mySurface); + free(); createSurface(width, height, nullptr); diff --git a/src/common/sdl_blitter/BilinearBlitter.cxx b/src/common/sdl_blitter/BilinearBlitter.cxx index 6be1efbc7..92e3b292e 100644 --- a/src/common/sdl_blitter/BilinearBlitter.cxx +++ b/src/common/sdl_blitter/BilinearBlitter.cxx @@ -44,7 +44,7 @@ void BilinearBlitter::reinitialize( SDL_Surface* staticData ) { - myRecreateTextures = !( + myRecreateTextures = myRecreateTextures || !( mySrcRect.w == srcRect.w && mySrcRect.h == srcRect.h && myDstRect.w == destRect.w && diff --git a/src/common/sdl_blitter/HqBlitter.cxx b/src/common/sdl_blitter/HqBlitter.cxx index 07ddbb865..5d408f6e0 100644 --- a/src/common/sdl_blitter/HqBlitter.cxx +++ b/src/common/sdl_blitter/HqBlitter.cxx @@ -69,7 +69,7 @@ void HqBlitter::reinitialize( SDL_Surface* staticData ) { - myRecreateTextures = !( + myRecreateTextures = myRecreateTextures || !( mySrcRect.w == srcRect.w && mySrcRect.h == srcRect.h && myDstRect.w == destRect.w &&