[Scummvm-cvs-logs] SF.net SVN: scummvm: [29273] scummvm/trunk/engines/saga
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sun Oct 28 05:12:02 CET 2007
Revision: 29273
http://scummvm.svn.sourceforge.net/scummvm/?rev=29273&view=rev
Author: thebluegr
Date: 2007-10-27 21:12:01 -0700 (Sat, 27 Oct 2007)
Log Message:
-----------
Cleanup of the engine detection code. Possibly fixes bug #1804403 - "IHNM/ITE: Error loading Game resources (fs-node regression)"
Modified Paths:
--------------
scummvm/trunk/engines/saga/detection.cpp
scummvm/trunk/engines/saga/rscfile.cpp
Modified: scummvm/trunk/engines/saga/detection.cpp
===================================================================
--- scummvm/trunk/engines/saga/detection.cpp 2007-10-28 03:34:10 UTC (rev 29272)
+++ scummvm/trunk/engines/saga/detection.cpp 2007-10-28 04:12:01 UTC (rev 29273)
@@ -155,26 +155,6 @@
_displayClip.right = getDisplayInfo().logicalWidth;
_displayClip.bottom = getDisplayInfo().logicalHeight;
- if (Common::File::exists("graphics/credit3n.dlt")) {
- _gf_wyrmkeep = true;
- }
-
- // If a compressed sound file is found in the game's directory, set the compressed flag to true
- if (_gameDescription->gameType == GType_ITE) {
- if (Common::File::exists("sounds.cmp") || Common::File::exists("soundsd.cmp") ||
- Common::File::exists("voices.cmp") || Common::File::exists("voicesd.cmp") ||
- Common::File::exists("inherit the earth voices.cmp")) {
- _gf_compressed_sounds = true;
- }
- } else {
- if (Common::File::exists("voicess.cmp") || Common::File::exists("voices1.cmp") ||
- Common::File::exists("voices2.cmp") || Common::File::exists("voices3.cmp") ||
- Common::File::exists("voices4.cmp") || Common::File::exists("voices5.cmp") ||
- Common::File::exists("voices6.cmp") || Common::File::exists("voicesd.cmp")) {
- _gf_compressed_sounds = true;
- }
- }
-
return _resource->createContexts();
}
Modified: scummvm/trunk/engines/saga/rscfile.cpp
===================================================================
--- scummvm/trunk/engines/saga/rscfile.cpp 2007-10-28 03:34:10 UTC (rev 29272)
+++ scummvm/trunk/engines/saga/rscfile.cpp 2007-10-28 04:12:01 UTC (rev 29273)
@@ -360,6 +360,11 @@
bool censoredVersion = false;
uint16 voiceFileType = GAME_VOICEFILE;
+ // If the Wyrmkeep credits file is found, set the Wyrmkeep version flag to true
+ if (Common::File::exists("graphics/credit3n.dlt")) {
+ _vm->_gf_wyrmkeep = true;
+ }
+
_contextsCount = 0;
for (i = 0; _vm->getFilesDescriptions()[i].fileName; i++) {
_contextsCount++;
@@ -375,17 +380,21 @@
if (Common::File::exists("sounds.rsc") || Common::File::exists("sounds.cmp")) {
_contextsCount++;
soundFileIndex = _contextsCount - 1;
- if (_vm->getFeatures() & GF_COMPRESSED_SOUNDS)
+ if (Common::File::exists("sounds.rsc")) {
+ sprintf(soundFileName, "sounds.rsc");
+ } else {
sprintf(soundFileName, "sounds.cmp");
- else
- sprintf(soundFileName, "sounds.rsc");
+ _vm->_gf_compressed_sounds = true;
+ }
} else if (Common::File::exists("soundsd.rsc") || Common::File::exists("soundsd.cmp")) {
_contextsCount++;
soundFileIndex = _contextsCount - 1;
- if (_vm->getFeatures() & GF_COMPRESSED_SOUNDS)
+ if (Common::File::exists("soundsd.rsc")) {
+ sprintf(soundFileName, "soundsd.rsc");
+ } else {
sprintf(soundFileName, "soundsd.cmp");
- else
- sprintf(soundFileName, "soundsd.rsc");
+ _vm->_gf_compressed_sounds = true;
+ }
} else {
// No sound file found, don't add any file to the array
soundFileInArray = true;
@@ -397,10 +406,12 @@
if (Common::File::exists("sfx.res") || Common::File::exists("sfx.cmp")) {
_contextsCount++;
soundFileIndex = _contextsCount - 1;
- if (_vm->getFeatures() & GF_COMPRESSED_SOUNDS)
+ if (Common::File::exists("sfx.rsc")) {
+ sprintf(soundFileName, "sfx.rsc");
+ } else {
sprintf(soundFileName, "sfx.cmp");
- else
- sprintf(soundFileName, "sfx.res");
+ _vm->_gf_compressed_sounds = true;
+ }
} else {
// No sound file found, don't add any file to the array
soundFileInArray = true;
@@ -414,30 +425,56 @@
if (Common::File::exists("voices.rsc") || Common::File::exists("voices.cmp")) {
_contextsCount++;
voicesFileIndex = _contextsCount - 1;
- if (_vm->getFeatures() & GF_COMPRESSED_SOUNDS)
+ if (Common::File::exists("voices.rsc")) {
+ sprintf(voicesFileName, "voices.rsc");
+ } else {
sprintf(voicesFileName, "voices.cmp");
- else
- sprintf(voicesFileName, "voices.rsc");
+ _vm->_gf_compressed_sounds = true;
+ }
} else if (Common::File::exists("voicesd.rsc") || Common::File::exists("voicesd.cmp")) {
_contextsCount++;
voicesFileIndex = _contextsCount - 1;
- if (_vm->getFeatures() & GF_COMPRESSED_SOUNDS)
+ if (Common::File::exists("voicesd.rsc")) {
+ sprintf(voicesFileName, "voicesd.rsc");
+ } else {
sprintf(voicesFileName, "voicesd.cmp");
- else
- sprintf(voicesFileName, "voicesd.rsc");
+ _vm->_gf_compressed_sounds = true;
+ }
+#ifndef __amigaos4__
} else if (Common::File::exists("inherit the earth voices") ||
Common::File::exists("inherit the earth voices.cmp")) {
+
_contextsCount++;
voicesFileIndex = _contextsCount - 1;
- if (_vm->getFeatures() & GF_COMPRESSED_SOUNDS)
+ if (Common::File::exists("inherit the earth voices")) {
+ sprintf(voicesFileName, "inherit the earth voices");
+ } else {
sprintf(voicesFileName, "inherit the earth voices.cmp");
- else
- sprintf(voicesFileName, "inherit the earth voices");
- // The resources in the Wyrmkeep combined Windows/Mac/Linux CD version are little endian, but
- // the voice file is big endian. If we got such a version with mixed files, mark this voice file
- // as big endian
- if (!_vm->isBigEndian())
- voiceFileType = GAME_VOICEFILE | GAME_SWAPENDIAN; // This file is big endian
+ _vm->_gf_compressed_sounds = true;
+ }
+ // The resources in the Wyrmkeep combined Windows/Mac/Linux CD version are little endian, but
+ // the voice file is big endian. If we got such a version with mixed files, mark this voice file
+ // as big endian
+ if (!_vm->isBigEndian())
+ voiceFileType = GAME_VOICEFILE | GAME_SWAPENDIAN; // This file is big endian
+#else
+ } else if (Common::File::exists("\"inherit the earth voices\"") ||
+ Common::File::exists("\"inherit the earth voices.cmp\"")) {
+
+ _contextsCount++;
+ voicesFileIndex = _contextsCount - 1;
+ if (Common::File::exists("\"inherit the earth voices\"")) {
+ sprintf(voicesFileName, "\"inherit the earth voices\"");
+ } else {
+ sprintf(voicesFileName, "\"inherit the earth voices.cmp\"");
+ _vm->_gf_compressed_sounds = true;
+ }
+ // The resources in the Wyrmkeep combined Windows/Mac/Linux CD version are little endian, but
+ // the voice file is big endian. If we got such a version with mixed files, mark this voice file
+ // as big endian
+ if (!_vm->isBigEndian())
+ voiceFileType = GAME_VOICEFILE | GAME_SWAPENDIAN; // This file is big endian
+#endif
} else {
// No voice file found, don't add any file to the array
voicesFileInArray = true;
@@ -458,17 +495,21 @@
_contextsCount += 5; // voices1-voices3, voices4-voices5
censoredVersion = true;
}
- if (_vm->getFeatures() & GF_COMPRESSED_SOUNDS)
+ if (Common::File::exists("voicess.res")) {
+ sprintf(voicesFileName, "voicess.res");
+ } else {
sprintf(voicesFileName, "voicess.cmp");
- else
- sprintf(voicesFileName, "voicess.res");
+ _vm->_gf_compressed_sounds = true;
+ }
} else if (Common::File::exists("voicesd.res") || Common::File::exists("voicesd.cmp")) {
_contextsCount++;
voicesFileIndex = _contextsCount - 1;
- if (_vm->getFeatures() & GF_COMPRESSED_SOUNDS)
+ if (Common::File::exists("voicesd.res")) {
+ sprintf(voicesFileName, "voicesd.res");
+ } else {
sprintf(voicesFileName, "voicesd.cmp");
- else
- sprintf(voicesFileName, "voicesd.res");
+ _vm->_gf_compressed_sounds = true;
+ }
} else {
// No voice file found, don't add any file to the array
voicesFileInArray = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list