From 67ebc66aa1be7188f99e215e1353c27cf203308f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 31 Jul 2011 18:19:27 +0000 Subject: Added methods to ui::ModelView to pass primary and secondary color to the renderer. --- src/ui/modelview.cc | 8 +++++--- src/ui/modelview.h | 9 +++------ 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; -- cgit v1.2.3