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/nebular/core/events.h"
27 #include "mads/nebular/core/player.h"
28 
29 namespace MADS {
30 namespace Nebular {
31 
32 class RexNebularEngine;
33 
35 public:
36  bool _active;
37  int _seqIndex;
38  int _animIndex;
39  Common::Rect _bounds;
40  Common::Point _feetPos;
41  Facing _facing;
42  int _descId;
43  int _verbId;
44  bool _valid; // V2
45  int _articleNumber;
46  byte _syntax; // V2
47  CursorType _cursor;
48 
53 
58 };
59 
60 #define DYNAMIC_HOTSPOTS_SIZE 16
61 
62 #define SYNTAX_SINGULAR 0
63 #define SYNTAX_PLURAL 1
64 #define SYNTAX_PARTITIVE 2
65 #define SYNTAX_SINGULAR_MASC 3
66 #define SYNTAX_SINGULAR_FEM 4
67 #define SYNTAX_SINGULAR_LIVING 5
68 #define SYNTAX_MASC_NOT_PROPER 6
69 #define SYNTAX_FEM_NOT_PROPER 7
70 #define MAX_SYNTAX 8
71 
73 private:
74  RexNebularEngine *_vm;
76  int _count;
77 public:
78  bool _changed;
79 public:
81 
83  return _entries.size();
84  }
85  DynamicHotspot &operator[](uint idx) {
86  return _entries[idx];
87  }
88  int add(int descId, int verbId, byte syntax, int seqIndex, const Common::Rect &bounds); // V2
89  int add(int descId, int verbId, int seqIndex, const Common::Rect &bounds);
90  int setPosition(int index, const Common::Point &pos, Facing facing);
91  int setCursor(int index, CursorType cursor);
92  void remove(int index);
93  void clear();
94  void reset();
95  void refresh();
96 
101  DynamicHotspot &get(int index);
102 
107 };
108 
109 class Hotspot {
110 public:
111  Common::Rect _bounds;
112  Common::Point _feetPos;
113  Facing _facing;
114  int _articleNumber;
115  bool _active;
116  byte _syntax; // V2
117  CursorType _cursor;
118  int _vocabId;
119  int _verbId;
120 
121  Hotspot();
122  Hotspot(Common::SeekableReadStream &f, bool isV2);
123 };
124 
125 class Hotspots : public Common::Array<Hotspot> {
126 private:
127  RexNebularEngine *_vm;
128 public:
129  Hotspots(RexNebularEngine *vm) : _vm(vm) {
130  }
131 
135  void activate(int vocabId, bool active);
136 
140  void activateAtPos(int vocabId, bool active, Common::Point pos);
141 
142 };
143 
144 } // namespace Nebular
145 } // namespace MADS
146 
147 #endif
Definition: nebular.h:51
Definition: hotspots.h:34
Definition: array.h:52
Definition: hotspots.h:125
Definition: rect.h:524
Definition: stream.h:745
Definition: serializer.h:80
void synchronize(Common::Serializer &s)
Definition: rect.h:144
size_type size() const
Definition: array.h:316
Definition: sound_manager.h:38
Definition: hotspots.h:109
uint size_type
Definition: array.h:62
Definition: hotspots.h:72