Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-07-31 18:19:27 +0000
committerStijn Buys <ingar@osirion.org>2011-07-31 18:19:27 +0000
commit67ebc66aa1be7188f99e215e1353c27cf203308f (patch)
treeaf799ce09a2ff1426c091c48fb41a07b50972d06
parent12e47f19f008d9134bad137a07a53e75207e50ff (diff)
Added methods to ui::ModelView to pass primary and secondary color to the renderer.
-rwxr-xr-xsrc/ui/modelview.cc8
-rwxr-xr-xsrc/ui/modelview.h9
2 files changed, 8 insertions, 9 deletions
diff --git a/src/ui/modelview.cc b/src/ui/modelview.cc
index 4ce388c..d4f76fa 100755
--- a/src/ui/modelview.cc
+++ b/src/ui/modelview.cc
@@ -60,9 +60,10 @@ void ModelView::set_modelname(const char *modelname)
modelview_zoom = 1.0f;
}
-void ModelView::set_color(const math::Color & color)
+void ModelView::set_colors(const math::Color & color_primary, const math::Color & color_secondary)
{
- modelview_color.assign(color);
+ modelview_color_primary.assign(color_primary);
+ modelview_color_secondary.assign(color_secondary);
}
void ModelView::set_zoom(const float zoom)
@@ -191,6 +192,7 @@ void ModelView::draw()
render::State::set_normalize(true);
+ // FIXME the inventory window needs to be able to use actual thrust values
float thrust = ::sinf(core::application()->time() * 0.5f);
if (thrust < 0.0f ) {
thrust = 1.0f + thrust;
@@ -198,7 +200,7 @@ void ModelView::draw()
thrust = 1.0f;
}
- render::draw_model_fragments(model, core::localplayer()->color(), core::localplayer()->color_second(), core::application()->time(), true, true, thrust);
+ render::draw_model_fragments(model, modelview_color_primary, modelview_color_primary, core::application()->time(), true, true, thrust);
render::State::set_normalize(false);
diff --git a/src/ui/modelview.h b/src/ui/modelview.h
index c235e99..f63dfa8 100755
--- a/src/ui/modelview.h
+++ b/src/ui/modelview.h
@@ -23,10 +23,6 @@ public:
return modelview_modelname;
}
- inline math::Color const &color() const {
- return modelview_color;
- }
-
inline float zoom() const {
return modelview_zoom;
}
@@ -41,7 +37,7 @@ public:
set_modelname(modelname.c_str());
}
- void set_color(const math::Color &color);
+ void set_colors(const math::Color & color_primary, const math::Color & color_secondary);
/// print modelview description
virtual void print(const size_t indent) const;
@@ -81,7 +77,8 @@ protected:
private:
std::string modelview_modelname;
- math::Color modelview_color;
+ math::Color modelview_color_primary;
+ math::Color modelview_color_secondary;
float modelview_zoom;
float modelview_radius;