Skip to content

Commit

Permalink
DRAGONAGE2: Use PtrList for the creature models
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 26, 2016
1 parent f21a681 commit acf7c17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
19 changes: 2 additions & 17 deletions src/engines/dragonage2/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,11 @@ Creature::Creature() : Object(kObjectTypeCreature) {
Creature::Creature(const GFF3Struct &creature) : Object(kObjectTypeCreature) {
init();

try {
load(creature);
} catch (...) {
clean();
throw;
}
load(creature);
}

Creature::~Creature() {
clean();
hide();
}

void Creature::init() {
Expand All @@ -91,16 +86,6 @@ void Creature::init() {
_partVariation[i] = 0xFFFFFFFF;
}

void Creature::clean() {
try {
hide();

for (Models::iterator m = _models.begin(); m != _models.end(); ++m)
delete *m;
} catch (...) {
}
}

void Creature::setPosition(float x, float y, float z) {
Object::setPosition(x, y, z);
Object::getPosition(x, y, z);
Expand Down
5 changes: 2 additions & 3 deletions src/engines/dragonage2/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <vector>
#include <list>

#include "src/common/ptrlist.h"
#include "src/common/ustring.h"

#include "src/aurora/types.h"
Expand Down Expand Up @@ -101,7 +102,7 @@ class Creature : public Object {
};
typedef std::vector<EquipItem> Items;

typedef std::list<Graphics::Aurora::Model *> Models;
typedef Common::PtrList<Graphics::Aurora::Model> Models;


bool _isPC; ///< Is the creature a PC?
Expand Down Expand Up @@ -144,8 +145,6 @@ class Creature : public Object {
static Common::UString createModelPrefix(const Aurora::GDAFile &gda, size_t row);
static Common::UString createModelPart(const Aurora::GDAFile &gda, size_t row,
const Common::UString &prefix);

void clean();
};

} // End of namespace Dragon Age
Expand Down

0 comments on commit acf7c17

Please sign in to comment.