Commit Graph

1410 Commits

Author SHA1 Message Date
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
Johannes Schickel
14d328faca GRAPHICS: Fix SharedPtrSurfaceDeleter for nullptr inputs. 2013-11-27 19:44:54 +01:00
Johannes Schickel
9da09f5846 GRAPHICS: Allow Font to accept U32String as strings. 2013-11-23 21:34:54 +01:00
Johannes Schickel
09c634dd55 GRAPHICS: Allow TTFFont to cache glyphs when required.
This should allow TTFFont to display UTF-32 characters from fonts.
2013-11-23 21:34:54 +01:00
Johannes Schickel
13d470dc61 GRAPHICS: Get rid of _glyphSlots in TTFFont. 2013-11-23 21:34:54 +01:00
Johannes Schickel
afa3f50b8a GRAPHICS: Let Font take uint32 as character codes.
This is required to support UTF-32 strings but does not make them work
automatically!
2013-11-23 21:34:54 +01:00
Alyssa Milburn
575f81da5f GRAPHICS: Set PNG alpha bits to 0 if there's no alpha present.
This fixes the color-keying checks in Wintermute for PNG images.
2013-11-12 10:57:25 +01:00
Matthew Hoops
aea224e260 ALL: Mark off common code used by ZVision 2013-10-26 10:39:36 -04:00
peres
070558c4c4 GRAPHICS: do not reset the extra parameters of IFFDecoder on destroy().
The two properties that control pixel packing and the size of the
surface need to be preserved for loadStream() to work correctly.
They are now under complete responsibility of the client.
2013-10-26 23:26:22 +09:00
peres
69be9adf52 Revert "GRAPHICS: do not clear the internal state of IFFDecoder on loadStream()."
This reverts commit 92c1ff31d6.
2013-10-26 23:26:22 +09:00
Matthew Hoops
091bcbf313 GRAPHICS: Have TGA's loadStream() call destroy() 2013-10-26 10:21:08 -04:00
Matthew Hoops
1b3eee6d78 GRAPHICS: Clarify implicit destroy() usage 2013-10-26 10:21:03 -04:00
peres
92c1ff31d6 GRAPHICS: do not clear the internal state of IFFDecoder on loadStream().
This decoder needs to keep track of client parameters that control
how the pixels are going to be packaged, so the responsibility for
clearing the state has been moved on the client (using the destroy()
method on ImageDecoder).

As no client uses the IFFDecoder for more than one image at a time,
this change does not require updates to the engines. The only effect
is on Parallaction (BRA-Amiga), which can now control the way pixels
are packaged in mask and path bitmaps.
2013-10-26 22:24:16 +09:00
Willem Jan Palenstijn
a532c7729f Merge branch 'zvision'
This merges pull request 395 for the ZVision engine developed during
GSoC2013.
2013-10-17 23:00:00 +02:00
D G Turner
480a059f83 GRAPHICS: Fix uninitialised field in PNG decoder. CID 1002280. 2013-09-30 05:01:41 +01:00
D G Turner
b6fbc3f4c6 GRAPHICS: Fix uninitialized cursor visibility variable. CID 1002283.
The default at cursor construction has been set to not visible.
This now requires an explicit call to setVisible(true) to show the
cursor, but a basic test shows that this seems to be OK and engines
which fail to do this would have been intermittently broken before.
2013-09-30 04:47:11 +01:00
RichieSams
49d67caa31 Merge branch 'master' into zvision 2013-09-29 18:04:53 -05:00
RichieSams
701250efb5 GRAPHICS: Remove variable shadowing 2013-09-22 15:54:06 -05:00
Johannes Schickel
46a69c89f4 Merge pull request #376 from lordhoto/libjpeg
GRAPHICS: Implement JPEGDecoder based on libjpeg.
2013-09-16 17:10:57 -07:00
Johannes Schickel
4063de4070 GRAPHICS: Add some paranoia asserts in JPEGDecoder. 2013-09-16 19:54:19 +02:00
Johannes Schickel
4809294b43 GRAPHICS: Make JPEGDecoder request RGB output from libjpeg by default.
This fixes loading of JPEG files which contain RGB color space instead of YUV.
It is a pretty odd extension of JPEG files by Adobe which is indicated by this:
http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/JPEG.html#Adobe

