361 Commits

Author SHA1 Message Date
Miro Kropacek bac2fd6348 GUI: Implement clipping for drawDDText 2026-04-26 21:06:07 +10:00
Le Philousophe 2c2f3bd175 GUI: Allow GUI manager to fetch the dirty rect of a Dialog
Co-authored-by: Miro Kropacek <miro.kropacek@gmail.com>
2026-04-26 21:06:07 +10:00
Le Philousophe 854826756c GUI: Improve tooltip redrawing performance
When displaying or hiding a tooltip, just render them on the screen
buffer and redraw the underneath foreground dialog.
For this, the tooltip is detached from the usual dialog stack and is
treated as a special case.
2026-04-26 21:06:07 +10:00
Cameron Cawley 8a01c2a0b0 GUI: Use Common::SharedPtr for reusing surfaces 2026-04-14 18:46:14 +03:00
Marwane ElBaraka d97dc54e8a GUI: Update cursor fallback logic in setActiveCursor function
When a theme doesn't define an index cursor fall back to the normal cursor.
In the case of the classic theme that has a hardcoded cursor, setActiveCursor fails silently.
2026-04-03 15:52:43 +02:00
Marwane ElBaraka 6dc02783fe GUI: Refactor cursor data storage to support multiple cursors
Introduce CursorData struct and array to store multiple cursor definitions. This prepares the ThemeEngine for supporting different cursor types (e.g., normal, cursor-index).
2026-04-03 15:52:43 +02:00
Eugene Sandulenko 9477aa2909 GUI: Fix path parsing in unpacked themes 2026-03-18 17:02:16 +01:00
Mohamed Shaaban 1c48e73347 GUI: Parse unpacked themes 2026-03-18 16:51:15 +01:00
Mohit Bankar 7351104a24 GUI: Use theme background in RichTextWidget
Replace hardcoded background color with value
extracted from the active theme.

Add ThemeEngine::getDrawDataColor() and use it
in createWidget() and drawWidget(), with
fallback to opaque white.
2026-03-05 00:43:03 +01:00
Filippos Karapetis e157b7044e GUI: Use C++ 11 range-based for loops 2025-03-27 13:47:57 +08:00
Cameron Cawley 7e0dfe0081 GRAPHICS: Use custom stream callbacks for loading TTF fonts 2024-07-23 15:33:43 +01:00
Cameron Cawley ff530edcb1 GRAPHICS: Deprecate ManagedSurface methods that implicitly copy pixel data 2024-07-02 13:31:18 +01:00
Cameron Cawley 96f9569790 GUI: Make use of simple blitting routines where possible 2024-06-19 02:36:17 +02:00
Eugene Sandulenko 5ed3dd8d81 GUI: Print out more diagnostics when theme file is bad 2024-06-08 22:13:26 +02:00
Eugene Sandulenko 8c33d23e9c GUI: Make sure we reload bitmaps on changed scale
Fixes GMM in TWP and other OpenGL-based engines
2024-04-23 12:36:38 +02:00
Darkhood148 cc214d0f4d GUI: Implement auto scrolling when drag-selecting text 2024-02-11 16:35:52 +01:00
Darkhood148 2f552e423c GUI: Add feature to copy text from console 2024-02-11 16:35:52 +01:00
Cameron Cawley f3fbd2477c GRAPHICS: Allow specifying separate xdpi and ydpi values in loadTTFFont 2024-01-08 23:41:50 +01:00
Le Philousophe ed9ded9e83 GUI: Migrate GUI to Path class 2023-12-24 13:19:25 +01:00
Le Philousophe bfc61439fb COMMON: Make themepath a Path object 2023-12-24 13:19:25 +01:00
Cameron Cawley bcc9259382 BACKENDS: Report if the backend supports cursors with alpha channels 2023-10-29 02:02:11 +02:00
Eugene Sandulenko 1ff6a5538b GUI: Fix out of bounds access. CID 1519091 2023-09-19 15:46:56 +02:00
Eugene Sandulenko e555528a42 GUI: Expose theme text colors int ThemeEngine 2023-09-17 00:56:28 +02:00
Eugene Sandulenko 5653eccba4 GUI: Propagate tab vertical flip to the VectorRenderer 2023-09-17 00:56:28 +02:00
Eugene Sandulenko 6d6a7a9b3a GUI: First step to draw tabs on bottom 2023-09-17 00:56:28 +02:00
Eugene Sandulenko 308e2fd340 GUI: Added possibility to disable BDF font scaling
Specify "gui_disable_fixed_font_scaling". The checkbox in the GUI will follow
2023-07-19 15:17:28 +02:00
Eugene Sandulenko 45eb45686a GUI: Re-enabled BDF font scaling since now the rendering was fixed by elasota 2023-07-08 21:10:19 +02:00
Eugene Sandulenko 0ccbcddb57 GUI: Disable BDF font scaling until it is fixed 2023-07-05 14:00:49 +02:00
Eugene Sandulenko a18864c646 GUI: Enable scaled BDF fonts 2023-06-26 15:05:51 +02:00
Eugene Sandulenko 96b0274fcc GUI: Scale fonts for classic theme 2023-06-23 12:08:56 +02:00
Miro Kropacek 09a5e47636 GUI: Add debug outputs for easier profiling 2023-06-10 23:27:57 +02:00
Miro Kropacek 650ccb6ded GUI: Don't assume ManagedSurface's pitch
This caused corruption with small scale's cursor (18px) if
ManagedSurface's inner surface used a different pitch than w *
format.bytesPerPixel.
2023-06-10 23:27:57 +02:00
Miro Kropacek 6fff1690a5 GUI: Don't redraw whole dialog in Widget::setEnabled()
Until now, every (even the tiniest) widget's change of the enabled state
resulted in a redraw of a complete *dialog*. Why this was needed and how
it has been fixed requires a bit of explanation.

