Commit Graph
1336 Commits
Author SHA1 Message Date
Le Philousophe e3a13c7d63 ANDROID: Move mouse cursor while displaying keyboard
This is only for 2D for now.
2024-11-02 21:42:43 +01:00
Eugene Sandulenko 60d2b72fb1 BACKENDS: OPENGLSDL: Fix potential division by zero. CID 1452787 2024-10-25 15:59:57 +02:00
Eugene Sandulenko ca4b64beeb BACKENDS: SURFACESDL: Fix image generation for ImGui. Courtesy of lephilosouphe 2024-09-29 17:26:34 +02:00
Le Philousophe 7a69ccc4b8 JANITORIAL: Cleanup whitespaces problems 2024-09-29 17:08:13 +02:00
Le Philousophe 2813582f6b BACKENDS: SDL: Remove superfluous version checks
The code is already guarded by outer checks.
2024-09-29 17:04:03 +02:00
Le Philousophe f04f248f20 BACKENDS: SDL: Implement ImGui API to load images 2024-09-29 17:04:03 +02:00
Le Philousophe 27c7a64683 COMMON: Add ImGui API to create images 2024-09-29 17:04:03 +02:00
Le Philousophe 2eebb5db02 BACKENDS: SDL: Add SDL2 Renderer support for ImGui
Some adaptations will be needed for the the engines.
2024-09-29 17:04:03 +02:00
Vladimir Serbinenko 488353480f SDL, COMMON: Support screen rotation 2024-09-29 02:10:39 +03:00
Sebastien Ronsse a9a3f0860f BACKENDS: Add ImGui support to SurfaceSdlGraphicsManager 2024-09-26 07:06:50 +02:00
Hubert Maier 4533e12280 JANITORIAL: BACKENDS: Fix typos 2024-09-16 02:13:34 +03:00
Le Philousophe c8c3a316d6 ANDROID: Properly apply touch settings when starting a game
The 2D graphics backend is recycled from the GUI when starting a game.
As a consequence, touch settings were never applied.
2024-09-14 16:51:19 +02:00
Filippos Karapetis 928f5bbcff BACKENDS: Minimal render rate support (force-frame-update)
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.
2024-09-03 10:58:56 +02:00
Le Philousophe a98df4e445 ANDROID: Rework the virtual gamepad controller
- 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
2024-08-31 16:45:32 +02:00
Le Philousophe caf7901cb4 BACKENDS: OPENGL: Update blending color when it's dirty
This makes sure the color is updated before drawing the texture and
avoids extraneous calls when the color was already set.
2024-08-31 16:41:40 +02:00
Donovan Watteau 11b25f3fcf SURFACESDL: Fix -Wcalloc-transposed-args warning from GCC 14.1.0 2024-08-11 18:39:11 +02:00
Simon Delamarre 3454d4988c GRAPHICS: Disable colorKey when applying a mask to a RGB cursor in SurfaceSdl
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.
2024-07-17 10:57:41 +03:00
Thorsten Otto 30670e0a46 BACKENDS: ATARI: Add support for -mfastcall 2024-07-15 19:42:51 +02:00
Miro Kropacek dd49c9e3ce BACKENDS: ATARI: QoL improvements
- 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
2024-07-15 19:42:51 +02:00
Miro Kropacek 0c77d67845 BACKENDS: ATARI: Make Cursor Screen's property
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.
2024-07-15 19:42:51 +02:00
Miro Kropacek c7bc03d4f4 BACKENDS: ATARI: Move Screen outside AtariGraphicsManager 2024-07-15 19:42:51 +02:00
Miro Kropacek 957aa15e7e BACKENDS: ATARI: Move Cursor outside AtariGraphicsManager 2024-07-15 19:42:51 +02:00
Miro Kropacek e9c7c8e03c JANITORIAL: atari_c2p-asm -> atari-c2p-asm 2024-07-15 19:42:50 +02:00
Cameron Cawley 9970ea6917 BACKENDS: OPENGL: Support aspect ratio correction for Hercules games 2024-07-01 18:40:33 +03:00
Le Philousophe 17a1b37dda BACKENDS: SDL: Refactor ImGui processing
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.
2024-06-30 15:57:03 +02:00
Le Philousophe 81196ec6c6 OPENGL: Don't use glBlendColor when it's not available
Bare Windows XP only has OpenGL 1.1 implementation where the function
is not here.
Fallback on no blending at all: this is like it was before.
2024-06-30 15:57:03 +02:00
Le Philousophe 85509bd428 ANDROID: Use float constants
This avoids promotion to double
2024-06-22 11:52:21 +02:00
Cameron Cawley 1357bfe672 COMMON: Avoid including engine headers in common code for DebugChannelDef 2024-06-20 20:15:57 +01:00
scemino 4a1209da9f IMGUI: Use docking branch
This is is imgui commit fee0210592b9cb5b1a778f005ffb1fe76b19ced0
2024-05-24 16:35:55 +02:00
Hubert Maier f06976637a JANITORIAL: Fix receive typo in surfacesdl-graphics.cpp 2024-05-18 13:52:31 +02:00
Hubert Maier 09879b225b JANITORIAL: Fix choosen typo in openglsdl-graphics.cpp 2024-05-18 13:52:31 +02:00
Eugene Sandulenko 34be774f4b BACKENDS: IMGUI: Bump ImGui to v1.90.6 2024-05-17 22:19:46 +02:00
Eugene Sandulenko 4cd62e3398 BACKENDS: IMGUI: Renamed modified files to minimize diff with upstream 2024-05-17 01:46:45 +02:00
Eugene Sandulenko c59ac26f97 BACKENDS: Remove obsolete gph/caanoo/gp2x/gp2xwiz port 2024-05-10 13:38:20 +02:00
scemino 936109fe4f BACKENDS: Update ImGui callbacks in OSystem and fix engines 2024-05-03 20:25:01 +02:00
scemino 8e07681356 BACKENDS: Update setImGuiRenderCallback in OSystem 2024-05-03 20:04:30 +02:00
Eugene Sandulenko 9bfba6bacc JANITORIAL: Fix code formatting 2024-04-28 22:04:23 +02:00
Le Philousophe a04fe8ef2f OPENGL: Don't always force redraw when ImGui is enabled
Only do it when ImGui is enabled by the engine and move the check in SDL
backend where ImGui is supported.
This makes the OpenGL backend independent of ImGui.
2024-04-28 21:48:10 +02:00
Le Philousophe e6a7d6bc9b OPENGLSDL: Don't compile code when not on SDL 2.0 2024-04-28 21:48:10 +02:00
Le Philousophe 3822d9d644 BACKENDS: Move setImGuiRenderCallback in OSystem and hide implementation
This avoids dynamic casts and having a variable defined in
backends not supporting ImGui
2024-04-28 21:48:10 +02:00
scemino b721f95ffe BACKENDS: Add imgui in OpenGL backend 2024-04-28 13:59:31 +02:00
Eugene Sandulenko 9965ee0c3e SURFACESDL: Fix crash on specifying gfx mode via command line
`./scummvm -g surfacesdl` was crashing since there is no previous
scaler
2024-04-10 00:14:11 +02:00
Matthew Jimenez 5219c99400 GRAPHICS: Move PaletteManager definition to a separate header 2024-03-12 12:24:00 +02:00
scemino 8807ab74db BACKENDS: New imgui proposition 2024-03-07 20:08:26 +01:00
Christian Kündig 7bdadaefae EMSCRIPTEN: GRAPHICS: Fix screenshots 2024-02-27 17:07:13 +01:00
Le Philousophe 6342045cc3 BACKENDS: OPENGL: Don't take the alpha channel from the game texture
It's not always set correctly by engines (AGS) and a fill call to clear
the screen will set it to 0 along with the other components.
Setting the framebuffer to some transparent value is not something we
intend to do as this let the content underneath the drawing texture
visible like it's the case on ChromeOS.
This has been reported here: https://forums.scummvm.org/viewtopic.php?p=99293
2024-02-24 16:43:14 +01:00
Miro Kropacek f41a678ba1 GRAPHICS: ATARI: Utilize dlmalloc
- every malloc is now aligned on 16 bytes

- no need for the hidden pointers

- ct60_vmalloc() is called only once, the rest is handled
  by dlmalloc (SV XBIOS' vmalloc is pretty fragile)
2024-02-24 03:54:54 +01:00
Torbjörn Andersson 57893f8d3a SURFACESDL: Refresh cursor scaler along whith standard scaler (bug #14872)
Otherwise, the cursor scaler and standard scaler may be different types,
which can lead to scaling the cursor with a scaler that normally doesn't
allow it. In this particular bug report, it caused ScummVM to crash.
2024-02-11 16:34:39 +01:00
Miro Kropacek 276103b0aa BACKENDS: ATARI: Fix a crash
_offsettedSurf must have the original screen dimensions, similar as done in
AtariGraphicsManager::Screen::reset().

Strangely, this bug was reproducible only in MagiC and not in FreeMiNT+MP.
2024-01-28 21:59:13 +01:00
Torbjörn Andersson 13996ea3d1 SURFACESDL: Remove redundant _mouseOrigSurface check
It's already checked a few lines above.
2024-01-28 14:07:33 +01:00