diff options
author | Stijn Buys <ingar@osirion.org> | 2010-09-19 19:44:13 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-09-19 19:44:13 +0000 |
commit | cc18095cded14f5e7e3f049e47fca2224134b647 (patch) | |
tree | 2a057f4836925083a19988d571dc0664925c9e48 /src/ui/modelview.cc | |
parent | badfb31888a6bd62e0a019b3f3dec517df4121ec (diff) |
text rendering cleanups, inventory capacity & cargo volume
Diffstat (limited to 'src/ui/modelview.cc')
-rwxr-xr-x | src/ui/modelview.cc | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/ui/modelview.cc b/src/ui/modelview.cc index 18cc091..c00cb07 100755 --- a/src/ui/modelview.cc +++ b/src/ui/modelview.cc @@ -35,17 +35,14 @@ void ModelView::print(const size_t indent) const con_print << aux::pad_left(marker, indent*2) << label() << " \"" << modelname() << "\"" << std::endl; } -void ModelView::set_modelname(const std::string & modelname) -{ - modelview_modelname.assign(modelname); -} - void ModelView::set_modelname(const char *modelname) { if (modelname) modelview_modelname.assign(modelname); else modelview_modelname.clear(); + + set_background(false); } void ModelView::set_color(const math::Color & color) @@ -76,16 +73,23 @@ bool ModelView::on_keypress(const int key, const unsigned int modifier) return false; } +void ModelView::draw_background() +{ + Paint::set_color(1.0f, 1.0f, 1.0f); + Paint::draw_bitmap(global_location(), size(), "textures/common/notex"); +} + void ModelView::draw() { if (!modelview_modelname.size()) { return; } - paint::color(1.0f, 1.0f, 1.0f); + Paint::set_color(1.0f, 1.0f, 1.0f); model::Model *model = model::Model::load(modelview_modelname); if (!model) { - paint::bitmap(global_location(), size(), "bitmaps/notex"); + modelview_modelname.clear(); + set_background(true); return; } @@ -102,6 +106,8 @@ void ModelView::draw() gl::enable(GL_CULL_FACE); // enable culling gl::enable(GL_COLOR_MATERIAL); // enable color tracking + + // FIXME - initialize lights gl::enable(GL_LIGHTING); // enable vertex arrays @@ -130,8 +136,8 @@ void ModelView::draw() void ModelView::draw_border() { - paint::color(palette()->foreground()); - paint::border(global_location(), size()); + Paint::set_color(palette()->foreground()); + Paint::draw_border(global_location(), size()); } } |