96 Commits

Author SHA1 Message Date
Johannes Schickel
df65bad9d2 GRAPHICS: Skip empty rects in VectorRendererSpec::drawSquareAlg. 2016-02-21 14:41:29 +01:00
Johannes Schickel
5f61de0e68 GRAPHICS: Skip empty rects in VectorRender*'s drawTabAlg. 2016-02-21 14:41:29 +01:00
Johannes Schickel
610d2eec00 GRAPHICS: Make VectorRendererAA::drawLineAlg never divide by zero.
It won't crash any longer in the case dx = dy = 0.
2016-02-21 14:41:29 +01:00
Johannes Schickel
5bc3a5aa3f GRAPHICS: Let drawLineAlg in VectorRenderer code take unsigned dx, dy. 2016-02-21 14:41:29 +01:00
Johannes Schickel
0e7facad76 GRAPHICS: Skip empty rects in VectorRendererSpec::drawTriangleVertAlg. 2016-02-21 14:41:29 +01:00
Johannes Schickel
16aac72b60 GRAPHICS: Add comments about safe divisions in VectorRendererSpec.cpp. 2016-02-21 14:41:29 +01:00
Filippos Karapetis
614de0d761 GRAPHICS: Remove trailing whitespace 2014-10-28 15:38:50 +02:00
Johannes Schickel
63ccd85baa GRAPHICS: colour -> color in VectorRendererSpec code. 2014-05-27 02:04:08 +02:00
Marcus Comstedt
4b81b1299d GRAPHICS: Fix dest alpha formula in blendPixelPtr
The original alpha computation formula had a problem:  If something was
drawn on top of a pixel that was already fully opaque, there would be
an overflow in the computed alpha, and the destination alpha would be
truncated to 0 (fully transparent).

In commit 264ba4a9 this formula was replaced with another one, which
did not have overflows but also was not correct.

This commits introduces a new formula, where the rounding errors have
been turned in another direction; drawing a fully opaque pixel on top
of a transparent one would result in a pixel which is almost, but not
fully, opaque.  However, this is no problem in practice, since drawing
fully opaque pixels can be achieved with much less code as a special
case, so add that (also improves rendering speed).
2014-01-10 20:04:10 +01:00
Marcus Comstedt
51d7405a7b GRAPHICS: Fix computation of addA in darkenFill()
The old computation had rounding issues, causing alpha to leak into
the red (usually) component.  There's a much easier way to compute it
that does not lead to such problems:  What should really happen is that
the two top bits of the A component should be set to 1 (thus adding
75% alpha).  So compute it that way for speed and precision.
2014-01-10 15:56:53 +01:00
D G Turner
094c378217 GRAPHICS: Minor readability fixes to drawBevelSquareAlg method.
No functional change.
2013-12-13 23:41:24 +00:00
Eugene Sandulenko
8a340007ea Merge pull request #361 from rundfunk47/guiimprovements
GUI: Various GUI Improvements
2013-08-22 05:31:23 -07:00
Johannes Schickel
a2fabef87c GRAPHICS: Increase robustness of VectorRendererSpec::drawString. 2013-08-22 11:46:50 +02:00
Johannes Schickel
af13b74d02 GRAPHICS: Unify drawing paths in VectorRendererSpec::drawString.
Formerly, the behavior between when a drawable area was specified and when not
was different in a sense which is not expected. For example, when an empty
textDrawableArea was passed and the text could be drawn outside the 'area'
specified. While when a textDrawableArea covering the whole screen was passed
the text was clipped inside 'area'. Now, the code does follow the latter logic
in both cases.

