101110 Commits

Author SHA1 Message Date
aryanrawlani28
5850987077 AGOS: Move some common detection related enums from intern.h -> intern_detection.h
- Include it in intern.h, so everything functions normally.
- However, now we can include detection-related things from intern.h in other files, without including unnecessary things.
2020-10-03 14:56:36 +02:00
aryanrawlani28
76cb0351e0 AGOS: Move common enum from agos.h to new header file 2020-10-03 14:56:36 +02:00
aryanrawlani28
c7dc3d6118 ZVISION: Split detection code & adapt to new plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
bbed423569 ZVISION: Move common enums to detection_enums header file.
- These enums are helping in game detection, as well as needed for the engine.
2020-10-03 14:56:36 +02:00
aryanrawlani28
c5325c68c9 ACCESS: Split detection code & adapt to new plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
48751160f9 ACCESS: Move common enum to detection_enums.h 2020-10-03 14:56:36 +02:00
aryanrawlani28
4ef8eab545 CGE2: Split detection code & adapt to new plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
0d61c5bd4b CGE: Split detection code & adapt to new plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
4b377af8c6 QUEEN: Split detection code & adapt to new plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
0a14511547 ADL: Remove unneeded functions from detection & move to metaengine. 2020-10-03 14:56:36 +02:00
aryanrawlani28
d57f84205c ADL: Seperate detection.h into two headers to improve dependencies
- Also makes it match other engine conventions.
- Engine files get a copy of detection_enums, while metaengine & detection.cpp get a copy of detection.h as well as detection_enums.
2020-10-03 14:56:36 +02:00
aryanrawlani28
c2428c7a8f ADL: Split detection code & adapt to new plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
0880ab9357 SWORD25: Split detection code & adapt to new plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
a21da27bf1 SWORD2: Refactoring of code, split detection code, adapt to new plugins.
- Entire code was located in the main sword2.cpp file.
- Seperate detection-related code to detection.cpp
- Seperate other MetaEngineConnect related code to metaengine.cpp
- detection.h serves common code between the above files
- A enum value has been copied from sword2.h into the detection TU to avoid duplicate copy
- the detection.h has static function definitions for detecting games.
- This is because metaengine.cpp includes it & detection.cpp does as well.
- If we keep the methods as static, we can truely seperate out everything detection related.
2020-10-03 14:56:36 +02:00
aryanrawlani28
467ca35a37 SWORD1: Split detection code & adapt to new plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
141edd7eb8 LURE: Split detection code & adapt to new plugins.
- There is also some shifting around of code done, so metaengine.cpp & detection.cpp can only share what's needed.
2020-10-03 14:56:36 +02:00
aryanrawlani28
14edaf3d03 DRASCULA: Split detection code & adapt to new plugins
- Also shift common things to detection.h, like a struct & enum.
2020-10-03 14:56:36 +02:00
aryanrawlani28
5161f46f98 DREAMWEB: Split detection code & adapt to new plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
cdf4261328 DREAMWEB: Move common struct to detection.h
- This way we don't include entire detection_tables in metaengine.cpp, which needs it.
2020-10-03 14:56:36 +02:00
aryanrawlani28
6a3b7b6722 SKY: Split detection features & adapt to new plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
4c1a03845f SCUMM: Refactoring, remove detection.o dependency from modules.
- Move detection code used by createInstance & MetaEngine to a common header - detection_internal.h
- Move steam-related method & table to detection_steam.h
- More info in comments.
2020-10-03 14:56:36 +02:00
aryanrawlani28
dc4672e294 SCUMM: Split detection features & adapt to new plugins.
- Also, we remove the static keyword so other TU's can use the functions defined.
- This change has a catch.
- Because creating an instance depends on game detection code from detection.cpp, we cannot exclude it from Scumm.
- For Statically linked Scumm, we can simply exclude these detection files, because they're already being built.
- For dynamically linked Scumm, we can add it to our executable.
- Thus, for dynamically linked Scumm, one catch is that we have duplicated code (detection.o in our executable, as well as scumm.dll), but that shouldn't be a big problem considering the advantage it gives us: Detection without a plugin loading.
2020-10-03 14:56:36 +02:00
aryanrawlani28
d10eb35dfe SCUMM: Move obsoleteGameIDsTable from detection_tables to a common header
- MetaEngineConnect requires these at compile time.
- In order to avoid including everything from detect_tables, we just move the one thing we need into header, and include that in metaengine.cpp
- Also include it in detection_tables.h to restore orignal functionality.
2020-10-03 14:56:36 +02:00
aryanrawlani28
fa36701425 AGI: Split detection features & adapt to new plugins. 2020-10-03 14:56:36 +02:00
aryanrawlani28
9c6c628ae6 AGI: Move some common code to detection.h
- These structs are necessary for detection, as well as the engine itself.
- So, we move it to a common header file, include it once in both the files.
- This way, we won't have to include agi.h inside detection translation unit, which saves us much junk code going into the executable.
2020-10-03 14:56:36 +02:00
aryanrawlani28
978901cc2f PLUMBERS: Split detection code & adapt to new plugins.
- Detection related code, and the class MetaEngine lives in detection.cpp
- Things which require the engine to be loaded, are in metaengine.cpp - the relevant class is called MetaEngineConnect.
- Update modules for the necessary changes.
2020-10-03 14:56:36 +02:00
aryanrawlani28
1616d7d515 ENGINES: ME & MEC: Move achievements-related code to MetaEngineConnect
- Adjust accordingly for dialogs.
2020-10-03 14:56:36 +02:00
aryanrawlani28
0cc8719417 BASE: ENGINES: Adapt to keymaps moving to engine plugins
- Also improvise usage of MetaEngineConnect in main.cpp a bit.
2020-10-03 14:56:36 +02:00
aryanrawlani28
fd1e333100 ENGINES: METAENGINE: Move initKeymaps into MetaEngineConnect.
- Used by Sky, for example.
2020-10-03 14:56:36 +02:00
aryanrawlani28
5d3292d844 CONFIGURE: Update to properly support statically linked ScummVM.
- Since new engine classes cannot provide same ID for the 2 different types of MetaEngines, update the script to adjust for this behaviour.
2020-10-03 14:56:36 +02:00
aryanrawlani28
9353e339c6 BASE: MAIN: Proper usage of unloadPluginsExcept before running a game. 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
73cc973ad7 BASE: ENGINES: Change saveload code to adapt to the new MEC class.
- MEC: MetaEngineConnect.
- How do games handle save/load if MetaEngine (detection) is seperate from MetaEngineConnect (engine factory)?

