summaryrefslogtreecommitdiff
path: root/assetFactory/textureFragment.cpp
blob: 0a4ec1d29f6642299b33ffd41782bae0450d9838 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);
	});
}