[Scummvm-cvs-logs] scummvm master -> fe0c5c0e9720c30689b745ff7aee136022c3df8d
clone2727
clone2727 at gmail.com
Thu Mar 8 15:24:10 CET 2012
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1e734ab48c COMMON: Add an exists function to MacResManager
30e7a0f001 SCI: Fix SCI1.1+ Mac games with resource fork container names
fe0c5c0e97 SCI: Fix KQ6 Mac movies with resource fork names
Commit: 1e734ab48caa842335d0283443614c8dd3f2750a
https://github.com/scummvm/scummvm/commit/1e734ab48caa842335d0283443614c8dd3f2750a
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2012-03-08T05:02:06-08:00
Commit Message:
COMMON: Add an exists function to MacResManager
Changed paths:
common/macresman.cpp
common/macresman.h
diff --git a/common/macresman.cpp b/common/macresman.cpp
index 1317600..14bdfa7 100644
--- a/common/macresman.cpp
+++ b/common/macresman.cpp
@@ -238,6 +238,27 @@ bool MacResManager::open(FSNode path, String filename) {
return false;
}
+bool MacResManager::exists(const String &filename) {
+ // Try the file name by itself
+ if (Common::File::exists(filename))
+ return true;
+
+ // Try the .rsrc extension
+ if (Common::File::exists(filename + ".rsrc"))
+ return true;
+
+ // Check if we have a MacBinary file
+ Common::File tempFile;
+ if (tempFile.open(filename + ".bin") && isMacBinary(tempFile))
+ return true;
+
+ // Check if we have an AppleDouble file
+ if (tempFile.open("._" + filename) && tempFile.readUint32BE() == 0x00051607)
+ return true;
+
+ return false;
+}
+
bool MacResManager::loadFromAppleDouble(SeekableReadStream &stream) {
if (stream.readUint32BE() != 0x00051607) // tag
return false;
diff --git a/common/macresman.h b/common/macresman.h
index 4d86e46..6820106 100644
--- a/common/macresman.h
+++ b/common/macresman.h
@@ -69,6 +69,13 @@ public:
bool open(FSNode path, String filename);
/**
+ * See if a Mac data/resource fork pair exists.
+ * @param filename The base file name of the file
+ * @return True if either a data fork or resource fork with this name exists
+ */
+ static bool exists(const String &filename);
+
+ /**
* Close the Mac data/resource fork pair.
*/
void close();
Commit: 30e7a0f00129323676cc9490e7c070374c6472f4
https://github.com/scummvm/scummvm/commit/30e7a0f00129323676cc9490e7c070374c6472f4
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2012-03-08T05:02:58-08:00
Commit Message:
SCI: Fix SCI1.1+ Mac games with resource fork container names
Changed paths:
engines/sci/resource.cpp
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 50b3387..77a6a40 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -609,7 +609,7 @@ int ResourceManager::addAppropriateSources() {
if (Common::File::exists("alt.map") && Common::File::exists("resource.alt"))
addSource(new VolumeResourceSource("resource.alt", addExternalMap("alt.map", 10), 10));
#endif
- } else if (Common::File::exists("Data1")) {
+ } else if (Common::MacResManager::exists("Data1")) {
// Mac SCI1.1+ file naming scheme
SearchMan.listMatchingMembers(files, "Data?*");
Commit: fe0c5c0e9720c30689b745ff7aee136022c3df8d
https://github.com/scummvm/scummvm/commit/fe0c5c0e9720c30689b745ff7aee136022c3df8d
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2012-03-08T05:04:54-08:00
Commit Message:
SCI: Fix KQ6 Mac movies with resource fork names
Changed paths:
engines/sci/engine/kfile.cpp
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index aade40f..3124977 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -24,6 +24,7 @@
#include "common/config-manager.h"
#include "common/debug-channels.h"
#include "common/file.h"
+#include "common/macresman.h"
#include "common/str.h"
#include "common/savefile.h"
#include "common/system.h"
@@ -1080,6 +1081,14 @@ reg_t kFileIOExists(EngineState *s, int argc, reg_t *argv) {
delete outFile;
}
+ // Special case for KQ6 Mac: The game checks for two video files to see
+ // if they exist before it plays them. Since we support multiple naming
+ // schemes for resource fork files, we also need to support that here in
+ // case someone has a "HalfDome.bin" file, etc.
+ if (!exists && g_sci->getGameId() == GID_KQ6 && g_sci->getPlatform() == Common::kPlatformMacintosh &&
+ (name == "HalfDome" || name == "Kq6Movie"))
+ exists = Common::MacResManager::exists(name);
+
debugC(kDebugLevelFile, "kFileIO(fileExists) %s -> %d", name.c_str(), exists);
return make_reg(0, exists);
}
More information about the Scummvm-git-logs
mailing list