aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/save/saveload_playtoons.cpp
diff options
context:
space:
mode:
authorArnaud Boutonné2009-07-07 11:58:22 +0000
committerArnaud Boutonné2009-07-07 11:58:22 +0000
commita0ab8c9c0cb079f21e342d1a53283064bdffebe4 (patch)
tree9e724242a51f682746783450ea260affd4268df5 /engines/gob/save/saveload_playtoons.cpp
parenta9aaf56b3e81d46776a6fba574ab9833a8f21be1 (diff)
downloadscummvm-rg350-a0ab8c9c0cb079f21e342d1a53283064bdffebe4.tar.gz
scummvm-rg350-a0ab8c9c0cb079f21e342d1a53283064bdffebe4.tar.bz2
scummvm-rg350-a0ab8c9c0cb079f21e342d1a53283064bdffebe4.zip
- Separate Playtoons gametypes from in GobEngine::initGameParts()
- Add a specific save/load class for Playtoons as some specific files need to be tested svn-id: r42214
Diffstat (limited to 'engines/gob/save/saveload_playtoons.cpp')
-rw-r--r--engines/gob/save/saveload_playtoons.cpp88
1 files changed, 88 insertions, 0 deletions
diff --git a/engines/gob/save/saveload_playtoons.cpp b/engines/gob/save/saveload_playtoons.cpp
new file mode 100644
index 0000000000..576a10294f
--- /dev/null
+++ b/engines/gob/save/saveload_playtoons.cpp
@@ -0,0 +1,88 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "gob/save/saveload.h"
+#include "gob/inter.h"
+#include "gob/variables.h"
+
+namespace Gob {
+
+SaveLoad_playtoons::SaveFile SaveLoad_playtoons::_saveFiles[] = {
+ { "disk.001", kSaveModeExists, 0, 0}, // Playtoons 1 identification file
+ { "disk.002", kSaveModeExists, 0, 0}, // Playtoons 2 identification file
+ { "disk.003", kSaveModeExists, 0, 0}, // Playtoons 3 identification file
+ { "disk.004", kSaveModeExists, 0, 0}, // Playtoons 4 identification file
+ { "disk.005", kSaveModeExists, 0, 0}, // Playtoons 5 identification file
+ { "disk.006", kSaveModeExists, 0, 0}, // Playtoons CK 1 identification file
+ { "disk.007", kSaveModeExists, 0, 0}, // Playtoons CK 2 identification file
+ { "disk.008", kSaveModeExists, 0, 0}, // Playtoons CK 3 identification file
+ { "titre.001", kSaveModeExists, 0, 0}, // Playtoons 1 titles
+ { "titre.002", kSaveModeExists, 0, 0}, // Playtoons 2 titles
+ { "titre.003", kSaveModeExists, 0, 0}, // Playtoons 3 titles
+ { "titre.004", kSaveModeExists, 0, 0}, // Playtoons 4 titles
+ { "titre.005", kSaveModeExists, 0, 0}, // Playtoons 5 titles
+ { "titre.006", kSaveModeExists, 0, 0}, // Playtoons CK 1 empty title (???)
+ { "titre.007", kSaveModeExists, 0, 0}, // Playtoons CK 2 empty title (???)
+ { "titre.008", kSaveModeExists, 0, 0}, // Playtoons CK 3 empty title (???)
+ { "mdo.def", kSaveModeExists, 0, 0},
+};
+
+SaveLoad::SaveMode SaveLoad_playtoons::getSaveMode(const char *fileName) const {
+ const SaveFile *saveFile = getSaveFile(fileName);
+
+ if (saveFile)
+ return saveFile->mode;
+
+ return kSaveModeNone;
+}
+
+SaveLoad_playtoons::SaveLoad_playtoons(GobEngine *vm) :
+ SaveLoad(vm) {
+}
+
+SaveLoad_playtoons::~SaveLoad_playtoons() {
+}
+
+const SaveLoad_playtoons::SaveFile *SaveLoad_playtoons::getSaveFile(const char *fileName) const {
+ fileName = stripPath(fileName);
+
+ for (int i = 0; i < ARRAYSIZE(_saveFiles); i++)
+ if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
+ return &_saveFiles[i];
+
+ return 0;
+}
+
+SaveLoad_playtoons::SaveFile *SaveLoad_playtoons::getSaveFile(const char *fileName) {
+ fileName = stripPath(fileName);
+
+ for (int i = 0; i < ARRAYSIZE(_saveFiles); i++)
+ if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
+ return &_saveFiles[i];
+
+ return 0;
+}
+
+} // End of namespace Gob