From 2c98d3eef488233b99a76ca44d69c1c9d53404af Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 7 Dec 2014 16:12:49 +0000 Subject: 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. --- src/model/model.cc | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'src/model/model.cc') 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); -- cgit v1.2.3