Preload the particle textures when first load
This prevent hangs when lazy loading texture runtime
This commit is contained in:
parent
7e0d706946
commit
c8d13d7360
@ -174,9 +174,12 @@ Material::Material(const XMLNode *node, bool deprecated)
|
||||
// backwards compatibility
|
||||
node->get("crash-reset-particles", &m_collision_particles);
|
||||
}
|
||||
if (!m_collision_particles.empty())
|
||||
{
|
||||
ParticleKindManager::get()->getParticles(m_collision_particles);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
s = "";
|
||||
if (node->get("shader", &s))
|
||||
{
|
||||
|
@ -200,6 +200,8 @@ ParticleKind::ParticleKind(const std::string &file)
|
||||
{
|
||||
material_manager->pushTempMaterial(materials, file);
|
||||
m_material_file = material_manager->getLatestMaterial()->getTexFname();
|
||||
// Preload textures
|
||||
getMaterial();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -1461,8 +1461,6 @@ void initRest()
|
||||
|
||||
race_manager->setTrack(UserConfigParams::m_last_track);
|
||||
|
||||
// Preload the explosion effects (explode.png)
|
||||
ParticleKindManager::get()->getParticles("explosion.xml");
|
||||
} // initRest
|
||||
|
||||
//=============================================================================
|
||||
@ -1564,6 +1562,9 @@ int main(int argc, char *argv[] )
|
||||
main_loop = new MainLoop();
|
||||
material_manager->loadMaterial();
|
||||
|
||||
// Preload the explosion effects (explode.png)
|
||||
ParticleKindManager::get()->getParticles("explosion.xml");
|
||||
|
||||
GUIEngine::addLoadingIcon( irr_driver->getTexture(FileManager::GUI,
|
||||
"options_video.png"));
|
||||
kart_properties_manager -> loadAllKarts ();
|
||||
|
Loading…
x
Reference in New Issue
Block a user