There are two buffers to render the widgets in: Backbuffer and Screen
(selected by ThemeEngine::drawToBackbuffer() and
ThemeEngine::drawToScreen() respectively, setting
VectorRenderer::_activeSurface). Then there are two layers/flags:
kDrawLayerBackground and kDrawLayerForeground
(selected in Dialog::drawDialog(), setting ThemeEngine::_layerToDraw).

When asked for a complete dialog rebuild in GuiManager::redraw()
(kRedrawCloseDialog, kRedrawFull) the widgets of every dialog,
regardless of their layer, are drawn into Backbuffer and then copied
into Screen.

When asked for a partial dialog rebuild (kRedrawOpenDialog,
kRedrawTopDialog) the widgets of the topmost dialog marked with
kDrawLayerBackground are drawn into Backbuffer, then copied into Screen
and finally the widgets marked with kDrawLayerForeground are drawn into
Screen *only*.

When redraw() is called just within the GuiManager's event loop the
widgets of the topmost dialog are drawn into Screen *only*. And this is
where the layers become important.

When rebuilding the dialog, it doesn't really matter which layer has
been defined for a widget: Backbuffer contains the ones with
kDrawLayerBackground and Screen will supply the rest with
kDrawLayerForeground, if needed. But which layer is taken into account
when calling Dialog::drawWidgets() ?

It is important to realize that the content of Backbuffer is
defined by the widget's initial state (idle or disabled): so Backbuffer
will contain either "idle color" or "disabled color" after dialog's
creation.

ThemeEngine::drawDD() does two checks:

1. if widget has kDrawLayerBackground set *and* _activeSurface is
  Screen, copy the widget from Backbuffer to Screen

2. if widget's layer is the same as _layerToDraw, draw the widget into
  _activeSurface

This is what happens in redraw(kRedrawDisabled) for kDrawLayerBackground
widgets:

- Backbuffer contains an idle/disabled (depending on its initial state)
  rendition of the widget
- widget is copied from Backbuffer to Screen (1st check in drawDD())
- widget is not drawn into Screen as _layerToDraw is
  kDrawLayerForeground (2nd check in drawDD())

Summary: when switching between idle/disabled state, widget's color is
not updated.

This is what happens in redraw(kRedrawDisabled) for kDrawLayerForeground
widgets:

