ScummVM API documentation
fist_control.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 ZVISION_FIST_CONTROL_H
23 #define ZVISION_FIST_CONTROL_H
24 
25 #include "common/array.h"
26 #include "common/rect.h"
27 #include "zvision/scripting/control.h"
28 
29 namespace Video {
30  class VideoDecoder;
31 }
32 
33 namespace ZVision {
34 
35 // Only used in Zork Nemesis, handles the door lock puzzle with the skeletal fingers (td9e)
36 class FistControl : public Control {
37 public:
38  FistControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream);
39  ~FistControl() override;
40 
41 private:
42  uint32 _fiststatus;
43  int _fistnum;
44  int16 _cursor;
45  int _order;
46 
49 
50  int32 _numEntries;
51 
52  struct entries {
53  uint32 _bitsStrt;
54  uint32 _bitsEnd;
55  int32 _anmStrt;
56  int32 _anmEnd;
57  int32 _sound;
58  };
59 
60  Common::Array<entries> _entries;
61 
62  Video::VideoDecoder *_animation;
63  Common::Rect _anmRect;
64  int32 _soundKey;
65  int32 _animationId;
66 
67 public:
68  bool onMouseUp(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) override;
69  bool onMouseMove(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) override;
70  bool process(uint32 deltaTimeInMillis) override;
71 
72 private:
73  void readDescFile(const Common::Path &fileName);
74  void clearFistArray(Common::Array< Common::Array<Common::Rect> > &arr);
75  uint32 readBits(const char *str);
76  int mouseIn(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos);
77  void getFistParams(const Common::String &inputStr, Common::String &parameter, Common::String &values);
78 };
79 
80 } // End of namespace ZVision
81 
82 #endif
Definition: str.h:59
Definition: control.h:43
Definition: fist_control.h:36
Definition: array.h:52
Definition: rect.h:524
Definition: path.h:52
Definition: stream.h:745
Definition: focus_list.h:27
Definition: video_decoder.h:53
Definition: rect.h:144
Definition: avi_frames.h:36