diff --git a/common/iff_container.h b/common/iff_container.h index 0e330a574d6..6ff28574e56 100644 --- a/common/iff_container.h +++ b/common/iff_container.h @@ -143,9 +143,6 @@ page 376) */ /* 8SVX Voice8Header */ -char * ID2string(Common::IFF_ID id); - - /** * Represents a IFF chunk available to client code. * diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp index 9a2f2fa73f5..dd7cced83c9 100644 --- a/engines/kyra/script.cpp +++ b/engines/kyra/script.cpp @@ -96,7 +96,7 @@ bool EMCInterpreter::callback(Common::IFFChunk &chunk) { break; default: - warning("Unexpected chunk '%s' of size %d found in file '%s'", Common::ID2string(chunk._type), chunk._size, _filename); + warning("Unexpected chunk '%s' of size %d found in file '%s'", Common::tag2string(chunk._type).c_str(), chunk._size, _filename); } return false; diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index 764cc445b3d..80e159433a3 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -141,7 +141,7 @@ bool TIMInterpreter::callback(Common::IFFChunk &chunk) { break; default: - warning("Unexpected chunk '%s' of size %d found in file '%s'", Common::ID2string(chunk._type), chunk._size, _filename); + warning("Unexpected chunk '%s' of size %d found in file '%s'", Common::tag2string(chunk._type).c_str(), chunk._size, _filename); } return false; diff --git a/graphics/iff.cpp b/graphics/iff.cpp index 902f97499af..21742911122 100644 --- a/graphics/iff.cpp +++ b/graphics/iff.cpp @@ -27,25 +27,6 @@ #include "common/util.h" - -namespace Common { - -// this really belongs to iff_container.cpp, but we don't want -// to put only this in a source file -char *ID2string(Common::IFF_ID id) { - static char str[] = "abcd"; - - str[0] = (char)(id >> 24 & 0xff); - str[1] = (char)(id >> 16 & 0xff); - str[2] = (char)(id >> 8 & 0xff); - str[3] = (char)(id >> 0 & 0xff); - - return str; -} - -} - - namespace Graphics { void BMHD::load(Common::ReadStream *stream) { @@ -154,6 +135,26 @@ void ILBMDecoder::planarToChunky(byte *out, uint32 outPitch, byte *in, uint32 in } +// handles PBM subtype of IFF FORM files +// +struct PBMDecoder { + /** + * PBM header data, necessary for loadBitmap() + */ + Graphics::BMHD _header; + + /** + * Fills the _header member from the given stream. + */ + void loadHeader(Common::ReadStream *stream); + + /** + * Loads and unpacks the PBM bitmap data from the stream into the buffer. + * The functions assumes the buffer is large enough to contain all data. + */ + void loadBitmap(byte *buffer, Common::ReadStream *stream); +}; + void PBMDecoder::loadHeader(Common::ReadStream *stream) { _header.load(stream); } @@ -266,5 +267,4 @@ uint32 PackBitsReadStream::read(void *dataPtr, uint32 dataSize) { return dataSize - left; } - -} +} // End of namespace Graphics diff --git a/graphics/iff.h b/graphics/iff.h index 115066cbf5d..0aab0e09cb9 100644 --- a/graphics/iff.h +++ b/graphics/iff.h @@ -22,7 +22,7 @@ * $Id$ */ -/** +/* * Bitmap decoder used in engines: * - parallaction * - saga @@ -104,40 +104,23 @@ struct ILBMDecoder { - -// handles PBM subtype of IFF FORM files -// -struct PBMDecoder { - /** - * PBM header data, necessary for loadBitmap() - */ - Graphics::BMHD _header; - - /** - * Fills the _header member from the given stream. - */ - void loadHeader(Common::ReadStream *stream); - - /** - * Loads and unpacks the PBM bitmap data from the stream into the buffer. - * The functions assumes the buffer is large enough to contain all data. - */ - void loadBitmap(byte *buffer, Common::ReadStream *stream); -}; - +/** + * Handles PBM subtype of IFF FORM files + */ void decodePBM(Common::ReadStream &input, Surface &surface, byte *colors); -/* - PackBits is a RLE compression algorithm introduced - by Apple. It is also used to encode ILBM and PBM - subtypes of IFF files, and some flavours of TIFF. - - As there is no compression across row boundaries - in the above formats, read() will extract a *new* - line on each call, discarding any alignment or - padding. -*/ +/** + * Decode a given PackBits encoded stream. + * + * PackBits is an RLE compression algorithm introduced by Apple. It is also + * used to encode ILBM and PBM subtypes of IFF files, and some flavours of + * TIFF. + * + * As there is no compression across row boundaries in the above formats, + * read() will extract a *new* line on each call, discarding any alignment + * or padding. + */ class PackBitsReadStream : public Common::ReadStream { protected: @@ -152,6 +135,6 @@ public: uint32 read(void *dataPtr, uint32 dataSize); }; -} +} // End of namespace Graphics #endif diff --git a/graphics/video/dxa_decoder.h b/graphics/video/dxa_decoder.h index 384a057c3f4..3edcc75ca99 100644 --- a/graphics/video/dxa_decoder.h +++ b/graphics/video/dxa_decoder.h @@ -23,13 +23,6 @@ * */ -/** - * Video decoder used in engines: - * - agos - * - sword1 - * - sword2 - */ - #ifndef GRAPHICS_VIDEO_DXA_PLAYER_H #define GRAPHICS_VIDEO_DXA_PLAYER_H @@ -37,6 +30,14 @@ namespace Graphics { +/** + * Decoder for DXA videos. + * + * Video decoder used in engines: + * - agos + * - sword1 + * - sword2 + */ class DXADecoder : public VideoDecoder { public: DXADecoder(); diff --git a/graphics/video/flic_decoder.h b/graphics/video/flic_decoder.h index 68bf3fb688f..dcfc7a0c34e 100644 --- a/graphics/video/flic_decoder.h +++ b/graphics/video/flic_decoder.h @@ -23,11 +23,6 @@ * */ -/** - * Video decoder used in engines: - * - tucker - */ - #ifndef GRAPHICS_VIDEO_FlicDecoder_H #define GRAPHICS_VIDEO_FlicDecoder_H @@ -41,6 +36,12 @@ namespace Common { namespace Graphics { +/** + * + * Decoder for DXA videos. + * Video decoder used in engines: + * - tucker + */ class FlicDecoder : public VideoDecoder { public: FlicDecoder(); diff --git a/graphics/video/smk_decoder.h b/graphics/video/smk_decoder.h index e28d85119d9..13d0c9d9ffa 100644 --- a/graphics/video/smk_decoder.h +++ b/graphics/video/smk_decoder.h @@ -23,19 +23,6 @@ * */ -/** - * Video decoder used in engines: - * - agos - * - saga - * - scumm (he) - * - sword1 - * - sword2 - */ - -// Based on http://wiki.multimedia.cx/index.php?title=Smacker -// and the FFmpeg Smacker decoder (libavcodec/smacker.c), revision 16143 -// http://svn.ffmpeg.org/ffmpeg/trunk/libavcodec/smacker.c?revision=16143&view=markup - #ifndef GRAPHICS_VIDEO_SMK_PLAYER_H #define GRAPHICS_VIDEO_SMK_PLAYER_H @@ -51,7 +38,18 @@ namespace Graphics { class BigHuffmanTree; /** - * Implementation of a Smacker v2/v4 video decoder + * Decoder for Smacker v2/v4 videos. + * + * Based on http://wiki.multimedia.cx/index.php?title=Smacker + * and the FFmpeg Smacker decoder (libavcodec/smacker.c), revision 16143 + * http://svn.ffmpeg.org/ffmpeg/trunk/libavcodec/smacker.c?revision=16143&view=markup + * + * Video decoder used in engines: + * - agos + * - saga + * - scumm (he) + * - sword1 + * - sword2 */ class SmackerDecoder : public VideoDecoder { public: