ScummVM API documentation
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  * Additional copyright for this file:
8  * Copyright (C) 1995-1997 Presto Studios, Inc.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef PEGASUS_CURSOR_H
26 #define PEGASUS_CURSOR_H
27 
28 #include "common/array.h"
29 #include "common/rect.h"
30 
31 #include "pegasus/timers.h"
32 
33 namespace Graphics {
34  struct Surface;
35 }
36 
37 namespace Pegasus {
38 
39 // The original cursor code was in the graphics code directly,
40 // unlike ScummVM where we have the cursor code separate. We're
41 // going to go with CursorManager here and therefore not inherit
42 // from the Sprite class.
43 
44 class Cursor : private Idler {
45 public:
46  Cursor();
47  ~Cursor() override;
48 
49  void addCursorFrames(uint16 id);
50 
51  void setCurrentFrameIndex(int32 index);
52  int32 getCurrentFrameIndex() const;
53 
54  void show();
55  void hide();
56  void hideUntilMoved();
57  bool isVisible();
58 
59  void getCursorLocation(Common::Point &) const;
60 
61 protected:
62  void useIdleTime() override;
63 
64 private:
65  struct CursorInfo {
66  uint16 tag;
67  Common::Point hotspot;
68  Graphics::Surface *surface;
69  byte *palette;
70  uint16 colorCount;
71  };
72 
73  Common::Point _cursorLocation;
75  bool _cursorObscured;
76  int _index;
77 
78  void loadCursorImage(CursorInfo &cursorInfo);
79 };
80 
81 } // End of namespace Pegasus
82 
83 #endif
Definition: timers.h:37
Definition: surface.h:67
Definition: formatinfo.h:28
Definition: rect.h:45
Definition: cursor.h:44
Definition: ai_action.h:33