[Scummvm-cvs-logs] SF.net SVN: scummvm:[35784] scummvm/trunk/engines/parallaction/disk_br.cpp
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Thu Jan 8 08:31:32 CET 2009
Revision: 35784
http://scummvm.svn.sourceforge.net/scummvm/?rev=35784&view=rev
Author: peres001
Date: 2009-01-08 07:31:32 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
Trim resource filenames to 8 characters as a last resort on BRA. Script files are unbelievably broken.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/disk_br.cpp
Modified: scummvm/trunk/engines/parallaction/disk_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_br.cpp 2009-01-08 07:11:32 UTC (rev 35783)
+++ scummvm/trunk/engines/parallaction/disk_br.cpp 2009-01-08 07:31:32 UTC (rev 35784)
@@ -102,8 +102,26 @@
}
Common::SeekableReadStream *stream = _sset.openFile(lookup);
+ if (stream) {
+ return stream;
+ }
+
+ // as a very last resort, try trimming the file name to 8 chars
+ if (!ext.empty() && lookup.hasSuffix(ext.c_str())) {
+ Common::String filename = Common::lastPathComponent(lookup, '/');
+ int len = filename.size();
+ if (len > 8) {
+ debugC(9, kDebugDisk, "Disk_br::openFile: trimming filename (%s) to 8 characters", name.c_str());
+ while (len-- > 8) {
+ lookup.deleteLastChar();
+ }
+ lookup += ext;
+ stream = _sset.openFile(lookup);
+ }
+ }
+
if (!stream && errorOnNotFound) {
- errorFileNotFound(lookup);
+ errorFileNotFound(name);
}
return stream;
}
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