Commit graph

182 commits

Author SHA1 Message Date
Le Philousophe
f06f470685 GRAPHICS: Properly take stroke width into account when drawing lines
Old code:
- didn't handle well strokes with an odd width
- didn't handle strokes widths above 1 in generic lines handler
2023-06-03 18:27:17 +02:00
su-xingyu
6ff2212f51 GUI: Fix hard shadow of tabs under HiDPI
Introduce 'shaodwIntensity' to shadow drawing functions
2023-04-15 22:17:27 +02:00
su-xingyu
c577b1d616
GUI: Fix hard shadow under HiDPI rendering (#4908) 2023-04-15 02:04:16 +02:00
Cameron Cawley
fb2503d02e GUI: Only use a transparent colour for BMP images 2023-04-09 12:54:38 +02:00
Le Philousophe
a2d8d9e4ce GRAPHICS: Fix clipping for circle and rounded squares
Rect::contains expect that bottom right is excluded but circle functions
consider the radius as included.

In addition fix an error in Wu's algorithm for rounded squares.
2023-03-19 17:33:01 +01:00
Vladimir Serbinenko
0557535324 GRAPHICS: Support RGB332 in VectorRendererSpec.
This is efficient on RS90
2023-01-12 10:27:20 +03:00
Cameron Cawley
33675c0b2e GRAPHICS: Fix darkened fills on overlays with alpha bits but no blending 2023-01-11 12:55:52 +00:00
Donovan Watteau
27f9a460b5 JANITORIAL: Fix "the the" and similar typos 2022-07-29 19:36:40 +03:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Eugene Sandulenko
9a6d04fa01
Revert "GRAPHICS: fix off-by-one errors when drawing a rounded rectangle"
This reverts commit 2d8e0579ea.

This leads to artifacts in GUI
2021-11-21 20:23:37 +01:00
Benoit Pierre
2d8e0579ea GRAPHICS: fix off-by-one errors when drawing a rounded rectangle
The code would create a rectangle of width+1 by weight+1, resulting
in buffer overflows when drawing at the bottom limit of a surface.
2021-11-21 20:22:06 +01:00
av-dx
4573f049f2 Revert "GUI: Add horizontal triangle drawing algorithm"
This reverts commit 6d2732e598500df36c793896a9a7bc3876fbb4e6.
2021-11-12 14:46:34 +01:00
av-dx
962d481e1b GUI: Add horizontal triangle drawing algorithm 2021-11-12 14:46:34 +01:00
av-dx
e8bee56f9a JANITORIAL: Formatting fixes 2021-11-12 14:46:34 +01:00
av-dx
fadb918bbd GUI: Fix clipping on bitmap images 2021-11-12 14:46:34 +01:00
Orgad Shaneh
cd1200bf7b GRAPHICS: Fix indentation in VectorRendererSpec
Reported by GCC11.
2021-10-21 11:54:19 +02:00
Le Philousophe
585b112d6b GRAPHICS: Implement horizontal triangles
Simplify drawTriangle in the same time and fix a bad copy paste when
drawing outline with w == h
2021-07-27 20:38:45 +02:00
Le Philousophe
087eb6005c GRAPHICS: Fix triangle rendering with some aspect ratios
The test to detect we cross an integer doesn't take into account 0.5
steps
When w = 9 and h = 7, you get dx = 4, dx = 5 and gradient = 0.5
In this case you never get interx + gradient > ipart(interx) + 1 when
interx is an integer.
2021-06-20 12:30:20 +02:00
Le Philousophe
66c78dc25a GRAPHICS: Ensure we still have space to draw the shadow
Else we get ptr_tl and ptr_tr reversed which causes bugs when filling
pixels
2021-06-20 11:48:19 +02:00
Eugene Sandulenko
c27ad28ab2
GRAPHICS: GUI: Take tab shadow size from theme 2021-04-13 08:09:16 +02:00
Eugene Sandulenko
382d4a6cd7
GRAPHICS: GUI: Do not use transparency when restoring background 2021-04-11 23:47:24 +02:00
Eugene Sandulenko
d3f5d34b62 GRAPHICS: Unify VectorRenderer blitting routines 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
dbf192fd13 GRAPHICS: Simplify VectorRenderer blitting routines 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
2839715a45 GUI: Remove TransparentSurface remnants aka alphabitmaps from themes 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
bd083c7fa7 GUI: Switch GUI to ManagedSurface 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
09f11bd37e GRAPHICS: Fix transparency in ManagedSurface bitmaps 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
916859ab86 GRAPHICS: Added (hacky) blitManagedSurface
So far, it is hardcoded, but in reality we need to merge
ManagedSurface and TransparentSurface and add blit() methods
to TransparentSurface
2021-04-11 21:21:44 +02:00
Eugene Sandulenko
f78155b12f GRAPHICS: Fix rounded square rendering 2021-04-11 21:21:44 +02:00
Eugene Sandulenko
7a09662701 GRAPHICS: Fix artifacts in rounded square border drawing in GUI 2021-04-11 21:21:44 +02:00
Thierry Crozat
2d64cba73a GRAPHICS: Remove unused function
This was a left over from GUI conversion to U32String.
2020-11-04 22:25:43 +00:00
aryanrawlani28
521acaf459 GUI: RTL: Fix 1-off issue for drawing u32 strings
When RTL mode is on, previously it was fixed in a commit. This commit just reapplies that, for u32 string drawing.
2020-08-30 14:43:41 +02:00
aryanrawlani28
ad78777bc6 GUI: Handle ellipsis shortening of text when drawing u32 strings 2020-08-30 14:43:41 +02:00
aryanrawlani28
20e21ba79d GUI: U32: Temporarily overload drawString
- To accept u32 string as a parameter
- To draw everything else normally until fully converted to drawing u32
2020-08-30 14:43:41 +02:00
aryanrawlani28
5a093e4e95 GUI: RTL: Improve right align text drawing
- Fix last chars being eaten
- Add support for input in right-align mode editables
- Fix issue with dirtyness of editables after clicking
- Improve spacing for lists and popup
- Make numbers reversed in lists
2020-06-22 00:03:02 +02:00
Cameron Cawley
00e3c03755 ALL: Remove unnecessary graphics/colormasks.h includes 2020-06-15 16:59:34 +01:00
Eugene Sandulenko
c403182353 GRAPHICS: Initialize class variables in VectorRenderer 2020-04-27 13:57:35 +02:00
Bastien Bouclet
2c812a6b7a GUI: Add DropdownButtonWidget and use it in the launcher for mass add
DropdownButtonWidget is a button split in two parts vertically. Clicking
the left part triggers a default action. Clicking the right part shows a
list of other actions the user can choose from.

Using this widget on the launcher lets 'Mass add' be a secondary action
of the 'Add' button, removing the necessity of pressing the shift key to
access the feature.
2019-11-24 14:06:25 +01:00
D G Turner
be56e9afed GRAPHICS: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-11-17 10:11:25 +00:00
Bastien Bouclet
191059b060 GRAPHICS: Fix drawing rounded rectangle borders for the non AA renderer
The check for the clipping rect was in the non-clip version of the method,
and was using values not in screen-space.
2019-10-08 20:54:50 +02:00
Bastien Bouclet
eabb81829f GRAPHICS: Fix modern theme tab widgets being 2px too tall
This was noticeable in the graphics tab of the options dialog when
scrolling down. The widgets would be partially drawn on top of the
tabs.
2019-10-07 22:18:27 +02:00
Bastien Bouclet
1d764bd787 GRAPHICS: Vector renderer clipping rect related cleanups
Selecting whether a clipping variant of a draw call needs to be used is
no longer the responsibility to the caller. The clipping rect is now
part of the state of the renderer.

Also fix some of the draw calls to better apply the clipping rect.
2019-10-07 21:47:42 +02:00
Bastien Bouclet
042e196488 GRAPHICS: Fix VectorRenderer's colorFillClip to apply the clipping rect 2019-09-08 19:55:23 +02:00
Lothar Serra Mari
fe83c985be GUI: Allow GUI background colors other than black in Classic Theme (#1526)
GUI: Allow GUI background colors other than black in Classic Theme
2019-03-10 16:56:17 +02:00
Adrian Frühwirth
3747d852ee JANITORIAL: Fix whitespace 2018-04-15 16:31:31 +02:00
Adrian Frühwirth
d36a9ce672 JANITORIAL: Fix formatting 2018-03-23 20:40:30 +01:00
Bastien Bouclet
b272701834 GRAPHICS: Dont clip in the non-clip version of drawRoundedSquareAlg
Fixes missing modern theme GUI dialog borders when using the
non-antialiased renderer.
2018-03-17 16:11:41 +01:00
Bastien Bouclet
d26aa8255d GRAPHICS: Fix drawing clipped key colored bitmaps
The previous implementation was not clipping the bottom part of the
bitmap.
2018-01-27 18:16:08 +01:00
Bastien Bouclet
482c075747 GRAPHICS: Fix incorrect call to blendFill in drawRoundedSquareShadowClip
Was broken in commit 622adff628.
2017-12-30 19:37:56 +01:00
Bastien Bouclet
622adff628 GRAPHICS: Speed up drawing of rounded square soft shadows
When drawing a rounded rectangle, first its shadow is drawn, and then
the rectangle proper is drawn over it. This optimization skips drawing
a shadow rectangle that is entirely occluded by the main rectangle.

A quick benchmark shows large improvements to the modern theme GUI draw
speed. On a 1 GHz ARMv7 CPU with optimizations enabled, drawing the add
game dialog @ 1920x1080 went from 976 ms to 136 ms.
2017-12-30 19:04:18 +01:00
Colin Snover
a5bc89102e ALL: Remove obsolete register keyword
The register keyword was deprecated from the C++11 standard,
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4193.html#809>,
and removed from the C++17 standard,
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4340>, so
cannot exist in a well-formed C++17 program.

It has never done anything in GCC
<https://gcc.gnu.org/ml/gcc/2010-05/msg00113.html>
and because of the way it is specified in the standard, it is “as
meaningful as whitespace”
<http://www.drdobbs.com/keywords-that-arent-or-comments-by-anoth/184403859>.

The one remaining use of the register keyword is in the DS backend,
where it is used to create a local register variable using the
non-standard GCC Extended Asm feature.

Closes gh-1079.
2017-12-03 20:27:42 -06:00