From 00464c237fbd3a01137099dedf23dc44569472fd Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 24 May 2008 15:38:07 +0000 Subject: surface flags: light --- src/render/draw.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/render') diff --git a/src/render/draw.cc b/src/render/draw.cc index dadd0fa..4295330 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -166,6 +166,22 @@ void draw_model_vertex(core::Entity *entity) } } +void draw_model_lvertex(core::Entity *entity) +{ + size_t count = entity->model()->lvertex_structural(); + if (entity->state()->detailvisible()) + count += entity->model()->lvertex_detail(); + + // draw model lvertices + if (count) { + gl::disable(GL_LIGHTING); + size_t index = entity->model()->first_lvertex(); + glDrawArrays(gl::Triangles, index, count); + Stats::tris += count/3; + gl::enable(GL_LIGHTING); + } +} + void draw_model_evertex(core::Entity *entity) { size_t count = entity->model()->evertex_structural(); @@ -180,6 +196,7 @@ void draw_model_evertex(core::Entity *entity) Stats::tris += count/3; } } + /* void draw_model_engines(core::EntityControlable *entity) { @@ -412,6 +429,7 @@ void draw_pass_model_vertex() gl::multmatrix(entity->state()->axis()); draw_model_vertex(entity); + draw_model_lvertex(entity); gl::pop(); } -- cgit v1.2.3