diff --git a/include/textures.h b/include/textures.h index b1c7eeb..9285d44 100644 --- a/include/textures.h +++ b/include/textures.h @@ -22,7 +22,7 @@ namespace Textures { bool LoadImageJPEG(unsigned char **data, SceOff *size, Tex *texture); bool LoadImagePCX(unsigned char **data, SceOff *size, Tex *texture); bool LoadImagePNG(unsigned char **data, SceOff *size, Tex *texture); - bool LoadImageSVG(const std::string &path, Tex *texture); + bool LoadImageSVG(unsigned char **data, Tex *texture); bool LoadImageTIFF(const std::string &path, Tex *texture); bool LoadImageWEBP(unsigned char **data, SceOff *size, Tex *texture); void Free(Tex *texture); diff --git a/source/textures.cpp b/source/textures.cpp index dd0cdc5..cb78000 100644 --- a/source/textures.cpp +++ b/source/textures.cpp @@ -382,9 +382,9 @@ namespace Textures { return ret; } - bool LoadImageSVG(const std::string &path, Tex *texture) { + bool LoadImageSVG(unsigned char **data, Tex *texture) { NSVGimage *svg; - svg = nsvgParseFromFile(path.c_str(), "px", 96); + svg = nsvgParse(reinterpret_cast(*data), "px", 96); texture->width = svg->width; texture->height = svg->height; diff --git a/source/windows/filebrowser.cpp b/source/windows/filebrowser.cpp index 7b0eca0..a35c91e 100644 --- a/source/windows/filebrowser.cpp +++ b/source/windows/filebrowser.cpp @@ -59,7 +59,7 @@ namespace Windows { else if (ext == ".PNG") image_ret = Textures::LoadImagePNG(&data, &size, &item->texture); else if (ext == ".SVG") - image_ret = Textures::LoadImageSVG(path, &item->texture); + image_ret = Textures::LoadImageSVG(&data, &item->texture); else if (ext == ".TIFF") image_ret = Textures::LoadImageTIFF(path, &item->texture); else if (ext == ".WEBP")