From af02db535683f26bea8f3f7428a570a361bcb423 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Tue, 29 Jun 2021 14:41:00 +0500 Subject: Removed old items ids --- src/AssetManager.cpp | 26 -------------------------- src/AssetManager.hpp | 2 -- 2 files changed, 28 deletions(-) (limited to 'src') diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index 63dc596..d5b8d68 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 assetIds; std::map blockIdToBlockName; std::unique_ptr assetTree; std::unique_ptr atlas; @@ -29,7 +28,6 @@ std::map 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(); - unsigned char state = it["meta"].get(); - std::string blockName = it["text_type"].get(); - assetIds[blockName] = BlockId{ id, state }; - } - LOG(INFO) << "Loaded " << assetIds.size() << " ids"; -} - void LoadAssets() { assetTree = std::make_unique(); 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; diff --git a/src/AssetManager.hpp b/src/AssetManager.hpp index b67d920..7f6c4fb 100644 --- a/src/AssetManager.hpp +++ b/src/AssetManager.hpp @@ -178,8 +178,6 @@ namespace AssetManager { BlockFaces &GetBlockModelByBlockId(BlockId block); - std::string GetAssetNameByBlockId(BlockId block); - Asset *GetAssetPtr(const std::string &assetName); template -- cgit v1.2.3