diff options
Diffstat (limited to 'src/client/testmodelview.cc')
-rw-r--r-- | src/client/testmodelview.cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/client/testmodelview.cc b/src/client/testmodelview.cc index 4164d6c..40ae1aa 100644 --- a/src/client/testmodelview.cc +++ b/src/client/testmodelview.cc @@ -36,28 +36,7 @@ TestModelView::~TestModelView() void TestModelView::set_modelname(const std::string & modelname) { - model::Model *model = model::Model::load(modelname); - - std::ostringstream str; - str << modelname << '\n'; - - if (model) { - size_t frags = 0; - - for (model::Model::Groups::const_iterator git = model->groups().begin(); git != model->groups().end(); git++) { - frags += (*git)->size(); - } - str << '\n'; - str << "tris: " << model->model_tris_count << '\n'; - str << "quads: " << model->model_quad_count << '\n'; - str << "fragments: " << frags << '\n'; - - testmodelview_modelview->set_modelname(modelname); - } else { - testmodelview_modelview->set_modelname(""); - testmodelview_modelview->set_background(true); - } - testmodelview_text->set_text(str.str()); + testmodelview_modelview->set_modelname(modelname); } void TestModelView::show() @@ -102,6 +81,27 @@ void TestModelView::draw_background() ui::Paint::draw_rectangle(global_location(), size()); } +void TestModelView::draw() +{ + model::Model *model = model::Model::find(testmodelview_modelview->modelname()); + + std::ostringstream str; + str << testmodelview_modelview->modelname() << '\n'; + + if (model) { + size_t frags = 0; + + for (model::Model::Groups::const_iterator git = model->groups().begin(); git != model->groups().end(); git++) { + frags += (*git)->size(); + } + str << '\n'; + str << "tris: " << model->model_tris_count << '\n'; + str << "quads: " << model->model_quad_count << '\n'; + str << "fragments: " << frags << '\n'; + } + testmodelview_text->set_text(str.str()); +} + bool TestModelView::on_emit(Widget *sender, const Event event, void *data) { if (event == ui::Widget::EventButtonClicked) { |