ScummVM API documentation
cursor32.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 SCI_GRAPHICS_CURSOR32_H
23#define SCI_GRAPHICS_CURSOR32_H
24
25#include "common/array.h" // for Array
26#include "common/rect.h" // for Point, Rect
27#include "common/scummsys.h" // for int16, byte, uint8
28#include "common/serializer.h" // for Serializable, Serializer (ptr only)
29#include "sci/graphics/celobj32.h" // for CelInfo32
30#include "sci/graphics/helpers.h" // for GuiResourceId
31
32namespace Sci {
33
35public:
37 ~GfxCursor32() override;
38
43 void init(const Buffer &outputBuffer);
44
48 bool deviceMoved(Common::Point &position);
49
54 virtual void gonnaPaint(Common::Rect paintRect);
55
59 virtual void paintStarting();
60
65 virtual void donePainting();
66
71 virtual void hide();
72
76 virtual void unhide();
77
81 virtual void show();
82
86 virtual void setView(const GuiResourceId viewId, const int16 loopNo, const int16 celNo);
87
91 void setPosition(const Common::Point &position);
92
97
102
103 void saveLoadWithSerializer(Common::Serializer &ser) override;
104
105protected:
111
116
117private:
118 struct DrawRegion {
119 Common::Rect rect;
120 byte *data;
121
122 DrawRegion() : data(nullptr) {}
123 };
124
129 DrawRegion _cursorBack;
130
134 DrawRegion _scratch1;
135
139 DrawRegion _scratch2;
140
144 DrawRegion _screenRegion;
145
150 DrawRegion _savedScreenRegion;
151
155 DrawRegion _cursor;
156
160 int16 _width, _height;
161
165 Buffer _screen;
166
170 Common::Point _position;
171
176 Common::Point _hotSpot;
177
181 Common::Rect _restrictedArea;
182
187 bool _needsPaint;
188
192 void copyFromScreen(DrawRegion &target);
193
202 template <bool SKIP>
203 void copy(DrawRegion &target, const DrawRegion &source);
204
209 void revealCursor();
210
214 void drawToScreen(const DrawRegion &source);
215
219 virtual void move();
220
221public:
222 virtual void setMacCursorRemapList(int cursorCount, reg_t *cursors) {}
223};
224
225} // End of namespace Sci
226
227#endif // SCI_GRAPHICS_CURSOR32_H
Definition: display_client.h:113
Definition: serializer.h:352
Definition: serializer.h:80
Definition: cursor32.h:34
bool deviceMoved(Common::Point &position)
virtual void donePainting()
virtual void show()
virtual void hide()
void setRestrictedArea(const Common::Rect &rect)
int _hideCount
Definition: cursor32.h:115
virtual void paintStarting()
virtual void gonnaPaint(Common::Rect paintRect)
CelInfo32 _cursorInfo
Definition: cursor32.h:110
void clearRestrictedArea()
void init(const Buffer &outputBuffer)
virtual void setView(const GuiResourceId viewId, const int16 loopNo, const int16 celNo)
virtual void unhide()
void setPosition(const Common::Point &position)
Definition: console.h:28
Definition: rect.h:144
Definition: rect.h:536
Definition: celobj32.h:64
Definition: vm_types.h:39