xoreos
0.0.5
src
graphics
aurora
pltfile.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_AURORA_PLTFILE_H
26
#define GRAPHICS_AURORA_PLTFILE_H
27
28
#include "
src/common/scopedptr.h
"
29
30
#include "
src/aurora/aurorafile.h
"
31
32
#include "
src/graphics/aurora/texture.h
"
33
34
namespace
Graphics
{
35
36
class
Surface;
37
38
namespace
Aurora
{
39
40
class
PLTFile
:
public
::Aurora::AuroraFile
,
public
Texture
{
41
public
:
42
enum
Layer
{
43
kLayerSkin
= 0,
44
kLayerHair
= 1,
45
kLayerMetal1
= 2,
46
kLayerMetal2
= 3,
47
kLayerCloth1
= 4,
48
kLayerCloth2
= 5,
49
kLayerLeather1
= 6,
50
kLayerLeather2
= 7,
51
kLayerTattoo1
= 8,
52
kLayerTattoo2
= 9,
53
kLayerMAX
54
};
55
56
~PLTFile
();
57
59
void
setLayerColor
(
Layer
layer,
uint8
color);
61
void
rebuild
();
62
63
bool
isDynamic
()
const
;
64
bool
reload
();
65
66
67
private
:
68
Common::UString
_name
;
69
70
Surface
*
_surface
;
71
72
Common::ScopedArray<uint8>
_dataImage
;
73
Common::ScopedArray<uint8>
_dataLayers
;
74
75
uint8
_colors
[
kLayerMAX
];
76
77
78
PLTFile
(
const
Common::UString
&name,
Common::SeekableReadStream
&plt);
79
80
void
load
(
Common::SeekableReadStream
&plt);
81
void
build
();
82
83
static
ImageDecoder
*
getLayerPalette
(
uint32
layer,
uint8
row);
84
static
void
getColorRows
(
byte
rows[4 * 256 *
kLayerMAX
],
const
uint8
colors[
kLayerMAX
]);
85
86
friend
class
Texture
;
87
};
88
89
}
// End of namespace Aurora
90
91
}
// End of namespace Graphics
92
93
#endif // GRAPHICS_AURORA_PLTFILE_H
Graphics::Aurora::PLTFile::build
void build()
Definition:
pltfile.cpp:147
Graphics::Aurora::PLTFile::kLayerHair
Definition:
pltfile.h:44
Common::UString
A class holding an UTF-8 string.
Definition:
ustring.h:48
Graphics::Aurora::PLTFile::_dataLayers
Common::ScopedArray< uint8 > _dataLayers
Definition:
pltfile.h:73
Graphics::Aurora::PLTFile::_dataImage
Common::ScopedArray< uint8 > _dataImage
Definition:
pltfile.h:72
uint8
uint8_t uint8
Definition:
types.h:200
Graphics::Aurora::PLTFile::kLayerMAX
Definition:
pltfile.h:53
Graphics::Aurora::PLTFile::_colors
uint8 _colors[kLayerMAX]
Definition:
pltfile.h:75
Graphics::Aurora::PLTFile::getColorRows
static void getColorRows(byte rows[4 *256 *kLayerMAX], const uint8 colors[kLayerMAX])
Definition:
pltfile.cpp:203
Graphics::Aurora::PLTFile::kLayerTattoo1
Definition:
pltfile.h:51
Graphics::Aurora::PLTFile::kLayerMetal2
Definition:
pltfile.h:46
Graphics::Aurora::PLTFile
Definition:
pltfile.h:40
scopedptr.h
A simple scoped smart pointer template.
Graphics::Aurora::PLTFile::~PLTFile
~PLTFile()
Definition:
pltfile.cpp:79
Graphics::Aurora::PLTFile::kLayerMetal1
Definition:
pltfile.h:45
Graphics::Aurora::PLTFile::Layer
Layer
Definition:
pltfile.h:42
Aurora
Definition:
2dafile.cpp:51
Graphics::Aurora::Texture
A texture.
Definition:
texture.h:48
aurorafile.h
Base for BioWare's Aurora engine files.
Graphics::Aurora::PLTFile::kLayerSkin
Definition:
pltfile.h:43
Graphics::Aurora::PLTFile::kLayerLeather2
Definition:
pltfile.h:50
Graphics::Aurora::PLTFile::getLayerPalette
static ImageDecoder * getLayerPalette(uint32 layer, uint8 row)
Load a specific layer palette image and perform some sanity checks.
Definition:
pltfile.cpp:180
Graphics::Aurora::PLTFile::kLayerTattoo2
Definition:
pltfile.h:52
Graphics::Aurora::PLTFile::setLayerColor
void setLayerColor(Layer layer, uint8 color)
Set the color of one layer within this layer texture.
Definition:
pltfile.cpp:91
Graphics::Aurora::PLTFile::_name
Common::UString _name
Definition:
pltfile.h:68
Graphics::Aurora::PLTFile::kLayerCloth1
Definition:
pltfile.h:47
Graphics::Aurora::PLTFile::reload
bool reload()
Try to reload the texture.
Definition:
pltfile.cpp:86
texture.h
A texture as used in the Aurora engines.
uint32
uint32_t uint32
Definition:
types.h:204
Graphics::Aurora::PLTFile::_surface
Surface * _surface
Definition:
pltfile.h:70
Aurora::AuroraFile
Base class for most files found in games using BioWare's Aurora engine.
Definition:
aurorafile.h:52
Graphics::ImageDecoder
A generic interface for image decoders.
Definition:
decoder.h:48
Common::ScopedArray< uint8 >
Graphics::Surface
Definition:
surface.h:32
Graphics::Aurora::PLTFile::isDynamic
bool isDynamic() const
Is this a dynamic texture, or a shared static one?
Definition:
pltfile.cpp:82
Graphics::Aurora::PLTFile::kLayerCloth2
Definition:
pltfile.h:48
Graphics::Aurora::PLTFile::load
void load(Common::SeekableReadStream &plt)
Definition:
pltfile.cpp:102
Graphics
Definition:
loadprogress.h:33
Common::SeekableReadStream
Interface for a seekable & readable data stream.
Definition:
readstream.h:265
Graphics::Aurora::PLTFile::kLayerLeather1
Definition:
pltfile.h:49
Graphics::Aurora::PLTFile::rebuild
void rebuild()
Rebuild the combined texture image.
Definition:
pltfile.cpp:97
byte
uint8 byte
Definition:
types.h:209
Graphics::Aurora::PLTFile::PLTFile
PLTFile(const Common::UString &name, Common::SeekableReadStream &plt)
Definition:
pltfile.cpp:70
Generated on Sun Nov 18 2018 15:13:41 for xoreos by
1.8.14