Skip to content

Commit

Permalink
CHEWY: Use virtual destructors. Some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Oct 2, 2016
1 parent 8c755b2 commit 8c7c42d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
2 changes: 1 addition & 1 deletion engines/chewy/events.h
Expand Up @@ -34,7 +34,7 @@ class Console;
class Events {
public:
Events(ChewyEngine *vm, Graphics *graphics, Console *console);
~Events() {}
virtual ~Events() {}

void processEvents();

Expand Down
2 changes: 1 addition & 1 deletion engines/chewy/graphics.h
Expand Up @@ -32,7 +32,7 @@ class SpriteResource;
class Graphics {
public:
Graphics(ChewyEngine *vm);
~Graphics();
virtual ~Graphics();

void drawImage(Common::String filename, int imageNum);
void playVideo(uint num);
Expand Down
23 changes: 5 additions & 18 deletions engines/chewy/resource.h
Expand Up @@ -86,19 +86,6 @@ struct TBFChunk {
byte *data;
};

// TAF (sprite) chunk header
/*struct TAFHeader {
// TAF chunk header
// ID (TAF, followed by a zero)
uint16 screenMode;
uint16 spriteCount;
uint32 size; // total size (width * height) of all sprites
byte palette[3 * 256];
uint32 nextSpriteOffset;
uint16 correctionTable;
// 1 byte padding
};*/

// TAF (sprite) image data chunk header - 15 bytes
struct TAFChunk {
uint16 compressionFlag;
Expand Down Expand Up @@ -160,39 +147,39 @@ class Resource {
class SpriteResource : public Resource {
public:
SpriteResource(Common::String filename) : Resource(filename) {}
~SpriteResource() {}
virtual ~SpriteResource() {}

TAFChunk *getSprite(uint num);
};

class BackgroundResource : public Resource {
public:
BackgroundResource(Common::String filename) : Resource(filename) {}
~BackgroundResource() {}
virtual ~BackgroundResource() {}

TBFChunk *getImage(uint num);
};

class SoundResource : public Resource {
public:
SoundResource(Common::String filename) : Resource(filename) {}
~SoundResource() {}
virtual ~SoundResource() {}

SoundChunk *getSound(uint num);
};

class TextResource : public Resource {
public:
TextResource(Common::String filename) : Resource(filename) {}
~TextResource() {}
virtual ~TextResource() {}

Common::String getText(uint num);
};

class VideoResource : public Resource {
public:
VideoResource(Common::String filename) : Resource(filename) {}
~VideoResource() {}
virtual ~VideoResource() {}

VideoChunk *getVideoHeader(uint num);
Common::SeekableReadStream *getVideoStream(uint num);
Expand Down
2 changes: 1 addition & 1 deletion engines/chewy/sound.h
Expand Up @@ -33,7 +33,7 @@ class SoundResource;
class Sound {
public:
Sound(Audio::Mixer *mixer);
~Sound();
virtual ~Sound();

void playSound(int num, bool loop = false);
void playMusic(int num, bool loop = false);
Expand Down

0 comments on commit 8c7c42d

Please sign in to comment.