ScummVM API documentation
hotspots.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 MADS_HOTSPOTS_H
23 #define MADS_HOTSPOTS_H
24 
25 #include "common/scummsys.h"
26 #include "mads/events.h"
27 #include "mads/player.h"
28 
29 namespace MADS {
30 
31 class MADSEngine;
32 
34 public:
35  bool _active;
36  int _seqIndex;
37  int _animIndex;
38  Common::Rect _bounds;
39  Common::Point _feetPos;
40  Facing _facing;
41  int _descId;
42  int _verbId;
43  bool _valid; // V2
44  int _articleNumber;
45  byte _syntax; // V2
46  CursorType _cursor;
47 
52 
57 };
58 
59 #define DYNAMIC_HOTSPOTS_SIZE 16
60 
61 #define SYNTAX_SINGULAR 0
62 #define SYNTAX_PLURAL 1
63 #define SYNTAX_PARTITIVE 2
64 #define SYNTAX_SINGULAR_MASC 3
65 #define SYNTAX_SINGULAR_FEM 4
66 #define SYNTAX_SINGULAR_LIVING 5
67 #define SYNTAX_MASC_NOT_PROPER 6
68 #define SYNTAX_FEM_NOT_PROPER 7
69 #define MAX_SYNTAX 8
70 
72 private:
73  MADSEngine *_vm;
75  int _count;
76 public:
77  bool _changed;
78 public:
80 
81  Common::Array<MADS::DynamicHotspot>::size_type size() const { return _entries.size(); }
82  DynamicHotspot &operator[](uint idx) { return _entries[idx]; }
83  int add(int descId, int verbId, byte syntax, int seqIndex, const Common::Rect &bounds); // V2
84  int add(int descId, int verbId, int seqIndex, const Common::Rect &bounds);
85  int setPosition(int index, const Common::Point &pos, Facing facing);
86  int setCursor(int index, CursorType cursor);
87  void remove(int index);
88  void clear();
89  void reset();
90  void refresh();
91 
96  DynamicHotspot &get(int index);
97 
102 };
103 
104 class Hotspot {
105 public:
106  Common::Rect _bounds;
107  Common::Point _feetPos;
108  Facing _facing;
109  int _articleNumber;
110  bool _active;
111  byte _syntax; // V2
112  CursorType _cursor;
113  int _vocabId;
114  int _verbId;
115 
116  Hotspot();
117  Hotspot(Common::SeekableReadStream &f, bool isV2);
118 };
119 
120 class Hotspots : public Common::Array<Hotspot> {
121 private:
122  MADSEngine *_vm;
123 public:
124  Hotspots(MADSEngine *vm) : _vm(vm) {}
125 
129  void activate(int vocabId, bool active);
130 
134  void activateAtPos(int vocabId, bool active, Common::Point pos);
135 
136 };
137 
138 } // End of namespace MADS
139 
140 #endif /* MADS_HOTSPOTS_H */
void synchronize(Common::Serializer &s)
Definition: array.h:52
Definition: hotspots.h:33
Definition: rect.h:144
Definition: stream.h:745
Definition: hotspots.h:120
Definition: serializer.h:79
Definition: rect.h:45
size_type size() const
Definition: array.h:315
Definition: hotspots.h:71
Definition: mads.h:87
Facing
Definition: player.h:40
Definition: action.h:28
uint size_type
Definition: array.h:59
Definition: hotspots.h:104