From 22042bc63741321557b401833adf9d2ccf10eb3b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 25 Mar 2006 04:17:17 +0000 Subject: - Implemented case insensitive file reading. Left old system as a fallback in case some engine writer decide to do something unwise - Removed used of ConfMan.getKey("path") in file-related cases, because now File class handles that - Fixed bug in ScummEngine_v80he::o80_getFileSize() where path delimiters weren't translated svn-id: r21443 --- base/main.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index b2f32edb1e..dba2eeacb7 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -276,6 +276,10 @@ static bool launcherDialog(GameDetector &detector, OSystem &system) { } static int runGame(GameDetector &detector, OSystem &system, const Common::String &edebuglevels) { + // We add it here, so MD5-based detection will be able to + // read mixed case files + Common::File::addDefaultDirectory(ConfMan.get("path")); + // Create the game engine Engine *engine = detector.createEngine(&system); if (!engine) { @@ -301,12 +305,17 @@ static int runGame(GameDetector &detector, OSystem &system, const Common::String system.setWindowCaption(caption.c_str()); } + Common::File::addDefaultDirectoryRecursive(ConfMan.get("path")); + // Add extrapath (if any) to the directory search list if (ConfMan.hasKey("extrapath")) - Common::File::addDefaultDirectory(ConfMan.get("extrapath")); + Common::File::addDefaultDirectoryRecursive(ConfMan.get("extrapath")); if (ConfMan.hasKey("extrapath", Common::ConfigManager::kApplicationDomain)) - Common::File::addDefaultDirectory(ConfMan.get("extrapath", Common::ConfigManager::kApplicationDomain)); + Common::File::addDefaultDirectoryRecursive(ConfMan.get("extrapath", Common::ConfigManager::kApplicationDomain)); + + // As a last resort add current directory and lock further additions + Common::File::addDefaultDirectory(".", true); int result; -- cgit v1.2.3