AGI: Add override keywords

This commit is contained in:
Bastien Bouclet 2020-02-09 12:05:27 +01:00
parent 61ac4a5ab4
commit 3f3c88ce6a
13 changed files with 88 additions and 88 deletions

@ -622,13 +622,13 @@ private:
public:
AgiLoader_v1(AgiEngine *vm);
virtual int init();
virtual int deinit();
virtual int detectGame();
virtual int loadResource(int16 resourceType, int16 resourceNr);
virtual int unloadResource(int16 resourceType, int16 resourceNr);
virtual int loadObjects(const char *);
virtual int loadWords(const char *);
int init() override;
int deinit() override;
int detectGame() override;
int loadResource(int16 resourceType, int16 resourceNr) override;
int unloadResource(int16 resourceType, int16 resourceNr) override;
int loadObjects(const char *) override;
int loadWords(const char *) override;
};
class AgiLoader_v2 : public AgiLoader {
@ -644,13 +644,13 @@ public:
_vm = vm;
}
virtual int init();
virtual int deinit();
virtual int detectGame();
virtual int loadResource(int16 resourceType, int16 resourceNr);
virtual int unloadResource(int16 resourceType, int16 resourceNr);
virtual int loadObjects(const char *);
virtual int loadWords(const char *);
int init() override;
int deinit() override;
int detectGame() override;
int loadResource(int16 resourceType, int16 resourceNr) override;
int unloadResource(int16 resourceType, int16 resourceNr) override;
int loadObjects(const char *) override;
int loadWords(const char *) override;
};
class AgiLoader_v3 : public AgiLoader {
@ -666,13 +666,13 @@ public:
_vm = vm;
}
virtual int init();
virtual int deinit();
virtual int detectGame();
virtual int loadResource(int16 resourceType, int16 resourceNr);
virtual int unloadResource(int16 resourceType, int16 resourceNr);
virtual int loadObjects(const char *);
virtual int loadWords(const char *);
int init() override;
int deinit() override;
int detectGame() override;
int loadResource(int16 resourceType, int16 resourceNr) override;
int unloadResource(int16 resourceType, int16 resourceNr) override;
int loadObjects(const char *) override;
int loadWords(const char *) override;
};
class GfxFont;
@ -713,14 +713,14 @@ protected:
// Engine API
Common::Error init();
virtual Common::Error go() = 0;
virtual Common::Error run() override {
Common::Error run() override {
Common::Error err;
err = init();
if (err.getCode() != Common::kNoError)
return err;
return go();
}
virtual bool hasFeature(EngineFeature f) const override;
bool hasFeature(EngineFeature f) const override;
virtual void initialize() = 0;
@ -752,7 +752,7 @@ public:
virtual void clearKeyQueue() = 0;
AgiBase(OSystem *syst, const AGIGameDescription *gameDesc);
~AgiBase();
~AgiBase() override;
virtual void clearImageStack() = 0;
virtual void recordImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3,
@ -836,7 +836,7 @@ struct AgiOpCodeDefinitionEntry {
class AgiEngine : public AgiBase {
protected:
// Engine APIs
virtual Common::Error go() override;
Common::Error go() override;
void initialize() override;
@ -844,7 +844,7 @@ protected:
public:
AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc);
virtual ~AgiEngine();
~AgiEngine() override;
bool promptIsEnabled() override;
@ -915,9 +915,9 @@ public:
int agiUnloadResource(int16 resourceType, int16 resourceNr);
void agiUnloadResources();
virtual int getKeypress() override;
virtual bool isKeypress() override;
virtual void clearKeyQueue() override;
int getKeypress() override;
bool isKeypress() override;
void clearKeyQueue() override;
byte getVar(int16 varNr);
void setVar(int16 varNr, byte newValue);

@ -77,7 +77,7 @@ private:
class MickeyConsole : public GUI::Debugger {
public:
MickeyConsole(MickeyEngine *mickey);
virtual ~MickeyConsole() {}
~MickeyConsole() override {}
private:
MickeyEngine *_mickey;
@ -90,7 +90,7 @@ private:
class WinnieConsole : public GUI::Debugger {
public:
WinnieConsole(WinnieEngine *winnie);
virtual ~WinnieConsole() {}
~WinnieConsole() override {}
private:
WinnieEngine *_winnie;

@ -209,19 +209,19 @@ public:
return "agi";
}
virtual const char *getName() const override {
const char *getName() const override {
return "AGI preAGI + v2 + v3";
}
virtual const char *getOriginalCopyright() const override {
const char *getOriginalCopyright() const override {
return "Sierra AGI Engine (C) Sierra On-Line Software";
}
virtual bool hasFeature(MetaEngineFeature f) const override;
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
virtual SaveStateList listSaves(const char *target) const override;
virtual int getMaximumSaveSlot() const override;
virtual void removeSaveState(const char *target, int slot) const override;
bool hasFeature(MetaEngineFeature f) const override;
bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
SaveStateList listSaves(const char *target) const override;
int getMaximumSaveSlot() const override;
void removeSaveState(const char *target, int slot) const override;
SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override;
ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const override;

@ -63,7 +63,7 @@ protected:
void clearKeyQueue() override {}
PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc);
virtual ~PreAgiEngine();
~PreAgiEngine() override;
int getGameId() {
return _gameId;
}

@ -679,17 +679,17 @@ class PreAgiEngine;
class MickeyEngine : public PreAgiEngine {
public:
MickeyEngine(OSystem *syst, const AGIGameDescription *gameDesc);
~MickeyEngine();
~MickeyEngine() override;
void init();
Common::Error go();
Common::Error go() override;
void debugCurRoom();
void debugGotoRoom(int);
void drawPic(int);
void drawObj(ENUM_MSA_OBJECT, int, int);
GUI::Debugger *getDebugger() { return _console; }
GUI::Debugger *getDebugger() override { return _console; }
protected:
MickeyConsole *_console;

@ -160,9 +160,9 @@ struct Item {
class TrollEngine : public PreAgiEngine {
public:
TrollEngine(OSystem *syst, const AGIGameDescription *gameDesc);
~TrollEngine();
~TrollEngine() override;
Common::Error go();
Common::Error go() override;
private:
int _roomPicture;

@ -284,14 +284,14 @@ class PreAgiEngine;
class WinnieEngine : public PreAgiEngine {
public:
WinnieEngine(OSystem *syst, const AGIGameDescription *gameDesc);
~WinnieEngine();
~WinnieEngine() override;
void init();
Common::Error go();
Common::Error go() override;
void debugCurRoom();
GUI::Debugger *getDebugger() { return _console; }
GUI::Debugger *getDebugger() override { return _console; }
private:
WinnieConsole *_console;

@ -118,8 +118,8 @@ protected:
class PCjrSound : public AgiSound {
public:
PCjrSound(uint8 *data, uint32 len, int resnum);
~PCjrSound() { free(_data); }
virtual uint16 type() { return _type; }
~PCjrSound() override { free(_data); }
uint16 type() override { return _type; }
const uint8 *getVoicePointer(uint voiceNum);
uint8 *getData() { return _data; }
uint32 getLength() { return _len; }

@ -150,8 +150,8 @@ public:
class IIgsMidi : public AgiSound {
public:
IIgsMidi(uint8 *data, uint32 len, int resnum);
~IIgsMidi() { if (_data != NULL) free(_data); }
virtual uint16 type() { return _type; }
~IIgsMidi() override { if (_data != NULL) free(_data); }
uint16 type() override { return _type; }
virtual const uint8 *getPtr() { return _ptr; }
virtual void setPtr(const uint8 *ptr) { _ptr = ptr; }
virtual void rewind() { _ptr = _data + 2; _ticks = 0; }
@ -167,8 +167,8 @@ public:
class IIgsSample : public AgiSound {
public:
IIgsSample(uint8 *data, uint32 len, int16 resourceNr);
~IIgsSample() { delete[] _sample; }
virtual uint16 type() { return _header.type; }
~IIgsSample() override { delete[] _sample; }
uint16 type() override { return _header.type; }
const IIgsSampleHeader &getHeader() const { return _header; }
protected:
IIgsSampleHeader _header; ///< Apple IIGS AGI sample header
@ -220,16 +220,16 @@ private:
class SoundGen2GS : public SoundGen, public Audio::AudioStream {
public:
SoundGen2GS(AgiBase *vm, Audio::Mixer *pMixer);
~SoundGen2GS();
~SoundGen2GS() override;
void play(int resnum);
void stop(void);
void play(int resnum) override;
void stop(void) override;
int readBuffer(int16 *buffer, const int numSamples);
int readBuffer(int16 *buffer, const int numSamples) override;
bool isStereo() const { return true; }
bool endOfData() const { return false; }
int getRate() const { return _sampleRate; }
bool isStereo() const override { return true; }
bool endOfData() const override { return false; }
int getRate() const override { return _sampleRate; }
private:
// Loader methods

@ -43,23 +43,23 @@ struct CoCoNote {
class SoundGenCoCo3 : public SoundGen, public Audio::AudioStream {
public:
SoundGenCoCo3(AgiBase *vm, Audio::Mixer *pMixer);
~SoundGenCoCo3();
~SoundGenCoCo3() override;
void play(int resnum);
void stop(void);
void play(int resnum) override;
void stop(void) override;
// AudioStream API
int readBuffer(int16 *buffer, const int numSamples);
int readBuffer(int16 *buffer, const int numSamples) override;
bool isStereo() const {
bool isStereo() const override {
return false;
}
bool endOfData() const {
bool endOfData() const override {
return false;
}
int getRate() const {
int getRate() const override {
// FIXME: Ideally, we should use _sampleRate.
return 22050;
}

@ -34,8 +34,8 @@ namespace Agi {
class MIDISound : public AgiSound {
public:
MIDISound(uint8 *data, uint32 len, int resnum);
~MIDISound() { free(_data); }
virtual uint16 type() { return _type; }
~MIDISound() override { free(_data); }
uint16 type() override { return _type; }
uint8 *_data; ///< Raw sound resource data
uint32 _len; ///< Length of the raw sound resource
@ -47,17 +47,17 @@ class SoundGenMIDI : public SoundGen, public Audio::MidiPlayer {
public:
SoundGenMIDI(AgiBase *vm, Audio::Mixer *pMixer);
void play(int resnum);
void play(int resnum) override;
// We must overload stop() here to implement the pure virtual
// stop() method of the SoundGen class.
void stop() { Audio::MidiPlayer::stop(); }
void stop() override { Audio::MidiPlayer::stop(); }
// MidiDriver_BASE interface implementation
virtual void send(uint32 b);
void send(uint32 b) override;
// Overload Audio::MidiPlayer method
virtual void sendToChannel(byte channel, uint32 b);
virtual void endOfTrack();
void sendToChannel(byte channel, uint32 b) override;
void endOfTrack() override;
private:
bool _isGM;

@ -74,23 +74,23 @@ struct ToneChan {
class SoundGenPCJr : public SoundGen, public Audio::AudioStream {
public:
SoundGenPCJr(AgiBase *vm, Audio::Mixer *pMixer);
~SoundGenPCJr();
~SoundGenPCJr() override;
void play(int resnum);
void stop(void);
void play(int resnum) override;
void stop(void) override;
// AudioStream API
int readBuffer(int16 *buffer, const int numSamples);
int readBuffer(int16 *buffer, const int numSamples) override;
bool isStereo() const {
bool isStereo() const override {
return false;
}
bool endOfData() const {
bool endOfData() const override {
return false;
}
int getRate() const {
int getRate() const override {
// FIXME: Ideally, we should use _sampleRate.
return 22050;
}

@ -69,23 +69,23 @@ struct ChannelInfo {
class SoundGenSarien : public SoundGen, public Audio::AudioStream {
public:
SoundGenSarien(AgiBase *vm, Audio::Mixer *pMixer);
~SoundGenSarien();
~SoundGenSarien() override;
void play(int resnum);
void stop(void);
void play(int resnum) override;
void stop(void) override;
// AudioStream API
int readBuffer(int16 *buffer, const int numSamples);
int readBuffer(int16 *buffer, const int numSamples) override;
bool isStereo() const {
bool isStereo() const override {
return false;
}
bool endOfData() const {
bool endOfData() const override {
return false;
}
int getRate() const {
int getRate() const override {
// FIXME: Ideally, we should use _sampleRate.
return 22050;
}