Skip to content

Commit

Permalink
IMAGES: Use PtrVector in CBGT
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 29, 2016
1 parent 7e0d683 commit c08726c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/images/cbgt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ CBGT::ReadContext::ReadContext(Common::SeekableReadStream &c,
cbgt(&c), pal(&p), twoda(&t) {
}

CBGT::ReadContext::~ReadContext() {
for (Palettes::iterator p = palettes.begin(); p != palettes.end(); ++p)
delete[] *p;
for (Cells::iterator c = cells.begin(); c != cells.end(); ++c)
delete *c;
}


CBGT::CBGT(Common::SeekableReadStream &cbgt, Common::SeekableReadStream &pal,
Common::SeekableReadStream &twoda) {
Expand Down
7 changes: 4 additions & 3 deletions src/images/cbgt.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

#include <vector>

#include "src/common/ptrvector.h"

#include "src/images/decoder.h"

namespace Common {
Expand Down Expand Up @@ -59,9 +61,9 @@ class CBGT : public Decoder {
~CBGT();

private:
typedef std::vector<byte *> Palettes;
typedef Common::PtrVector<byte, Common::DeallocatorArray> Palettes;
typedef std::vector<size_t> PaletteIndices;
typedef std::vector<Common::SeekableReadStream *> Cells;
typedef Common::PtrVector<Common::SeekableReadStream> Cells;

struct ReadContext {
Common::SeekableReadStream *cbgt;
Expand All @@ -80,7 +82,6 @@ class CBGT : public Decoder {
ReadContext(Common::SeekableReadStream &c,
Common::SeekableReadStream &p,
Common::SeekableReadStream &t);
~ReadContext();
};

void load(ReadContext &ctx);
Expand Down

0 comments on commit c08726c

Please sign in to comment.