From f2266b843959413277767a990bb9a9c5593f3489 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sun, 13 Jun 2021 13:47:33 +0500 Subject: Implemented basic RmlUi integration --- src/AssetManager.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/AssetManager.cpp') diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index 514d008..0db495a 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -402,22 +402,26 @@ void ParseAssetShader(AssetTreeNode &node) { std::string vertPath = j["vert"].get(); std::string fragPath = j["frag"].get(); - AssetTreeNode *vertAsset = AssetManager::GetAssetByAssetName(vertPath); - AssetTreeNode *fragAsset = AssetManager::GetAssetByAssetName(fragPath); + 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 uniforms; - for (auto &it : j["uniforms"]) { + for (auto& it : j["uniforms"]) { uniforms.push_back(it.get()); } node.asset = std::make_unique(); - AssetShader *asset = dynamic_cast(node.asset.get()); + AssetShader* asset = dynamic_cast(node.asset.get()); asset->shader = std::make_unique(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; } } -- cgit v1.2.3