xoreos  0.0.5
model_nwn2.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_MODEL_NWN2_H
26 #define GRAPHICS_AURORA_MODEL_NWN2_H
27 
30 
31 namespace Common {
32  class SeekableReadStream;
33 }
34 
35 namespace Graphics {
36 
37 namespace Aurora {
38 
39 class ModelNode_NWN2;
40 
42 class Model_NWN2 : public Model {
43 public:
45  ~Model_NWN2();
46 
48  void setTint(const float tint[3][4]);
49 
51  void setTintFloor(const float tint[3][4]);
53  void setTintWalls(const float tint[3][4]);
54 
55 private:
56  struct PacketKey {
59  };
60 
61  struct ParserContext {
63 
65 
66  State *state;
67 
68  std::list<ModelNode_NWN2 *> nodes;
69 
72 
73  ParserContext(const Common::UString &name);
75 
76  void clear();
77  };
78 
79 
80  void newState(ParserContext &ctx);
81  void addState(ParserContext &ctx);
82 
83  void load(ParserContext &ctx);
84 
85  friend class ModelNode_NWN2;
86 };
87 
88 class ModelNode_NWN2 : public ModelNode {
89 public:
90  ModelNode_NWN2(Model &model);
92 
95 
96  void setTint(const float tint[3][4]);
97 
98 private:
100 
102 
103  float _tint[3][4];
104 
105  void removeTint();
106  void createTint();
107 };
108 
109 } // End of namespace Aurora
110 
111 } // End of namespace Graphics
112 
113 #endif // GRAPHICS_AURORA_MODEL_NWN2_H
Definition: 2dafile.h:39
A class holding an UTF-8 string.
Definition: ustring.h:48
void setTintFloor(const float tint[3][4])
Tint all floor nodes of the model with these tint colors.
Definition: model_nwn2.cpp:102
A real object in the game world.
Definition: types.h:52
Model_NWN2(const Common::UString &name, ModelType type=kModelTypeObject)
Definition: model_nwn2.cpp:83
A 3D model in the NWN2 MDB format.
Definition: model_nwn2.h:42
ModelType
The display type of a model.
Definition: types.h:51
void newState(ParserContext &ctx)
Definition: model_nwn2.cpp:168
A node within a 3D model.
A 3D model of an object.
bool loadSkin(Model_NWN2::ParserContext &ctx)
Definition: model_nwn2.cpp:331
void setTintWalls(const float tint[3][4])
Tint all wall nodes of the model with these tint colors.
Definition: model_nwn2.cpp:112
void setTint(const float tint[3][4])
Definition: model_nwn2.cpp:459
bool loadRigid(Model_NWN2::ParserContext &ctx)
Definition: model_nwn2.cpp:208
void setTint(const float tint[3][4])
Tint the whole model with these tint colors.
Definition: model_nwn2.cpp:96
std::list< ModelNode_NWN2 * > nodes
Definition: model_nwn2.h:68
ParserContext(const Common::UString &name)
Definition: model_nwn2.cpp:60
uint32_t uint32
Definition: types.h:204
Common::SeekableReadStream * mdb
Definition: model_nwn2.h:62
void load(ParserContext &ctx)
Definition: model_nwn2.cpp:125
Interface for a seekable & readable data stream.
Definition: readstream.h:265
void addState(ParserContext &ctx)
Definition: model_nwn2.cpp:174