Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/render.cc')
-rw-r--r--src/render/render.cc26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/render/render.cc b/src/render/render.cc
index 4ad2d84..12445a6 100644
--- a/src/render/render.cc
+++ b/src/render/render.cc
@@ -130,10 +130,11 @@ void init(int width, int height)
func = core::Func::add("list_particles", func_list_particles);
func->set_info("list registered particle scripts");
+
+ load();
}
// unload game assets (zone change)
-/* TODO RenderExt class containing render state */
void unload()
{
// clear zone sky textures
@@ -165,8 +166,6 @@ void unload()
// clear all assets
void clear()
{
- //con_debug << " clearing render data...\n";
-
// clear zone sky textures
for (core::Zone::Registry::iterator it = core::Zone::registry().begin(); it != core::Zone::registry().end(); it++) {
core::Zone *zone = (*it).second;
@@ -200,6 +199,27 @@ void clear()
ParticleScript::clear();
}
+// load assets
+void load()
+{
+ // load entity models
+ for (core::Entity::Registry::iterator it = core::Entity::registry().begin(); it != core::Entity::registry().end(); it++) {
+ core::Entity *entity = (*it).second;
+
+ if (entity->modelname().size()) {
+ entity->set_model(model::Model::load(entity->modelname()));
+ }
+ }
+
+ // load info models
+ for (core::Info::Registry::iterator it = core::Info::registry().begin(); it != core::Info::registry().end(); it++) {
+ core::Info *info = (*it).second;
+ if (info->modelname().size()) {
+ model::Model::load(info->modelname());
+ }
+ }
+}
+
// reset render subsystem (module disconnect)
void reset()
{