xoreos  0.0.5
cbgt.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef GRAPHICS_IMAGES_CBGT_H
26 #define GRAPHICS_IMAGES_CBGT_H
27 
28 #include <vector>
29 
30 #include "src/common/ptrvector.h"
31 
33 
34 namespace Common {
35  class SeekableReadStream;
36 }
37 
38 namespace Graphics {
39 
57 class CBGT : public ImageDecoder {
58 public:
61  ~CBGT();
62 
63 private:
65  typedef std::vector<size_t> PaletteIndices;
67 
68  struct ReadContext {
72 
76 
79 
81 
85  };
86 
87  void load(ReadContext &ctx);
88 
89  void readPalettes(ReadContext &ctx);
91  void readCells(ReadContext &ctx);
92 
93  void checkConsistency(ReadContext &ctx);
94 
95  void createImage(uint32 width, uint32 height);
96  void drawImage(ReadContext &ctx);
97 };
98 
99 } // End of namespace Graphics
100 
101 #endif // GRAPHICS_IMAGES_CBGT_H
Common::PtrVector< Common::SeekableReadStream > Cells
Definition: cbgt.h:66
Generic image decoder interface.
void checkConsistency(ReadContext &ctx)
Definition: cbgt.cpp:204
Definition: 2dafile.h:39
Common::SeekableReadStream * twoda
Definition: cbgt.h:71
void drawImage(ReadContext &ctx)
Definition: cbgt.cpp:228
void readPalettes(ReadContext &ctx)
Definition: cbgt.cpp:72
ReadContext(Common::SeekableReadStream &c, Common::SeekableReadStream &p, Common::SeekableReadStream &t)
Definition: cbgt.cpp:39
void load(ReadContext &ctx)
Definition: cbgt.cpp:62
A vector storing pointer to objects, with automatic deletion.
CBGT(Common::SeekableReadStream &cbgt, Common::SeekableReadStream &pal, Common::SeekableReadStream &twoda)
Definition: cbgt.cpp:46
PaletteIndices paletteIndices
Definition: cbgt.h:74
uint32_t uint32
Definition: types.h:204
std::vector< size_t > PaletteIndices
Definition: cbgt.h:65
A generic interface for image decoders.
Definition: decoder.h:48
Loader for CBGT, BioWare&#39;s Compressed BackGround Tiles, an image format found in Sonic, used as area background images.
Definition: cbgt.h:57
Common::SeekableReadStream * pal
Definition: cbgt.h:70
Interface for a seekable & readable data stream.
Definition: readstream.h:265
void readCells(ReadContext &ctx)
Definition: cbgt.cpp:164
Common::PtrVector< byte, Common::DeallocatorArray > Palettes
Definition: cbgt.h:64
Common::SeekableReadStream * cbgt
Definition: cbgt.h:69
void createImage(uint32 width, uint32 height)
Definition: cbgt.cpp:214
void readPaletteIndices(ReadContext &ctx)
Definition: cbgt.cpp:108