ScummVM API documentation
cdtoons.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef IMAGE_CODECS_CDTOONS_H
23 #define IMAGE_CODECS_CDTOONS_H
24 
25 #include "image/codecs/codec.h"
26 
27 #include "common/hashmap.h"
28 
29 namespace Image {
30 
31 struct CDToonsBlock {
32  uint16 flags;
33  uint32 size;
34  uint16 startFrame;
35  uint16 endFrame;
36  uint16 unknown12;
37  byte *data;
38 };
39 
45 class CDToonsDecoder : public Codec {
46 public:
47  CDToonsDecoder(uint16 width, uint16 height);
48  ~CDToonsDecoder() override;
49 
50  Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream) override;
52  bool containsPalette() const override { return true; }
53  const byte *getPalette() override { _dirtyPalette = false; return _palette; }
54  bool hasDirtyPalette() const override { return _dirtyPalette; }
55 
56 private:
57  Graphics::Surface *_surface;
58  byte _palette[256 * 3];
59  bool _dirtyPalette;
60  uint16 _currentPaletteId;
61 
63 
64  void renderBlock(byte *data, uint size, int x, int y, uint width, uint height);
65  void setPalette(byte *data);
66 };
67 
68 } // End of namespace Image
69 
70 #endif
Definition: surface.h:67
bool containsPalette() const override
Definition: cdtoons.h:52
Definition: pixelformat.h:138
Definition: cdtoons.h:45
Definition: stream.h:745
Definition: codec.h:57
Definition: cdtoons.h:31
bool hasDirtyPalette() const override
Definition: cdtoons.h:54
Definition: hashmap.h:85
Graphics::PixelFormat getPixelFormat() const override
Definition: cdtoons.h:51
const byte * getPalette() override
Definition: cdtoons.h:53
Definition: movie_decoder.h:32
static PixelFormat createFormatCLUT8()
Definition: pixelformat.h:184