HPL1: implement save loading method

This commit is contained in:
grisenti 2022-08-24 22:21:30 +02:00 committed by Eugene Sandulenko
parent eabf877903
commit c9e0b7733c
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 12 additions and 0 deletions

View File

@ -21,6 +21,8 @@
#include "hpl1/penumbra-overture/Init.h"
#include "hpl1/penumbra-overture/MainMenu.h"
#include "hpl1/penumbra-overture/SaveHandler.h"
#include "hpl1/engine/system/String.h"
#include "engine/engine.h"
#include "hpl1/hpl1.h"
#include "common/config-manager.h"
@ -124,6 +126,14 @@ Common::StringArray Hpl1Engine::listInternalSaves(const Common::String &pattern)
return internalSaves;
}
Common::Error Hpl1Engine::loadGameState(int slot) {
SaveStateDescriptor a = getMetaEngine()->querySaveMetaInfos(_targetName.c_str(), slot);
_gameInit->mpMainMenu->SetActive(false);
// FIXME: strings
_gameInit->mpSaveHandler->LoadGameFromFile(cString::To16Char(Common::String(a.getDescription()).c_str()));
return Common::kNoError;
}
Common::Error Hpl1Engine::syncGame(Common::Serializer &s) {
// The Serializer has methods isLoading() and isSaving()
// if you need to specific steps; for example setting

View File

@ -98,6 +98,8 @@ public:
Common::StringArray listInternalSaves(const Common::String &pattern);
Common::Error loadGameState(int slot) override;
/**
* Uses a serializer to allow implementing savegame
* loading and saving using a single method