aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-09-21 10:09:58 +0000
committerTorbjörn Andersson2005-09-21 10:09:58 +0000
commit8f8f0daf1cf29138bc10fdc2d923283a56b70bfc (patch)
tree67c15956d6fd137cf694532133fb2f88be806f58
parent15969fa797779d31da869992f86c2d54117fe7cd (diff)
downloadscummvm-rg350-8f8f0daf1cf29138bc10fdc2d923283a56b70bfc.tar.gz
scummvm-rg350-8f8f0daf1cf29138bc10fdc2d923283a56b70bfc.tar.bz2
scummvm-rg350-8f8f0daf1cf29138bc10fdc2d923283a56b70bfc.zip
Added a GAME_SWAPENDIAN flag so that game files can be labelled as having
the opposite byte order of the rest of the files. This is needed for the multi-OS version. (Now it crashes with a "RAWInputStream() wrong musicInfo" message instead, but it's still an improvement.) svn-id: r18852
-rw-r--r--saga/game.cpp2
-rw-r--r--saga/rscfile.cpp7
-rw-r--r--saga/saga.h3
3 files changed, 7 insertions, 5 deletions
diff --git a/saga/game.cpp b/saga/game.cpp
index 2e413d8192..202fe44fbf 100644
--- a/saga/game.cpp
+++ b/saga/game.cpp
@@ -334,7 +334,7 @@ static GameFileDescription ITEMULTICD_GameFiles[] = {
{"ite.rsc", GAME_RESOURCEFILE},
{"scripts.rsc", GAME_SCRIPTFILE},
{"sounds.rsc", GAME_SOUNDFILE},
- {"Inherit the Earth Voices", GAME_VOICEFILE},
+ {"Inherit the Earth Voices", GAME_VOICEFILE | GAME_SWAPENDIAN},
{"music.rsc", GAME_MUSICFILE}
};
diff --git a/saga/rscfile.cpp b/saga/rscfile.cpp
index 1f5b3e9725..2a38b2f7e5 100644
--- a/saga/rscfile.cpp
+++ b/saga/rscfile.cpp
@@ -268,12 +268,15 @@ bool Resource::loadContext(ResourceContext *context) {
byte *tableBuffer;
size_t tableSize;
bool isMacBinary;
-
+
if (!context->file->open(context->fileName)) {
return false;
}
context->isBigEndian = _vm->isBigEndian();
+
+ if (context->fileType & GAME_SWAPENDIAN)
+ context->isBigEndian = !context->isBigEndian;
isMacBinary = (context->fileType & GAME_MACBINARY) > 0;
context->fileType &= ~GAME_MACBINARY;
@@ -287,7 +290,6 @@ bool Resource::loadContext(ResourceContext *context) {
return false;
}
}
-
//process internal patch files
if (GAME_PATCHFILE & context->fileType) {
@@ -328,7 +330,6 @@ bool Resource::loadContext(ResourceContext *context) {
}
}
}
-
return true;
}
diff --git a/saga/saga.h b/saga/saga.h
index 8839b3c65e..adc6e93496 100644
--- a/saga/saga.h
+++ b/saga/saga.h
@@ -295,7 +295,8 @@ enum GameFileTypes {
GAME_MUSICFILE_GM = 1 << 6,
GAME_MUSICFILE_FM = 1 << 7,
GAME_PATCHFILE = 1 << 8,
- GAME_MACBINARY = 1 << 9
+ GAME_MACBINARY = 1 << 9,
+ GAME_SWAPENDIAN = 1 << 10
};
enum GameSoundTypes {