diff options
author | Stijn Buys <ingar@osirion.org> | 2010-11-18 19:43:46 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-11-18 19:43:46 +0000 |
commit | b3fd7b76f217b2fe3900a22111506e34d47473d0 (patch) | |
tree | 113ecceecd99dee9db1ea72222d3158c66fc98af /src | |
parent | a3b3dbf3ced35ae4c0aca148d89509a12f785062 (diff) |
Have r_loadmodels load all particle scripts referenced by models.
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()); + } + } + } } |