[Scummvm-cvs-logs] scummvm master -> 783e3fea628d32a7286ee1810ee720eea2a8ea78
digitall
digitall at scummvm.org
Mon Nov 14 00:46:35 CET 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
783e3fea62 AGOS: Fix engine crash when playing Feeble Files from cabinet datafiles.
Commit: 783e3fea628d32a7286ee1810ee720eea2a8ea78
https://github.com/scummvm/scummvm/commit/783e3fea628d32a7286ee1810ee720eea2a8ea78
Author: D G Turner (digitall at scummvm.org)
Date: 2011-11-13T15:44:38-08:00
Commit Message:
AGOS: Fix engine crash when playing Feeble Files from cabinet datafiles.
Playing with cabinet datafiles, this failed to find the "Charisma.smk"
file in the cabinets when in the Recreation (TV) room on Cygnus Alpha
and this caused an engine abort after the GUI dialog warning of the
"missing" video file. This was due to animation.cpp code using
Common::file::exists() instead of going via the ArchiveMan.
However,a hasFile() method implementation was also required to implement
fallback to decompressed (movie) files if the file requested is not in
the cabinet or the cabinet has been externally decompressed to files.
Thanks to fuzzie for the hasFile() patch.
Also, removed noisy warning which this correction triggers repeatedly in
installshield_cab.cpp hasFile(). This looks like leftover from
debugging, so not critical.
Changed paths:
engines/agos/agos.h
engines/agos/animation.cpp
engines/agos/installshield_cab.cpp
engines/agos/res.cpp
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index cf75842..03feafa 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -197,6 +197,7 @@ public:
void registerArchive(const Common::String &filename, int priority);
#endif
+ bool hasFile(const Common::String &name);
Common::SeekableReadStream *open(const Common::String &filename);
private:
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index d9d6b71..db2cff3 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -525,25 +525,25 @@ MoviePlayer *makeMoviePlayer(AGOSEngine_Feeble *vm, const char *name) {
memcpy(shortName, baseName, 6);
sprintf(filename, "%s~1.dxa", shortName);
- if (Common::File::exists(filename)) {
+ if (vm->_archives.hasFile(filename)) {
memset(baseName, 0, sizeof(baseName));
memcpy(baseName, filename, 8);
}
sprintf(filename, "%s~1.smk", shortName);
- if (Common::File::exists(filename)) {
+ if (vm->_archives.hasFile(filename)) {
memset(baseName, 0, sizeof(baseName));
memcpy(baseName, filename, 8);
}
}
sprintf(filename, "%s.dxa", baseName);
- if (Common::File::exists(filename)) {
+ if (vm->_archives.hasFile(filename)) {
return new MoviePlayerDXA(vm, baseName);
}
sprintf(filename, "%s.smk", baseName);
- if (Common::File::exists(filename)) {
+ if (vm->_archives.hasFile(filename)) {
return new MoviePlayerSMK(vm, baseName);
}
diff --git a/engines/agos/installshield_cab.cpp b/engines/agos/installshield_cab.cpp
index f7b49a6..ac4e40d 100644
--- a/engines/agos/installshield_cab.cpp
+++ b/engines/agos/installshield_cab.cpp
@@ -162,7 +162,6 @@ InstallShieldCabinet::InstallShieldCabinet(const Common::String &filename) : _in
}
bool InstallShieldCabinet::hasFile(const Common::String &name) {
- warning("hasFile: Filename %s", name.c_str());
return _map.contains(name);
}
diff --git a/engines/agos/res.cpp b/engines/agos/res.cpp
index 69447f4..6219734 100644
--- a/engines/agos/res.cpp
+++ b/engines/agos/res.cpp
@@ -47,6 +47,13 @@ void ArchiveMan::registerArchive(const Common::String &filename, int priority) {
}
#endif
+bool ArchiveMan::hasFile(const Common::String &name) {
+ if (_fallBack && SearchMan.hasFile(name))
+ return true;
+
+ return Common::SearchSet::hasFile(name);
+}
+
Common::SeekableReadStream *ArchiveMan::open(const Common::String &filename) {
if (_fallBack && SearchMan.hasFile(filename)) {
return SearchMan.createReadStreamForMember(filename);
More information about the Scummvm-git-logs
mailing list