diff options
author | Stijn Buys <ingar@osirion.org> | 2014-12-07 16:12:49 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2014-12-07 16:12:49 +0000 |
commit | 2c98d3eef488233b99a76ca44d69c1c9d53404af (patch) | |
tree | 9259bad9533d1de7381b291eee19fd319b8366eb /src/model/model.cc | |
parent | acb236d0df275394095ab43e8519aebc4811865d (diff) |
Cleanup of the slots code, unified model weapon and dock tags into a single slots list,
load dock tags into entity slots, represent entity slot locations in entity coordinate space,
have r_slots render fixed-size slot indicators regardless of model scale.
Diffstat (limited to 'src/model/model.cc')
-rw-r--r-- | src/model/model.cc | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/model/model.cc b/src/model/model.cc index fdff22e..e98a251 100644 --- a/src/model/model.cc +++ b/src/model/model.cc @@ -43,11 +43,11 @@ Model::~Model() } model_groups.clear(); - // delete all docks - for (Docks::iterator dit = model_docks.begin(); dit != model_docks.end(); ++dit) { - delete(*dit); + // delete all slots + for (Slots::iterator slit = model_slots.begin(); slit != model_slots.end(); ++slit) { + delete(*slit); } - model_docks.clear(); + model_slots.clear(); // delete all particle systems for (Model::ParticleSystems::iterator pit = model_particles.begin(); pit != model_particles.end(); ++pit) { @@ -72,12 +72,6 @@ Model::~Model() delete (*sit); } model_sounds.clear(); - - // delete all weapon tags - for (Weapons::iterator wit = model_weapons.begin(); wit != model_weapons.end(); ++wit) { - delete (*wit); - } - model_weapons.clear(); } void Model::set_collisionmodel(CollisionModel *collisionmodel) @@ -120,14 +114,9 @@ void Model::add_sound(Sound *sound) model_sounds.push_back(sound); } -void Model::add_dock(Dock *dock) -{ - model_docks.push_back(dock); -} - -void Model::add_weapon(Weapon *weapon) +void Model::add_slot(Slot *slot) { - model_weapons.push_back(weapon); + model_slots.push_back(slot); } void Model::print() const @@ -193,8 +182,7 @@ bool compare_tag_location_front(const Tag *first, const Tag *second) } void Model::sort() { - model_weapons.sort(compare_tag_location); - model_docks.sort(compare_tag_location_front); + model_slots.sort(compare_tag_location_front); model_particles.sort(compare_tag_location); model_lights.sort(compare_tag_location); |