summaryrefslogtreecommitdiff
path: root/assetFactory/textureFragment.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-10 14:46:18 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-10 14:46:18 +0100
commit989b10986f1626d1a50fceb8a33174108c03da93 (patch)
treeda7c1a18abb5290079328872f311b2dbea60d618 /assetFactory/textureFragment.cpp
parenttest-assetFactory depends on all resource files (diff)
downloadilt-989b10986f1626d1a50fceb8a33174108c03da93.tar.bz2
ilt-989b10986f1626d1a50fceb8a33174108c03da93.tar.xz
ilt-989b10986f1626d1a50fceb8a33174108c03da93.zip
Load texture fragment images as we go, make the image a member
Diffstat (limited to 'assetFactory/textureFragment.cpp')
-rw-r--r--assetFactory/textureFragment.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/assetFactory/textureFragment.cpp b/assetFactory/textureFragment.cpp
index 72107a5..d153688 100644
--- a/assetFactory/textureFragment.cpp
+++ b/assetFactory/textureFragment.cpp
@@ -1,7 +1,15 @@
#include "textureFragment.h"
+#include "resource.h"
+#include <stb/stb_image.h>
bool
TextureFragment::persist(Persistence::PersistenceStore & store)
{
return STORE_TYPE && STORE_MEMBER(id) && STORE_MEMBER(path);
}
+
+void
+TextureFragment::postLoad()
+{
+ image = std::make_unique<Image>(Resource::mapPath(path), STBI_rgb_alpha);
+}