From 53faab4c1d692fed7c7ecfedea57fc457bf61e80 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 24 Feb 2009 19:13:27 +0000 Subject: Replaced 'The Osirion Project' with 'Project::OSiRioN' in messages, added g_collision cflag to facillitate future development, added ShowOnMap entity flag --- src/render/draw.cc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/render') diff --git a/src/render/draw.cc b/src/render/draw.cc index 51530e3..a435eff 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -50,11 +50,6 @@ bool has_zone_light = false; typedef std::map Globes; Globes globes_list; -// function to test flags -inline bool flag_is_set(unsigned int const flags, unsigned int const flag) { - return ((flags & flag) == flag); -} - /* ---- Prepare the renderer state --------------------------------- */ void pass_prepare(float seconds) @@ -87,7 +82,7 @@ void pass_prepare(float seconds) } // add level lights - if (flag_is_set(globe->flags(), core::Entity::Bright)) { + if (globe->flag_is_set(core::Entity::Bright)) { // bright globes set level light GLfloat diffuse_light[4]; @@ -195,7 +190,7 @@ void draw_globe(core::EntityGlobe *globe) math::Vector3f location(globe->location()); float radius = globe->radius(); - if(flag_is_set(globe->flags(), core::Entity::Bright)) { + if(globe->flag_is_set(core::Entity::Bright)) { // bright globe, render fullbright gl::disable(GL_LIGHTING); } else { @@ -240,7 +235,7 @@ void draw_globe(core::EntityGlobe *globe) gl::pop(); - if(flag_is_set(globe->flags(), core::Entity::Bright)) { + if(globe->flag_is_set(core::Entity::Bright)) { math::Vector3f v = globe->location() - Camera::eye(); v.normalize(); @@ -300,7 +295,7 @@ void draw_globe(core::EntityGlobe *globe) } } - if (flag_is_set(globe->flags(), core::Entity::Bright)) { + if (globe->flag_is_set(core::Entity::Bright)) { gl::enable(GL_LIGHTING); } else { gl::enable(GL_LIGHT0); @@ -486,7 +481,7 @@ void draw_pass_default() gl::translate(entity->location()); gl::multmatrix(entity->axis()); - if (flag_is_set(entity->flags(), core::Entity::Bright)) { + if (entity->flag_is_set(core::Entity::Bright)) { gl::disable(GL_LIGHTING); } @@ -510,7 +505,7 @@ void draw_pass_default() break; } - if (flag_is_set(entity->flags(), core::Entity::Bright)) { + if (entity->flag_is_set(core::Entity::Bright)) { gl::enable(GL_LIGHTING); } -- cgit v1.2.3