aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--saga/game.cpp62
-rw-r--r--saga/rscfile.cpp6
-rw-r--r--saga/saga.h15
-rw-r--r--saga/sound.cpp8
-rw-r--r--saga/sound.h2
5 files changed, 77 insertions, 16 deletions
diff --git a/saga/game.cpp b/saga/game.cpp
index c463112cb8..0bb09efccd 100644
--- a/saga/game.cpp
+++ b/saga/game.cpp
@@ -216,7 +216,7 @@ static GameFileDescription ITEWINDEMO_GameFiles[] = {
{"voicesd.rsc", GAME_VOICEFILE}
};
-// Inherit the Earth - Wyrmkeep Linux Demo version
+// Inherit the Earth - Wyrmkeep Linux Demo version
static GameFileDescription ITELINDEMO_GameFiles[] = {
{"ited.rsc", GAME_RESOURCEFILE},
{"scriptsd.rsc", GAME_SCRIPTFILE},
@@ -225,7 +225,7 @@ static GameFileDescription ITELINDEMO_GameFiles[] = {
{"musicd.rsc", GAME_MUSICFILE}
};
-// Inherit the Earth - Wyrmkeep Linux version
+// Inherit the Earth - Wyrmkeep Linux version
static GameFileDescription ITELINCD_GameFiles[] = {
{"ite.rsc", GAME_RESOURCEFILE},
{"scripts.rsc", GAME_SCRIPTFILE},
@@ -234,6 +234,20 @@ static GameFileDescription ITELINCD_GameFiles[] = {
{"music.rsc", GAME_MUSICFILE}
};
+// Inherit the Earth - Wyrmkeep combined Windows/Mac/Linux version. This
+// version is different from the other Wyrmkeep re-releases in that it does
+// not have any substitute files. Presumably the ite.rsc file has been
+// modified to include the Wyrmkeep changes. The resource files are little-
+// endian, except for the voice file which is big-endian.
+
+static GameFileDescription ITEMULTICD_GameFiles[] = {
+ {"ite.rsc", GAME_RESOURCEFILE},
+ {"scripts.rsc", GAME_SCRIPTFILE},
+ {"sounds.rsc", GAME_SOUNDFILE},
+ {"Inherit the Earth Voices", GAME_VOICEFILE},
+ {"music.rsc", GAME_MUSICFILE}
+};
+
static GameFontDescription ITEWINDEMO_GameFonts[] = {
{0},
{2}
@@ -489,6 +503,12 @@ static GameMD5 gameMD5[] = {
{ GID_ITE_LINCD, "41bb6b95d792dde5196bdb78740895a6", "voices.rsc", false },
{ GID_ITE_LINCD, "d6454756517f042f01210458abe8edd4", "music.rsc", false },
+ { GID_ITE_MULTICD, "a6433e34b97b15e64fe8214651012db9", "ite.rsc", false },
+ { GID_ITE_MULTICD, "a891405405edefc69c9d6c420c868b84", "scripts.rsc", false },
+ { GID_ITE_MULTICD, "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc", false },
+ { GID_ITE_MULTICD, "c14c4c995e7a0d3828e3812a494301b7", "Inherit the Earth Voices", false },
+ { GID_ITE_MULTICD, "d6454756517f042f01210458abe8edd4", "music.rsc", false },
+
{ GID_ITE_DISK_DE, "869fc23c8f38f575979ec67152914fee", "ite.rsc", false },
{ GID_ITE_DISK_DE, "516f7330f8410057b834424ea719d1ef", "scripts.rsc", false },
{ GID_ITE_DISK_DE, "0c9113e630f97ef0996b8c3114badb08", "voices.rsc", false },
@@ -675,6 +695,23 @@ static GameDescription gameDescriptions[] = {
&ITECD_GameSound,
GF_VOX_VOICES | GF_WYRMKEEP | GF_CD_FX
},
+
+ // Inherit the earth - Wyrmkeep combined Windows/Mac/Linux CD
+ {
+ "ite",
+ GType_ITE,
+ GID_ITE_MULTICD,
+ "Inherit the Earth (Multi-OS CD Version)",
+ &ITE_DisplayInfo,
+ ITE_DEFAULT_SCENE,
+ &ITE_Resources,
+ ARRAYSIZE(ITEMULTICD_GameFiles),
+ ITEMULTICD_GameFiles,
+ ARRAYSIZE(ITECD_GameFonts),
+ ITECD_GameFonts,
+ &ITECD_GameSound,
+ GF_WYRMKEEP | GF_BIG_ENDIAN_VOICES | GF_CD_FX
+ },
// Inherit the earth - Wyrmkeep Linux CD version
// should be before GID_ITE_CD_G
@@ -852,7 +889,7 @@ RSCFILE_CONTEXT *SagaEngine::getFileContext(uint16 type, int param) {
uint16 i;
for (i = 0; i < _gameDescription->filesCount; i++) {
- if ( _gameDescription->filesDescriptions[i].fileType & type) {
+ if (_gameDescription->filesDescriptions[i].fileType & type) {
return _gameFileContexts[i];
}
}
@@ -860,6 +897,25 @@ RSCFILE_CONTEXT *SagaEngine::getFileContext(uint16 type, int param) {
return NULL;
}
+bool SagaEngine::isBigEndianFile(const char *filename) {
+ bool isBigEndian = IS_BIG_ENDIAN;
+
+ if (isBigEndian)
+ return true;
+
+ if (!(_vm->getFeatures() & GF_BIG_ENDIAN_VOICES))
+ return isBigEndian;
+
+ for (int i = 0; i < _gameDescription->filesCount; i++) {
+ GameFileDescription *desc = &_gameDescription->filesDescriptions[i];
+ if (desc->fileType & GAME_VOICEFILE && scumm_stricmp(filename, desc->fileName) == 0) {
+ return true;
+ }
+ }
+
+ return isBigEndian;
+}
+
DetectedGameList GAME_ProbeGame(const FSList &fslist) {
DetectedGameList detectedGames;
int game_n;
diff --git a/saga/rscfile.cpp b/saga/rscfile.cpp
index 045d2e21f8..b35fe9fe6d 100644
--- a/saga/rscfile.cpp
+++ b/saga/rscfile.cpp
@@ -116,6 +116,8 @@ int RSC_LoadRSC(RSCFILE_CONTEXT *rsc) {
size_t tbl_len;
uint32 i;
+ bool isBigEndian = _vm->isBigEndianFile(rsc->rc_file_fspec);
+
RSCFILE_RESOURCE *rsc_restbl;
if (rsc->rc_file->size() < RSC_MIN_FILESIZE) {
@@ -129,7 +131,7 @@ int RSC_LoadRSC(RSCFILE_CONTEXT *rsc) {
return FAILURE;
}
- MemoryReadStreamEndian readS(tblinfo_buf, RSC_TABLEINFO_SIZE, IS_BIG_ENDIAN);
+ MemoryReadStreamEndian readS(tblinfo_buf, RSC_TABLEINFO_SIZE, isBigEndian);
res_tbl_offset = readS.readUint32();
res_tbl_ct = readS.readUint32();
@@ -161,7 +163,7 @@ int RSC_LoadRSC(RSCFILE_CONTEXT *rsc) {
return FAILURE;
}
- MemoryReadStreamEndian readS1(tbl_buf, tbl_len, IS_BIG_ENDIAN);
+ MemoryReadStreamEndian readS1(tbl_buf, tbl_len, isBigEndian);
debug(9, "RSC %s", rsc->rc_file_fspec);
for (i = 0; i < res_tbl_ct; i++) {
diff --git a/saga/saga.h b/saga/saga.h
index 3d620459d2..c3aa5061bf 100644
--- a/saga/saga.h
+++ b/saga/saga.h
@@ -261,6 +261,7 @@ enum GameIds {
GID_ITE_CD, // data for Win rerelease is same as in old DOS
GID_ITE_MACCD,
GID_ITE_LINCD,
+ GID_ITE_MULTICD, // Wyrmkeep combined Windows/Mac/Linux version
GID_ITE_WINDEMO1, // older Wyrmkeep windows demo
GID_ITE_MACDEMO1, // older Wyrmkeep mac demo
GID_ITE_LINDEMO,
@@ -301,12 +302,13 @@ enum GameSoundTypes {
};
enum GameFeatures {
- GF_VOX_VOICES = 1 << 0,
- GF_BIG_ENDIAN_DATA = 1 << 1,
- GF_MAC_RESOURCES = 1 << 2,
- GF_LANG_DE = 1 << 3,
- GF_WYRMKEEP = 1 << 4,
- GF_CD_FX = 1 << 5
+ GF_VOX_VOICES = 1 << 0,
+ GF_BIG_ENDIAN_VOICES = 1 << 1,
+ GF_BIG_ENDIAN_DATA = 1 << 2,
+ GF_MAC_RESOURCES = 1 << 3,
+ GF_LANG_DE = 1 << 4,
+ GF_WYRMKEEP = 1 << 5,
+ GF_CD_FX = 1 << 6
};
struct GameSoundInfo {
@@ -619,6 +621,7 @@ public:
public:
int initGame(void);
RSCFILE_CONTEXT *getFileContext(uint16 type, int param);
+ bool isBigEndianFile(const char *filename);
public:
const GameResourceDescription *getResourceDescription() { return _gameDescription->resourceDescription; }
const GameSoundInfo *getSoundInfo() { return _gameDescription->soundInfo; }
diff --git a/saga/sound.cpp b/saga/sound.cpp
index 4bff16e762..c134bea73c 100644
--- a/saga/sound.cpp
+++ b/saga/sound.cpp
@@ -46,7 +46,7 @@ Sound::~Sound() {
_soundInitialized = 0;
}
-int Sound::playSoundBuffer(Audio::SoundHandle *handle, SOUNDBUFFER *buf, int volume, bool loop) {
+int Sound::playSoundBuffer(Audio::SoundHandle *handle, SOUNDBUFFER *buf, int volume, bool loop, bool forceBigEndian) {
byte flags;
if (!_soundInitialized) {
@@ -60,7 +60,7 @@ int Sound::playSoundBuffer(Audio::SoundHandle *handle, SOUNDBUFFER *buf, int vol
if (buf->s_samplebits == 16) {
flags |= Audio::Mixer::FLAG_16BITS;
- if (!(_vm->getFeatures() & GF_BIG_ENDIAN_DATA))
+ if (!(_vm->getFeatures() & GF_BIG_ENDIAN_DATA) && !forceBigEndian)
flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN;
}
if (buf->s_stereo)
@@ -74,7 +74,7 @@ int Sound::playSoundBuffer(Audio::SoundHandle *handle, SOUNDBUFFER *buf, int vol
}
int Sound::playSound(SOUNDBUFFER *buf, int volume, bool loop) {
- return playSoundBuffer(&_effectHandle, buf, 2 * volume, loop);
+ return playSoundBuffer(&_effectHandle, buf, 2 * volume, loop, false);
}
int Sound::pauseSound() {
@@ -108,7 +108,7 @@ int Sound::stopSound() {
}
int Sound::playVoice(SOUNDBUFFER *buf) {
- return playSoundBuffer(&_voiceHandle, buf, 255, false);
+ return playSoundBuffer(&_voiceHandle, buf, 255, false, (_vm->getFeatures() & GF_BIG_ENDIAN_VOICES) != 0);
}
int Sound::playVoxVoice(SOUNDBUFFER *buf) {
diff --git a/saga/sound.h b/saga/sound.h
index a22dd79b3e..d14842f1f6 100644
--- a/saga/sound.h
+++ b/saga/sound.h
@@ -64,7 +64,7 @@ public:
private:
- int playSoundBuffer(Audio::SoundHandle *handle, SOUNDBUFFER *buf, int volume, bool loop);
+ int playSoundBuffer(Audio::SoundHandle *handle, SOUNDBUFFER *buf, int volume, bool loop, bool forceBigEndian);
int _soundInitialized;
int _enabled;