Commit Graph
1751 Commits
Author SHA1 Message Date
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 b9430d7c72 GRAPHICS: Silence some false positive MSVC warnings 2016-02-19 02:38:30 +02:00
Eugene Sandulenko 6c895643aa Merge pull request #667 from a-detiste/master
JANITORIAL: Typos detected with lintian & grep
2016-02-15 18:31:50 +01:00
Alexandre Detiste 6c298e964f JANITORIAL: Typos detected with lintian & grep 2016-02-15 18:27:02 +01:00
Martin Kiewitz 956aacf83b GRAPHICS: Fully fix compilation under MSVC 2016-02-14 23:41:58 +01:00
Eugene Sandulenko a7c7a6d5b7 GRAPHICS: Fix compilation under MSVC 2016-02-14 23:10:39 +01:00
Eugene Sandulenko 11e03fbce2 Merge pull request #658 from sev-/wage
WAGE: New Engine
2016-02-14 17:20:25 +01:00
Eugene Sandulenko d2303ac6dd GRAPHICS: Fix regression in polygon drawing 2016-02-14 17:13:24 +01:00
Eugene Sandulenko bbcd455004 GRAPHICS: Use our own sort instead of bubble 2016-02-14 17:13:22 +01:00
Eugene Sandulenko 5e002c4fe2 GRAPHICS: Move generic primitives from WAGE engine 2016-02-14 17:13:03 +01:00
Filippos Karapetis 5151ec0fe0 GRAPHICS: Silence an MSVC warning 2016-01-08 02:01:27 +02:00
Bastien Bouclet 2d86f6da9c GRAPHICS: Introduce a size mode for TrueType fonts
Allows to match Windows font size selection by converting font heights
to point sizes using the TrueType tables.
2015-12-21 18:41:14 +01:00
Johannes Schickel 69220505b6 GRAPHICS: Add function to query TransparentSurface's builtin PixelFormat. 2015-12-14 05:16:12 +01:00
Johannes Schickel f7683083e2 GRAPHICS: Use tabs for indentation. 2015-12-14 02:26:11 +01:00
Johannes Schickel f2926412fe GRAPHICS: Fix fast ALPHA_BINARY blitting with TransparentSurface.
This is a regression from 5d0f38d747 and caused
color glitches in Wintermute.
2015-12-14 02:15:28 +01:00
Eugene Sandulenko 5d0f38d747 GRAPHICS: Fix rendering in some corner cases 2015-11-17 23:17:48 +01:00
Johannes Schickel ac93f3512f GRAPHICS: Remove unused header include. 2015-11-16 17:01:59 +01:00
Johannes Schickel aaca04cdfc GRAPHICS: Rewrite PixelFormat::toString to be easier to understand. 2015-11-16 16:58:23 +01:00
Johannes Schickel 1c7a5e5a01 GRAPHICS: Fix component order in PixelFormat::toString output.
Formerly components were printed from bottom to top, common notation is from
top to bottom. For reference check how we name formats, like in for example:
backends/graphics/openglsdl/openglsdl-graphics.cpp:190-230
backends/graphics/surfacesdl/surfacesdl-graphics.cpp:409-490
sherlock/scalpel/scalpel.cpp:207
2015-11-16 16:28:01 +01:00
Johannes Schickel eee8ef9dce GRAPHICS: Make PixelFormat::toString const. 2015-11-16 16:03:44 +01:00
Eugene Sandulenko cfc626d78d GRAPHICS: Implemented utility function to print PixelFormat 2015-11-16 07:00:09 +01:00
Matthew Hoops 75acef7566 GRAPHICS: Force a cast to int to avoid gcc warnings 2015-04-11 16:12:47 -04:00
Torbjörn Andersson 6f7b0311af GRAPHICS: Fix GCC signed/unsigned warnings. 2015-03-02 08:38:33 +01:00
Filippos Karapetis 614de0d761 GRAPHICS: Remove trailing whitespace 2014-10-28 15:38:50 +02:00
Fedor 75305f136f GRAPHICS: Remove some trailing whitespace in surface.h 2014-10-28 15:03:44 +02:00
Filippos Karapetis d3475fe3b6 GRAPHICS: Silence an MSVC warning 2014-10-19 17:03:14 +03:00
Johannes Schickel 2a75e9f1ad Merge pull request #500 from lordhoto/ttf-improvements
Improve TTF Rendering (includes Font API changes).
2014-09-07 21:23:24 +02:00
Johannes Schickel 248ea3c1ab GRAPHICS: Allow negative xOffset in TTF.
This should improve the visual looks of many fonts. However, it might result
in the first line of the glyph to be drawn left of the position specified in
drawChar.
2014-09-03 22:55:48 +02:00
Johannes Schickel d55cd8f3b4 GRAPHICS: Allow to query the bounding box of chars/strings drawn with Font API. 2014-09-03 22:55:48 +02:00
Einar Johan Trøan Sømåen 0593c2eab2 GRAPHICS: Fix some Doxygen comments that seem wrong. 2014-08-29 03:26:48 +02:00
Matthew Hoops 6642f6df9e GRAPHICS: Improve color bit depth conversion
Data is no longer truncated it so should be more accurate. See pull request #486 for more info.
2014-08-17 17:49:37 -04:00
Eugene Sandulenko 89d789b122 GRAPHICS: Added BE/LE to TS_ macros 2014-06-23 15:39:31 +03:00
Eugene Sandulenko 5847240234 GRAPHICS: Rename BS_ to TS_ (for TransparentSurface) 2014-06-17 14:54:53 +03:00
Eugene Sandulenko 039249d39b GRAPHICS: Fix compilation for Amiga 2014-06-15 21:50:10 +03:00
Eugene Sandulenko 1ebb8aa6de Merge pull request #466 from sev-/transparent-surface
COMMON: Move TransparentSurface to common code
2014-06-15 21:15:31 +03:00
Eugene Sandulenko 7322d905b3 COMMON: Copy TransparentSurface from Wintermute engine to common code 2014-06-15 15:43:06 +03:00
Johannes Schickel 5b03ba04d7 GRAPHICS: Allow client code to specify TTF render mode.
This allows clients to use the default FreeType2 render mode instead of light.
We really only use light as default because that's what looks best with the
font we use in our GUI right now (which is the same reason why formerly light
was always used in non-monochrome mode).
2014-06-09 01:04:47 +02:00
Johannes Schickel 63ccd85baa GRAPHICS: colour -> color in VectorRendererSpec code. 2014-05-27 02:04:08 +02:00
Johannes Schickel e499a25a00 GRAPHICS: Manually specify function alignment in ARM assembly. 2014-03-06 20:21:48 +01:00
Matthew Hoops 740b6e8fbd IMAGE: Move all ImageDecoders to image/ 2014-02-28 00:27:28 -05:00
Johannes Schickel 53332e8066 GRAPHICS: Make GPL headers consistent in themselves. 2014-02-18 02:39:34 +01:00
D G Turner ac4087856f ALL: Remove optimization unstable code on checking for null after new.
These issues were identified by the STACK tool.

By default, the C++ new operator will throw an exception on allocation
failure, rather than returning a null pointer.

The result is that testing the returned pointer for null is redundant
and _may_ be removed by the compiler. This is thus optimization
unstable and may result in incorrect behaviour at runtime.

However, we do not use exceptions as they are not supported by all
compilers and may be disabled.

To make this stable without removing the null check, you could qualify
the new operator call with std::nothrow to indicate that this should
return a null, rather than throwing an exception.

However, using (std::nothrow) was not desirable due to the Symbian
toolchain lacking a <new> header.
A global solution to this was also not easy by redefining "new" as "new
(std::nothrow)" due to custom constructors in NDS toolchain and various
common classes.

Also, this would then need explicit checks for OOM adding to all new
usages as per C malloc which is untidy.

For now to remove this optimisation unstable code is best as it is
likely to not be present anyway, and OOM will cause a system library
exception instead, even without exceptions enabled in the application
code.
2014-01-15 02:36:19 +00: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
Johannes Schickel b6f32028e1 GRAPHICS: Document loadTTFFont a bit. 2013-12-08 20:11:59 +01:00
Eugene Sandulenko 3e85976877 GRAPHICS: Initialize variable. CID 1133708 2013-12-01 00:51:09 +02:00