Commit Graph

252 Commits

Author SHA1 Message Date
Eugene Sandulenko
7ff34bc9ec PLUGINS: MetaEngineStatic -> MetaEngineDetection 2020-10-11 23:14:39 +02:00
Eugene Sandulenko
7ea6781043 PLUGINS: PLUGIN_TYPE_METAENGINE -> PLUGIN_TYPE_ENGINE_DETECTION 2020-10-11 23:12:32 +02:00
Eugene Sandulenko
9590eed4b4 BASE: Upgrade fullpipe engineid to ngi
Making it hardcoded because:
  * This is the only place where it could happen
  * It is the second time in history of ScummVM when we renamed
    and engine (the first one was Simon -> AGOS)

Thus, there is a little sense in creating a universal solution.
2020-10-04 14:17:59 +02:00
aryanrawlani28
ffa69bfb26 GUI: debug statements related to plugins matching -> level 9. 2020-10-03 14:56:36 +02:00
aryanrawlani28
41af1b63a9 BASE: PLUGINS: Improve fb detection for Sci & Wintermute 2020-10-03 14:56:36 +02:00
aryanrawlani28
71a820caff ENGINES: Begin class renaming of ME & AME
- ME -> MetaEngineStatic (static parts)
- MEC -> MetaEngine (dynamic parts)
2020-10-03 14:56:36 +02:00
aryanrawlani28
c48719404a BASE: PLUGINS: Rename plugin matching helpers
- give*From* -> get*From*
2020-10-03 14:56:36 +02:00
aryanrawlani28
a9841622e0 ENGINES: DETECTION: Use inheritance hierarchy and mimic existing plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
ba5368542f BASE: PLUGINS: Update header file & use DETECTION_STATIC def check to build static detection features. 2020-10-03 14:56:36 +02:00
aryanrawlani28
ac900a06b8 BASE: PLUGINS: Use engines/detection_table header for static plugins 2020-10-03 14:56:36 +02:00
aryanrawlani28
fea29b04ac BASE: PLUGINS: Add a plugin suffix only if it is available 2020-10-03 14:56:36 +02:00
aryanrawlani28
7615f37698 BASE: PLUGINS: Add detection tables header file when getting static plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
8dfaf6cc0e BASE: PLUGINS: Add support for detection plugins to be loaded on demand.
- Mainly used for UncachedPluginManagers.
- CachedPluginManagers will not handle these, as metaengines will always be available in memory.
2020-10-03 14:56:36 +02:00
aryanrawlani28
b78534dcb0 BASE: PLUGINS: Seperate declaration/definition of StaticPlugins.
- Move declarations inside plugins.h to make it visible to detection/detection.cpp
2020-10-03 14:56:36 +02:00
aryanrawlani28
408158edc9 BASE: PLUGINS: Add a new type of plugin - DETECTION. 2020-10-03 14:56:36 +02:00
aryanrawlani28
53f08789eb BASE: PLUGINS: Restore functionalities of uncached plugin manager for the new changes. 2020-10-03 14:56:36 +02:00
aryanrawlani28
84ddd3ac88 BASE: PLUGINS: Remove comments referring to old game detection 2020-10-03 14:56:36 +02:00
aryanrawlani28
bdafdf220d BASE: PLUGINS: Deprecate improper usage of unloadPluginsExcept 2020-10-03 14:56:36 +02:00
aryanrawlani28
50e9f0d875 BASE: PLUGINS: Add helper methods which match MetaEngine to Engine & vice-versa 2020-10-03 14:56:36 +02:00
aryanrawlani28
f2dd03e7d8 BASE: PLUGINS: Implement a getEngineId for PluginObjects, return nullptr by default.
- See comments.
2020-10-03 14:56:36 +02:00
aryanrawlani28
943df64b32 ENGINES: Change behaviour of EngineMan::getPlugins.
- Changed so we can get any type of plugins.
- This used to always return PLUGIN_TYPE_ENGINE.
- Because now we can differentiate between engines and metaengine, this must be changed.
- For now, return METAENGINE by default
2020-10-03 14:56:36 +02:00
aryanrawlani28
f07bdb100e BASE: PLUGINS: Implement unloadPluginsExcept correctly
- The new implementation matchs a plugin from type MetaEngine to an Engine, and unloads every else ENGINE.
2020-10-03 14:56:36 +02:00
aryanrawlani28
09c1e1e07d BASE: Change how game detection works.
- Do NOT use pluginMan and load plugins, etc, etc.
- Get MetaEngines from memory, since they're always built in statically.
- Use detectGames method to detect games.
2020-10-03 14:56:36 +02:00
aryanrawlani28
6689fa740a BASE: PLUGINS: Add a new type of plugin - MetaEngine
- MetaEngines will now always go to the executable.
- But, because they still live in engine projects and are connected via a macro, they will need to be differentiated from Engines.
- This macro, and it's use in future will help in that.
2020-10-03 14:56:36 +02:00
Lothar Serra Mari
51c42478d2 BASE: WIN32: Exclude scummvm's base directory from plugin path
Currently, the plugin architecture searches for plugins in ScummVM's
base directory and in the plugins directory itself.

