Commit Graph

130 Commits

Author SHA1 Message Date
Paul Gilbert
154ec75010 IMAGE: Allow v4 bitmaps in BItmapDecoder 2020-02-01 13:13:51 -08:00
Eugene Sandulenko
6ce6922eef IMAGE: Fix potential memory leaks 2020-01-06 13:35:04 +01:00
Cameron Cawley
d289fa5f98 OPENGL: Ensure surfaces created by saveScreenshot are the right way up 2020-01-02 20:53:29 +02:00
D G Turner
f0c02796f4 IMAGE: Fix Missing Default Switch Case in Truemotion 1 Codec
This is flagged by GCC if -Wswitch-default is enabled.
2019-12-01 01:26:53 +00:00
D G Turner
aee09409e8 IMAGE: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-11-30 22:08:44 +00:00
Cameron Cawley
773295842a
IMAGE: Remove unnecessary check from Image::writePNG()
Surfaces with pixel formats not supported by libpng are already converted to RGBA, meaning that the check isn't needed.
2019-11-10 12:40:44 +00:00
Paul Gilbert
8a8ac63636 IMAGE: Add a paletted transparency mode flag to PNGDecoder
Previously, the PNGDecoder would always convert images that
have a palette with a transparent color(s) to a full RGBA
surface automatically. There needed to be a way to diable
this and keep the image paletted for the Glk engine, since
some Infocom V6 game Blorb files reuse the palettes from
previous images, so I couldn't have the decoder using the
dummy palette that comes with the image
2019-08-01 22:05:40 -07:00
SupSuper
2365b678b3 IMAGE: Fix MSVC warnings
Fixes warning C4067: unexpected tokens following preprocessor directive
due to non-standard "and" "or" operators
2019-05-09 18:13:10 +10:00
Bastien Bouclet
efcd8ab270 IMAGE: Fix build when not using libjpeg-turbo 2019-04-28 09:18:07 +02:00
Bastien Bouclet
8ffa737901 IMAGE: Remove decoding JPEG directly to RGB565
It's not supported by ancient versions of libjpeg-turbo, and there is no
way to detect if support is available without doing a compilation
test...
2019-04-28 07:59:14 +02:00
Bastien Bouclet
9f98cddf8d IMAGE: Don't perform color conversion when decoding PNGs 2019-04-28 07:59:14 +02:00
Bastien Bouclet
0d5d04ca3a IMAGE: Allow setting the output pixel format to the JPEG decoder 2019-04-28 07:59:14 +02:00
Bastien Bouclet
0f57aea2df COMMON: Use a prefix table to speed up the Huffman decoder
Symbols for codes shorter than the prefix table index width are stored
in the table. All the entries in the table with an index starting with
the code are set to the symbol value. That way, when decoding it is
possible to get the number of bits corresponding to the table width from
the bitstream and directly find the symbol value. Longer code still need
to be searched for in the codes list.
2019-04-13 16:24:25 +03:00
sluicebox
b195ff5e19 GRAPHICS: Add support for PICT opcode $90 BitsRect
Add limited support for unpacked PICT bits which FPFP Mac requires.

SCI games use packed PICT bits unless an image is less than 8 bytes
per row in which case they can't be packed, like FPFP's shovel icon.

Fixes bug #7059 which prevents the game from being completed.
2019-03-31 14:02:58 +03:00
Cameron Cawley
205df5dbdf IMAGE: Fix taking screenshots on big endian systems 2019-03-02 07:29:22 +01:00
Cameron Cawley
8ae17b481a IMAGE: Move bitmap writing code out of OpenGLGraphicsManager 2019-03-02 07:29:22 +01:00
Torbjörn Andersson
d4f8b330d6 IMAGE: Honor nb_fields when calculating frame duration
From what I understand, this has something to do with the image
being either made up from two or three parts. When it's made from
three parts, the frame should be displayed for half again as long
as normal.

This makes the speed of the Zork: Grand Inquisitor video look
about right to me. It's still out of sync, but it doesn't seem to
get *more* out of sync as the video progresses.
2018-11-04 22:33:22 +01:00
Torbjörn Andersson
fc7fa1de3a VIDEO: Use liba52 to decode audio. This is still laughably broken
At the moment, this produces nothing but misery in the form of
Valgrind warnings and horrible noise.
2018-11-04 22:33:22 +01:00
Bastien Bouclet
360e1e97c9 IMAGE: Check the output surface bounds when writing QT encoded PICT images 2018-09-14 19:54:52 +02:00
Cameron Cawley
a7bc08992e IMAGE: INDEO: Use the system pixel format for non-8bpp screen modes 2018-04-15 08:05:24 -05:00
Torbjörn Andersson
4702681be2 IMAGE: Explicitly initialize CinePak codebooks
Starship Titanic produces lots of "uninitialized value" warnings
at the very beginning of the game, when turning right. This is
because in the very first movie frame it uses codebooks that have
not been loaded. Explicitly set their data to 0 to guarantee
consistent behavior.
2018-04-07 10:03:50 +02:00
Adrian Frühwirth
4faa8b0439 JANITORIAL: Remove useless comment 2018-03-25 18:37:10 +02:00
Adrian Frühwirth
cec905e036 IMAGE: Fix Indeo3 compiler warnings 2018-01-20 20:00:30 +01:00
Colin Snover
56cc138e58 IMAGE: Remove unnecessary heap allocation in BitmapRawDecoder 2017-09-24 16:22:40 -05:00
Paul Gilbert
5424f70002 IMAGE: Fix memory leak in BitmapRawDecoder 2017-09-24 12:02:48 -04:00
Colin Snover
194984de2f IMAGE: Remove unused end info structs from PNG code
Thanks to @dafioram for noticing the problem & sending an initial
patch, and to @wjp for noticing further that the PNG reader did not
even use the end info struct it created either.

