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>2012-10-07 21:42:50 +0000
committerStijn Buys <ingar@osirion.org>2012-10-07 21:42:50 +0000
commit4131fcb1b53dc85ced61ff2cc41889811c8a2aaf (patch)
treec1638afb195ae02d481d1fa69509f61da0cb1e07 /src/ui/modelview.cc
parent9ce4282b3c309bb838888264f2e68c0b458224ac (diff)
Added Widget::EventClicked and Widget::EventDoubleClicked,
made ModelView::clear() work according to specification.
Diffstat (limited to 'src/ui/modelview.cc')
-rwxr-xr-xsrc/ui/modelview.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/ui/modelview.cc b/src/ui/modelview.cc
index e4975a3..8069ac7 100755
--- a/src/ui/modelview.cc
+++ b/src/ui/modelview.cc
@@ -22,7 +22,7 @@ namespace ui
{
const float LIGHT_DISTANCE = -10.0f;
-const float LIGHT_ATTENUATION = 0.2f;
+const float LIGHT_ATTENUATION = 0.5f;
ModelView::ModelView(Widget *parent) : Widget(parent)
{
@@ -50,7 +50,7 @@ void ModelView::print(const size_t indent) const
con_print << aux::pad_left(marker, indent*2) << label() << " \"" << modelname() << "\"" << std::endl;
}
-void ModelView::clear()
+void ModelView::reset()
{
set_background(false);
@@ -66,9 +66,15 @@ void ModelView::clear()
modelview_globebright = false;
}
+void ModelView::clear()
+{
+ reset();
+ modelview_mode = Model;
+}
+
void ModelView::set_globetexturename(const std::string & texturename, const bool bright, const std::string & coronaname)
{
- clear();
+ reset();
modelview_globetexturename.assign(texturename);
modelview_globecoronaname.assign(coronaname);
modelview_globebright = bright;
@@ -76,7 +82,7 @@ void ModelView::set_globetexturename(const std::string & texturename, const bool
void ModelView::set_modelname(const std::string & modelname)
{
- clear();
+ reset();
modelview_modelname.assign(modelname);
}
@@ -190,7 +196,7 @@ void ModelView::draw_globe()
math::Vector3f(LIGHT_DISTANCE * reference_radius, 0, 0),
math::Color(1.0f, 1.0f, 1.0f)
);
- light->set_attenuation(LIGHT_ATTENUATION, LIGHT_ATTENUATION, 0.0f);
+ light->set_attenuation(0.0f, LIGHT_ATTENUATION, 0.0f);
render::LightEnvironment lightenv;
lightenv.add(light);
@@ -290,7 +296,7 @@ void ModelView::draw_model()
math::Vector3f(LIGHT_DISTANCE * reference_radius, 0, 0),
math::Color(1.0f, 1.0f, 1.0f)
);
- light->set_attenuation(LIGHT_ATTENUATION, LIGHT_ATTENUATION, 0.0f);
+ light->set_attenuation(0.0f, LIGHT_ATTENUATION, 0.0f);
render::LightEnvironment lightenv;
lightenv.add(light);