summaryrefslogtreecommitdiffstats
path: root/src/AssetManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/AssetManager.cpp26
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;