Fixes Trac#10217. Closes gh-1028.
2017-09-21 20:43:04 -05:00
Cameron Cawley
7846d098b2 IMAGE: Support rendering Indeo videos at 15bpp 2017-09-05 23:40:05 +01:00
Paul Gilbert
0b19ebe7b2 IMAGE: Fix shadowing warning 2017-09-04 09:16:59 -04:00
Colin Snover
2b46eda5b6 IMAGE: Allow Indeo4 transparency decoding in scalable videos
y459.avi in Starship Titanic uses these two modes together, and
this appears to work fine.
2017-08-24 21:17:54 -05:00
Colin Snover
4a39f85c1b IMAGE: Implement handling of key color in Indeo transparency
This should also improve performance by eliminating unnecessary
writes to the output bitmap for opaque pixels and by simplifying
the rendering loop.
2017-08-24 20:36:08 -05:00
Colin Snover
d39a9272bf IMAGE: Remove unnecessary extra heap allocation of Indeo surface 2017-08-24 20:34:55 -05:00
Colin Snover
7dd2c0342d IMAGE: Remove unnecessary temporary surface in Indeo4/5 2017-08-24 20:34:19 -05:00
Colin Snover
085ec30b49 IMAGE: Add support for Indeo4 transparency plane
This is used by TITANIC for most of the furniture in the SGT
stateroom and Titania's parts.
2017-08-24 20:34:16 -05:00
Willem Jan Palenstijn
edfdbb9dd7 IMAGE: Use new BitStreamMemory class for indeo 2017-08-24 19:46:59 +02:00
Willem Jan Palenstijn
60fae8847e IMAGE: Inline indeo getVLC2 2017-08-24 19:46:59 +02:00
Willem Jan Palenstijn
dde259f068 COMMON: Remove BitStream base class to allow inlining calls
All users of BitStream were in fact using a specific, hardcoded variant,
so we can hardcode that variant, removing the need for virtual calls,
and enabling inlining.
2017-08-24 19:46:59 +02:00
Eugene Sandulenko
c48cb7af7c JANITORIAL: Add fall through statement 2017-08-11 21:40:11 +02:00
Simei Yin
a503af4959 IMAGE: Correct 4-byte image writting pixel format 2017-08-03 09:36:30 +02:00
Paul Gilbert
411cc2cb4e IMAGE: Extra initialization of Indeo decoder IVIHuffTab 2017-07-25 19:50:23 -04:00
yinsimei
791aedf7a5 Image: extend writePng for 4-byte pixelFormat 2017-07-13 18:27:45 +02:00
yinsimei
1a27d67123 IMAGE: add flag to skip signature check in png decoder 2017-07-13 18:27:45 +02:00
Willem Jan Palenstijn
4ec3c2875b IMAGE: Inline two simple indeo functions 2017-07-11 01:32:05 +02:00
Colin Snover
fa0bb7dd5a BACKENDS: Compress screenshots using PNG if available
Closes gh-948.
2017-05-21 15:55:39 -05:00
Colin Snover
7b90f0693a IMAGE: Return correct pixel format for Indeo3
This gives Indeo3 the same behavior as other codecs when
encapsulated in a container that provides bit depth information
(e.g. AVI).

Closes #888.
2017-01-11 10:59:55 -06:00
D G Turner
f63b9d0fcb IMAGE: Fix Unused Variable Compiler Warning in Indeo 4 Codec. 2017-01-09 07:21:59 +00:00
Paul Gilbert
bc039f6b10 IMAGE: Properly load bottom origin RLE encoded TGA images 2017-01-01 02:36:01 -05:00
Paul Gilbert
206b3f9315 IMAGE: Fixed attribution comments for the Indeo decoders 2016-12-26 00:07:17 -05:00
Paul Gilbert
b3c686195f IMAGE: Add hack to Indeo 4 decoder to guess transparent areas 2016-11-21 20:20:23 -05:00
Paul Gilbert
4888433c46 IMAGE: Fix some confusion of bytes vs bits in Indeo decoders 2016-11-18 21:04:12 -05:00
Paul Gilbert
91d61b2cdb IMAGE: Respect bit depth in Indeo 5 decoder 2016-11-18 20:58:39 -05:00