Allow disabling gift boxes and bananas indicators by removing their textures
This commit is contained in:
parent
90277eebd5
commit
1f8ffccd97
@ -118,8 +118,9 @@ void ItemManager::loadDefaultItemMeshes()
|
|||||||
#endif
|
#endif
|
||||||
m_item_lowres_mesh[i]->grab();
|
m_item_lowres_mesh[i]->grab();
|
||||||
}
|
}
|
||||||
m_icon[i] = "icon-" + item_names[(ItemState::ItemType)i] + ".png";
|
std::string icon = "icon-" + item_names[(ItemState::ItemType)i] + ".png";
|
||||||
preloadIcon(m_icon[i]);
|
if (preloadIcon(icon))
|
||||||
|
m_icon[i] = icon;
|
||||||
} // for i
|
} // for i
|
||||||
delete root;
|
delete root;
|
||||||
preloadIcon("item_spark.png");
|
preloadIcon("item_spark.png");
|
||||||
@ -128,14 +129,15 @@ void ItemManager::loadDefaultItemMeshes()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/** Preload icon materials to avoid hangs when firstly insert item
|
/** Preload icon materials to avoid hangs when firstly insert item
|
||||||
*/
|
*/
|
||||||
void ItemManager::preloadIcon(const std::string& name)
|
bool ItemManager::preloadIcon(const std::string& name)
|
||||||
{
|
{
|
||||||
// From IrrDriver::addBillboard
|
// From IrrDriver::addBillboard
|
||||||
Material* m = material_manager->getMaterial(name, false/*full_path*/,
|
Material* m = material_manager->getMaterial(name, false/*full_path*/,
|
||||||
/*make_permanent*/true, /*complain_if_not_found*/true,
|
/*make_permanent*/true, /*complain_if_not_found*/true,
|
||||||
/*strip_path*/false, /*install*/false);
|
/*strip_path*/false, /*install*/false);
|
||||||
m->getTexture(true/*srgb*/, m->getShaderName() == "additive" ||
|
return m->getTexture(true/*srgb*/, m->getShaderName() == "additive" ||
|
||||||
m->getShaderName() == "alphablend" ? true : false/*premul_alpha*/);
|
m->getShaderName() == "alphablend" ? true : false/*premul_alpha*/) !=
|
||||||
|
NULL;
|
||||||
} // preloadIcon
|
} // preloadIcon
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -57,7 +57,7 @@ private:
|
|||||||
|
|
||||||
static uint32_t m_random_seed;
|
static uint32_t m_random_seed;
|
||||||
|
|
||||||
static void preloadIcon(const std::string& name);
|
static bool preloadIcon(const std::string& name);
|
||||||
public:
|
public:
|
||||||
static void loadDefaultItemMeshes();
|
static void loadDefaultItemMeshes();
|
||||||
static void removeTextures();
|
static void removeTextures();
|
||||||
|
Loading…
Reference in New Issue
Block a user