aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_saveload.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-04-18 23:37:54 +0200
committerWillem Jan Palenstijn2013-05-08 20:46:44 +0200
commit02c5cc75a7cb8885d2a0fa141fbc0e763c5b31a0 (patch)
tree72b64a67ebeca41e9b83593da80850e848a99e2e /engines/mohawk/riven_saveload.cpp
parent1539023834a2ad7cf8942711d60983891a10a82a (diff)
parent1e200620d673af4acdd2d128ed6e390df001aacf (diff)
downloadscummvm-rg350-02c5cc75a7cb8885d2a0fa141fbc0e763c5b31a0.tar.gz
scummvm-rg350-02c5cc75a7cb8885d2a0fa141fbc0e763c5b31a0.tar.bz2
scummvm-rg350-02c5cc75a7cb8885d2a0fa141fbc0e763c5b31a0.zip
Merge branch 'master'
Conflicts: configure base/plugins.cpp
Diffstat (limited to 'engines/mohawk/riven_saveload.cpp')
-rw-r--r--engines/mohawk/riven_saveload.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/mohawk/riven_saveload.cpp b/engines/mohawk/riven_saveload.cpp
index 18c13ec12b..f5bf7782d4 100644
--- a/engines/mohawk/riven_saveload.cpp
+++ b/engines/mohawk/riven_saveload.cpp
@@ -88,13 +88,13 @@ static uint16 mapNewStackIDToOld(uint16 newID) {
return 0;
}
-bool RivenSaveLoad::loadGame(Common::String filename) {
+Common::Error RivenSaveLoad::loadGame(Common::String filename) {
if (_vm->getFeatures() & GF_DEMO) // Don't load games in the demo
- return false;
+ return Common::kNoError;
Common::InSaveFile *loadFile = _saveFileMan->openForLoading(filename);
if (!loadFile)
- return false;
+ return Common::kReadingFailed;
debug(0, "Loading game from \'%s\'", filename.c_str());
@@ -103,7 +103,7 @@ bool RivenSaveLoad::loadGame(Common::String filename) {
if (!mhk->openStream(loadFile)) {
warning("Save file is not a Mohawk archive");
delete mhk;
- return false;
+ return Common::Error(Common::kUnknownError, "Invalid save file");
}
// First, let's make sure we're using a saved game file from this version of Riven by checking the VERS resource
@@ -114,7 +114,7 @@ bool RivenSaveLoad::loadGame(Common::String filename) {
|| (saveGameVersion == kDVDSaveGameVersion && !(_vm->getFeatures() & GF_DVD))) {
warning("Incompatible saved game versions. No support for this yet");
delete mhk;
- return false;
+ return Common::Error(Common::kUnknownError, "Incompatible save version");
}
// Now, we'll read in the variable values.
@@ -206,7 +206,7 @@ bool RivenSaveLoad::loadGame(Common::String filename) {
delete zips;
delete mhk;
- return true;
+ return Common::kNoError;
}
Common::MemoryWriteStreamDynamic *RivenSaveLoad::genVERSSection() {
@@ -273,7 +273,7 @@ Common::MemoryWriteStreamDynamic *RivenSaveLoad::genZIPSSection() {
return stream;
}
-bool RivenSaveLoad::saveGame(Common::String filename) {
+Common::Error RivenSaveLoad::saveGame(Common::String filename) {
// NOTE: This code is designed to only output a Mohawk archive
// for a Riven saved game. It's hardcoded to do this because
// (as of right now) this is the only place in the engine
@@ -295,7 +295,7 @@ bool RivenSaveLoad::saveGame(Common::String filename) {
Common::OutSaveFile *saveFile = _saveFileMan->openForSaving(filename);
if (!saveFile)
- return false;
+ return Common::kWritingFailed;
debug (0, "Saving game to \'%s\'", filename.c_str());
@@ -418,7 +418,7 @@ bool RivenSaveLoad::saveGame(Common::String filename) {
delete varsSection;
delete zipsSection;
- return true;
+ return Common::kNoError;
}
void RivenSaveLoad::deleteSave(Common::String saveName) {