summaryrefslogtreecommitdiffstats
path: root/src/AssetManager.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-05 01:40:01 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-05 01:40:01 +0200
commitc0b81150298ce9f2f21da42f26a57fe59a93bb77 (patch)
tree15304e4c36093a5beb524e67c976a241c5c556f3 /src/AssetManager.hpp
parentImplemented texture atlas (diff)
downloadAltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.tar
AltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.tar.gz
AltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.tar.bz2
AltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.tar.lz
AltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.tar.xz
AltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.tar.zst
AltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.zip
Diffstat (limited to 'src/AssetManager.hpp')
-rw-r--r--src/AssetManager.hpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/AssetManager.hpp b/src/AssetManager.hpp
index 1b64215..0663f48 100644
--- a/src/AssetManager.hpp
+++ b/src/AssetManager.hpp
@@ -132,6 +132,7 @@ struct BlockModel {
ElementData::FaceDirection visibility;
glm::mat4 transform;
glm::vec4 texture;
+ float layer;
glm::vec3 color;
};
@@ -204,7 +205,11 @@ public:
template <typename T>
T *GetAsset(const std::string &assetName) {
- AssetTreeNode *node = GetAssetByAssetName(assetName);
+ AssetTreeNode *node;
+ if (assetName[0] != '/')
+ node = GetAssetByAssetName('/'+assetName);
+ else
+ node = GetAssetByAssetName(assetName);
if (!node)
return nullptr;
return dynamic_cast<T*>(node->asset.get());