Commit Graph

134 Commits

Author SHA1 Message Date
Cameron Cawley
f3b094e53f ENGINES: Change the MetaEngineDetection interface to match MetaEngine 2022-07-23 23:31:58 +02:00
Cameron Cawley
a020300701 ENGINES: Remove use of getEngineId() in MetaEngine subclasses 2022-07-20 11:54:19 +02:00
D G Turner
f8e18b81f5 BASE: Fix Redundant Declaration Warnings in Plugin Macros
These generated GCC Warnings when -Wredundant-decls is enabled.
2022-03-07 11:42:19 +00:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh
b11c5ace90 BACKENDS: JANITORIAL: Remove 'virtual' when override is specified 2021-11-14 14:31:41 +02:00
Eugene Sandulenko
436e47292e
BASE: Load engine plugins by name. Fixes bug #12342
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
2021-08-16 20:32:53 +02:00
Eric Culp
a3af191753 GRAPHICS/BASE: Adds definitions for scaler plugins
This includes a class for plugin implementations to inherit from and
code necessary for plugin managers to use scalers
2021-03-15 16:48:40 +02:00
Cameron Cawley
76ac4414ec BASE: Fix crash when building with uncached plugins and static detection 2021-02-08 03:09:58 +02:00
Bartosz Gentkowski
7192ec0bb5 DOXYGEN: Fix the build output and structure
This commit introduces a couple tweaks to the
doxygen build configuration to assure the
overall structure looks correct.
2020-12-02 22:55:41 +00:00
Eugene Sandulenko
7ea6781043 PLUGINS: PLUGIN_TYPE_METAENGINE -> PLUGIN_TYPE_ENGINE_DETECTION 2020-10-11 23:12:32 +02:00
aryanrawlani28
c48719404a BASE: PLUGINS: Rename plugin matching helpers
- give*From* -> get*From*
2020-10-03 14:56:36 +02:00
Eugene Sandulenko
ceabaf3b0d BASE: Added override keywords 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
39f5c93c5c BASE: PLUGINS: Bump PLUGIN_TYPE_ENGINE_VERSION to 2
- Because of the many changes happening to engine classes, it would be a good idea to update the version, something similiar was done with themes.
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
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
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
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
sluicebox
e67b8501bf WIN32: Fix embedding disabled engine files
Fix Windows builds (msvc and mingw) including data files from disabled
engines as embedded resources in executable. Bug #10878
2019-03-02 10:01:37 +02: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
Ori Avtalion
4d120800fa ALL: Don't use 'defined' in macro definitions
This is undefined behavior and clang warns about it.
See <http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160118/147239.html>.
2016-07-23 16:18:51 +03:00
Johannes Schickel
f62153c795 BASE: Make GPL headers consistent in themselves. 2014-02-18 02:39:32 +01:00
D G Turner
dd18159578 BASE: Fix uninitialized type field in plugin base class. CID 1002938. 2013-09-30 02:26:44 +01:00
Johannes Schickel
b7c3ffd37c BASE: Add operator* to PluginSubclass. 2012-06-14 03:12:48 +02:00
Alyssa Milburn
31d1ae6530 Revert "BASE: Get rid of unecessary friend in PluginManagerUncached."
This reverts commit 1e0de79cf5.
The only available constructor for PluginManagerUncached is
protected, so this broke the builds using it.
2012-02-01 21:54:40 +01:00
Johannes Schickel
1e0de79cf5 BASE: Get rid of unecessary friend in PluginManagerUncached. 2012-02-01 19:38:27 +01:00
Max Horn
88913c0139 ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
  git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-06-20 00:59:48 +02:00
