GLTexture - Use BitmapCache::nsvgParseFromFileWithReplace() in place of nsvgParseFromFile() to load images from files

This commit is contained in:
enricoturri1966 2022-06-08 13:12:29 +02:00
parent f11f216f91
commit b42e4b2927

View File

@ -7,6 +7,7 @@
#include "GUI_App.hpp" #include "GUI_App.hpp"
#include "GLModel.hpp" #include "GLModel.hpp"
#endif // ENABLE_LEGACY_OPENGL_REMOVAL #endif // ENABLE_LEGACY_OPENGL_REMOVAL
#include "BitmapCache.hpp"
#include <GL/glew.h> #include <GL/glew.h>
@ -204,7 +205,7 @@ bool GLTexture::load_from_svg_files_as_sprites_array(const std::vector<std::stri
if (!boost::algorithm::iends_with(filename, ".svg")) if (!boost::algorithm::iends_with(filename, ".svg"))
continue; continue;
NSVGimage* image = nsvgParseFromFile(filename.c_str(), "px", 96.0f); NSVGimage* image = BitmapCache::nsvgParseFromFileWithReplace(filename.c_str(), "px", 96.0f, {});
if (image == nullptr) if (image == nullptr)
continue; continue;
@ -536,7 +537,7 @@ bool GLTexture::load_from_svg(const std::string& filename, bool use_mipmaps, boo
{ {
bool compression_enabled = compress && GLEW_EXT_texture_compression_s3tc; bool compression_enabled = compress && GLEW_EXT_texture_compression_s3tc;
NSVGimage* image = nsvgParseFromFile(filename.c_str(), "px", 96.0f); NSVGimage* image = BitmapCache::nsvgParseFromFileWithReplace(filename.c_str(), "px", 96.0f, {});
if (image == nullptr) { if (image == nullptr) {
reset(); reset();
return false; return false;