aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/main.cpp2
-rw-r--r--engines/engine.cpp4
-rw-r--r--engines/engine.h11
3 files changed, 16 insertions, 1 deletions
diff --git a/base/main.cpp b/base/main.cpp
index c993dfa57a..abf75b7e7e 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -197,7 +197,7 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
//
// Add the game path to the directory search list
- SearchMan.addDirectory(dir.getPath(), dir, 0, 4);
+ engine->initializePath(dir);
// Add extrapath (if any) to the directory search list
if (ConfMan.hasKey("extrapath")) {
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 52020c772e..8326a1fe89 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -154,6 +154,10 @@ Engine::~Engine() {
CursorMan.popCursorPalette();
}
+void Engine::initializePath(const Common::FSNode &gamePath) {
+ SearchMan.addDirectory(gamePath.getPath(), gamePath, 0, 4);
+}
+
void initCommonGFX(bool defaultTo1XScaler) {
const Common::ConfigManager::Domain *transientDomain = ConfMan.getDomain(Common::ConfigManager::kTransientDomain);
const Common::ConfigManager::Domain *gameDomain = ConfMan.getActiveDomain();
diff --git a/engines/engine.h b/engines/engine.h
index 4f4223384a..33416dda44 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -37,6 +37,7 @@ class Error;
class EventManager;
class SaveFileManager;
class TimerManager;
+class FSNode;
}
namespace GUI {
class Debugger;
@@ -142,6 +143,16 @@ public:
virtual ~Engine();
/**
+ * Init SearchMan according to the game path.
+ *
+ * By default it adds the directory in non-flat mode with a depth of 4 as
+ * priority 0 to SearchMan.
+ *
+ * @param gamePath The base directory of the game data.
+ */
+ virtual void initializePath(const Common::FSNode &gamePath);
+
+ /**
* Init the engine and start its main loop.
* @return returns kNoError on success, else an error code.
*/