summaryrefslogtreecommitdiff
path: root/assetFactory/textureFragment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'assetFactory/textureFragment.cpp')
-rw-r--r--assetFactory/textureFragment.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/assetFactory/textureFragment.cpp b/assetFactory/textureFragment.cpp
index 72107a5..0a4ec1d 100644
--- a/assetFactory/textureFragment.cpp
+++ b/assetFactory/textureFragment.cpp
@@ -1,7 +1,17 @@
#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 = Worker::addWork([this]() {
+ return std::make_unique<Image>(Resource::mapPath(path), STBI_rgb_alpha);
+ });
+}