Commit Graph

454 Commits

Author SHA1 Message Date
sluicebox 386c5659ec BASE: Purge keyboard/mouse events before running Engine
Fixes GUI events leaking into engines at startup. This caused
Phantasmagoria 1 to skip its introduction if the game was started from
the ScummVM GUI with a keyboard (Enter) but not with a mouse because
the key-down event started the engine and the key-up event remained
in the queue.

This also purges and mouse events since we happen to already have a
purgeMouseEvents() method. We may want to also clear joystick inputs,
or possibly the entire event queue, but that can be done after the
upcoming release. For now, the known bug is fixed.
2021-08-23 15:46:33 -05:00
Eugene Sandulenko fef26b3c59 BASE: Capture all global debug channels as early as possible 2021-08-16 21:28:26 +02:00
Cameron Cawley b2d41daabc GUI: Add improved scaler selection to the Options dialog 2021-06-23 21:29:53 +02:00
sluicebox f2f28c4549 COMMON: Rename DebugManager methods, update comments 2021-06-14 12:42:38 -05:00
sluicebox efd4f9ff9d COMMON: Remove DebugManager::debugFlagsClear() 2021-06-14 12:42:38 -05:00
sluicebox 8e1d90f8e4 ALL: Remove clearAllDebugChannels() from Engine dtors 2021-06-14 12:42:38 -05:00
sluicebox 77cfab947a BASE: Fix debug levels parameter name 2021-06-10 10:47:42 -06:00
ysj1173886760 d3b596d820 BASE: Register debug channels before calling the findGame() in main.cpp 2021-05-22 01:34:57 +02:00
ysj1173886760 1c333f66e2 BASE: change the method name to adapt for new api 2021-05-22 01:34:57 +02:00
ysj1173886760 a6542f242e BASE: move setting debug flags to debug manager, set debug flags before call detectGames 2021-05-22 01:34:57 +02:00
ysj1173886760 f07ceca9cb BASE: add global debug flag 2021-05-22 01:34:57 +02:00
ysj1173886760 061fd12966 BASE: register debug channel before instantiate the engine in main 2021-05-22 01:34:57 +02:00
Le Philousophe 610fdfade8 BASE: Unload plugins when exiting after processing arguments
When not displaying the GUI, plugins are not unloaded.
This can cause problems on AmigaOS where plugins must be unloaded before
exiting. Else, some plugins with global destructors cause crashes being
destroyed too late.
2021-05-15 12:50:52 +02:00
Martin Gerhardy 9d82fa51df COMMON: removed USE_TTS check from engines
OSystem now just returns a nullptr if there is no text to speech manager instance
(because none is compiled into the binary, or the system doesn't provide support
for it). This removed the need for the engine authors to add scummvm osystem compile
time options checks into their engine code
2021-05-03 14:13:41 +03:00
Eugene Sandulenko 06794e48c6 BASE: Implemented --window-size command line option 2021-04-21 00:57:31 +02:00
Cameron Cawley f88769f132 BASE: Fix a crash when attempting to run a disabled engine 2021-04-08 12:18:11 +03:00
Cameron Cawley 3e8ab22eb2 BASE: Don't attempt to unload detection code when building with static detection 2021-04-07 14:38:51 +02:00
Cameron Cawley a1890ede9c BASE: Avoid calling PluginMan.getEngineFromMetaEngine where possible 2021-04-05 15:33:23 +01:00
Thierry Crozat 67720ef658 JANITORIAL: Remove obselete references to MetaEngineConnect
At some point when splitting the MetaEngine to a detection
plugin and a static meta engine, the former was called
MetaEngine while the latter was called MetaEngineConnect.
Thus was then later change to MetaEngineDetection and
MetaEngine. But some references were left to the former
names in comments and documentation.
2021-02-14 14:32:36 +00:00
av-dx 7950a9b215 GUI: Refresh stretch mode and shader on returning to launcher 2021-01-24 04:09:09 +02:00
Thierry Crozat a1c807704d ALL: Ignore force RTL option when the engine does not support RTL
This fixes bug #12072: Cannot quit Blazing Dragons when always
return to launcher is selected
2021-01-20 23:35:47 +00:00
Vladimir Serbinenko 0d39e96f55 COMMON: Make TranslationManager reusable.
This makes it possible to reuse TranslationManager with different
files.
2020-12-17 09:49:18 +01:00
Thierry Crozat 4518f73f92 BASE: Remove FORCE_RETURN_TO_LAUNCHER define
This was only used by the ps2 backend, and that backend no longer
exists. Also now backends that want to force RTL should use the
kFeatureNoQuit OSystem feature instead.
2020-12-09 22:13:22 +00:00
Thierry Crozat 9e5540f838 BASE: Handle RTL at exit config in scummvm_main
This config was handled in the DefaultEventManager, but this did not
work for engines that quit the game without using a QUIT_EVENT (such
as SCI). So now it is handled one level up directly in scummvm_main.

