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 
32 namespace Sci {
33 
35 public:
36  GfxCursor32();
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 
96  void setRestrictedArea(const Common::Rect &rect);
97 
101  void clearRestrictedArea();
102 
103  void saveLoadWithSerializer(Common::Serializer &ser) override;
104 
105 protected:
111 
116 
117 private:
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 
221 public:
222  virtual void setMacCursorRemapList(int cursorCount, reg_t *cursors) {}
223 };
224 
225 } // End of namespace Sci
226 
227 #endif // SCI_GRAPHICS_CURSOR32_H
int _hideCount
Definition: cursor32.h:115
bool deviceMoved(Common::Point &position)
virtual void donePainting()
Definition: rect.h:144
void setPosition(const Common::Point &position)
void setRestrictedArea(const Common::Rect &rect)
Definition: serializer.h:79
void clearRestrictedArea()
Definition: celobj32.h:64
void init(const Buffer &outputBuffer)
virtual void show()
Definition: rect.h:45
virtual void setView(const GuiResourceId viewId, const int16 loopNo, const int16 celNo)
Definition: console.h:28
Definition: serializer.h:308
virtual void gonnaPaint(Common::Rect paintRect)
virtual void hide()
virtual void paintStarting()
Definition: display_client.h:113
virtual void unhide()
Definition: vm_types.h:39
CelInfo32 _cursorInfo
Definition: cursor32.h:110
Definition: cursor32.h:34