aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen
diff options
context:
space:
mode:
Diffstat (limited to 'engines/xeen')
-rw-r--r--engines/xeen/files.cpp10
-rw-r--r--engines/xeen/files.h10
2 files changed, 19 insertions, 1 deletions
diff --git a/engines/xeen/files.cpp b/engines/xeen/files.cpp
index 2ba3b6f993..a424bd510b 100644
--- a/engines/xeen/files.cpp
+++ b/engines/xeen/files.cpp
@@ -328,7 +328,11 @@ bool File::open(const Common::String &filename, int ccMode) {
int oldMode = files._isDarkCc ? 1 : 0;
files.setGameCc(ccMode);
- File::open(filename, *_currentArchive);
+ if (File::exists(filename, *_currentArchive))
+ File::open(filename, *_currentArchive);
+ else
+ File::open(filename);
+
files.setGameCc(oldMode);
return true;
@@ -390,6 +394,10 @@ bool File::exists(const Common::String &filename, int ccMode) {
return result;
}
+bool File::exists(const Common::String &filename, Common::Archive &archive) {
+ return archive.hasFile(filename);
+}
+
void File::syncBitFlags(Common::Serializer &s, bool *startP, bool *endP) {
byte data = 0;
diff --git a/engines/xeen/files.h b/engines/xeen/files.h
index 4ceadcd753..306ec96657 100644
--- a/engines/xeen/files.h
+++ b/engines/xeen/files.h
@@ -187,9 +187,19 @@ public:
* Checks if a given file exists
*
* @param filename the file to check for
+ * @param ccMode Archive to use
* @return true if the file exists, false otherwise
*/
static bool exists(const Common::String &filename, int ccMode);
+
+ /**
+ * Checks if a given file exists
+ *
+ * @param filename the file to check for
+ * @param archive Archive to use
+ * @return true if the file exists, false otherwise
+ */
+ static bool exists(const Common::String &filename, Common::Archive &archive);
};
/**