mirror of
https://github.com/joel16/VITAlbum.git
synced 2024-11-23 03:29:54 +00:00
textures: Parse SVG from data stored in buffer
This commit is contained in:
parent
9fa1d60d54
commit
4729aa646a
@ -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);
|
||||
|
@ -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<char *>(*data), "px", 96);
|
||||
|
||||
texture->width = svg->width;
|
||||
texture->height = svg->height;
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user