Skip to content
Browse files

Add setting enable_on_demand_item_visuals

  • Loading branch information...
1 parent 48121d4 commit 67369459aff9b408da9bb632703d4ed23fa51eb6 @celeron55 committed Dec 1, 2012
Showing with 21 additions and 0 deletions.
  1. +7 −0 minetest.conf.example
  2. +13 −0 src/client.cpp
  3. +1 −0 src/defaultsettings.cpp
View
7 minetest.conf.example
@@ -126,6 +126,13 @@
#sound_volume = 0.7
# Whether node texture animations should be desynchronized per MapBlock
#desynchronize_mapblock_texture_animation = true
+# Texture filtering settings
+#mip_map = false
+#anisotropic_filter = false
+#bilinear_filter = false
+#trilinear_filter = false
+# Set to false to pre-generate all item visuals
+#enable_on_demand_item_visuals = true
#
# Server stuff
View
13 src/client.cpp
@@ -2464,6 +2464,19 @@ void Client::afterContentReceived()
infostream<<"- Updating node textures"<<std::endl;
m_nodedef->updateTextures(m_tsrc);
+ // Update item textures and meshes if configured to
+ if(g_settings->getBool("enable_on_demand_item_visuals") == false)
+ {
+ 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();
View
1 src/defaultsettings.cpp
@@ -110,6 +110,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("anisotropic_filter", "false");
settings->setDefault("bilinear_filter", "false");
settings->setDefault("trilinear_filter", "false");
+ settings->setDefault("enable_on_demand_item_visuals", "true");
// Server stuff
// "map-dir" doesn't exist by default.

0 comments on commit 6736945

Please sign in to comment.
Something went wrong with that request. Please try again.