To still support Groovie's need for YUV data I added some possibility to
request direct YUV output.
2013-09-16 19:54:19 +02:00
Johannes Schickel
ac66cc9219 GRAPHICS: Implement JPEGDecoder based on libjpeg. 2013-09-16 15:55:36 +02:00
RichieSams
6f4e80e36e ZVISION: Add wrapper function for copyRectToSurface
Also rename some arguments to make them more clear
2013-09-12 14:07:42 -05:00
Willem Jan Palenstijn
6417192584 Merge branch 'master' into zvision
Conflicts:
	video/avi_decoder.cpp
2013-09-24 13:55:54 +02: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
richiesams
7e8e9bf3d1 GRAPHICS: Create copyRectToSurface member function 2013-08-15 14:31:21 -05: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
ece8b7fb65 GRAPHICS: Fix fonts/bdf.cpp to allow for 32bpp to be used 2013-08-08 08:27:11 +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
Torbjörn Andersson
b8850522b6 GRAPHICS: Fix incorrect parameter order for getBasePtr.
This caused createThumbnail() to crash, e.g. when saving in the
Kyrandia engine. Probably other engines as well.
2013-08-08 06:55:17 +02:00
Johannes Schickel
7f8308e0eb Merge pull request #365 from lordhoto/protected-pixels
Make Graphics::Surface::pixels protected.
2013-08-07 12:24:59 -07:00
Johannes Schickel
363a5a95cf GRAPHICS: Make Surface::pixels protected. 2013-08-06 03:51:49 +02:00
Johannes Schickel
604e1b0070 GRAPHICS: Fix typo. 2013-08-04 01:01:15 +02:00
Johannes Schickel
260ec7a430 GRAPHICS: Add two new methods to change 'pixels' of a Surface.
One method is a simpler setter for 'pixels'. The other one can be used to
setup a Surface with custom data.
2013-08-03 04:02:54 +02:00
Johannes Schickel
5111746911 GRAPHICS: Take advantage of Surface::getPixels. 2013-08-03 04:02:49 +02:00
Johannes Schickel
f03dc05847 GRAPHICS: Add an easy way to query 'pixels' of Surface.
This introduced getPixels which is a shortcut for getBasePtr(0, 0).
2013-08-03 04:02:49 +02:00
Johannes Schickel
dbef9fef3b GRAPHICS: Prefer getBasePtr over direct Surface::pixels access. 2013-08-03 04:02:49 +02:00
Johannes Schickel
affb7c3cb3 GRAPHICS: Prefer getBasePtr over direct Surface::pixels access. 2013-08-03 02:52:34 +02:00
Johannes Schickel
058c22ddaa GRAPHICS: Allow to query a Surface describing a subarea in Surface. 2013-08-02 18:47:00 +02:00
Johannes Schickel
ff451ba2dc GRAPHICS: Slight formatting fixes in thumbnail_intern.cpp. 2013-08-02 17:48:31 +02:00
Johannes Schickel
9a787fa586 GRAPHICS: Silence conversion warnings by using an explicit cast. 2013-08-02 17:33:13 +02:00
Johannes Schickel
9db17152c1 GRAPHICS: Make Surface::copyFrom work for any src pitch.
Formerly we assumed that the newly created surface has the same pitch as the
source surface. This is a assumption that might be invalid (for example in
case of the Surface returned by OSystem::lockScreen.)
2013-08-01 23:57:10 +02:00
Johannes Schickel
adf8cee449 GRAPHICS: Allow arbitrary input sizes for thumbnail scaling.
Instead of a fixed 1/2 or 1/4 scaling we do a two step scaling now:
1) Scale image to width < 160*2 && height < [100,120]*2 with 1/4 or 1/2
   nearest-neighbor.
2) Use a bilinear scaler to scale aspect preserving to 160x[100,120]

