summaryrefslogtreecommitdiffhomepage
path: root/loader-impl.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-06-08 08:08:43 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-06-08 08:08:43 +0200
commit66968b083c8e2ee12819735f9aa9583192dc8091 (patch)
treea4582cf1f17cc400594e1c7c7c69fc4e6a7d48f8 /loader-impl.cpp
parent9a485dcda3ddb0c9e1344df3f753905cc6c9a43b (diff)
flush
Diffstat (limited to 'loader-impl.cpp')
-rw-r--r--loader-impl.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/loader-impl.cpp b/loader-impl.cpp
index a0f316c8..8e7cb081 100644
--- a/loader-impl.cpp
+++ b/loader-impl.cpp
@@ -5,8 +5,10 @@
#include <Corrade/Containers/StringView.h>
#include <Corrade/PluginManager/PluginManager.h>
#include <Corrade/Utility/Resource.h>
+#include <Magnum/ImageView.h>
#include <Magnum/Trade/AbstractImporter.h>
#include <Magnum/Trade/ImageData.h>
+#include <Magnum/Trade/AbstractImageConverter.h>
#include <unordered_map>
#include <utility>
@@ -17,9 +19,13 @@ using atlas_ptr = std::shared_ptr<atlas_texture>;
struct loader_impl final : loader_
{
const Utility::Resource shader_res{"game/shaders"};
- PluginManager::Manager<Trade::AbstractImporter> plugins;
+ PluginManager::Manager<Trade::AbstractImporter> importer_plugins;
Containers::Pointer<Trade::AbstractImporter> tga_importer =
- plugins.loadAndInstantiate("TgaImporter");
+ importer_plugins.loadAndInstantiate("TgaImporter");
+
+ PluginManager::Manager<Trade::AbstractImageConverter> image_converter_plugins;
+ Containers::Pointer<Trade::AbstractImageConverter> tga_converter =
+ image_converter_plugins.loadAndInstantiate("TgaImageConverter");
std::unordered_map<std::string, atlas_ptr> atlas_map;
@@ -44,7 +50,8 @@ atlas_ptr loader_impl::tile_atlas(const Containers::StringView& name, Vector2i s
auto it = atlas_map.find(name);
if (it != atlas_map.end())
return it->second;
- auto atlas = std::make_shared<atlas_texture>(tile_texture(name), size);
+ auto image = tile_texture(name);
+ auto atlas = std::make_shared<atlas_texture>(image, size);
atlas_map[name] = atlas;
return atlas;
}