This is a degradation from the split of detection plugins. All the
caching code which was present was left with detection plugins which
now make no sense: we always load all detection plugins as a whole.
This commit moves the caching logic over to the Engine plugins.
This opens a question now whether we should move all to UNCACHED_PLUGINS
For unknown variants it now checks that the file is actually an
AGS game to avoid false positive due to generic names used by
some of the detection entries (such as 'game.exe'). Also unknown
variants can now be added.
This will give an error dialog and not actually start the game. The dialog can be customized with a message from the ADGameDescription::extra field.
Some changes have been made to DetectedGame to prevent the string from the extras field to be appended to the game description.
- When there are more than one non-alphanum at the end, like "Quest..."
- When there is no alphanum at all: "::::"
- Added error messages if anything else is not caught
- Update AMEC's getFileProps (changes related to MacResMan)
- This commit also includes a change from other engines.
- Fallback detection here depends upon many Engine resources.
- As such, it might not be suitable to add all of them to executable.
- Thus, shift fallback detection to the dynamic part.
- The static part gets the relevant Engine plugin & then tries to call it.
- This way, fallback detection for Wintermute will depend on the engine plugin.
- Normal detection will still work fine.
- Add fallbackDetectExtern, meant to be overriden by child classes, if fallbackdetection heavily depends on Engine code.
- Add getFileProperties helper.
- End function names with "extern" to distinguish from normal.
- We have a default createInstance method overridden from MetaEngine from before in AME.
- So, just leave that as-is, and call the child class's function from there.
- Lastly, in AMEC - the generic createInstance is called, so we redirect it to call the one in the MetaEngine.
- Then, games can be run normally.
Common::MacResMan is now able to open files from a specified
Common::Archive. This is a bit hacky as dynamic_cast is used to break
the Archive encapsulation to retreive the underlying FSNode. It should
however be more correct than the previous code that assumed files were
at the root of the currently running game's path.
AdvancedDetector constructs a Common::Archive from its FileMap based
filesystem cache and uses it to detect the mac resource fork files.
This cuts the time it takes to run the detection code with all the
engines enabled as dynamic plugins on the 3DS to 30 s from 280 s.
Checking whether a file exists is costly on the 3DS. Remembering which
files do not exist instead of repeatedly checking for them reduces the
time it takes to detect games from ~1 minute to ~10 seconds in some
cases.
The engine ID identifies which engine should be used to launch the target.
Also remove the 'single ID' system. Different games from engines that used
that system now have different game IDs.
Also-By: Matthew Hoops <clone2727@gmail.com>
Hidden files are now only ignored in the GUI file browser when the user
has not checked 'show hidden files'.
Myst III has the hidden flag set for one of the directories containing
datafiles on the CD-ROM. When users copy the files to their hard drives
the hidden flag is kept. Detection worked previously because hidden
files were explicitly requested in the AD code. The engine would fail
to open the datafiles because SearchMan.addSubDirectoryMatching
ignored hidden directories.
Fixes#1516.
Hidden files are now only ignored in the GUI file browser when the user
has not checked 'show hidden files'.
Myst III has the hidden flag set for one of the directories containing
datafiles on the CD-ROM. When users copy the files to their hard drives
the hidden flag is kept. Detection worked previously because hidden
files were explicitly requested in the AD code. The engine would fail
to open the datafiles because SearchMan.addSubDirectoryMatching
ignored hidden directories.
This is a regression from 90b78c5446
This commit restores the previous behaviour and avoids a null
pointer dereference induced crash.
This fixes the root cause of bug Trac #10515.