Skip to content

Commit

Permalink
AURORA: Use PtrMap for the entries in TalkTable_GFF
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 26, 2016
1 parent 76e4d9a commit 8172d33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
8 changes: 0 additions & 8 deletions src/aurora/talktable_gff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ TalkTable_GFF::TalkTable_GFF(Common::SeekableReadStream *tlk, Common::Encoding e
}

TalkTable_GFF::~TalkTable_GFF() {
clean();
}

void TalkTable_GFF::clean() {
for (Entries::iterator e = _entries.begin(); e != _entries.end(); ++e)
delete e->second;
}

bool TalkTable_GFF::hasEntry(uint32 strRef) const {
Expand Down Expand Up @@ -91,8 +85,6 @@ void TalkTable_GFF::load(Common::SeekableReadStream *tlk) {
throw Common::Exception("Unsupported GFF TLK file version %08X", _gff->getTypeVersion());

} catch (Common::Exception &e) {
clean();

e.add("Unable to load GFF TLK");
throw;
}
Expand Down
5 changes: 2 additions & 3 deletions src/aurora/talktable_gff.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "src/common/types.h"
#include "src/common/scopedptr.h"
#include "src/common/ptrmap.h"
#include "src/common/ustring.h"

#include "src/aurora/types.h"
Expand Down Expand Up @@ -67,7 +68,7 @@ class TalkTable_GFF : public TalkTable {
Entry(const GFF4Struct *s = 0) : strct(s) { }
};

typedef std::map<uint32, Entry *> Entries;
typedef Common::PtrMap<uint32, Entry> Entries;


Common::ScopedPtr<GFF4File> _gff;
Expand All @@ -84,8 +85,6 @@ class TalkTable_GFF : public TalkTable {

void readString05(Common::SeekableReadStream *huffTree,
Common::SeekableReadStream *bitStream, Entry &entry) const;

void clean();
};

} // End of namespace Aurora
Expand Down

0 comments on commit 8172d33

Please sign in to comment.