Commit Graph
165 Commits
Author SHA1 Message Date
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
Bastien Bouclet ce3d5ebec1 GRAPHICS: Fix buffer overflow in drawBevelSquareAlgClip
Port of the fix from 0d8afad55.
2017-11-12 10:38:05 +01:00
Colin Snover 0d8afad559 GRAPHICS: Fix buffer overflow in drawBevelSquareAlg
Thanks to garethbp for discovering the issue and providing a fix.

Fixes Trac#6468.
2017-11-11 20:49:19 -06:00
Torbjörn Andersson 5602ca3d64 JANITORIAL: Silence some more GCC 7 fallthrough warnings
These weren't explicitly flagged as deliberate, but I recognize
Duff's Device when I see it.
2017-08-06 15:26:44 +02:00
Eugene Sandulenko 355c4fa646 JANITORIAL: Remove more trailing spaces 2016-10-09 15:02:02 +02:00
Eugene Sandulenko 6524a8d103 GUI: Added transparency to PicWidgets 2016-08-24 16:07:55 +06:00
Eugene Sandulenko 94bc75ae46 GUI: Implemented centering of dialog background 2016-08-24 16:07:55 +06:00
Eugene Sandulenko 75f9b099dc GUI: Added possibility to specify scale mode for AlphaBitmaps 2016-08-24 16:07:55 +06:00
Eugene Sandulenko 38114eb760 GUI: Plug NinePatch bitmaps into parser 2016-08-24 16:07:55 +06:00
Eugene Sandulenko ec7312ac13 GUI: Implemented more modes to autoscale 2016-08-24 16:07:55 +06:00
Eugene Sandulenko 4474ccf814 GUI: Implemented alphabitmap autoscale 2016-08-24 16:07:55 +06:00
Eugene Sandulenko f0c52096f3 GUI: Implemented possibility to use alphabitmaps in GraphicsWidget 2016-08-24 16:07:55 +06:00
Eugene Sandulenko 53a42ececf GUI: Added new alphabitmap image type 2016-08-24 16:07:55 +06:00
Torbjörn Andersson 11ec5ad5a3 GRAPHICS: Fix copy/paste error in blitAlphaBitmapClip() (CID 1357410) 2016-07-11 05:43:24 +02:00
Torbjörn Andersson 6eabc887e1 GRAPHICS: Fix copy/paste error in blitSurfaceClip (CID 1357411) 2016-07-11 05:41:04 +02:00
Alexander Tkachev 6de5324742 JANITORIAL: Fix a few warnings 2016-07-03 12:24:55 +02:00
Alexander Tkachev cea58cc61c JANITORIAL: Remove trailing spaces 2016-07-03 12:24:53 +02:00
Alexander Tkachev 6fd6043391 GUI: Fix blitAlphaBitmapClip() 2016-07-03 12:24:11 +02:00