D G Turner
5a2e6e4f3f BUILD: Fix compilation when --enable-plugins is enabled. 2011-05-31 04:44:12 +01:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Ori Avtalion
cd6ee0589d JANITORIAL: Format forward declarations to follow convention 2011-04-28 12:20:34 +03:00
Jordi Vilalta Prat
a422763833 BUILD: Remove explicit references to SVN in revision variable names.
svn-id: r55898
2011-02-12 16:43:57 +00:00
Yotam Barnoy
8f36a5f887 PLUGINS: single plugin model now saves plugin filename to config file
After searching for the right plugin once, the filename will be saved to the config file under the domain 'plugin_files'. The key is the gameid and the value is the plugin file. The backup mechanism is searching plugin by plugin.

svn-id: r55061
2010-12-29 15:25:21 +00:00
Yotam Barnoy
10b96eb94d PLUGINS: PluginManager minor cleanups
svn-id: r55027
2010-12-23 14:37:03 +00:00
Yotam Barnoy
ee2b1092ab PLUGINS: switched plugin manager to inheritance rather than #defines
The reason for this was that I found issues where the wrong functions were called in EngineManager for single plugin operation. Rather than inserting more messy #defines, I preferred to change the PluginManager to use virtual functions, which also makes EngineManager simpler.

svn-id: r55024
2010-12-23 13:38:37 +00:00
Yotam Barnoy
a6bee87990 PLUGINS: improved one-at-a-time plugin code
I reduced memory fragmentation using 2 principles: Plugins should be loaded for as little time as possible, and long lasting memory allocations should be allocated before plugins are loaded. There might still be a little fragmentation left.
Note that command line settings that require plugins to be loaded don't work yet, but they didn't work (properly) before either.

svn-id: r54097
2010-11-05 13:24:57 +00:00
Andre Heider
2596143e2b PLUGINS: Additional plugin check for the ELF loader.
The ELF loader does not have access to the symbols of the main
executable, it just relocates symbols to it via fixed offsets. We need
to make sure that loaded plugins are from the same link process to
prevent crashes. An embedded build date is used for that.

svn-id: r52730
2010-09-15 07:44:08 +00:00
Andre Heider
41834499ed PLUGINS: Cleanup.
- Unify ELF loader handling in configure
- Rename ELF_LOADER_TARGET to USE_ELF_LOADER

svn-id: r52728
2010-09-15 07:43:16 +00:00
Andre Heider
fd4189180d PLUGINS: Fix warning when not using the ELF loader.
svn-id: r52613
2010-09-06 22:18:10 +00:00
Andre Heider
ae408db07f PLUGINS: Use the C++ ABI to call dtors when unloading a plugin.
Avoid linking all plugins against libstdc++ to free up some memory
(about ~40kb on Wii per plugin). Enable it on GameCube, Wii, DS and PSP
(PS2 doesn't have __cxa_atexit support in its libc).

svn-id: r52607
2010-09-06 20:34:00 +00:00
Max Horn
f27b984fec Fix warning & code formatting
svn-id: r52202
2010-08-19 08:46:19 +00:00
Tony Puccinelli
43488f789f Ensured getPlugins is not called multiple times on Static Plugin Provider with 'ONE_PLUGIN_AT_A_TIME' defined
svn-id: r52080
2010-08-14 08:04:40 +00:00
Tony Puccinelli
89d76fe5a5 Refined first refinement of new plugin design. Tested successfully adding/removing/running games on Linux with only one engine plugin loaded at a time
svn-id: r52026
2010-08-12 06:00:19 +00:00
Tony Puccinelli
d889a706f2 gave plugin iterators more appropriate names, removed debugging printf, added comments to loadFirstPlugin and loadNextPlugin
svn-id: r51673
2010-08-03 01:10:36 +00:00
Tony Puccinelli
44d7414215 changed plugins so games can be added in the launcher with only one plugin loaded into memory at a time (first refinement)
svn-id: r51607
2010-08-02 08:43:47 +00:00
Tony Puccinelli
869e49d185 initial work on plugin design changes (already added games can be launched with only one plugin loaded at a time if you compile with a 'NEW_PLUGIN_DESIGN_FIRST_REFINEMENT' flag)
svn-id: r51502
2010-07-30 09:32:45 +00:00