summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/AssetManager.cpp26
-rw-r--r--src/AssetManager.hpp2
2 files changed, 0 insertions, 28 deletions
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<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;
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 <typename T>