ScummVM API documentation
events.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 VOYEUR_EVENTS_H
23 #define VOYEUR_EVENTS_H
24 
25 #include "common/scummsys.h"
26 #include "common/list.h"
27 #include "graphics/surface.h"
28 #include "voyeur/files.h"
29 
30 namespace Voyeur {
31 
32 class VoyeurEngine;
33 class EventsManager;
34 class CMapResource;
35 
36 #define GAME_FRAME_RATE 50
37 #define GAME_FRAME_TIME (1000 / GAME_FRAME_RATE)
38 
39 typedef void (EventsManager::*EventMethodPtr)();
40 
41 class IntNode {
42 public:
43  EventMethodPtr _intFunc;
44  uint16 _curTime;
45  uint16 _timeReset;
46  uint32 _flags;
47 
48  IntNode();
49  IntNode(uint16 curTime, uint16 timeReset, uint16 flags);
50 };
51 
52 class IntData {
53 public:
54  bool _flipWait;
55  int _flashTimer;
56  int _flashStep;
57  bool _hasPalette;
58  bool _skipFading;
59  int _palStartIndex;
60  int _palEndIndex;
61  byte *_palette;
62 
63  IntData();
64 };
65 
67 private:
68  VoyeurEngine *_vm;
69  bool _counterFlag;
70  bool _cursorBlinked;
71  uint32 _gameCounter;
72  uint32 _priorFrameTime;
73  uint32 _recordBlinkCounter; // Original field was called _joe :)
74  Common::List<IntNode *> _intNodes;
75  Common::Point _mousePos;
76 
77  void mainVoyeurIntFunc();
78  void checkForNextFrameCounter();
79  void voyeurTimer();
80  void videoTimer();
81  void vDoFadeInt();
82  void vDoCycleInt();
83  void fadeIntFunc();
84  void addIntNode(IntNode *node);
85  void deleteIntNode(IntNode *node);
86 
90  void showMousePosition();
91 public:
92  IntData _gameData;
93  IntData &_intPtr;
94  IntNode _fadeIntNode;
95  IntNode _fade2IntNode;
96  IntNode _cycleIntNode;
97  IntNode _evIntNode;
98  IntNode _mainIntNode;
99  int _cycleStatus;
100  int _fadeFirstCol, _fadeLastCol;
101  int _fadeCount;
102  int _fadeStatus;
103 
104  bool _leftClick, _rightClick;
105  bool _mouseClicked, _newMouseClicked;
106  bool _newLeftClick, _newRightClick;
107 
108  int _videoDead;
109  int _cycleTime[4];
110  byte *_cycleNext[4];
111  VInitCycleResource *_cyclePtr;
112 
114 
115  void setMousePos(const Common::Point &p) { _mousePos = p; }
116  void startMainClockInt();
117  void sWaitFlip();
118  void vInitColor();
119 
120  void delay(int cycles);
121  void delayClick(int cycles);
122  void pollEvents();
123  void startFade(CMapResource *cMap);
124  void addFadeInt();
125 
126  void setCursor(PictureResource *pic);
127  void setCursor(byte *cursorData, int width, int height, int keyColor);
128  void setCursorColor(int idx, int mode);
129  void showCursor();
130  void hideCursor();
131  Common::Point getMousePos() { return _mousePos; }
132  uint32 getGameCounter() const { return _gameCounter; }
133  void getMouseInfo();
134  void startCursorBlink();
135  void incrementTime(int amt);
136 
137  void stopEvidDim();
138 
139  Common::String getEvidString(int eventIndex);
140 };
141 
142 } // End of namespace Voyeur
143 
144 #endif /* VOYEUR_EVENTS_H */
Definition: voyeur.h:75
Definition: str.h:59
Definition: list.h:44
Definition: files.h:421
Definition: files.h:279
Definition: events.h:52
Definition: events.h:41
Definition: rect.h:45
Definition: files.h:437
Definition: animation.h:38
Definition: events.h:66