diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/render/render.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/render/render.cc b/src/render/render.cc index 2a325e9..7776ef2 100644 --- a/src/render/render.cc +++ b/src/render/render.cc @@ -19,6 +19,7 @@ #include "render/gl.h" #include "render/state.h" #include "render/dust.h" +#include "render/particles.h" #include "render/render.h" #include "render/screenshot.h" #include "render/sky.h" @@ -230,15 +231,27 @@ void load() } // load all models referenced by info records +// this function can be useful when checking models for parsing errors void load_info_models() { - // load info models + // load all models referenced by info records for (core::Info::Registry::iterator it = core::Info::registry().begin(); it != core::Info::registry().end(); it++) { core::Info *info = (*it); if (info->modelname().size()) { model::Model::load(info->modelname()); } } + + // load all particle scripts referenced by models + for (model::Model::Registry::iterator it = model::Model::registry().begin(); it != model::Model::registry().end(); it++) { + + for (model::Model::ParticleSystems::iterator pit = (*it).second->particles().begin(); pit != (*it).second->particles().end(); pit++) { + model::Particles *particles = (*pit); + if (particles->script().size()) { + ParticleScript::load(particles->script()); + } + } + } } |