- Most of the changes are quite similiar. ConfMan finds us the relevant MetaEngine, then simply use the new helpers from PluginMan.
- The new helpers will help convert a relevant MetaEngine into the other format or vice versa.
- Once the matching is complete, simply invoke functions by:
plugin->get<MetaEngineConnect>().engineMethod();
- Refer to previous commits to see the new class changes & notes.
2020-10-03 14:56:36 +02:00
aryanrawlani28
01efb65931 ENGINES: METAENGINE: Shift save/load related content to MetaEngineConnect
- These include various functions and functionalities related to save/load.
- These are shifted, because the MEC class will house things that can be dynamic in nature.
- The MetaEngine class is fully & only dependent on ScummVM code, so it can always be built into executable.
2020-10-03 14:56:36 +02:00
aryanrawlani28
ce80c0c730 ENGINES: Add a helper method - getMetaEngineConnect().
- Get a metaEngine plugin by querying the ConfMan.
- Next, use this MetaEngine to find a matching enginePlugin.
- Return the enginePlugin.
2020-10-03 14:56:36 +02:00
aryanrawlani28
9c67225293 COMMON: ERROR: Add kMetaEnginePluginNotFound 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
a73858a3df ENGINES: MEC & AMEC: Provide notes for getName().
- If classes inherting provide the same name here as they did in the relevant MetaEngine, we can easily match a Engine with MetaEngine.
2020-10-03 14:56:36 +02:00
aryanrawlani28
575e77522a BASE: MAIN: Change how running games works.
- In runGame(), in main.cpp, we get a plugin of type MetaEngine.
- This MetaEngine cannot createInstances, but it just a helper class.
- Connect a MetaEngine class with it's factory class - MetaEngineConnect.
- Then, simply call the method.
2020-10-03 14:56:36 +02:00
aryanrawlani28
e69d9c98a4 ENGINES: AME: Move the subclass implemented method createInstance out of AME into AMEConnect.
- 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.
2020-10-03 14:56:36 +02:00
aryanrawlani28
09a16347de ENGINES: Move createInstance from ME to MetaEngineConnect class 2020-10-03 14:56:36 +02:00
aryanrawlani28
24ee4c7559 ENGINES: ME & AME: Add new classes related to ME & AME.
- MetaEngineConnect
- AdvancedMetaEngineConnect
- These classes will have "bridge" functions, see comments for more info.
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
aryanrawlani28
28dc54940f BUILD: MAKEFILE: Introduce DETECT_OBJS variable. Executable depends on it.
Note: No detection objects added currently. It's just an empty variable uptill now.
- These DETECT_OBJS will be seen in action in the new commits
- They contain engine_name/detection.o
- They have MetaEngine code, which has detection features.
- This way, Executable will have linked against the detection.o files
- Detection.cpp files will be individually compilable and not dependent on engine
2020-10-03 14:56:36 +02:00
aryanrawlani28
365b1101f3 CONFIGURE: Add static-detect-plugins array to be added in plugin_tables.h
- Currently, it is empty.
- After I enable engines one by to one to use detection statically, I will add them to the static_detect_engines array.
2020-10-03 14:56:36 +02:00