]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture.cpp
Refactor texture external image loading into a helper function
[libs/gl.git] / source / texture.cpp
index b747a2a6b0d7001b3d06e7a2811f91e93f075e78..703ea96c5fabfddb2cb8b33c65cb8056df205f16 100644 (file)
@@ -306,14 +306,18 @@ unsigned Texture::Loader::get_levels() const
 
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-void Texture::Loader::external_image(const string &fn)
+void Texture::Loader::load_external_image(Graphics::Image &img, const std::string &fn)
 {
-       Graphics::Image img;
        RefPtr<IO::Seekable> io = get_collection().open_raw(fn);
        if(!io)
                throw IO::file_not_found(fn);
        img.load_io(*io);
+}
 
+void Texture::Loader::external_image(const string &fn)
+{
+       Graphics::Image img;
+       load_external_image(img, fn);
        obj.image(img, get_levels(), srgb);
 }