summaryrefslogtreecommitdiffstats
path: root/src/AssetManager.cpp
diff options
context:
space:
mode:
authorLaG1924 <lag1924@gmail.com>2021-11-19 20:29:28 +0100
committerLaG1924 <lag1924@gmail.com>2021-11-19 20:29:28 +0100
commit83c61036966c4c358a094cabe27c8de60082200d (patch)
tree6947537bd6af8a1e0d16de6a75f3e07f7db3b268 /src/AssetManager.cpp
parentAdded framebuffer to Gal (diff)
downloadAltCraft-83c61036966c4c358a094cabe27c8de60082200d.tar
AltCraft-83c61036966c4c358a094cabe27c8de60082200d.tar.gz
AltCraft-83c61036966c4c358a094cabe27c8de60082200d.tar.bz2
AltCraft-83c61036966c4c358a094cabe27c8de60082200d.tar.lz
AltCraft-83c61036966c4c358a094cabe27c8de60082200d.tar.xz
AltCraft-83c61036966c4c358a094cabe27c8de60082200d.tar.zst
AltCraft-83c61036966c4c358a094cabe27c8de60082200d.zip
Diffstat (limited to 'src/AssetManager.cpp')
-rw-r--r--src/AssetManager.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp
index 1a7e523..0976e30 100644
--- a/src/AssetManager.cpp
+++ b/src/AssetManager.cpp
@@ -392,34 +392,7 @@ void ParseAssetBlockState(AssetTreeNode &node) {
}
void ParseAssetShader(AssetTreeNode &node) {
- try {
- nlohmann::json j = nlohmann::json::parse(node.data);
- std::string vertPath = j["vert"].get<std::string>();
- std::string fragPath = j["frag"].get<std::string>();
-
- AssetTreeNode* vertAsset = AssetManager::GetAssetByAssetName(vertPath);
- AssetTreeNode* fragAsset = AssetManager::GetAssetByAssetName(fragPath);
- std::string vertSource((char*)vertAsset->data.data(), (char*)vertAsset->data.data() + vertAsset->data.size());
- std::string fragSource((char*)fragAsset->data.data(), (char*)fragAsset->data.data() + fragAsset->data.size());
-
- std::vector<std::string> uniforms;
-
- for (auto& it : j["uniforms"]) {
- uniforms.push_back(it.get<std::string>());
- }
-
- node.asset = std::make_unique<AssetShader>();
- AssetShader* asset = dynamic_cast<AssetShader*>(node.asset.get());
- asset->shader = std::make_unique<Shader>(vertSource, fragSource, uniforms);
- } catch (std::exception &e) {
- glCheckError();
- LOG(ERROR) << "Shader asset parsing failed: " << e.what();
- } catch (...) {
- glCheckError();
- LOG(ERROR) << "Shader asset parsing failed with unknown reason";
- return;
- }
}
void ParseAssetScript(AssetTreeNode &node) {