diff options
Diffstat (limited to 'src/model/mapfile.cc')
-rw-r--r-- | src/model/mapfile.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/model/mapfile.cc b/src/model/mapfile.cc index 32eee8a..47ea354 100644 --- a/src/model/mapfile.cc +++ b/src/model/mapfile.cc @@ -908,8 +908,9 @@ void MapFile::load_fragmentgroup(Model *model, const FragmentGroup::Type class_t count += fragment->add_vertex(quad->v1() - translation, quad->normal(), quad->t1(), false); count += fragment->add_vertex(quad->v2() - translation, quad->normal(), quad->t2(), false); count += fragment->add_vertex(quad->v3() - translation, quad->normal(), quad->t3(), false); - if (count == 4) + if (count == 4) { model->model_quad_count++; + } } } @@ -1427,8 +1428,20 @@ Model * MapFile::load(std::string const &name) // copy fragments, this only copies the original fragment's pointer into the vertex array for (FragmentGroup::Fragments::const_iterator fit = groupsrc->fragments().begin(); fit != groupsrc->fragments().end(); fit++) { + Fragment *fragmentdst = new Fragment(*(*fit)); groupdst->add_fragment(fragmentdst); + + switch (fragmentdst->type()) { + case Fragment::Triangles: + model->model_tris_count += (fragmentdst->structural_size() + fragmentdst->detail_size()) / 3; + model->model_tris_detail_count += fragmentdst->detail_size() / 3; + break; + case Fragment::Quads: + model->model_quad_count += (fragmentdst->structural_size() + fragmentdst->detail_size()) / 4; + model->model_quad_detail_count += fragmentdst->detail_size() / 4; + break; + } } if (groupdst->size()) { |