scummvm/scummvm — pull request #423 by lordhoto (2014-01-22 17:27:20+00:00)
Title: ENGINES: Make game path addition to SearchMan fully configurable

Currently we add the game path ("path" from the config entry) in a hardocded fashion to SearchMan inside runGame in base/main.cpp. This has the disadvantage that the search depth, flattening mode etc. is all fixed for all engines. In case an engine wants to add the main game path differently it would need to work around this by adding the game path on its own inside the constructor (and thus before runGame does it). Tinsel currently does this for PSX versions of DW1. This results in an ugly warning about the game path being added twice.

To make this more configurable for engines, this pull requests adds an overridable method initializePath to Engine and calls it from runGame instead of the former hardcoded addition. The default implementation of initializePath still conforms to the old behavior.

I also adapted Tinsel to show how this can be used.

We might also think of moving all the path initialization from the Engine subclasses's constructor to initializePath in all engines (or only as new standard place, i.e. update http://wiki.scummvm.org/index.php/HOWTO-Engines).