xoreos  0.0.5
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 
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 {
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:
69 
71 
74 
76 
77 
79 
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
A class holding an UTF-8 string.
Definition: ustring.h:48
Common::ScopedArray< uint8 > _dataLayers
Definition: pltfile.h:73
Common::ScopedArray< uint8 > _dataImage
Definition: pltfile.h:72
uint8_t uint8
Definition: types.h:200
uint8 _colors[kLayerMAX]
Definition: pltfile.h:75
static void getColorRows(byte rows[4 *256 *kLayerMAX], const uint8 colors[kLayerMAX])
Definition: pltfile.cpp:203
A simple scoped smart pointer template.
Base for BioWare&#39;s Aurora engine files.
static ImageDecoder * getLayerPalette(uint32 layer, uint8 row)
Load a specific layer palette image and perform some sanity checks.
Definition: pltfile.cpp:180
void setLayerColor(Layer layer, uint8 color)
Set the color of one layer within this layer texture.
Definition: pltfile.cpp:91
Common::UString _name
Definition: pltfile.h:68
bool reload()
Try to reload the texture.
Definition: pltfile.cpp:86
A texture as used in the Aurora engines.
uint32_t uint32
Definition: types.h:204
Base class for most files found in games using BioWare&#39;s Aurora engine.
Definition: aurorafile.h:52
A generic interface for image decoders.
Definition: decoder.h:48
bool isDynamic() const
Is this a dynamic texture, or a shared static one?
Definition: pltfile.cpp:82
void load(Common::SeekableReadStream &plt)
Definition: pltfile.cpp:102
Interface for a seekable & readable data stream.
Definition: readstream.h:265
void rebuild()
Rebuild the combined texture image.
Definition: pltfile.cpp:97
uint8 byte
Definition: types.h:209
PLTFile(const Common::UString &name, Common::SeekableReadStream &plt)
Definition: pltfile.cpp:70