Fix blitter reinitialization, always call Blitter::free on surface reload

This commit is contained in:
Christian Speckner 2019-12-15 00:42:44 +01:00
parent 9aa027f4fd
commit b769638a35
3 changed files with 4 additions and 2 deletions

View File

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

View File

@ -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 &&

View File

@ -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 &&