Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/draw.cc')
-rw-r--r--src/render/draw.cc36
1 files changed, 12 insertions, 24 deletions
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);
}
}