diff options
Diffstat (limited to 'src/render/draw.cc')
-rw-r--r-- | src/render/draw.cc | 52 |
1 files changed, 41 insertions, 11 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc index a48908f..0b6fba2 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -1115,9 +1115,6 @@ void draw_pass_model_fx(float elapsed) void draw_pass_model_radius() { - if (!(r_radius && r_radius->value())) - return; - for (core::Zone::Content::iterator it = zone->content().begin(); it != zone->content().end(); it++) { core::Entity *entity = (*it); @@ -1213,7 +1210,13 @@ void draw(float seconds) gl::enable(GL_COLOR_MATERIAL); // enable color tracking gl::enable(GL_LIGHTING); // enable lighting - gl::enable(GL_NORMALIZE); // enable rescaling of normals + if (r_normalize && r_normalize->value()) { + // enable full normalization + gl::enable(GL_NORMALIZE); + } else { + // enable rescaling of normals + gl::enable(GL_RESCALE_NORMAL); + } draw_pass_globes(); // draw globes @@ -1221,7 +1224,13 @@ void draw(float seconds) draw_pass_model_fragments(); - gl::disable(GL_NORMALIZE); // disable resaling of normals + if (r_normalize && r_normalize->value()) { + // disable full normalization + gl::disable(GL_NORMALIZE); + } else { + // disable resaling of normals + gl::disable(GL_RESCALE_NORMAL); + } gl::disable(GL_LIGHTING); // disable lighting gl::enable(GL_BLEND); @@ -1233,19 +1242,40 @@ void draw(float seconds) Dust::draw(zone_color); // draw spacedust } - draw_pass_model_fx(seconds); // draw entity lights and engines + // draw entity lights, flares and particles + draw_pass_model_fx(seconds); + + // draw entity radius globe + if (r_radius && r_radius->value()) { - gl::enable(GL_LIGHTING); - gl::enable(GL_RESCALE_NORMAL); + if (r_normalize && r_normalize->value()) { + // enable full normalization + gl::enable(GL_NORMALIZE); + } else { + // enable rescaling of normals + gl::enable(GL_RESCALE_NORMAL); + } - draw_pass_model_radius(); // draw entity radius + gl::enable(GL_LIGHTING); + + draw_pass_model_radius(); + + gl::disable(GL_LIGHTING); + + if (r_normalize && r_normalize->value()) { + // disable full normalization + gl::disable(GL_NORMALIZE); + } else { + // disable resaling of normals + gl::disable(GL_RESCALE_NORMAL); + } + } glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); - gl::disable(GL_RESCALE_NORMAL); - gl::disable(GL_LIGHTING); + gl::disable(GL_COLOR_MATERIAL); // disable color tracking gl::disable(GL_CULL_FACE); // disable culling |