The User Manual Help menu item now opens the pdf bundled with the
application if present, and only opens the website otherwise.
The bundled documentation is preferred as:
- This will work even with no internet access
- This is future proof and will still work in 10 years when the
website URL might have changed or the website may be down.
- This ensure we get the doc that corresponds to the version of
ScummVM being used.
SDL handles HiDPI scaling differently depending on the system. On
macOS for example the SDL window size and SDL drawable area have a
different size (factor 2 usually) while on Windows they are the
same. When HiDPI is disabled (for the SDL Surface mode for example)
they are always the same.
We need to appl this scaling when converting cursor position between
the drawable area and the SDL window.
The OSystem_SDL::getDefaultGraphicsMode was returning the
default for the current graphics manager and not the default
for the OSystem_SDL instance. So for example if the default
is SDL Surface when starting ScummVM with the gfx_mode not
set in the config file, and then the user selects the OpenGL
graphics mode, getDefaultGraphicsMode() would now return the
OpenGL mode (the default the OpenGLGraphicsManager). As a
result changing the graphics mode back to <default> and
applying the change would not switch back to Surface SDL
until you restart ScummVM or start a game.
This commit also change how the SDL backends can specify which
graphics mode to use by default. They no longer have to assume
they know the names of the graphics modes in the graphics manager.
- allow certain symbols from unistd.h within SDL backend
- e.g. on armv7, ppc64, aarch and s390, SDL.h would include indirectly
unistd.h after common/forbidden.h and so the preprocessor would
generate broken code even if the symbols are never called by
scummvm
Supported graphics modes are grouped in an merged array in which
the first part contains modes from the non-OpenGL SDL manager,
obtained by a copy dynamically allocated.
When the array was rebuilt or aimed to be destroyed, it was only
cleared (removing elements) but not freeing duplicated fields
name and description.
An additional leak came from the temporary array (srcModes)
not freed.
When an engine is added or removed, it affects the embedded resources in
scummvm.rc, so config.mk is required.
+ Add some missing dependencies in win32.mk.
Example:
../scummvm/backends/platform/sdl/win32/win32_wrapper.cpp:39:52: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'VerSetConditionMaskFunction' {aka 'long long unsigned int (*)(long long unsigned int, long unsigned int, unsigned char)'} [-Wcast-function-type]
39 | VerSetConditionMaskFunction verSetConditionMask = (VerSetConditionMaskFunction)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "VerSetConditionMask");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The call to MIDIGetNumberOfDestinations() starts the MIDI server which takes
3-4l seconds even on the modern hardware. We are querying this in the GUI Options
which then lags on the first launch.
Thus, we are creating a separate thread and make this call at the start of
ScummVM, so by the time the user gets to the GUI, the server is already launched
and there is no lag.
Of course, that would mean that we will launch MIDI even for the games which are
not using it, so this is a tradeoff for the better UX.