aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/file/base_disk_file.cpp
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-27 16:07:50 +0200
committerEinar Johan Trøan Sømåen2012-07-27 16:07:50 +0200
commita190bb8fdc5959bb2b529baab0d45bc31d2f467a (patch)
treea8ea490bfba94bcd4cfc4020194913d57e69a02e /engines/wintermute/base/file/base_disk_file.cpp
parent996e79b3d5e5d336080017a800e50be6a9a33d15 (diff)
downloadscummvm-rg350-a190bb8fdc5959bb2b529baab0d45bc31d2f467a.tar.gz
scummvm-rg350-a190bb8fdc5959bb2b529baab0d45bc31d2f467a.tar.bz2
scummvm-rg350-a190bb8fdc5959bb2b529baab0d45bc31d2f467a.zip
WINTERMUTE: Add a stubbed fallback for the absolute path used in East Side Story
C:\\windows\\fonts\\framd.ttf
Diffstat (limited to 'engines/wintermute/base/file/base_disk_file.cpp')
-rw-r--r--engines/wintermute/base/file/base_disk_file.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/engines/wintermute/base/file/base_disk_file.cpp b/engines/wintermute/base/file/base_disk_file.cpp
index 7d805aedb5..93533b4057 100644
--- a/engines/wintermute/base/file/base_disk_file.cpp
+++ b/engines/wintermute/base/file/base_disk_file.cpp
@@ -52,9 +52,10 @@ static Common::FSNode getNodeForRelativePath(const Common::String &filename) {
// The filename can be an explicit path, thus we need to chop it up, expecting the path the game
// specifies to follow the Windows-convention of folder\subfolder\file (absolute paths should not happen)
- // Absolute path: TODO: Add specific fallbacks here.
+ // Absolute path: These should have been handled in openDiskFile.
if (filename.contains(':')) {
- error("openDiskFile::Absolute path or invalid filename used in %s", filename.c_str());
+ // So just return an invalid node.
+ return Common::FSNode();
}
// Relative path:
@@ -112,9 +113,19 @@ bool diskFileExists(const Common::String &filename) {
Common::SeekableReadStream *openDiskFile(const Common::String &filename) {
uint32 prefixSize = 0;
Common::SeekableReadStream *file = NULL;
+ Common::String fixedFilename = filename;
+
+ // Absolute path: TODO: Add specific fallbacks here.
+ if (filename.contains(':')) {
+ if (filename.hasPrefix("c:\\windows\\fonts\\")) { // East Side Story refers to "c:\windows\fonts\framd.ttf"
+ fixedFilename = filename.c_str() + 17;
+ } else {
+ error("openDiskFile::Absolute path or invalid filename used in %s", filename.c_str());
+ }
+ }
// Try directly from SearchMan first
Common::ArchiveMemberList files;
- SearchMan.listMatchingMembers(files, filename);
+ SearchMan.listMatchingMembers(files, fixedFilename);
for (Common::ArchiveMemberList::iterator it = files.begin(); it != files.end(); it++) {
if ((*it)->getName() == filename) {