ScummVM API documentation
bbdou_cursor.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 ILLUSIONS_BBDOU_BBDOU_CURSOR_H
23 #define ILLUSIONS_BBDOU_BBDOU_CURSOR_H
24 
25 #include "illusions/specialcode.h"
26 
27 namespace Illusions {
28 
29 class IllusionsEngine_BBDOU;
30 class BbdouSpecialCode;
31 class Control;
32 
33 struct VerbState {
34  int _cursorState;
35  bool _verbActive[32];
36  uint32 _verbId;
37  bool _isBubbleVisible;
38  uint32 _objectIds[2];
39  int16 _index;
40  bool _flag56;
41  int _minPriority;
42 };
43 
44 struct CursorData {
45  int _mode;
46  int _mode2;
47  uint32 _verbId1;
48  uint32 _progResKeywordId;
49  VerbState _verbState;
50  uint32 _currOverlappedObjectId;
51  uint32 _overlappedObjectId;
52  uint32 _sequenceId;
53  uint32 _sequenceId2;
54  uint32 _holdingObjectId;
55  uint32 _holdingObjectId2;
56  int _visibleCtr;
57  uint32 _causeThreadId1;
58  uint32 _causeThreadId2;
59  int16 _field90;
60  uint _flags;
61  uint32 _currCursorTrackingSequenceId;
62  int16 _idleCtr;
63 };
64 
66  uint32 _objectId;
67  uint32 _sequenceId;
68  CursorSequence() : _objectId(0), _sequenceId(0) {}
69 };
70 
71 const uint kMaxCursorSequences = 100;
72 
73 class BbdouCursor {
74 public:
76  ~BbdouCursor();
77  void init(uint32 objectId, uint32 progResKeywordId);
78  void enable(uint32 objectId);
79  void disable(uint32 objectId);
80  void reset(uint32 objectId);
81  void addCursorSequenceId(uint32 objectId, uint32 sequenceId);
82  uint32 findCursorSequenceId(uint32 objectId);
83  bool updateTrackingCursor(Control *control);
84  void saveInfo();
85  void restoreInfo();
86  void saveBeforeTrackingCursor(Control *control, uint32 sequenceId);
87  void restoreAfterTrackingCursor();
88  uint32 getSequenceId1(int sequenceIndex);
89  uint calcTrackingFlags(Common::Point actorPos, Common::Point trackingLimits);
90  uint calcTrackingCursorIndex(uint trackingFlags);
91  bool getTrackingCursorSequenceId(Control *control, uint32 &outSequenceId);
92 public:
94  BbdouSpecialCode *_bbdou;
95  Control *_control;
96  CursorData _data;
97  CursorSequence _cursorSequences[kMaxCursorSequences];
98  void resetActiveVerbs();
99  void show(Control *control);
100  void hide(uint32 objectId);
101 };
102 
103 } // End of namespace Illusions
104 
105 #endif // ILLUSIONS_BBDOU_BBDOU_CURSOR_H
Definition: bbdou_cursor.h:44
Definition: actor.h:34
Definition: illusions_bbdou.h:60
Definition: rect.h:45
Definition: bbdou_cursor.h:65
Definition: bbdou_cursor.h:33
Definition: actor.h:180
Definition: bbdou_cursor.h:73
Definition: bbdou_specialcode.h:106