From 02b285bf20603bab6fc75d106acbaccead645eb9 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 24 Nov 2010 23:00:28 +0000 Subject: Actually add entities in the intro to their zone, removed core::EntityControlable::movement(), cleaned up core::EntityGlobe, adds support for a per-globe corona, adds core::EntityControlable::control_flags(), bumps network protocol version to 21 --- src/render/draw.cc | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'src/render/draw.cc') diff --git a/src/render/draw.cc b/src/render/draw.cc index 4cf5571..79daffd 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -202,9 +202,9 @@ void draw_globe(const core::EntityGlobe* globe) gl::disable(GL_LIGHT0); } - if (globe->render_texture) { + if (globe->texture_id()) { // textured globe - Textures::bind(globe->render_texture); + Textures::bind(globe->texture_id()); gl::enable(GL_TEXTURE_2D); } @@ -238,29 +238,23 @@ void draw_globe(const core::EntityGlobe* globe) draw_sphere(globe->color(), radius); gl::pop(); - - if (globe->flag_is_set(core::Entity::Bright)) { + if (globe->flag_is_set(core::Entity::Bright) && globe->corona_id()) { math::Vector3f v = globe->location() - Camera::eye(); v.normalize(); float a = dotproduct(v, Camera::axis().forward()); if (a > 0.1f) { - // FIXME a corona is actually just a giant flare - if (!globe->render_texture) { - gl::enable(GL_TEXTURE_2D); - } - Textures::bind("textures/fx/corona"); - /* - if (ext_render(globe)->distance() <= farplane) { - gl::depthmask(GL_FALSE); - }*/ + gl::enable(GL_BLEND); gl::disable(GL_DEPTH_TEST); + gl::enable(GL_TEXTURE_2D); + + Textures::bind(globe->corona_id()); math::Color color(globe->color()); color.a = a - 0.1f; gl::color(color); - gl::enable(GL_BLEND); + gl::begin(gl::Quads); glTexCoord2f(0, 1); @@ -275,16 +269,10 @@ void draw_globe(const core::EntityGlobe* globe) Stats::quads++; - gl::disable(GL_BLEND); - /* - if (ext_render(globe)->distance() <= farplane) { - gl::depthmask(GL_TRUE); - }*/ - if (!globe->render_texture) { - gl::disable(GL_TEXTURE_2D); - } - + + gl::disable(GL_TEXTURE_2D); gl::enable(GL_DEPTH_TEST); + gl::disable(GL_BLEND); } } @@ -305,7 +293,7 @@ void draw_globe(const core::EntityGlobe* globe) gl::enable(GL_LIGHT0); } - if (globe->render_texture) { + if (globe->texture_id()) { gl::disable(GL_TEXTURE_2D); } } -- cgit v1.2.3