I am not sure whether this will cause any issues, but a quick check of the
launcher and options menu didn't reveal anything...
2013-08-22 11:46:49 +02:00
Johannes Schickel
81ae06cae3 GRAPHICS: Simplify VectorRendererSpec::drawString.
This removes the two additional copy steps for rendering when a drawable text
area is specified. Instead it uses Surface::getSubArea to draw directly onto
_activeSurface.
2013-08-22 11:46:48 +02:00
Torbjörn Andersson
8c2bbb09a8 GRAPHICS: Add missing "break"s in switch, CID 1063214
This won't actually make any difference, since the fall through
would do nothing and then reach the break in the default case. But
I think it's less error-prone this way if the code is ever modified.
2013-08-19 19:34:41 +02:00
Narek Mailian
6fa3c7751f GRAPHICS: Gradient blending on borders of rounded squares 2013-08-16 20:54:10 +02:00
Narek Mailian
52ee92625f GRAPHICS: Change soft-shadow calculation to not use doubles 2013-08-16 20:54:09 +02:00
Narek Mailian
b91e10f931 GRAPHICS: Shadows on tabs 2013-08-16 20:54:09 +02:00
Narek Mailian
5c00dbbd2a GRAPHICS: Add support for Soft Shadows with rounded squares 2013-08-16 20:54:08 +02:00
Narek Mailian
887a99e211 GRAPHICS: Added changes and improved code from inisider/scummvm (partial text)
Includes code from https://github.com/inisider/scummvm/ , which has been
squashed and bugfixed
2013-08-16 20:54:08 +02:00
Johannes Schickel
a2a5d42a58 GRAPHICS: Fix warnings about mismatching format arguments. 2013-08-12 16:43:35 +02:00
Narek Mailian
1f1d35bd3d GRAPHICS: Allow VectorRenderer and ThemeEngine to init with 4BPP 2013-08-08 08:35:08 +02:00
Narek Mailian
f545a2f08f GUI: Change name of GUI-renderers to remove "16-bit" 2013-08-08 08:35:08 +02:00
Narek Mailian
1d40dca7a0 GRAPHICS: Add error-checking in blendPixelPtr for invalid BPPs 2013-08-08 08:27:11 +02:00
Johannes Schickel
0f59009e6e GRAPHICS: Fix VectorRendererSpec for RGBA8888.
Formerly values in the gradient and blending code overflowed and thus caused
incorrect colors. Now there's some special case for 32bpp modes, which needs
slightly more operations but assures a correct output.
2013-08-08 08:27:11 +02:00
Johannes Schickel
5111746911 GRAPHICS: Take advantage of Surface::getPixels. 2013-08-03 04:02:49 +02:00
Johannes Schickel
89abab97e3 JANITORIAL: Remove trailing whitespaces.
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-09-26 04:17:55 +02:00
Johannes Schickel
aec9b9e22a ALL: Let overlay related methods in OSystem take a void * and use a proper pitch values.
This is a first step to get rid of OverlayColor, which is a requirement for
proper 4Bpp overlay support.
2012-06-16 04:17:14 +02:00
Willem Jan Palenstijn
d0c655f1fa GUI: Fix mingw-w64 build errors 2012-02-20 22:38:35 +01:00
Willem Jan Palenstijn
66d3def0e5 GUI: Implement AAed tabs
The stroke effect isn't properly implemented yet since it isn't used
in the modern theme.

There are slight bleeding colours around the corners of the
tab_background when its corners overlap with the corners of the
underlying dialog. These are hard to avoid because the underlying dialog
destroys the background that we should be blending these corners with.
2012-02-20 22:17:33 +01:00
Willem Jan Palenstijn
19cb2dc7e7 GUI: Add AA dialog corners on alpha overlays 2012-02-20 22:17:33 +01:00
Willem Jan Palenstijn
c6ac4cc7ea GUI: Minor cleanup 2012-02-20 22:17:33 +01:00
Willem Jan Palenstijn
905f9591ab GUI: Speed up alpha blending with black for classic dialog backgrounds 2012-02-20 22:17:33 +01:00
Willem Jan Palenstijn
264ba4a9ec GUI: Keep dst alpha unchanged when blending colours 2012-02-20 22:17:33 +01:00
Willem Jan Palenstijn
2957321903 GUI: Rewrite AA rounded square renderer
This fixes bleeding of colours between different regions.
It also turns 'bevel' into an option that turns the stroke into a bevel,
and implements antialiased gradient-fills.
2012-02-20 22:17:28 +01:00
D G Turner
6a2522a142 GRAPHICS: Crash fix for bug #3466536 ("Assertion on MIDI gain slider").
This fixes the crash, but the Midi Gain slider (and probably any other
slider bar in modern theme) still distorts the left corner shape when
the slider thumb is at very small values...
2011-12-29 06:32:09 +00:00
Eugene Sandulenko
71d6771be5 GUI: Implement dithering for tabs and round squares 2011-12-14 00:56:15 +00:00
Alyssa Milburn
50c9aa1bc1 GRAPHICS: Fix compiler warnings. 2011-12-10 14:16:35 +01:00
Eugene Sandulenko
9d3eb2ebd7 GUI: Refactor gradient calculation into separate method 2011-12-10 11:51:10 +00:00
Eugene Sandulenko
1dbc41d411 GUI: Move _gradientBytes to VectorRendererSpec 2011-12-10 11:51:10 +00:00
Eugene Sandulenko
04d1c1d54b GUI: Implemented color dithering for background 2011-12-10 11:51:10 +00:00
MaximRussia
ad4471f70c GUI: Improved pop up and scrollbar arrows look
Previous triangle drawing was all wrong, rewrote it from the scratch.
Added padding to drawsteps in stx files
2011-12-07 14:04:10 +00:00
Johannes Schickel
61795739f8 COMMON: Rename Common::set_to to Common::fill.
This makes the name match with the name of the STL function with the same
behavior.
2011-11-16 18:06:30 +01:00
Willem Jan Palenstijn
052177d136 COMMON: Remove some double-underscore defines (reserved) 2011-11-14 14:59:58 +01:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Johannes Schickel
71bdb86e02 Merge pull request #16 "Add a PixelFormat to Graphics::Surface.".
For further discussion check here:
https://github.com/scummvm/scummvm/pull/16

Conflicts:
	graphics/png.cpp
2011-05-01 16:54:45 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Johannes Schickel
3fd919060c GRPAHICS: Do not access Surface::bytesPerPixel anymore. 2011-04-17 20:58:08 +02:00
Torbjörn Andersson
54b2a8c98d JANITORIAL: Cleanup (mostly whitespace)
svn-id: r53161
2010-10-12 04:19:58 +00:00