diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2021-07-04 14:47:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-04 14:47:44 +0200 |
commit | 8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a (patch) | |
tree | 1e9510a1c2ff7f6c0eaaba211c38e0a855b36ca9 /src/AssetManager.cpp | |
parent | Merge pull request #64 from LaG1924/ftr/render-optimization (diff) | |
parent | Added screenshot-mode (diff) | |
download | AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.tar AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.tar.gz AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.tar.bz2 AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.tar.lz AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.tar.xz AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.tar.zst AltCraft-8a4075c58b4a078cdbbe8b394eb5ae761fdaff6a.zip |
Diffstat (limited to 'src/AssetManager.cpp')
-rw-r--r-- | src/AssetManager.cpp | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index 5f24404..9cbb6df 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -21,7 +21,6 @@ namespace fs = std::filesystem; const fs::path pathToAssets = "./assets/"; const std::string pathToAssetsList = "./items.json"; -std::map<std::string, BlockId> assetIds; std::map<BlockId, std::string> blockIdToBlockName; std::unique_ptr<AssetTreeNode> assetTree; std::unique_ptr<TextureAtlas> atlas; @@ -29,7 +28,6 @@ std::map<BlockId, BlockFaces> blockIdToBlockFaces; BlockFaces errorFaces; -void LoadIds(); void LoadAssets(); void LoadTextures(); void LoadScripts(); @@ -62,7 +60,6 @@ void AssetManager::InitAssetManager() LoadTextures(); - LoadIds(); ParseBlockModels(); PluginSystem::Init(); @@ -79,19 +76,6 @@ void AssetManager::InitPostRml() { } } -void LoadIds() { - std::ifstream in(pathToAssetsList); - nlohmann::json index; - in >> index; - for (auto &it : index) { - unsigned short id = it["type"].get<int>(); - unsigned char state = it["meta"].get<int>(); - std::string blockName = it["text_type"].get<std::string>(); - assetIds[blockName] = BlockId{ id, state }; - } - LOG(INFO) << "Loaded " << assetIds.size() << " ids"; -} - void LoadAssets() { assetTree = std::make_unique<AssetTreeNode>(); assetTree->name = "/"; @@ -661,16 +645,6 @@ BlockFaces &AssetManager::GetBlockModelByBlockId(BlockId block) { return blockIdToBlockFaces.insert(std::make_pair(block, blockFaces)).first->second; } -std::string AssetManager::GetAssetNameByBlockId(BlockId block) { - for (auto& it : assetIds) { - BlockId value = it.second; - value.state = 0; - if (value == block) - return it.first; - } - return "#NF"; -} - Asset *AssetManager::GetAssetPtr(const std::string & assetName) { OPTICK_EVENT(); AssetTreeNode *node; |