This removes the usage of memset to clear complex structures and replaces
them with constructor methods for the structures which will be executed
when these are instantiated.
The GLSL version code has been taken from ResidualVM. The variable
'texture' is now a reserved keyword in GLSL 3.00, so it has been
renamed. This fixes compilation issues in AmigaOS4 (PR 1554).
Four modes are supported:
- Use original size with no scaling
- Scale by an integral amount as much as possible but not bigger
than the window.
- Scale to fit the window while respecting the aspect ratio. There
may be black bars on the left and right, or on the top and bottom,
but not both. This is the default, and the old behaviour.
- Scale and stretch to fit the window. In this mode the aspecy ratio
is not respected and there is no black bars.
The mode is controled by the "scaling_mode" value (between 0 and 3) in
the config file.
Also add Crtl-Alt-s hotkey to cycle through scaling modes
When a 32-bit cursor has the same size as an 8- or 16-bit cursor,
the mouse surfaces were not being regenerated even though the
32-bit cursors have a different memory requirement. This lead to
memory corruption as an inappropriate surface would be used for
the other type of cursor.
The shoe-horned 32-bit cursor support is clearly showing its
scrappy nature here and probably ought to be revisited in the
future if the SurfaceSdl graphics manager sticks around.
Fixes Trac#10349, Trac#10350, Trac#10351.
If a game is doing a screen shake (for example, DOTT when the
stereo is on), and the user does an RTL, the screen shake offset
may get stuck if the engine does not reset it on shutdown. To
avoid this in all cases, just always reset the screen shake
whenever the graphics manager is told to switch to a new graphics
mode.
Normally, notifyMousePosition converts real mouse events into the
virtual coordinate system, but events only get sent through
notifyMousePosition if they are real events from SDL since that
method also decides if the real mouse is inside the content area or
not. As such, these fake events need to be pre-converted to virtual
coordinates or else the wrong values are sent through to the engine
when a scaler or AR correction is in use.