ScummVM API documentation
object_settings_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_OBJECT_SETTINGS_XML_PARSER_H
23 #define TETRAEDGE_GAME_OBJECT_SETTINGS_XML_PARSER_H
24 
25 #include "common/formats/xmlparser.h"
26 #include "tetraedge/game/object3d.h"
27 #include "tetraedge/te/te_vector3f32.h"
28 
29 namespace Tetraedge {
30 
32 public:
34  Common::XMLParser(), _textTagType(TagNone), _objectSettings(settings) {}
35 
36  void finalize();
37 
38  // Parser
39  CUSTOM_XML_PARSER(ObjectSettingsXmlParser) {
40  XML_KEY(ObjectsSettings)
41  XML_KEY(Object)
42  XML_PROP(name, true)
43  XML_KEY(modelFileName)
44  KEY_END()
45  XML_KEY(defaultScale)
46  KEY_END()
47  XML_KEY(originOffset)
48  KEY_END()
49  XML_KEY(invertNormals)
50  KEY_END()
51  KEY_END()
52  KEY_END()
53  } PARSER_END()
54 
55 private:
56  // Parser callback methods
57  bool parserCallback_ObjectsSettings(ParserNode *node);
58  bool parserCallback_Object(ParserNode *node);
59  bool parserCallback_modelFileName(ParserNode *node);
60  bool parserCallback_defaultScale(ParserNode *node);
61  bool parserCallback_originOffset(ParserNode *node);
62  bool parserCallback_invertNormals(ParserNode *node);
63  bool textCallback(const Common::String &val) override;
64 
65  enum TextTagType {
66  TagNone,
67  TagModelFileName,
68  TagDefaultScale,
69  TagOriginOffset
70  };
71 
72  TextTagType _textTagType;
73  Object3D::ObjectSettings _curObject;
75 };
76 
77 } // end namespace Tetraedge
78 
79 #endif // TETRAEDGE_GAME_OBJECT_SETTINGS_XML_PARSER_H
Definition: str.h:59
Definition: detection.h:27
bool textCallback(const Common::String &val) override
Definition: xmlparser.h:145
Definition: xmlparser.h:98
Definition: hashmap.h:85
Definition: object3d.h:37
Definition: object_settings_xml_parser.h:31