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
|
// backwards compatibility
|
||||||
node->get("crash-reset-particles", &m_collision_particles);
|
node->get("crash-reset-particles", &m_collision_particles);
|
||||||
}
|
}
|
||||||
|
if (!m_collision_particles.empty())
|
||||||
|
{
|
||||||
|
ParticleKindManager::get()->getParticles(m_collision_particles);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
s = "";
|
s = "";
|
||||||
if (node->get("shader", &s))
|
if (node->get("shader", &s))
|
||||||
{
|
{
|
||||||
|
@ -200,6 +200,8 @@ ParticleKind::ParticleKind(const std::string &file)
|
|||||||
{
|
{
|
||||||
material_manager->pushTempMaterial(materials, file);
|
material_manager->pushTempMaterial(materials, file);
|
||||||
m_material_file = material_manager->getLatestMaterial()->getTexFname();
|
m_material_file = material_manager->getLatestMaterial()->getTexFname();
|
||||||
|
// Preload textures
|
||||||
|
getMaterial();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
@ -1461,8 +1461,6 @@ void initRest()
|
|||||||
|
|
||||||
race_manager->setTrack(UserConfigParams::m_last_track);
|
race_manager->setTrack(UserConfigParams::m_last_track);
|
||||||
|
|
||||||
// Preload the explosion effects (explode.png)
|
|
||||||
ParticleKindManager::get()->getParticles("explosion.xml");
|
|
||||||
} // initRest
|
} // initRest
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
@ -1564,6 +1562,9 @@ int main(int argc, char *argv[] )
|
|||||||
main_loop = new MainLoop();
|
main_loop = new MainLoop();
|
||||||
material_manager->loadMaterial();
|
material_manager->loadMaterial();
|
||||||
|
|
||||||
|
// Preload the explosion effects (explode.png)
|
||||||
|
ParticleKindManager::get()->getParticles("explosion.xml");
|
||||||
|
|
||||||
GUIEngine::addLoadingIcon( irr_driver->getTexture(FileManager::GUI,
|
GUIEngine::addLoadingIcon( irr_driver->getTexture(FileManager::GUI,
|
||||||
"options_video.png"));
|
"options_video.png"));
|
||||||
kart_properties_manager -> loadAllKarts ();
|
kart_properties_manager -> loadAllKarts ();
|
||||||
|
Loading…
Reference in New Issue
Block a user