diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-12-01 23:54:15 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-12-02 00:46:10 +0200 |
commit | e3258b78e263c3f95007e1fbc92fcc3a51646f69 (patch) | |
tree | 4201dcfbff2fc450b7f3b8656d9a2bc3e71377ec /src | |
parent | bee170570de7a796ac7b5ba6c0b39b253380b5e3 (diff) | |
download | minetest-e3258b78e263c3f95007e1fbc92fcc3a51646f69.tar.gz minetest-e3258b78e263c3f95007e1fbc92fcc3a51646f69.tar.bz2 minetest-e3258b78e263c3f95007e1fbc92fcc3a51646f69.zip |
Add setting preload_item_visuals
Diffstat (limited to 'src')
-rw-r--r-- | src/client.cpp | 13 | ||||
-rw-r--r-- | src/defaultsettings.cpp | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index 3c69db076..c0c513fef 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -2464,6 +2464,19 @@ void Client::afterContentReceived() infostream<<"- Updating node textures"<<std::endl; m_nodedef->updateTextures(m_tsrc); + // Preload item textures and meshes if configured to + if(g_settings->getBool("preload_item_visuals")) + { + verbosestream<<"Updating item textures and meshes"<<std::endl; + std::set<std::string> names = m_itemdef->getAll(); + for(std::set<std::string>::const_iterator + i = names.begin(); i != names.end(); ++i){ + // Asking for these caches the result + m_itemdef->getInventoryTexture(*i, this); + m_itemdef->getWieldMesh(*i, this); + } + } + // Start mesh update thread after setting up content definitions infostream<<"- Starting mesh update thread"<<std::endl; m_mesh_update_thread.Start(); diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 333d98cd8..4fde4b5b3 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -113,6 +113,7 @@ void set_default_settings(Settings *settings) settings->setDefault("anisotropic_filter", "false"); settings->setDefault("bilinear_filter", "false"); settings->setDefault("trilinear_filter", "false"); + settings->setDefault("preload_item_visuals", "false"); // Server stuff // "map-dir" doesn't exist by default. |