- Backbuffer contains an idle/disabled (depending on its initial state)
  rendition of the widget
- widget is not copied from Backbuffer to Screen as widget has
  kDrawLayerForeground set (1st check in drawDD())
- widget is drawn into Screen as _layerToDraw is still
  kDrawLayerForeground from the last redraw() (2nd check in drawDD())

Summary: when switching between idle/disabled state, widget's color is
correctly updated and not restored from Backbuffer.

Initially, I set up "button idle" to be rendered in the foreground
layer, same as "button disabled". However @lephilousophe suggested a
great improvement: render "button idle" still in the background but make
"button disabled" its child (in the foreground). Worked like a charm as
it just mimics the hovering behaviour.

And this is why hovering doesn't require scheduleTopDialogRedraw():

- Backbuffer contains an idle [kDrawLayerBackground] rendition of the
  widget
- when highlighted [kDrawLayerForeground], widget is not copied from
  Backbuffer to Screen
- widget is drawn into Screen

Unhovering:

- Backbuffer contains an idle [kDrawLayerBackground] rendition of the
  widget
- when idle [kDrawLayerBackground], widget is copied from Backbuffer to
  Screen
- widget is not drawn into Screen
2023-05-10 22:52:48 +02:00
Cameron Cawley fb2503d02e GUI: Only use a transparent colour for BMP images 2023-04-09 12:54:38 +02:00
Miro Kropacek e00c5581ff GUI: Cache bitmaps again
This reverts commit 04f040af which forced a bitmap reloading to prevent
reusing already up/downscaled images in case that _scaleFactor has
changed.

However after commit ad31dfc this no longer applies as changing the
scale factor in GUI forces a ThemeEngine destroy and recreate. So
_bitmaps[filename] is safe to keep its cached image which is reused e.g.
during initial theme loading.
2023-03-16 19:20:50 +01:00
Miro Kropacek faeb24f037 GRAPHICS: SVGBitmap now inherits from ManagedSurface
Since the only use case for SVGBitmap is blitting it to a
ManagedSurface, combine both into one to avoid unnecessary allocation
and blitting.
2023-03-16 19:20:50 +01:00
Vladimir Serbinenko ef3eda01e0 GUI: Fix black rectangle around cursor in modern remastered them without RGB
Modern remastered uses cursor with alpha. It's not correctly converted and
so we get black rectangle around it when using --disable-16bit
2023-02-02 19:36:12 +03:00
Vladimir Serbinenko 0fe52aed23 GUI: Support RGB332 for Theme Engine 2023-01-12 10:27:20 +03:00
Cameron Cawley 7f2d9fd0fd GRAPHICS: Split conversion.cpp into multiple files 2022-12-22 23:45:14 +01:00
Eugene Sandulenko fb7095f5a4 COMMON: Move all compression-related files to a separate directory 2022-12-01 11:53:02 +01:00
BLooperZ b67b88e6d9 GUI: Support unicode and BiDi in editable widget 2022-08-02 22:04:54 +02:00
grisenti 7b53202a9e ALL: add support for --config and refactor code 2022-05-29 13:56:21 +02:00
grisenti 819f52a14d ALL: add support for --fullscreen command 2022-05-29 13:56:21 +02:00
grisenti c0acb85605 ALL: add support for --savepath command 2022-05-29 13:56:21 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Torbjörn Andersson 8fe33fdb55 GUI: Fix memory leak 2021-11-15 09:32:36 +01:00
Eugene Sandulenko a10e36315c GUI: Improve Group Selection and bump theme version
- Replace inscription with an icon to save space
- Reduced size of the search box
- Disbled grid for low-res layouts
- Fixed classic theme
- Regenerated built-in theme
2021-11-12 23:02:41 +01:00
Eugene Sandulenko 3011084703 GUI: Improve debug output 2021-11-12 14:46:34 +01:00
av-dx 08b442aa76 GUI: Get rid of placeholder for fold indicator 2021-11-12 14:46:34 +01:00
av-dx 777ae61dfa GUI: Restore placeholder symbols for fold indicator
This will be replaced with triangle drawing when #3178 is merged.
2021-11-12 14:46:34 +01:00