+unsigned Texture::Loader::get_levels() const
+{
+ return (is_mipmapped(obj.default_sampler.get_min_filter()) ? levels : 1);
+}
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+void Texture::Loader::load_external_image(Graphics::Image &img, const std::string &fn)
+{
+ 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)
+{
+ obj.use_srgb_format = false;
+ external_image_common(fn);
+}
+
+void Texture::Loader::external_image_srgb(const string &fn)
+{
+ obj.use_srgb_format = true;
+ external_image_common(fn);
+}
+
+void Texture::Loader::external_image_common(const string &fn)
+{
+ if(obj.manager)
+ obj.manager->set_resource_location(obj, get_collection(), fn);
+ else
+ {
+ Graphics::Image img;
+ load_external_image(img, fn);
+ obj.image(img, get_levels());
+ }
+}
+