Commit Graph

167 Commits

Author SHA1 Message Date
Orgad Shaneh
7a4e5612de JANITORIAL: Replace new[]/memset with new[]()
Mostly done using the following Ruby script:

(Dir.glob('**/*.cpp') + Dir.glob('**/*.h')).each do |file|
  s = File.read(file, encoding: 'iso8859-1')
  t = s.gsub(/(([\w_.\[\]]+)\s*=\s*new\s+\S+?\[[^\]]+?\](?!\())([^\{\}]*?)\n\s+memset\(\s*\2\s*,\s*0\s*,[^;]*;/m, '\1()\3')
  if t != s
    File.open(file, 'w') { |io| io.write(t) }
  end
end
2021-11-10 19:53:15 +01:00
sluicebox
620dc8a1df IMAGE: Fix BitmapRawDecoder constructor regression
Fixes parameter order mismatch between definition and declaration
introduced in: 5d093e725f

Fixes flipped QFG4 intro movie, bug #13059
2021-11-04 00:46:46 -05:00
lb_ii
75b8735b57
IMAGE: Load BMPs with any v1-v5 header 2021-11-01 16:26:23 +02:00
lb_ii
236be25624
IMAGE: Parse 4bpp BMP files 2021-11-01 16:26:19 +02:00
lb_ii
5d093e725f
IMAGE: Extend raw decoder to support BMP with alpha channel 2021-11-01 16:25:43 +02:00
Eugene Sandulenko
8626c39b21
IMAGE: Fix SMC decoder
It is a regression introduced in 6fb49b6595.
Because of this, we were not reading all the bytes from the source.
2021-08-10 20:51:42 +02:00
ysj1173886760
2be3f87a49 DIRECTOR: change _isQT to _flip in BimapRawDecoder 2021-08-05 19:03:58 +08:00
ysj1173886760
1b5f986df9 IMAGE: change the type of rleCode to int to prevent overflow. 2021-08-05 17:42:10 +08:00
ysj1173886760
adfa11e684 IMAGE: flip 8bpp images when we are decoding QuickTimeVideo 2021-08-05 15:06:14 +08:00
Matthew Duggan
732d05f036 IMAGE: Make JYV1 decoder a little more robust to bad data 2021-07-25 15:40:03 +09:00
Paul Gilbert
005561d305 COMMON: Increase Stream pos, seek, size from int32 to int64 2021-07-08 18:24:28 -07:00
Paul Gilbert
baccbedf50 GRAPHICS: Changed surface classes sizes from uint16 to int16 2021-07-04 18:24:27 -07:00
lb_ii
dd75517d61 IMAGE: Use 0-bit alpha for non-transparent PNGs 2021-07-05 01:00:11 +02:00
Matthew Duggan
fbc4da2d83 IMAGE: Mention usage of bmp decoder by ultima8 engine 2021-06-24 08:44:08 +09:00
Matthew Duggan
c24f92cb6f IMAGE: Fix decoding bug in Crusader: No Remorse RRV videos
Previously the upscale test was changing the frame contents with incorrect data
before going back, but the algorithm relies on not changing contents for some
pixels by "skipping" them.  Duplicated a bit of code to create a
non-destructive upscale test before decoding the whole frame.
2021-05-26 12:27:44 +09:00
Orgad Shaneh
a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Cameron Cawley
d9fe53efb2 CRYOMNI3D: Move HNMDecoder into common code 2021-04-17 21:48:45 +03:00
Eugene Sandulenko
5e7fe2dc57
JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00
Martin Gerhardy
bb34721dd4 IMAGE: added GIFDecoder using libgif 2021-04-10 10:59:09 +02:00
Martin Gerhardy
755931f9aa IMAGE: missing override for png decoder 2021-04-06 11:15:06 +02:00
Eugene Sandulenko
1c327e0c70
IMAGE: Added not on BMP format conversion 2021-03-30 16:57:06 +02:00
Matthew Hoops
d5b6f36676 IMAGE: Mark BitmapDecoder as being used by buried 2021-03-22 00:07:37 +01:00
Matthew Hoops
ccabf0621c IMAGE: Add support for headerless bitmaps
These ones are found inside of executables as resources
2021-03-22 00:07:36 +01:00
Thierry Crozat
aaa1bb151a IMAGE: Allow writing PNG from 8 bit surfaces 2021-03-15 00:56:01 +00:00
Matthew Duggan
017a801c96 IMAGE: Add support for Xan codec videos (Crusader, Wing Commander) 2021-03-14 19:16:24 +01:00
Le Philousophe
cd8cd86a9e IMAGE: Move mpeg2dec.h inclusion in CPP file
This avoids to pollute declarations with inttypes.h and mpeg2dec.h when
including mpeg.h
2021-02-13 17:49:21 +01:00
Paweł Kołodziejski
54c2b1aaec IMAGE: Print source of callback messages. Change PNG warning into debug. 2021-02-13 12:31:16 +01:00
Paul Gilbert
1fa5e17b24 IMAGE: Support pngs with alphas for multiple palette entries 2020-12-23 19:32:19 -08:00
Bartosz Gentkowski
be39e3b4d2 DOXYGEN: Doxy work on files from 'image'
There is only one file in this folder that is in scope of
GSoD - image_decoder.h. It was in great shape docwise though,
so not much review required.

The rest of the headers have received a doxy group definition.
2020-11-29 23:04:01 +00:00
Vladimir Serbinenko
f3f0d0228a IMAGE: Add decoder for CEL 3DO format
This format is used by 3DO version of Plumbers Don't Wear Ties
but it's a generic format on 3DO similar to BMP on windows.
2020-10-24 00:59:01 +02:00
Andrei Prykhodko
a5f16796ed IMAGE: Update Engine Usage Comment in BMP Decoder 2020-10-07 22:52:12 +03:00
Eugene Sandulenko
6fb49b6595 IMAGE: Added sanity checks to SMC video decoder 2020-08-19 14:54:47 +02:00
Eugene Sandulenko
2999977154 IMAGE: CODECS: Plug QT RAW decoder 2020-08-10 12:46:38 +02:00
Cameron Cawley
00e3c03755 ALL: Remove unnecessary graphics/colormasks.h includes 2020-06-15 16:59:34 +01:00
Strangerke
f7bdd77d0c KINGDOM: Add some functions and constants (courtesy of TMM), fix the IFFDecoder for chunks with odd size 2020-06-07 00:02:29 +02:00
Matthew Duggan
2ac6579236 IMAGE: Fix use of and keyword 2020-05-12 22:43:00 +09:00
Matthew Duggan
818e681746 IMAGE: Add support for Crusader: No Remorse movie decoding
The movies for Crusader: No Remorse have a unique decoder which is not too hard
to implement.  Unfortunately, they don't properly implement the "compression"
FourCC, and instead put their ID in the "Stream Handler".  Since supporting
them requires a change to the existing Image API, I thought I should make a
pull request for comments.

With this change, the movies in Crusader can all be played nicely.
2020-05-11 07:54:24 +02:00
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