KINGDOM: Supporting returning back to launcher feature

Also adds a _mixer->stopAll() call in the engine's destructor
This commit is contained in:
antoniou79 2024-01-01 12:47:49 +02:00 committed by Filippos Karapetis
parent d2efce1c64
commit 21248eca74
2 changed files with 12 additions and 4 deletions

View File

@ -142,6 +142,8 @@ void KingdomGame::initVariables() {
}
KingdomGame::~KingdomGame() {
_mixer->stopAll();
unloadKingArt();
delete[] _asPtr;
@ -149,6 +151,11 @@ KingdomGame::~KingdomGame() {
delete _rnd;
}
bool KingdomGame::hasFeature(EngineFeature f) const {
return
f == kSupportsReturnToLauncher;
}
bool KingdomGame::isDemo() const {
return (bool)(_gameDescription->flags & ADGF_DEMO);
}

View File

@ -89,9 +89,10 @@ namespace Kingdom {
class KingdomGame : public Engine {
public:
KingdomGame(OSystem *syst, const ADGameDescription *gameDesc);
~KingdomGame();
~KingdomGame() override;
virtual Common::Error run();
bool hasFeature(EngineFeature f) const override;
Common::Error run() override;
// Detection related functions
const ADGameDescription *_gameDescription;
@ -229,8 +230,8 @@ namespace Kingdom {
void cursorTypeExit();
void saveGame();
void restoreGame();
virtual Common::Error loadGameState(int slot);
virtual Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false);
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::String getSavegameFilename(int slot);
void writeSavegameHeader(Common::OutSaveFile *out, KingdomSavegameHeader &header);
void synchronize(Common::Serializer &s);