diff options
author | Stijn Buys <ingar@osirion.org> | 2011-01-27 12:36:26 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-01-27 12:36:26 +0000 |
commit | 2a87246be478e5ddd2bef4080f36382a889e02dd (patch) | |
tree | d203a9a49044f03764dc2661f688b1c6c836e56d /src/core | |
parent | 45b93da49b74acd7389e4faa1cfd5dba6cd75c95 (diff) |
Moved material loading from render to core, make sure the dedicated server reads materials.ini,
removed unnecessary CollisionMesh::translate() method.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/commandbuffer.cc | 9 | ||||
-rw-r--r-- | src/core/gameinterface.cc | 9 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/core/commandbuffer.cc b/src/core/commandbuffer.cc index 58fe6be..76d46c4 100644 --- a/src/core/commandbuffer.cc +++ b/src/core/commandbuffer.cc @@ -148,6 +148,11 @@ void func_list_model(std::string const &args) } +void func_list_materials(std::string const &args) +{ + model::Material::list(); +} + void func_list_module(std::string const &args) { Loader::list(); @@ -266,6 +271,9 @@ void CommandBuffer::init() func = Func::add("list_zone", (FuncPtr)func_list_zone); func->set_info("list zones"); + + func = core::Func::add("list_materials", func_list_materials); + func->set_info("list materials"); Func::add("list_model", (FuncPtr) func_list_model); func->set_info("list 3d models"); @@ -303,6 +311,7 @@ void CommandBuffer::shutdown() Func::remove("list_info"); Func::remove("list_inventories"); Func::remove("list_ent"); + Func::remove("list_material"); Func::remove("list_model"); Func::remove("list_module"); Func::remove("list_zone"); diff --git a/src/core/gameinterface.cc b/src/core/gameinterface.cc index 0a485bc..1d3e6fb 100644 --- a/src/core/gameinterface.cc +++ b/src/core/gameinterface.cc @@ -16,6 +16,7 @@ #include "core/gameinterface.h" #include "core/player.h" #include "core/zone.h" +#include "model/material.h" #include "model/model.h" #include "sys/sys.h" @@ -70,6 +71,7 @@ GameInterface::GameInterface() Func *func = Func::add("list_players", func_list_players); func->set_info("get the local list of connected players"); + // TODO this should be moved back into render size_t mb = (size_t) Cvar::mem_vertex->value(); if (mb < 4 * sizeof(float)) mb = 4 * sizeof(float); @@ -77,6 +79,8 @@ GameInterface::GameInterface() mb = 512; (*Cvar::mem_vertex) = (float) mb; game_vertexarray = new model::VertexArray(mb); + + model::Material::init(); } GameInterface::~GameInterface() @@ -106,8 +110,11 @@ void GameInterface::clear() // remove info records Info::clear(); - // remove all models + // remove models model::Model::clear(); + + // remove materials + model::Material::clear(); // clear player list for (Players::iterator it = game_players.begin(); it != game_players.end(); it++) { |