ScummVM API documentation
hivecontrol.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 ASYLUM_PUZZLES_HIVECONTROL_H
23 #define ASYLUM_PUZZLES_HIVECONTROL_H
24 
25 #include "common/hashmap.h"
26 
27 #include "asylum/puzzles/puzzle.h"
28 
29 namespace Asylum {
30 
31 class AsylumEngine;
32 
33 enum Control {
34  kControlNone = -1,
35  kControlWingsButton1 = 34,
36  kControlWingsButton2 = 35,
37  kControlWingsButton3 = 36,
38  kControlReset = 38,
39  kControlWheelLeft = 39,
40  kControlWheelRight = 40,
41  kControlButtonRight = 41,
42  kControlButtonLeft = 42,
43  kControlGlyph1 = 49,
44  kControlGlyph2 = 50,
45  kControlGlyph3 = 51,
46  kControlGlyph4 = 52,
47  kControlGlyph5 = 53,
48  kControlGlyph6 = 54
49 };
50 
51 static const uint32 puzzleHiveControlHieroglyphs[2][6] = {
52  {5, 12, 22, 13, 20, 6},
53  {21, 4, 14, 13, 20, 6}
54 };
55 
56 class PuzzleHiveControl : public Puzzle {
57 public:
60 
61  // Serializable
62  virtual void saveLoadWithSerializer(Common::Serializer &s);
63 
64 private:
65  enum Element {
66  kElementSwirl = 31,
67  kElementFlyHead = 32,
68  kElementResetDynamic = 33,
69  kElementLever = 37,
70  kElementWingLeft1 = 43,
71  kElementWingRight1 = 44,
72  kElementWingLeft2 = 45,
73  kElementWingRight2 = 46,
74  kElementWingLeft3 = 47,
75  kElementWingRight3 = 48,
76  kElementLensLeft = 55,
77  kElementLensRight = 56,
78  kElementIndicator = 57,
79  kElementSwirlRim = 71,
80  kElementResetStatic = 72
81  };
82 
83  int32 _soundVolume;
84  int32 _rectIndex;
85  uint32 _counter;
86 
87  int32 _data_457260;
88  int32 _data_457264;
89 
90  uint32 _frameIndexes[73];
92 
93  bool _resetFlag;
94  bool _wingsState[3];
95  bool _glyphFlags[2][6];
96  Control _currentControl;
97  uint32 _colorL, _colorR;
98  uint32 _frameIndexOffset;
99  uint32 _leverPosition, _prevLeverPosition, _leverDelta;
100 
102  // Event Handling
104  bool init(const AsylumEvent &evt);
105  void updateScreen();
106  bool mouseLeftDown(const AsylumEvent &evt);
107  bool exitPuzzle();
108 
110  // Helpers
112  void updateCursor();
113  Control findControl();
114  void playSound();
115  void reset();
116  bool hitTest1(Control control, const Common::Point &point, const Common::Point &location);
117 };
118 
119 } // End of namespace Asylum
120 
121 #endif // ASYLUM_PUZZLES_HIVECONTROL_H
Definition: asylum.h:53
Definition: serializer.h:79
Definition: eventhandler.h:43
Definition: rect.h:45
Definition: asylum.h:73
Definition: puzzle.h:41
Definition: hivecontrol.h:56