diff options
author | Stijn Buys <ingar@osirion.org> | 2008-03-02 12:23:48 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-03-02 12:23:48 +0000 |
commit | 81787e9004377016236865e95b95707ed6cf1d0b (patch) | |
tree | b8a7bd0d51f97848ad98ec8c8f5e424de910df32 /src/client | |
parent | 1d45d8ecb4633f07a0ff163255dbedc3c3a72ac8 (diff) |
initial (buggy) support for .map models
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/draw.cc | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/client/draw.cc b/src/client/draw.cc index 11d4aa7..76c55b3 100644 --- a/src/client/draw.cc +++ b/src/client/draw.cc @@ -8,6 +8,7 @@ #include "render/render.h" #include "render/sphere.h" #include "render/box.h" +#include "render/model.h" #include "client/client.h" #include "client/camera.h" #include "client/draw.h" @@ -55,23 +56,32 @@ void draw_entity_diamond(core::Entity *entity) // draw an entity of entity_type core::Entity::Default void draw_entity_default(core::Entity *entity) { + render::Model *model = 0; + if (entity->modelname().size()) + model = render::Model::get(entity->modelname()); + render::gl::push(); render::gl::translate(entity->location()); - - switch(entity->shape()) { - case core::Entity::Sphere: - draw_entity_sphere(entity); - break; - case core::Entity::Diamond: - draw_entity_diamond(entity); - break; + if (model) { + render::gl::color(entity->color()); + model->draw(); + } else { + switch(entity->shape()) { + case core::Entity::Sphere: + draw_entity_sphere(entity); + break; + + case core::Entity::Diamond: + draw_entity_diamond(entity); + break; - case core::Entity::Cube: + case core::Entity::Cube: default: draw_entity_cube(entity); break; + } } render::gl::pop(); |