ScummVM API documentation
safedialpuzzle.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 NANCY_ACTION_SAFEDIALPUZZLE_H
23 #define NANCY_ACTION_SAFEDIALPUZZLE_H
24 
25 #include "engines/nancy/action/actionrecord.h"
26 
27 namespace Nancy {
28 namespace Action {
29 
30 // Handles the nancy3 safe puzzle with Chinese characters on the dial,
31 // as well as nancy4's sextant puzzle
33 public:
35  virtual ~SafeDialPuzzle() {}
36 
37  void init() override;
38  void updateGraphics() override;
39 
40  void readData(Common::SeekableReadStream &stream) override;
41  void execute() override;
42  void handleInput(NancyInput &input) override;
43 
44 protected:
45  enum AnimState { kNone, kSpin, kSelect, kReset, kResetAnim };
46  Common::String getRecordTypeName() const override { return "SafeDialPuzzle"; }
47  bool isViewportRelative() const override { return true; }
48 
49  void drawDialFrame(uint frame);
50  void pushSequence(uint id);
51 
52  Common::Path _imageName1;
53  Common::Path _imageName2;
54  Common::Path _resetImageName;
55 
56  bool _enableWraparound = true;
57 
58  Common::Rect _dialDest;
59 
61 
62  Common::Rect _resetDest;
63  Common::Rect _resetSrc;
64  Common::Rect _arrowDest;
65  Common::Rect _arrowSrc;
66 
67  Common::Array<Common::Rect> _resetDialSrcs;
68 
69  uint16 _resetTurns = 0;
70 
71  Common::Array<uint16> _correctSequence;
72 
73  Common::Rect _ccwHotspot;
74  Common::Rect _cwHotspot;
75 
76  bool _useMoveArrows = false;
77 
78  SoundDescription _spinSound;
79  SoundDescription _selectSound;
80  SoundDescription _resetSound;
81 
82  SceneChangeWithFlag _solveScene;
83  uint _solveSoundDelay = 0;
84  SoundDescription _solveSound;
85 
86  SceneChangeWithFlag _exitScene;
87  Common::Rect _exitHotspot;
88 
89  Graphics::ManagedSurface _image1, _image2, _resetImage;
90 
91  uint _numInbetweens = 1;
92 
93  Common::Array<uint16> _playerSequence;
94  bool _solved = false;
95  AnimState _animState = kNone;
96  uint32 _nextAnim = 0;
97  uint16 _current = 0;
98 };
99 
100 } // End of namespace Action
101 } // End of namespace Nancy
102 
103 #endif // NANCY_ACTION_SAFEDIALPUZZLE_H
Definition: managed_surface.h:51
Definition: str.h:59
Definition: safedialpuzzle.h:32
Definition: rect.h:144
Definition: path.h:52
Definition: stream.h:745
Definition: input.h:41
Definition: commontypes.h:171
Definition: actionrecord.h:149
Definition: commontypes.h:254
Definition: actionmanager.h:32