diff options
author | Stijn Buys <ingar@osirion.org> | 2012-11-25 12:06:13 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-11-25 12:06:13 +0000 |
commit | d8be908233fd7b85492d7a9e87f07bb207173990 (patch) | |
tree | 70d9103a867688838fc517290bb370366c69fedb /src/model/mapfile.cc | |
parent | edc5ddce817244111b302e449c28a052f2746cc4 (diff) |
Moved core::EntityGlobe into a separate file,
added various methods to core::Item and core::Slot,
added r_slots cvar to draw entity slots and docks,
added game methods for mounting and umounting of weapons,
added playerlist to chat window.
Diffstat (limited to 'src/model/mapfile.cc')
-rw-r--r-- | src/model/mapfile.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/model/mapfile.cc b/src/model/mapfile.cc index fd82036..9badc9b 100644 --- a/src/model/mapfile.cc +++ b/src/model/mapfile.cc @@ -2045,11 +2045,25 @@ Model * MapFile::load(std::string const &name) model->set_origin(map_center * -1.0f); // translate transformed vertex groups + size_t frags = 0; for (Model::Groups::iterator git = model->groups().begin(); git != model->groups().end(); git++) { FragmentGroup *fragmentgroup = (*git); fragmentgroup->set_location(fragmentgroup->location() - map_center); + frags += fragmentgroup->size(); } + // set a sane radius if the mapfile is empty + if (frags == 0) { + const float r = SCALE; + model->model_box.assign( + math::Vector3f(-r, -r, -r), + math::Vector3f(r, r, r) + + ); + model->set_radius(model->box().max().length()); + } + + // translate tags for (Model::Lights::iterator lit = model->lights().begin(); lit != model->lights().end(); lit++) { (*lit)->get_location() -= map_center; @@ -2074,7 +2088,7 @@ Model * MapFile::load(std::string const &name) for (Model::Weapons::iterator wit = model->weapons().begin(); wit != model->weapons().end(); wit++) { (*wit)->get_location() -= map_center; } - + if (mapfile.warning_q2brush) con_warn << mapfile.name() << " quake2 style brushes detected" << std::endl; |