aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen
diff options
context:
space:
mode:
authorPaul Gilbert2018-02-22 19:40:22 -0500
committerPaul Gilbert2018-02-23 15:23:20 -0500
commitbb19a6c771396e415e5007968ae843d220a5f2e5 (patch)
tree69ad667351ca72ef2e0fd15781856a9791067c25 /engines/xeen
parent2f6ca8f45ec6ef8bf86adc3ab60346fa9d14f6a9 (diff)
downloadscummvm-rg350-bb19a6c771396e415e5007968ae843d220a5f2e5.tar.gz
scummvm-rg350-bb19a6c771396e415e5007968ae843d220a5f2e5.tar.bz2
scummvm-rg350-bb19a6c771396e415e5007968ae843d220a5f2e5.zip
XEEN: Add custom maze to the create_xeen tool
This could be used as an example of how other new maps could be added in the future, and it also gives people a cool result if they try typing 'ScummVM' into the teleport mirror
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);
};
/**