aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/saveload.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2006-09-17 20:21:40 +0000
committerJohannes Schickel2006-09-17 20:21:40 +0000
commitb6a8e38726b55dec5a959ec914c6f9e6fda358d8 (patch)
tree72c3c981e7171789a71aa752485cd45149263e3d /engines/kyra/saveload.cpp
parent3e8380f2c6889c85e0e962631eaf9814c2f84963 (diff)
downloadscummvm-rg350-b6a8e38726b55dec5a959ec914c6f9e6fda358d8.tar.gz
scummvm-rg350-b6a8e38726b55dec5a959ec914c6f9e6fda358d8.tar.bz2
scummvm-rg350-b6a8e38726b55dec5a959ec914c6f9e6fda358d8.zip
- removes the kyra specific language flag system, and uses the language enum defined in Common for that now
- also reworks the game flag system in general svn-id: r23920
Diffstat (limited to 'engines/kyra/saveload.cpp')
-rw-r--r--engines/kyra/saveload.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp
index 17e40b296e..45d34de88e 100644
--- a/engines/kyra/saveload.cpp
+++ b/engines/kyra/saveload.cpp
@@ -32,6 +32,12 @@
#define CURRENT_VERSION 6
+// TODO: our current savefiles still use the old
+// flag system to check the version, we should
+// change that some day, but for now it works
+#define GF_FLOPPY (1 << 0)
+#define GF_TALKIE (1 << 1)
+
namespace Kyra {
void KyraEngine::loadGame(const char *fileName) {
debugC(9, kDebugLevelMain, "loadGame('%s')", fileName);
@@ -63,13 +69,13 @@ void KyraEngine::loadGame(const char *fileName) {
in->read(saveName, 31);
if (version >= 2) {
- uint32 gameFlags = in->readUint32BE();
- if ((gameFlags & GF_FLOPPY) && !(_features & GF_FLOPPY)) {
- warning("can not load floppy savefile for this (non floppy) gameversion");
+ uint32 flags = in->readUint32BE();
+ if ((flags & GF_FLOPPY) && _flags.isTalkie) {
+ warning("Can not load floppy savefile for this (non floppy) gameversion");
delete in;
return;
- } else if ((gameFlags & GF_TALKIE) && !(_features & GF_TALKIE)) {
- warning("can not load cdrom savefile for this (non cdrom) gameversion");
+ } else if ((flags & GF_TALKIE) && !(_flags.isTalkie)) {
+ warning("Can not load cdrom savefile for this (non cdrom) gameversion");
delete in;
return;
}
@@ -81,7 +87,7 @@ void KyraEngine::loadGame(const char *fileName) {
snd_playWanderScoreViaMap(0, 1);
// unload the current voice file should fix some problems with voices
- if (_currentRoom != 0xFFFF && (_features & GF_TALKIE)) {
+ if (_currentRoom != 0xFFFF && _flags.isTalkie) {
char file[32];
assert(_currentRoom < _roomTableSize);
int tableId = _roomTable[_currentRoom].nameIndex;
@@ -259,7 +265,7 @@ void KyraEngine::saveGame(const char *fileName, const char *saveName) {
out->writeUint32BE(MKID_BE('KYRA'));
out->writeUint32BE(CURRENT_VERSION);
out->write(saveName, 31);
- out->writeUint32BE(_features);
+ out->writeUint32BE((_flags.isTalkie ? GF_TALKIE : GF_FLOPPY));
for (int i = 0; i < 11; i++) {
out->writeUint16BE(_characterList[i].sceneId);