ScummVM API documentation
wam_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 CRYOMNI3D_WAM_PARSER_H
23#define CRYOMNI3D_WAM_PARSER_H
24
25#include "common/array.h"
26#include "common/rect.h"
27#include "common/str.h"
28
29namespace Common {
30class ReadStream;
31}
32
33namespace CryOmni3D {
34
35class Omni3DManager;
36
37struct Zone {
38 uint zoneId;
39 uint action;
40 Common::Rect rct;
41};
42
43struct Transition {
44 uint dstId;
45 double srcAlpha;
46 double srcBeta;
47 double dstAlpha;
48 double dstBeta;
50 uint getNumAnimations() const { return animations.size(); }
51};
52
53struct Place {
54 uint placeId;
56 Common::Array<Transition> transitions;
58
59 uint getNumStates() const { return warps.size(); }
60 uint getNumTransitions() const { return transitions.size(); }
61 void setupWarpConstraints(Omni3DManager &omni3d) const;
62 uint hitTest(const Common::Point &point) const;
63 const Transition *findTransition(uint nextPlaceId) const;
64};
65
66class WAMParser {
67public:
68 void loadStream(Common::ReadStream &stream);
69 const Place *findPlaceById(uint placeId) const;
70
71private:
72 // For duplicate finding
73 // We use a different name because else it gets chosen before the const one and fails because it's private
74 Place *findPlaceById_(uint placeId);
76};
77
78} // End of namespace CryOmni3D
79
80#endif
size_type size() const
Definition: array.h:316
Definition: stream.h:385
Definition: omni3d.h:29
Definition: wam_parser.h:66
Definition: algorithm.h:29
Definition: cryomni3d.h:62
Definition: rect.h:144
Definition: rect.h:536
Definition: wam_parser.h:53
Definition: wam_parser.h:43
Definition: wam_parser.h:37