This adds a new shortcut (Ctrl+R) which toggles the resizable state of
the window and allows the user to lock the window size and prevents
resizing.
Closes bug:15124.
Init ImGui after our GLContext object has been initialized and check the
context type to specify the proper GLSL version.
Also make sure we are not in GLES mode before setuping ImGui.
Pretending that the manager starts in the overlay mode was really
confusing.
Also, the concept of _workScreen seemed great in theory but lead to
various subtle errors which were very hard to debug (related to cursor
handling, resolution changing etc).
The "scale_factor" setting can be -1, which means the default. But
instead it was hardcoded to 1, which is wrong for the SurfaceSDL
graphics mode where the default is 2.
- seamless resolution/palette switching (at least in theory, it still
isn't artifact-free, no clue why)
- bugfixes (shake offset, some s_screenSurf corner cases)
- simplification the triple-buffering code
This shaves off a good 800 KB from all the engines. However, do keep
local atari debug messages for diagnostic purposes.
Also, use natfeats for debug output when possible else the classic
stdout/stderr (not both as before).
Normally when using the OpenGL mode the window is not resized when
starting a game, unless the game requires a window bigger than the
current window size. However this was not the case if the engine
called initSizeHint() with sizes smaller than the current window
size, as in this case the window was forcibly resized to the bigger
of those provided sizes.
The initSizeHint() function was added for engines that use multiple
resolutions to indicate when starting the engine that it may use
multiple resolutions and thus may need a bigger window later than
when the game starts. This allows getting the bigger size from the
start and prevent window resize during gameplay. But this function
was not meant to make the window smaller if the graphics backend
request an even bigger size, which may be the case of the OpenGLSDL
graphics backend as it tries to preserve the current window size.
- optimize fillScreen(): Eco Quest calls it way too often with 1x1 rects
- don't disable Cursor::isChanged() flags on !isVisible(), that leads to
skipping of _surface creation in some cases
- handle properly any number of parameters between beginGFXTransaction
and endGFXTransaction
- clear the work buffer when exiting a game to avoid showing it when
next game shows an error upon startup
Originally authored by @magicmyth in PR #1039
ScummVM is optimised to render frames when something changes on screen.
As some host environments can perform poorly if the app does not
reliably refresh its output regularly (notably Steam overlay) this new
option ensures that Scummvm outputs a minimal amount of frames even if
nothing is changing in the game renderer.
Currently this is only implemented in the SDL OpenGL renderer.
The new config option is called force-frame-update and it takes a
integer value representing the desired minimum milliseconds Scummvm
should wait before forcing a screen update/refresh. E.g: 50.
Note that the rendering system will not force a re-draw of a frame if
the app has rendered a changed frame within the desired minimum refresh.
Thus if the app is outputting 30fps and force-frame-update is set to
100ms (~10fps) then no duplicate frame will be shown (in theory).
As this is implemented in OpenGLSdlGraphicsManager::updateScreen()
OpenGLGraphicsManager::_forceRedraw has had its access changed to
*protected* so that it can be access by it's descendant. The reason this
has been done in OpenGLSdlGraphicsManager::updateScreen() is so
SDL_GetTicks() can be used to track the elapsed time. If it is useful
for other platforms using OpenGL to have this feature it could be
implemented within OpenGLGraphicsManager::updateScreen() provided a
suitable platform independent replacement for SDL_GetTicks() is used.
This would potentially be better as OpenGLSdlGraphicsManager checks
various other states when deciding if the screen should update.
- Use a SVG asset to allow for better scalability
- Make the controller visible when touching the screen
- Allow for oblique moving by placing finger between two directions
- Add more buttons on the center area of the screen (GUIDE, START, LEFT
STICK, RIGHT STICK) and simplify right area (only four buttons)
- Don't track all fingers, only the ones needed
- Cleanup now unused code
To apply a mask to a RGB (non-paletted) cursor in SurfaceSdl, we use an
intermediary masked_image, where the pixels made transparent by the mask
are replaced by an ARGB color with alpha = 0 (ARGB 0x00000000 in practice).
However the cursor surface still has a key color attached to it by
SDL_SetColorKey (set to 0 currently), which is not sensitive to the alpha
channel, wrongly making opaque black ARGB 0xFF000000 transparent as well.
So we provide an option to disable the key color in such a case.
- fixed aspect ratio correction (overlay destroyed
its state, keyboard shortcut didn't always work),
as well as significantly sped it up on VGA and
SuperVidel
- smoother transitions between video modes
- reduce the number of video mode changes
- fixed a few extreme cases when triple buffering
could lose an update
- lighter ST RAM usage in the lite build
- removed hardware accessing init/deinit routines
Instead of having one globally in AtariGraphicsManager. This simplifies
code and cleans up a lot of dark corners in AtariGraphicsManager.
A slight disadvantage is that now the cursor surface has be to converted
for each buffer.
This unifies the ImGui processing for both 2D and 3D engine.
This also make sure we don't destroy ImGui if init failed (like on older
OpenGL).
The destroy callback is also called whenever we destroy the context.