25067Fermer25069
bearbecueLe 17/02/2013 à 15:27
void PreloadAllScenes(CParticleSceneInterface *sceneInterface)
{
CString pathSuffix = "/Spawner";
TArray<PParticleDescriptor> childDescs;
CParticleMediumCollection *mCollection = sceneInterface->ParticleMediumCollection();

for (hh_u32 i = 0; i < HH_ARRAY_COUNT(g_SceneList); i++)
{
PActionFactory spawner = HBO::g_Context->LoadObject<CActionFactory>(g_SceneList[i].m_Path + pathSuffix);
if (spawner != null)
{
HBO::GatherChilds<CParticleDescriptor>(spawner, childDescs);

for (hh_u32 j = 0; j < childDescs.Count(); i++)
{
HH_ASSERT(childDescs[i] != null);

for (hh_u32 s = 0; s < childDescs[i]->States().Count(); s++)
mCollection->FindOrCreateCompatibleMedium(childDescs[i].Get(), s);

mCollection->FindOrCreateCompatibleRenderMedium(childDescs[i]->Renderer().Get());
}
}
}
}