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')
-rw-r--r--src/render/draw.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index 54a56a0..47f0d7a 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -296,11 +296,23 @@ void draw_model_fragments(core::Entity *entity)
use_color_array = false;
glDisableClientState(GL_COLOR_ARRAY);
}
- // FIXME Primary, Secondary Tertiary color
- math::Color color(entity->color());
+
+ math::Color color;
+
+ if ((material & Material::Tertiary) == Material::Tertiary) {
+ for (size_t i = 0; i < 3; i++)
+ color[i] = (entity->color()[i] + entity->color_second()[i]) / 2;
+
+ } else if ((material & Material::Secondary) == Material::Secondary) {
+ color.assign(entity->color_second());
+
+ } if ((material & Material::Primary) == Material::Primary) {
+ color.assign(entity->color());
+ }
if (material & Material::Dark)
color *= 0.5f;
+
gl::color(color);
} else {