However, for Win32, we need to bundle several DLL files in order to
make ScummVM run at all. Currently, this leads to several warning
messages since ScummVM tries to load those DLLs as plugins.

This patch excludes the ScummVM base directory when running on Win32 and
only accepts plugins from the plugins directory.
2020-09-13 18:03:16 +02:00
Bastien Bouclet
3f45f77269 BACKENDS: Fix crash when all the plugins fail to load 2020-08-27 21:14:07 +02:00
Eugene Sandulenko
fe0193b914 JANITORIAL: Remove unndeded "common/translation.h" include 2020-08-27 20:26:45 +02:00
athrxx
5e276286ae AUDIO/GUI: add SegaCD sound settings 2020-07-30 22:19:21 +02:00
Matthew Duggan
e5501c7be4
BASE: Move CoreMIDI to end of list to speed up finding the right device (#2193)
CoreMIDI provides hardware midi device support.

On my MacBook, the first call to MIDIGetNumberOfDestinations() takes around 2
seconds.  Using one of the midi devices lower on the plugin list (mt32,
fluidsynth, etc) takes 2 extra seconds on every game start as
MidiDriver::getDeviceHandle() enumerates all the plugins to find the right one.

This change simply moves CoreMIDI to the bottom of the list.  It will still
take 2 extra seconds when opening the options box, but that's a rare operation
relative to starting games.
2020-05-01 13:27:43 +09:00
Bastien Bouclet
f17a7a96da BASE: Fix being unable to run games when using dynamic plugins
When the plugin-engine mapping is not cached in the configuration file,
we were not scanning all the plugins to establish the mapping.

This is a regression from commit: e2d91258b7

This commit reverts the offending commit and implements a proper fix for
the case where there are no dynamic plugins.

Fixes #11300.
2020-01-04 17:49:32 +01:00
Cameron Cawley
e2d91258b7 PLUGINS: Fix crash when no plugins are available 2019-12-02 11:04:57 +02:00
Cameron Cawley
f2b9f7bb76 BACKENDS: Remove the Windows CE port 2019-11-17 22:33:56 +01:00
Bastien Bouclet
c142838122 BASE: Change the command line interface to use engine-qualified game names
Qualified game names have the following form: engineId:gameId.
Unqualified game names are still supported as long as they are not
ambiguous. However they are considered deprecated and are no longer
displayed by the --list-games command.
2019-11-03 11:43:00 +01:00
Bastien Bouclet
ae9f764c7a ENGINES: Automatically upgrade the targets on launch to add an engine ID 2019-11-03 11:43:00 +01:00
Bastien Bouclet
bb813719b5 ENGINES: Change targets to have an 'engine ID'
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>
2019-11-03 11:43:00 +01:00
Bastien Bouclet
c5b92bcb2e GUI: Better integration for the unknown game dialog when adding games
* The list of candidates now includes unknown variants. When an unknown
variant is selected, the unknown game dialog is shown.
* On the unknown game dialog, users are given the choice to add the game
when that is possible, or to cancel.

The goal of those changes is to make the unknown game dialog less
confusing for users, especially when both known and unknown games
variants are found.
2019-05-12 11:44:51 +03:00
Eric Culp
6d11f46b15 BASE: Only reload engine plugins after return to launcher
The other plugins do not need to be reloaded. Reloading
the scaler plugins breaks the graphics.
2019-03-10 03:49:29 +02:00
Paul Gilbert
ef161922d8 ENGINES: Add optional extra configuration entries when creating new targets 2018-12-08 19:05:59 -08:00
Bastien Bouclet
9d62f13e3a BASE: Fix a segfault when mass detector encounters an empty directory
Was introduced in the recent detection rework.
2018-06-17 18:09:40 +02:00
Bastien Bouclet
1dcb8076db ENGINES: Remove usage of C++11 extended initializer lists 2018-05-10 09:26:26 +02:00
Bastien Bouclet
90b78c5446 ENGINES: Merge GameDescriptor and DetectedGame 2018-05-10 09:04:23 +02:00
Bastien Bouclet
faa2534f46 ENGINES: Factor adding games to ConfMan 2018-05-10 09:04:23 +02:00
Bastien Bouclet
5aff87dc15 ENGINES: Turn GameDescriptor into a simple struct 2018-05-10 09:04:23 +02:00
Bastien Bouclet
8fb149e3c7 ENGINES: Change MetaEngine::findGame to return a plain game descriptor 2018-05-10 09:04:23 +02:00
Bastien Bouclet
cf1ebf2951 ENGINES: Add unknown game variants to the game detector results 2018-05-10 09:04:23 +02:00
Lothar Serra Mari
451cf2304f ENGINES: Show the unknown Game dialog only when the detector is launched by the Add Game feature 2018-04-29 21:47:10 +01:00
Adrian Frühwirth
3747d852ee JANITORIAL: Fix whitespace 2018-04-15 16:31:31 +02:00
Colin Snover
d087c9605f BASE: Remove bad casts between incompatible Plugin types
Previously, a C-style cast was used to convert a
Common::Array<Plugin *>, populated with pointers to StaticPlugin
and DynamicPlugin instances, to a
Common::Array<PluginSubclass<T> *>, but PluginSubclass<T> is a
*sibling* class to StaticPlugin/DynamicPlugin, so this cast was
invalid and the results undefined. The methods for retrieving
subclasses of plugins can't be easily changed to just generate an
array of temporary wrapper objects that expose an identical API
which dereferences to the preferred PluginObject subclass because
pointers to these objects are retained by other parts of ScummVM,
so the wrappers would needed to be persisted or they would need to
just re-expose the underlying Plugin object again. This indicated
that a way to solve this problem is to have the callers receive
Plugin objects and get the PluginObject from the Plugin by
explicitly stating their desired type, in a similar manner to
std::get(std::variant), so that the pattern used by this patch to
solve the problem.

Closes gh-1051.
2017-12-03 20:26:38 -06:00
Eugene Sandulenko
940b2a20f1 Revert "COMMON: Change way the Singleton instances are instantiated"
This reverts commit eefa72afa1.

With this patch ConfigManager is broken.
2017-07-10 21:17:41 +02:00
Thierry Crozat
eefa72afa1 COMMON: Change way the Singleton instances are instantiated
This fixes tons of warnings with clang from a recent xcode version on
macOS (and possibly other systems) complaining that an instantiation
of _singleton is required but no definition is available.
2017-07-10 21:11:20 +02:00