Add setting preload_item_visuals

This commit is contained in:
Perttu Ahola 2012-12-01 23:54:15 +02:00
parent bee170570d
commit e3258b78e2
3 changed files with 21 additions and 0 deletions

View File

@ -129,6 +129,13 @@
#sound_volume = 0.7 #sound_volume = 0.7
# Whether node texture animations should be desynchronized per MapBlock # Whether node texture animations should be desynchronized per MapBlock
#desynchronize_mapblock_texture_animation = true #desynchronize_mapblock_texture_animation = true
# Texture filtering settings
#mip_map = false
#anisotropic_filter = false
#bilinear_filter = false
#trilinear_filter = false
# Set to true to pre-generate all item visuals
#preload_item_visuals = false
# #
# Server stuff # Server stuff

View File

@ -2464,6 +2464,19 @@ void Client::afterContentReceived()
infostream<<"- Updating node textures"<<std::endl; infostream<<"- Updating node textures"<<std::endl;
m_nodedef->updateTextures(m_tsrc); 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 // Start mesh update thread after setting up content definitions
infostream<<"- Starting mesh update thread"<<std::endl; infostream<<"- Starting mesh update thread"<<std::endl;
m_mesh_update_thread.Start(); m_mesh_update_thread.Start();

View File

@ -113,6 +113,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("anisotropic_filter", "false"); settings->setDefault("anisotropic_filter", "false");
settings->setDefault("bilinear_filter", "false"); settings->setDefault("bilinear_filter", "false");
settings->setDefault("trilinear_filter", "false"); settings->setDefault("trilinear_filter", "false");
settings->setDefault("preload_item_visuals", "false");
// Server stuff // Server stuff
// "map-dir" doesn't exist by default. // "map-dir" doesn't exist by default.