Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/render/draw.cc30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index 75c488b..51530e3 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -553,7 +553,7 @@ void draw_model_fragments(core::Entity *entity)
// default material, lighted and geometry color
const model::Material *material = 0;
- bool use_color_array = true; // glEnableClientState(GL_COLOR_ARRAY) is set
+ //bool use_color_array = true; // glEnableClientState(GL_COLOR_ARRAY) is set
bool use_light = true; // gl::disable(GL_LIGHTING) is set
bool power = true;
@@ -598,18 +598,18 @@ void draw_model_fragments(core::Entity *entity)
if (material) {
if (material->flags() & Material::Engine) {
- if (use_color_array) {
+/* if (use_color_array) {
glDisableClientState(GL_COLOR_ARRAY);
use_color_array = false;
- }
+ }*/
gl::color(model->enginecolor() * thrust);
} else if (material->flags() & Material::Tertiary) {
- if (use_color_array) {
+/* if (use_color_array) {
use_color_array = false;
glDisableClientState(GL_COLOR_ARRAY);
- }
+ }*/
math::Color color;
@@ -631,10 +631,11 @@ void draw_model_fragments(core::Entity *entity)
gl::color(color);
} else {
- if (!use_color_array) {
+/* if (!use_color_array) {
glEnableClientState(GL_COLOR_ARRAY);
use_color_array = true;
- }
+ }*/
+ gl::color(material->color());
}
if (power && (material->flags() & Material::Bright)) {
@@ -659,10 +660,11 @@ void draw_model_fragments(core::Entity *entity)
gl::disable(GL_LIGHTING);
use_light = false;
}
- if (!use_color_array) {
+/* if (!use_color_array) {
glEnableClientState(GL_COLOR_ARRAY);
use_color_array = true;
- }
+ }*/
+ gl::color(1.0f, 0.0f, 1.0f);
}
}
@@ -678,9 +680,9 @@ void draw_model_fragments(core::Entity *entity)
gl::enable(GL_LIGHTING);
}
- if (!use_color_array) {
+/* if (!use_color_array) {
glEnableClientState(GL_COLOR_ARRAY);
- }
+ }*/
}
// draw bounding box
@@ -1031,7 +1033,7 @@ void draw(float seconds)
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
+// glDisableClientState(GL_COLOR_ARRAY);
gl::disable(GL_DEPTH_TEST);
gl::depthmask(GL_FALSE); // disable depth buffer writing
@@ -1055,11 +1057,11 @@ void draw(float seconds)
gl::disable(GL_NORMALIZE);
//gl::disable(GL_RESCALE_NORMAL);
- glEnableClientState(GL_COLOR_ARRAY);
+// glEnableClientState(GL_COLOR_ARRAY);
draw_pass_model_fragments();
- glDisableClientState(GL_COLOR_ARRAY);
+// glDisableClientState(GL_COLOR_ARRAY);
gl::disable(GL_LIGHTING);
gl::enable(GL_BLEND);