ScummVM API documentation
gpointer.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  * Based on the original sources
22  * Faery Tale II -- The Halls of the Dead
23  * (c) 1993-1996 The Wyrmkeep Entertainment Co.
24  */
25 
26 #ifndef SAGA2_GPOINTER_H
27 #define SAGA2_GPOINTER_H
28 
29 #include "saga2/vdraw.h"
30 
31 namespace Saga2 {
32 
34  gPixelMap *_pointerImage, // pointer to current mouse image
35  _saveMap; // memory to backsave to
36  gPort _savePort; // port to save to
37  gDisplayPort *_videoPort; // port to render to
38  Rect16 _saveExtent; // extent of backsave
39  int16 _hideCount; // mouse hiding nesting level
40  Point16 _currentPosition, // where real coords are
41  _offsetPosition; // center of mouse image
42  bool _shown; // mouse currently shown
43 
44  void draw();
45  void restore();
46 public:
47  gMousePointer(gDisplayPort &); // constructor
48  ~gMousePointer(); // destructor
49 
50  bool init(Point16 pointerLimits);
51  bool init(uint16 xLimit, uint16 yLimit) {
52  return init(Point16(xLimit, yLimit));
53  }
54  void show(); // show the pointer
55  void hide(); // hide the pointer
56  void show(gPort &port, Rect16 r); // show the pointer
57  void hide(gPort &port, Rect16 r); // hide the pointer
58  int manditoryShow();
59  void move(Point16 pos); // move the pointer
60  void setImage(gPixelMap &img, int x, int y); // set the pointer imagery
61  bool isShown() {
62  return _shown;
63  }
64  int16 hideDepth() {
65  return _hideCount;
66  }
67  gPixelMap *getImage(Point16 &offset) {
68  offset = _offsetPosition;
69  return _pointerImage;
70  }
71  gPixelMap *getImageCurPos(Point16 &curPos) {
72  curPos = _currentPosition;
73  return _pointerImage;
74  }
75  gPixelMap *getSaveMap(Rect16 &save) {
76  save = _saveExtent;
77  return &_saveMap;
78  }
79 };
80 
81 } // end of namespace Saga2
82 
83 #endif // SAGA2_POINTER_H
Definition: gpointer.h:33
Definition: actor.h:32
Definition: gdraw.h:56
Definition: gdraw.h:178
Definition: vdraw.h:33
Definition: rect.h:42
Definition: rect.h:290