xoreos
0.0.5
src
graphics
images
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
32
#include "
src/graphics/images/decoder.h
"
33
34
namespace
Common
{
35
class
SeekableReadStream;
36
}
37
38
namespace
Graphics
{
39
57
class
CBGT
:
public
ImageDecoder
{
58
public
:
59
CBGT
(
Common::SeekableReadStream
&cbgt,
Common::SeekableReadStream
&pal,
60
Common::SeekableReadStream
&twoda);
61
~CBGT
();
62
63
private
:
64
typedef
Common::PtrVector<byte, Common::DeallocatorArray>
Palettes
;
65
typedef
std::vector<size_t>
PaletteIndices
;
66
typedef
Common::PtrVector<Common::SeekableReadStream>
Cells
;
67
68
struct
ReadContext
{
69
Common::SeekableReadStream
*
cbgt
;
70
Common::SeekableReadStream
*
pal
;
71
Common::SeekableReadStream
*
twoda
;
72
73
Palettes
palettes
;
74
PaletteIndices
paletteIndices
;
75
Cells
cells
;
76
77
uint32
width
;
78
uint32
height
;
79
80
size_t
maxPaletteIndex
;
81
82
ReadContext
(
Common::SeekableReadStream
&c,
83
Common::SeekableReadStream
&p,
84
Common::SeekableReadStream
&t);
85
};
86
87
void
load
(
ReadContext
&ctx);
88
89
void
readPalettes
(
ReadContext
&ctx);
90
void
readPaletteIndices
(
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
Graphics::CBGT::Cells
Common::PtrVector< Common::SeekableReadStream > Cells
Definition:
cbgt.h:66
Graphics::CBGT::~CBGT
~CBGT()
Definition:
cbgt.cpp:59
decoder.h
Generic image decoder interface.
Graphics::CBGT::checkConsistency
void checkConsistency(ReadContext &ctx)
Definition:
cbgt.cpp:204
Common
Definition:
2dafile.h:39
Graphics::CBGT::ReadContext::twoda
Common::SeekableReadStream * twoda
Definition:
cbgt.h:71
Graphics::CBGT::ReadContext::cells
Cells cells
Definition:
cbgt.h:75
Graphics::CBGT::drawImage
void drawImage(ReadContext &ctx)
Definition:
cbgt.cpp:228
Graphics::CBGT::ReadContext
Definition:
cbgt.h:68
Graphics::CBGT::readPalettes
void readPalettes(ReadContext &ctx)
Definition:
cbgt.cpp:72
Graphics::CBGT::ReadContext::ReadContext
ReadContext(Common::SeekableReadStream &c, Common::SeekableReadStream &p, Common::SeekableReadStream &t)
Definition:
cbgt.cpp:39
Graphics::CBGT::load
void load(ReadContext &ctx)
Definition:
cbgt.cpp:62
Common::PtrVector< byte, Common::DeallocatorArray >
Graphics::CBGT::ReadContext::maxPaletteIndex
size_t maxPaletteIndex
Definition:
cbgt.h:80
Graphics::CBGT::ReadContext::height
uint32 height
Definition:
cbgt.h:78
Graphics::CBGT::ReadContext::width
uint32 width
Definition:
cbgt.h:77
ptrvector.h
A vector storing pointer to objects, with automatic deletion.
Graphics::CBGT::CBGT
CBGT(Common::SeekableReadStream &cbgt, Common::SeekableReadStream &pal, Common::SeekableReadStream &twoda)
Definition:
cbgt.cpp:46
Graphics::CBGT::ReadContext::paletteIndices
PaletteIndices paletteIndices
Definition:
cbgt.h:74
uint32
uint32_t uint32
Definition:
types.h:204
Graphics::CBGT::PaletteIndices
std::vector< size_t > PaletteIndices
Definition:
cbgt.h:65
Graphics::ImageDecoder
A generic interface for image decoders.
Definition:
decoder.h:48
Graphics
Definition:
loadprogress.h:33
Graphics::CBGT
Loader for CBGT, BioWare's Compressed BackGround Tiles, an image format found in Sonic, used as area background images.
Definition:
cbgt.h:57
Graphics::CBGT::ReadContext::pal
Common::SeekableReadStream * pal
Definition:
cbgt.h:70
Common::SeekableReadStream
Interface for a seekable & readable data stream.
Definition:
readstream.h:265
Graphics::CBGT::readCells
void readCells(ReadContext &ctx)
Definition:
cbgt.cpp:164
Graphics::CBGT::Palettes
Common::PtrVector< byte, Common::DeallocatorArray > Palettes
Definition:
cbgt.h:64
Graphics::CBGT::ReadContext::cbgt
Common::SeekableReadStream * cbgt
Definition:
cbgt.h:69
Graphics::CBGT::ReadContext::palettes
Palettes palettes
Definition:
cbgt.h:73
Graphics::CBGT::createImage
void createImage(uint32 width, uint32 height)
Definition:
cbgt.cpp:214
Graphics::CBGT::readPaletteIndices
void readPaletteIndices(ReadContext &ctx)
Definition:
cbgt.cpp:108
Generated on Sun Nov 18 2018 15:13:41 for xoreos by
1.8.14