Age | Commit message (Collapse) | Author |
|
Translation strings come from external data sources and can cause
a stack buffer overflow here just by accidentally (or maliciously)
being too long.
|
|
|
|
Destroying and recreating the SDL window whenever the video mode
changes in SDL2 is not necessary and causes several problems:
1. In windowed mode, the game window shifts position;
2. In fullscreen mode in macOS, every time the window is
recreated, it causes the OS to play its switch-to-fullscreen
animation again and emit system alert noises;
3. The window content flickers; and
4. The engine loses events from the old destroyed window.
This patch changes the SDL backend code to avoid destroying and
recreating the SDL window when using SDL2, except when switching
OpenGL modes, since there is no way to change the OpenGL feature
of a window.
There are still some outstanding issues with OpenGL where window
size ends up getting reset even though the user has resized it;
this will probably need to be addressed at some point in another
patch.
Thanks to @bgK and @criezy for their feedback which made this
patch much better.
Co-Authored-By: Bastien Bouclet <bastien.bouclet@gmail.com>
|
|
Closes gh-948.
|
|
In particular this adds a warning when failing to save a screenshot
in OpenGL mode (there was already one in SurfaceSDL mode).
|
|
|
|
This fixes bug #9701: WINDOWS: Flow of taking screenshots
on Windows is broken
|
|
|
|
|
|
|
|
|
|
|
|
|
|
We don't need to recreate the window when turning filtering on or off.
Only the texture needs to be recreated.
|
|
|
|
This implements the request from ticket #9573: SDL1/2: Different
rendering/filtering?
|
|
Previous releases also did full screen updates for transparent OSD messages.
There should be no performance regression with that regard.
Computing smaller update rects is non trivial, but should be looked into if
performance is an issue for OSD icons.
Fixes #9598
|
|
|
|
|
|
|
|
|
|
|
|
Now it doesn't require full redraw, but asks to redraw the area which is
copied to.
|
|
Now OSD is always drawn.
|
|
|
|
So one can erase everything from OSD and then blit something on it.
|
|
I was lazy to implement that in OpenGLGraphicsManager and I'm not sure
it's implemented correctly in SurfaceSdlGraphicsManager, but it works
for me.
|
|
Overlays are shown with _currentShakePos offset too, so no need to
compensate the mousepointer position for overlays. This compensation
was done inconsistently in draw/undraw mouse causing the mouse trails.
|
|
Too many artifacts. It is not possible with current ScummVM
drawing approaches.
|
|
|
|
Bug is: "IRIX: X BadMatch when trying to start any 640x480 game".
40e019efd45a02261a7dbc69ceaa9188d8c7a269 introduced resetting the pixel depth
when unloading modes for SDL output. This was required to make mode listing
for OpenGL work on Win8+.
This causes issues on non-Win32 platforms though. SDL might not give us a valid
a pixel depth, causing the resetting to fail. A particular example is X11 on
IRIX, when only 16bit output modes work. Initially SDL tells us that the pixel
depth is 32bit. Trying to set this up causes a crash though.
Since there is no way to validate SDL's return value, we simply limit the reset
to platforms where it is actually required, i.e. Win32.
|
|
The code is disabled for now.
|
|
The mouse emulation via keyboard (or other means) was broken with
079037b73990b6107e59c7f1cd971c3a1cc221d1.
|
|
Thanks to bgK for noticing.
|
|
|
|
As a side effect we get better coordinates from mouse move events in
fullscreen, i.e. we do not get actual window coordinates but something close
to actual viewport coordinates. The easily noticable issue is that mouse
coordinates inside black bars are outside of the viewport. For example, the
x coordinate can get negative when there's a black bar at the left side.
|
|
|
|
We set a custom video mode that might have a different BPP from the default. To ensure that other graphics managers will get the proper results when listing available video modes, we need to restore the initial BPP when unloading.
This fixes an issue when switching to OpenGL on Windows 8 and later. On those OSes, fullscreen OpenGL only has a 32bpp mode. It is correctly listed in the options but we call SLD_SetVideoMode later in the surface graphics manager. When we list the mode again after a switch, the internally selected BPP is still 16 and we fail to find any available fullscreen modes.
|
|
|
|
This is based upon skristiansson's change set to make ScummVM work with SDL2.
|
|
|
|
|
|
Enable RTTI and clean up the code by exploiting the availability of dynamic_cast.
|
|
|
|
|
|
|
|
|
|
We can do this now that we can use virtual inheritance and dynamic_cast
because we enabled RTTI.
|
|
|
|
|