ScummVM API documentation
in_game_scene_xml_parser.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef TETRAEDGE_GAME_IN_GAME_SCENE_XML_PARSER_H
23 #define TETRAEDGE_GAME_IN_GAME_SCENE_XML_PARSER_H
24 
25 #include "tetraedge/te/te_xml_parser.h"
26 #include "tetraedge/game/in_game_scene.h"
27 
28 namespace Tetraedge {
29 
35 public:
37  : _scene(scene), _textNodeType(TextNodeNone) {}
38 
39  // NOTE: This doesn't handle snowCustom tag which was
40  // added in original but commented out in every place.
41  CUSTOM_XML_PARSER(InGameSceneXmlParser) {
42  XML_KEY(scene)
43  XML_KEY(camera)
44  XML_PROP(name, true)
45  KEY_END()
46  XML_KEY(pathZone)
47  XML_PROP(name, true)
48  XML_KEY(gridSize)
49  KEY_END()
50  KEY_END()
51  XML_KEY(curve)
52  XML_PROP(name, true)
53  KEY_END()
54  XML_KEY(dummy)
55  XML_PROP(name, true)
56  XML_KEY(position)
57  KEY_END()
58  KEY_END()
59  XML_KEY(mask)
60  XML_PROP(name, true)
61  XML_PROP(texture, true)
62  KEY_END()
63  XML_KEY(dynamicLight)
64  XML_PROP(name, true)
65  XML_PROP(texture, true)
66  KEY_END()
67  XML_KEY(rippleMask)
68  XML_PROP(name, true)
69  XML_PROP(texture, true)
70  KEY_END()
71  XML_KEY(snowCone)
72  XML_PROP(name, true)
73  KEY_END()
74  XML_KEY(shadowMask)
75  XML_PROP(name, true)
76  XML_PROP(texture, true)
77  KEY_END()
78  XML_KEY(shadowReceivingObject)
79  XML_PROP(name, true)
80  KEY_END()
81  XML_KEY(zBufferObject)
82  XML_PROP(name, true)
83  KEY_END()
84  XML_KEY(rObject)
85  XML_PROP(name, true)
86  KEY_END()
87  XML_KEY(rBB)
88  XML_PROP(name, true)
89  KEY_END()
90  XML_KEY(light)
91  XML_PROP(name, true)
92  KEY_END()
93  XML_KEY(flamme)
94  XML_KEY(name)
95  XML_PROP(value, true)
96  KEY_END()
97  XML_KEY(center)
98  XML_PROP(x, true)
99  XML_PROP(y, true)
100  XML_PROP(z, true)
101  KEY_END()
102  XML_KEY(yMax)
103  XML_PROP(x, true)
104  XML_PROP(y, true)
105  XML_PROP(z, true)
106  KEY_END()
107  XML_KEY(offsetMin)
108  XML_PROP(x, true)
109  XML_PROP(y, true)
110  XML_PROP(z, true)
111  KEY_END()
112  XML_KEY(offsetMax)
113  XML_PROP(x, true)
114  XML_PROP(y, true)
115  XML_PROP(z, true)
116  KEY_END()
117  KEY_END()
118  XML_KEY(collisionSlide)
119  KEY_END()
120  XML_KEY(coliisionSlide)
121  KEY_END()
122  XML_KEY(noCollisionSlide)
123  KEY_END()
124  KEY_END()
125  } PARSER_END()
126 
127  bool parserCallback_scene(ParserNode *node) { return true; }
128  bool parserCallback_camera(ParserNode *node);
129  bool parserCallback_pathZone(ParserNode *node);
130  bool parserCallback_gridSize(ParserNode *node);
131  bool parserCallback_curve(ParserNode *node);
132  bool parserCallback_dummy(ParserNode *node);
133  bool parserCallback_position(ParserNode *node);
134  bool parserCallback_mask(ParserNode *node);
135  bool parserCallback_dynamicLight(ParserNode *node);
136  bool parserCallback_rippleMask(ParserNode *node);
137  bool parserCallback_snowCone(ParserNode *node);
138  bool parserCallback_shadowMask(ParserNode *node);
139  bool parserCallback_shadowReceivingObject(ParserNode *node);
140  bool parserCallback_zBufferObject(ParserNode *node);
141  bool parserCallback_rObject(ParserNode *node);
142  bool parserCallback_rBB(ParserNode *node);
143  bool parserCallback_light(ParserNode *node);
144  bool parserCallback_collisionSlide(ParserNode *node);
145  bool parserCallback_coliisionSlide(ParserNode *node);
146  bool parserCallback_noCollisionSlide(ParserNode *node);
147 
148  // Flamme and its children.
149  bool parserCallback_flamme(ParserNode *node);
150  bool parserCallback_name(ParserNode *node);
151  bool parserCallback_center(ParserNode *node);
152  bool parserCallback_yMax(ParserNode *node);
153  bool parserCallback_offsetMin(ParserNode *node);
154  bool parserCallback_offsetMax(ParserNode *node);
155 
156  virtual bool closedKeyCallback(ParserNode *node) override;
157  virtual bool textCallback(const Common::String &val) override;
158 
159 public:
160  InGameScene *_scene;
161 
162  // Free Move Zones have to be handled separately just to handle a single
163  // corner case where the grid size is overridden.
164  TeVector2f32 _fmzGridSize;
165 
166  enum TextNodeType {
167  TextNodeNone,
168  TextNodePosition,
169  TextNodeGridSize
170  };
171 
172  TextNodeType _textNodeType;
173 
174 };
175 
176 } // end namespace Tetraedge
177 
178 #endif // TETRAEDGE_GAME_IN_GAME_SCENE_XML_PARSER_H
Definition: str.h:59
Definition: detection.h:27
Definition: xmlparser.h:145
virtual bool textCallback(const Common::String &val) override
Definition: te_xml_parser.h:38
Definition: in_game_scene_xml_parser.h:34
Definition: te_vector2f32.h:32
virtual bool closedKeyCallback(ParserNode *node) override
Definition: in_game_scene.h:48