Note: It is still also handled in the DefaultEventManager so that we
get the correct confirmation dialog there when "confirm_exit" is true.
2020-12-09 22:13:22 +00:00
Cameron Cawley 01b4432825 BACKENDS: Use Common::U32String for OSystem::setWindowCaption 2020-11-22 17:20:19 +00:00
Cameron Cawley 11724f9df1 GUI: Add a tab for backend-specific options 2020-11-22 16:35:03 +00:00
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
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 5f5363f03b BASE: MAIN: Load/Unload detection plugin for UncachedPluginMan as/when needed.
- Used only in context of UncachedPluginMan
- Always load on startup
- When starting a game, unload all other MetaEngines except the one needed.
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 9353e339c6 BASE: MAIN: Proper usage of unloadPluginsExcept before running a game. 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 4b6976c558 GUI: U32: Reduce number of files changed and fixes
Up until last commit, everything was working fine but the amount of files changed was too large. This commit tries to reduce the changes.

- Add a fake constructor to Keymap, text-to-speech, setDescription (save-state)
- Redirecting functions for PopUpWidget::appendEntry, ButtonWidget::setLabel, GUIErrorMessage
- Use the above functions and constructors to reduce changes in Engines
- Fix warnings being in unicode. Only output english text in - Warnings, Errors, etc.
- Mark some strings as "translation" strings. (Not yet added to POTFILES)
- Remove some CP related things from po/modules.mk
- Previously used some Common::convertToU32 where it was not necessary, replace this with u32constructor
2020-08-30 14:43:41 +02:00
aryanrawlani28 f800ca4ada GUI: U32: Convert majority of code to use U32
This commit also includes some additional major changes.

- Return U32String from TransMan getTranslation()
- Change tooltips to be U32Strings
- Remove temporary code of convertToU32String
- U32 Support various dialogs (Browser, FileBrowser, Messages, Chooser, etc)
- U32 for music plugins
- U32 for OSD messages
- Add some helper functions to ustr.cpp
- Change default tooltips from nullptr & 0 -> ""
- Some runtime exceptions may occur when changing languages due to incorrect String::Format
2020-08-30 14:43:41 +02:00
Cameron Cawley cc5abf5ebb TTS: Fix crash when TextToSpeechManager is unavailable, clean up formatting 2020-05-27 12:43:49 +02:00
mataniko 2f5eb14d4b JANITORIAL: Rename additional RTL references and comments 2020-05-12 10:36:38 +02:00
mataniko 321a02aff2 JANITORIAL: Rename shouldRTL, resetRTL and FORCE_RTL 2020-05-12 10:36:38 +02:00
Bastien Bouclet bcfb7145fa GUI: Allow engines to define a fully custom tab in the edit game dialog
By implementing MetaEngine::buildEngineOptionsWidget, engines can
instantiate a container widget that will be shown in the Engine tab of
the edit game dialog. The default implementation retains the existing
behavior and shows the extra GUI options.
2020-03-28 07:38:39 +01:00
Bastien Bouclet 9cc2fee887 SDL: Enable joystick input by default
Game controller input is now enabled whenever a compatible device is
connected. The keymapper's keymaps are refreshed when a joystick is added
or removed.

Fixes #10366.
2020-03-16 18:41:27 +01:00
Cameron Cawley f2db412ba5 GUI: Store the shader name in the config file instead of the ID 2020-03-09 18:01:14 -05:00
Cameron Cawley 7488e17c0a GUI: Allow shaders to be selected for individual targets 2020-03-09 18:01:14 -05:00
Zvika Haramaty 3b4810aab4 AUDIO: Added dump-midi mechanism
This mechanism is enabled by '--dump-midi' command line parameter.
The midi events are printed to screen, and dumped to 'dump.mid' file.
2020-02-28 08:27:12 +02:00
Bastien Bouclet 3567c4f159 BASE: Reset the keymapper on RTL with dynamic plugins enabled
When returning to the launcher with dynamic plugins enabled, the config manager
is re-created, invalidating the pointers the keymapper keeps to the
configuration domains.

Fixes #11348.
2020-02-09 07:29:43 +01:00
Bastien Bouclet 2ef7365401 KEYMAPPER: Change backend default bindings to replace keymap defaults
Previously backend defaults where added to the keymap defaults.
However, it became apparent backends need to change the default bindings
to resolve conflicts.
2020-01-29 08:51:30 +01:00
Bastien Bouclet 519b4a57e2 KEYMAPPER: Allow engines to return multiple keymaps
The idea is that keymaps may be situational. A keymap may be always
enabled, while another one may be enabled only during combat..
2020-01-29 08:51:29 +01:00
Bastien Bouclet 7617723ab5 KEYMAPPER: Allow backends to register multiple keymaps 2020-01-29 08:51:29 +01:00
Bastien Bouclet 14663c4790 KEYMAPPER: Make the keymapper mandatory 2020-01-29 08:51:29 +01:00