This fixes bug #3614568 "GRAPHICS: Odd thumbnail sizes crash".
2013-07-13 01:57:23 +02:00
Johannes Schickel
e9bb9ddcf5 GRAPHICS: Be more robust with broken/unsupported thumbnail headers.
This fixes future issues like bug #3614654:
"ALL: ScummVM 1.5.0 can't read newer saved games".

There are a few behavior changes introduced with this commit:

- checkThumbnailHeader will now also report the presence of
  unsupported/broken (but skippable) headers.

- skipThumbnail will also try to skip the data for broken/unsupported
  thumbnail data.

- loadThumbnail will skip over broken/unsupported thumbnail data but still
  return 0 in this case.
2013-07-12 22:54:53 +02:00
Eugene Sandulenko
49210a803a Merge pull request #331 from sev-/gsoc2012-eventsrecorder
GSoC2012: Event Recorder (reworked)
2013-07-04 04:58:54 -07:00
Matthew Hoops
7445459c9d GRAPHICS: Cleanup the YUV to RGB usage documentation 2013-06-30 17:56:36 -04:00
Eugene Sandulenko
f59512c47e RECORDER: Implement Events Recorder 2013-05-17 00:18:09 +03:00
Matthew Hoops
2d6b66ef41 GRAPHICS: Fix quantization table id check 2013-04-16 12:00:39 -04:00
Einar Johan Trøan Sømåen
0db8a0b3b1 GRAPHICS: Let JPEGs pixelformat state 0 alpha bits. 2013-02-01 01:54:39 +01:00
Johannes Schickel
b4d0a8ba66 JANITORIAL: Enforce "} // End of namespace" with a single space after }. 2013-01-26 19:38:02 +01:00
Matthew Hoops
6ae97cdfbe GRAPHICS: Modify the JFIF version warning
v1.02 images should only differ with the thumbnail from v1.01, and should be handled correctly by our decoder.
2013-01-26 11:56:13 -05:00
Johannes Schickel
2ef500ce81 Merge pull request #256 from lordhoto/thumbnail-pixelformat
GRAPHICS: Serialize PixelFormat for thumbnails and allow 4Bpp surfaces.
2013-01-26 05:37:32 -08:00
Einar Johan Trøan Sømåen
5d4d65d6d9 JANITORIAL: Fix ){ -> ) { 2013-01-24 20:15:13 +01:00
Einar Johan Trøan Sømåen
58777682fe GRAPHICS: Fix leak in PNG-decoder. 2013-01-24 17:39:16 +01:00
Tomas Jakobsson
befa207bfa GRAPHICS: Delete iff.cpp and iff.h since all ILBM and PBM decoding is handled by IFFDecoder now 2013-01-06 20:04:50 +01:00
Tomas Jakobsson
fe2b4b39f7 GRAPHICS: New IFFDecoder that decodes ILBM and PBM images 2013-01-06 20:04:42 +01:00
D G Turner
0b72bd2dea GRAPHICS: Add ability to override outputPitch to ILBM decoder.
This allows loading an image into a buffer of a larger width.

Thanks to Tomaz^ for this patch.
2012-12-26 02:54:18 +00:00
D G Turner
5fecf5bcb5 GRAPHICS: Allow ILBM bitmap loading for images with 6 planes.
Thanks to Tomaz^ for this.
2012-12-26 02:09:33 +00:00
D G Turner
0eb68f6c97 GRAPHICS: Add support for ILBM files containing uncompressed data.
Thanks to Tomaz^ for this patch.
2012-12-26 00:52:30 +00:00
Einar Johan Trøan Sømåen
1ef63578bb GRAPHICS: Mark decoders used by Wintermute as such. 2012-10-23 21:48:27 +02:00
David-John Willis
e7921438cd GRAPHICS: Rename NEON_ASPECT_CORRECTOR to USE_ARM_NEON_ASPECT_CORRECTOR
* This better matches other ARM codepaths.
* Also remove #ifdef OPENPANDORA as moved to configure.
2012-10-21 18:43:07 +01:00
Matthew Hoops
c645f7dc93 GRAPHICS: Make failing to find the PICT header return false from loadStream 2012-10-16 22:15:09 -04:00
Johannes Schickel
a5bce74635 GRAPHICS: Fix compilation of conversion.cpp on motomagx.
Using plain "inline" instead of "FORCEINLINE" allows the compiler to continue
even when it fails to inline crossBlitLogic/crossBlitLogic3BppSource. The
impact of other systems now not inlining the functions anymore is hopefully
small enough to not cause any problems.
2012-10-09 23:32:51 +02:00
Johannes Schickel
c2971374cd Merge pull request #257 from lordhoto/graphics-conversion
Extend crossBlit for abitrary (in-place) conversions and add a in-place conversion to Surface
2012-10-08 14:18:33 -07: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
dc6b98f64c GRAPHICS: Slight formatting fixes in aspect.cpp. 2012-09-25 15:16:54 +02:00
clone2727
2e4ee0b2d0 Merge pull request #275 from clone2727/pegasus
Pegasus engine (The Journeyman Project: Pegasus Prime)
2012-09-20 13:17:39 -07:00
Matthew Hoops
0677871ea9 GRAPHICS: Update YUV410 conversion docs 2012-09-19 16:00:27 -04:00
Matthew Hoops
09269fce8c GRAPHICS: Implement different luminance ranges
Bink and Theora are now much improved
2012-09-18 16:50:01 -04:00
Matthew Hoops
893a2b37ff GRAPHICS: Rework YUV->RGB code a bit 2012-09-17 19:30:46 -04:00
Bertrand Augereau
4c02e19742 SCALER: Neon code for aspect correction for OpenPandora
It gains 35% on the first function of the profiling on Indy IV
It is now nearly memory-bound (~10%) so it might not be needed to schedule the code better than this
2012-09-17 22:13:34 +02:00
Matthew Hoops
7759f47607 GRAPHICS: Fix BMP palette color count with bpp != 8 2012-09-17 12:35:17 -04:00
Filippos Karapetis
c0babb010a Merge pull request #278 from bluegr/pcxdecoder
GRAPHICS: Add a PCX decoder
2012-09-16 14:06:42 -07:00
Einar Johan Trøan Sømåen
25aa19b272 GRAPHICS: Reinsert attributeBits as a comment to the TGA-decoder 2012-09-15 18:08:34 +02:00
Einar Johan Trøan Sømåen
cffda7710c GRAPHICS: Force alphaBits to 8 for 32bpp TGAs for now 2012-09-15 17:57:08 +02:00
Matthew Hoops
d5ed8b1901 Merge remote branch 'upstream/master' into pegasus
Conflicts:
	AUTHORS
2012-09-12 20:18:13 -04:00
Filippos Karapetis
ccccb392b5 GRAPHICS: Add a common PCX image decoder 2012-09-13 01:49:29 +03:00
Matthew Hoops
ed2be9d873 GRAPHICS: Fix ImageDecoder inconsistency with getPalette()
Per LordHoto's suggestion
2012-09-09 17:20:07 -04:00
Filippos Karapetis
1f11ce6df2 PNG: call png_set_interlace_handling() before calling png_read_update_info()
This matches the documentation, information from the PNG bug tracker and the
behavior of example decoders off the net. It fixes warnings thrown from the PNG
decoder
2012-09-06 01:35:58 +03:00
Matthew Hoops
f35e820e9f Merge remote branch 'upstream/master' into pegasus 2012-09-05 11:45:25 -04:00
Bertrand Augereau
5f6a98cb5b SCALER: No need to inline interpolate5Line, it just bloats stretch200To240 for nothing 2012-09-03 01:34:41 +02:00
Matthew Hoops
2f9b1b67b0 ALL: Mark off some things as used by Pegasus 2012-08-31 22:26:02 -04:00
Matthew Hoops
790a74ab9d Merge remote branch 'upstream/master' into pegasus 2012-08-31 21:58:58 -04:00
Bertrand Augereau
10a947a0be GRAPHICS: Scope reduction of the sometimes unused alpha component in TGADecoder::readHeader 2012-08-30 18:32:27 +02:00
Bertrand Augereau
3b4d713ba1 GRAPHICS: Undefined behaviour/warnings removal in the TGA decoder 2012-08-30 18:13:00 +02:00
Johannes Schickel
f87154def8 GRAPHICS: Slight formatting change for consistency. 2012-08-29 15:59:15 +02:00
Johannes Schickel
f189d8a541 GRAPHICS: Remove extra semicolon. 2012-08-29 15:58:55 +02:00
Johannes Schickel
933726a7e8 Merge pull request #263 from somaen/tgaloader
GRAPHICS: Add in a TGA-decoder
2012-08-29 06:58:22 -07:00
Einar Johan Trøan Sømåen
47a7df2d0f GRAPHICS: Add in a TGA-decoder 2012-08-29 14:05:54 +02:00
Johannes Schickel
eeb3959259 GRAPHICS: Add an in-place Surface PixelFormat conversion. 2012-08-28 02:27:48 +02:00
Johannes Schickel
e8cf0adf95 GRAPHICS: Slight cleanup in crossBlit code. 2012-08-28 02:27:48 +02:00
Johannes Schickel
a92a509ac8 GRAPHICS: Allow in-place conversion with any color formats in crossBlit. 2012-08-28 02:27:48 +02:00
Johannes Schickel
0d78d46a0e GRAPHICS: Remove crossBlit's dstBpp >= srcBpp limitation. 2012-08-28 02:27:48 +02:00
Johannes Schickel
3a55adbf5e GRAPHICS: Fix a bug in crossBlit with 3Bpp source.
Formerly it added 2 to the source pixel pointer instead of 3.
2012-08-28 02:27:48 +02:00
Johannes Schickel
a0f46e9396 GRAPHICS: Remove 3Bpp destination support in crossBlit. 2012-08-28 02:27:47 +02:00
Johannes Schickel
ea1bcaad33 GRAPHICS: Refactor crossBlit logic into a template. 2012-08-28 02:27:47 +02:00
Johannes Schickel
05d24e892c GRAPHICS: Clean up crossBlit a bit. 2012-08-28 02:27:47 +02:00
Matthew Hoops
bb1e60e8b2 Merge remote branch 'upstream/master' into pegasus
Conflicts:
	AUTHORS
	devtools/credits.pl
	gui/credits.h
2012-08-26 16:12:25 -04:00
Johannes Schickel
5df8c99768 GPRAHICS: Slight cleanup in png.cpp.
This adds an explanation why we use FORBIDDEN_SYMBOL_ALLOW_ALL and removes
some trailing whitespaces.
2012-08-21 02:19:51 +02:00
Johannes Schickel
05eb6eecfc Merge pull request #262 from somaen/pngwithlibpng
GRAPHICS: Reimplement the PNG-decoder using libpng
2012-08-20 17:12:52 -07:00
Einar Johan Trøan Sømåen
af05b1b80e GRAPHICS: Reimplement the PNG-decoder using libpng 2012-08-20 21:14:59 +02:00
Einar Johan Trøan Sømåen
8982026661 GRAPHICS: Add support for 32bpp BMPs 2012-08-13 02:31:34 +02:00
Matthew Hoops
c839fd50b5 GRAPHICS: Clarify format of the palette in ImageDecoder 2012-08-12 17:44:23 -04:00
Johannes Schickel
b4196e48b1 GRAPHICS: Add a DPI parameter to loadTTFFont.
Will be used by WME.
2012-08-09 03:13:00 +02:00
Johannes Schickel
50a93c2e71 GRAPHICS: Small formatting fixes in iff.cpp. 2012-07-25 21:07:19 +02:00
Johannes Schickel
f1a1938253 GRAPHICS: Serialize PixelFormat for thumbnails and allow 4Bpp surfaces.
This allows any 2Bpp/4Bpp Surfaces to be written via saveThumbnail
and loadThumbnail now. It furthermore will preserve the loaded Surface
in loadThumbnail.
2012-07-14 03:07:48 +02:00
Matthew Hoops
91efe792d5 Merge remote branch 'upstream/master' into pegasus 2012-06-24 09:37:53 -04:00
Johannes Schickel
82a553a12c Merge pull request #247 from clone2727/pixelformat-argb-fix
GRAPHICS: Fix colorToARGB's alpha value when no alpha channel is present
2012-06-20 09:24:08 -07:00
Matthew Hoops
625f6cc716 Merge remote branch 'upstream/master' into pegasus 2012-06-16 01:43:32 -04:00
Matthew Hoops
984e0012d9 GRAPHICS: Fix colorToARGB's alpha value when no alpha channel is present 2012-06-15 23:11:28 -04: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
Johannes Schickel
e1e1f01b87 GRAPHICS: Let CursorMan's cursor functions take "const void *" buffers. 2012-06-16 03:28:42 +02:00
Johannes Schickel
0075fa2f98 GRAPHICS: Replace OverlayColor with uint16 in scaler code.
Scalers are actually fixed at 2Bpp right now and not at the
depth of OverlayColor.
2012-06-12 04:18:59 +02:00
Johannes Schickel
a401f0a19e ALL: Replace cursorTargetScale in OSystem API with a simple "do not scale" logic.
All uses of the old target scale API actually wanted to disallow scaling of
the mouse cursor. This commit adapts our API to this and thus simplifies
backend implementations.

Some backends, most notable the Wii and Android, did some implementation of
the cursor target scale, which I didn't adapt yet. I added a TODO for the
porters there.
2012-06-03 02:02:57 +02:00
Matthew Hoops
f1f6a82cd5 Merge remote branch 'upstream/master' into pegasus 2012-05-25 00:35:38 -04:00
Matthew Hoops
b253a05454 GRAPHICS: Hide the WinCursor implementation 2012-05-14 09:56:56 -04:00
Matthew Hoops
d789df8945 GRAPHICS: Add palette start index and color count functions to ImageDecoder 2012-05-14 09:56:56 -04:00
Matthew Hoops
e80d622fa5 Merge remote branch 'upstream/master' into pegasus 2012-05-04 23:32:29 -04:00
Matthew Hoops
e5808c740a GRAPHICS: Fix 32-bit DirectBits images 2012-05-04 23:18:28 -04:00
Johannes Schickel
3b212fdb51 GRAPHICS: Remove unused function ftFloor26_6 in ttf.cpp. 2012-05-03 23:25:00 +02:00
Johannes Schickel
b96143c180 Merge pull request #213 from fuzzie/leak-fixes
The pull request in question is "Memory leak fixes".
2012-05-03 13:45:40 -07:00
D G Turner
4d6f2875de GRAPHICS: Fix BMP getPalette function definition.
The BMP decoder getPalette function definition is now identical to
the other image format decoders subclassed from ImageDecoder.
This also fixes a overloaded virtual warning reported by salty-horse.
2012-04-22 16:41:30 +01:00
Matthew Hoops
c5363006ed GRAPHICS: Only accept JPEG CompressedQuickTime PICT opcodes 2012-04-19 11:49:06 -04:00
Matthew Hoops
9971e74c4c Merge remote branch 'upstream/master' into pegasus
Conflicts:
	base/plugins.cpp
	configure
2012-04-19 08:16:24 -04:00
Matthew Hoops
b2de2cf855 GRAPHICS: Improve the YUV410 conversion code speed some more 2012-04-16 21:34:13 -04:00
Matthew Hoops
473a09786d GRAPHICS: Make YUV410 conversion code use bilinear interpolation
SVQ1 no longer looks blocky and now looks a lot closer to what QuickTime outputs
2012-04-14 17:06:31 -04:00
Matthew Hoops
db52618833 GRAPHICS: Add comments on which engines use the decoders 2012-04-08 08:58:42 -04:00
D G Turner
e1f9598392 GRAPHICS: Add YUV410 to RGB Conversion Functions, required for SVQ1.
Thanks to clone2727 for these.
2012-04-08 03:28:58 +01:00
Joel Teichroeb
ab16233318 GRAPHICS: Fix casting away const 2012-04-03 16:54:05 -07:00
Alyssa Milburn
b470c9af28 BASE: Free TTFLibrary singleton on shutdown.
This uses a helper function because TTFLibrary is internal.
2012-03-28 19:17:53 +02:00
Alyssa Milburn
6d3927cd7a GRAPHICS: Take ownership of fonts passed to FontManager. 2012-03-28 19:17:13 +02:00
Alyssa Milburn
fdee01bf04 GRAPHICS: Don't try to delete static BDF data. 2012-03-28 19:16:52 +02:00
Matthew Hoops
71756bdf4e Merge remote branch 'upstream/master' into pegasus 2012-03-20 14:49:16 -04:00
Matthew Hoops
e79f0bf717 GRAPHICS: Fix regression caused by a bad rebase 2012-03-19 23:29:58 -04:00
Matthew Hoops
fce0e8c45b GRAPHICS: Fix PICT 16bpp 2012-03-19 21:54:37 -04:00
Matthew Hoops
a7740fb6de GRAPHICS: Add support for converting surfaces from 24bpp 2012-03-20 01:06:48 +01:00
Matthew Hoops
a658fc660e GRAPHICS: Move PNG to the ImageDecoder interface 2012-03-20 01:06:48 +01:00
Matthew Hoops
dd9790c1c8 GRAPHICS: Make PNG signature more readable 2012-03-20 01:06:48 +01:00
Matthew Hoops
b6d2a11432 GRAPHICS: Make the JPEG code use the new YUV to RGB converter 2012-03-20 01:06:48 +01:00
Matthew Hoops
765a870445 GRAPHICS: Convert JPEG to the ImageDecoder API 2012-03-20 01:06:48 +01:00
Matthew Hoops
4516b5ea24 GRAPHICS: Convert PictDecoder to the ImageDecoder API 2012-03-20 01:06:48 +01:00
Matthew Hoops
426c81a7a7 GRAPHICS: Rewrite ImageDecoder to have an improved API
The new bitmap decoder class is based off the Mohawk one, and now has 8bpp decoding capability.
2012-03-20 01:06:47 +01:00
Matthew Hoops
a004897252 GRAPHICS: Add a convertTo() function to Surface 2012-03-20 01:06:47 +01:00
Alyssa Milburn
92327c7991 GRAPHICS: Render TTF glyphs at the right locations.
Or at least using the fields used by the FreeType examples.
2012-03-19 23:00:14 +01:00
Alyssa Milburn
9a13b34549 GRAPHICS: Fix TTF glyph drawing at negative Y positions. 2012-03-19 22:57:48 +01:00
Christoph Mallon
e618e6794d JANITORIAL: Remove unnecessary empty default constructors/destructors. 2012-03-13 15:42:30 +01:00
Max Horn
367131ef0e COMMON: Move Language and Platform functionality into separate files 2012-02-26 15:21:36 +01:00
Johannes Schickel
442bcb7d3e ALL: Fix some signed/unsigned comparison warnings. 2012-02-22 20:20:55 +01:00
Willem Jan Palenstijn
9ffe3e11d9 Merge pull request #182 from fingolfin/forbid-ctype
ALL: Avoid using is* macros from ctype.h
2012-02-21 11:33:32 -08: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
Max Horn
4f8665fc83 COMMON: Move isFoo functions to namespace Common, add doxygen comments 2012-02-20 16:18:27 +01:00
Tarek Soliman
a4798602d7 JANITORIAL: Fix missing whitespace in pointer cast
find -name '*.h' -or -name '*.cpp' | xargs sed -r -i 's@\(([A-Za-z0-9]+)\*\)@(\1 *)@g'

This seems to have caught some params as well which is not undesirable IMO.
It also caught some strings containing this which is undesirable so I
excluded them manually. (engines/sci/engine/kernel_tables.h)
2012-02-15 10:07:10 -06:00
Max Horn
658080deed ALL: Avoid using is* macros from ctype.h
On some systems, passing signed chars to macros like isspace() etc. lead
to a runtime error. Hence, mark these macros as forbidden by default,
and introduce otherwise equivalent alternatives for them.
2012-02-15 16:51:37 +01:00
Willem Jan Palenstijn
4182bdbd52 GRAPHICS: Remove unused variable 2012-02-11 22:54:36 +01:00
Bastien Bouclet
3becde4d1a GRAPHICS: Switch to integer based JPEG IDCT
Based on public domain code, and explanations from :
http://halicery.com/jpeg/idct.html
Thanks.
2012-02-09 16:10:51 +01:00
Bastien Bouclet
de0425c7e2 GRAPHICS: Add support for JPEG files using a restart interval
Patch by Scott and clone2727
2012-02-09 16:10:51 +01:00
Johannes Schickel
66c3279b2f GRAPHICS: Obtain pointer to dst surface after bounds checks in TTF renderer.
This should really make sure we are not drawing outside the surface bounds.
2012-02-02 02:39:41 +01:00
Johannes Schickel
6402d30874 GRAPHICS: Use monochrome font hinter for TTF's monochrome loading. 2012-02-02 02:39:40 +01:00
Johannes Schickel
f63df3bf7b GRAPHICS/GUI: Implement charset mapping for TTF fonts.
The charsets used by the translations now need to have a "$(name).cp" file,
which contains an charset index => unicode mapping. Otherwise
create_translations will fail.
2012-01-29 16:26:20 +01:00
Johannes Schickel
9f3fbe1bd7 GRAPHICS/GUI: Implement kerning support for Font.
This adapts the related graphics code, which is the generic Font API and the
TTF font implementation.

It furthermore adapts the GUI to properly take care of kerning in text input
widgets.
2012-01-29 16:26:20 +01:00
Johannes Schickel
843b9f9665 GRAPHICS: Add a TTF font class using FreeType2. 2012-01-29 16:26:20 +01:00
Filippos Karapetis
103ae27d3a GRAPHICS: Silence a false positive warning in MSVC 2012-01-07 22:45:59 +02:00
Johannes Schickel
1574d644e8 GRAPHICS: Let FontManager::setFont accept an "const BdfFont *".
As the documentation points out this method currently only works for BDF
fonts, thus it is safer to let it actually just accept such.
2012-01-07 01:16:33 +01:00
Johannes Schickel
050b8e3360 GUI: Rework how the default localized font is managed.
Now we set the default localized font to the "text_default" font of the
currently active theme and default to the big GUI font in case none is
specified properly.
2012-01-07 01:03:07 +01:00
Johannes Schickel
309e9a855d GRAPHICS: Slight formatting fix. 2012-01-07 00:35:26 +01:00
Johannes Schickel
e454788a23 GRAPHICS: Whops. Fix misformatting introduced with 243de59. 2012-01-06 15:59:16 +01:00
Johannes Schickel
d2a210feb5 GRAPHICS: Properly return 0 for late BDF cache loading fails. 2012-01-06 15:53:22 +01:00
Johannes Schickel
243de5950f GRAPHICS: Slight cleanup in BDF code. 2012-01-06 15:52:55 +01:00
Johannes Schickel
abbc87e180 GRAPHICS: Slight formatting fixes in jpeg.cpp. 2012-01-06 15:51:10 +01:00
Johannes Schickel
08b6f28d54 GRAPHICS: Rework BDF font code. 2012-01-06 15:38:29 +01:00
Johannes Schickel
c2c8108f3b GRAPHICS: The PNG decoder is not used by our GUI. 2012-01-05 10:33:31 +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
Matthew Hoops
bdf14ed598 GRAPHICS: Fix PICT lines with large pitches 2011-12-19 15:21:35 -05:00
Eugene Sandulenko
71d6771be5 GUI: Implement dithering for tabs and round squares 2011-12-14 00:56:15 +00:00