mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 22:25:38 +00:00
Merge pull request #454 from pjft/svg-resizes
Adjust mutex for SVG initialization and resizing
This commit is contained in:
commit
678d1af3a6
|
@ -35,11 +35,9 @@ void TextureData::initFromPath(const std::string& path)
|
||||||
bool TextureData::initSVGFromMemory(const unsigned char* fileData, size_t length)
|
bool TextureData::initSVGFromMemory(const unsigned char* fileData, size_t length)
|
||||||
{
|
{
|
||||||
// If already initialised then don't read again
|
// If already initialised then don't read again
|
||||||
{
|
|
||||||
std::unique_lock<std::mutex> lock(mMutex);
|
std::unique_lock<std::mutex> lock(mMutex);
|
||||||
if (mDataRGBA)
|
if (mDataRGBA)
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
// nsvgParse excepts a modifiable, null-terminated string
|
// nsvgParse excepts a modifiable, null-terminated string
|
||||||
char* copy = (char*)malloc(length + 1);
|
char* copy = (char*)malloc(length + 1);
|
||||||
|
@ -84,7 +82,6 @@ bool TextureData::initSVGFromMemory(const unsigned char* fileData, size_t length
|
||||||
|
|
||||||
ImageIO::flipPixelsVert(dataRGBA, mWidth, mHeight);
|
ImageIO::flipPixelsVert(dataRGBA, mWidth, mHeight);
|
||||||
|
|
||||||
std::unique_lock<std::mutex> lock(mMutex);
|
|
||||||
mDataRGBA = dataRGBA;
|
mDataRGBA = dataRGBA;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue