mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Merge branch 'master' into 'develop'
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "SDL_Extensions.h"
|
||||
|
||||
#include "../GameEngine.h"
|
||||
#include "../xBRZ/xbrz.h"
|
||||
|
||||
#include <tbb/parallel_for.h>
|
||||
@@ -226,12 +227,19 @@ SDLImageScaler::SDLImageScaler(SDL_Surface * surf, const Rect & virtualDimension
|
||||
SDL_FreeSurface(intermediate);
|
||||
intermediate = SDL_ConvertSurfaceFormat(surf, SDL_PIXELFORMAT_ARGB8888, 0);
|
||||
}
|
||||
|
||||
if (intermediate == surf)
|
||||
throw std::runtime_error("Scaler uses same surface as input!");
|
||||
}
|
||||
|
||||
SDLImageScaler::~SDLImageScaler()
|
||||
{
|
||||
SDL_FreeSurface(intermediate);
|
||||
SDL_FreeSurface(ret);
|
||||
ENGINE->dispatchMainThread([surface = intermediate]()
|
||||
{
|
||||
// potentially SDL bug, execute SDL_FreeSurface in main thread to avoid thread races to its internal state
|
||||
// may be fixed somewhere between 2.26.5 - 2.30
|
||||
SDL_FreeSurface(surface);
|
||||
});
|
||||
}
|
||||
|
||||
SDL_Surface * SDLImageScaler::acquireResultSurface()
|
||||
|
||||
Reference in New Issue
Block a user