ScummVM API documentation
cursor_manager.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 ZVISION_CURSOR_MANAGER_H
23 #define ZVISION_CURSOR_MANAGER_H
24 
25 #include "zvision/graphics/cursors/cursor.h"
26 
27 #include "common/str.h"
28 
29 namespace Graphics {
30 struct PixelFormat;
31 }
32 
33 namespace ZVision {
34 
35 class ZVision;
36 
41  CursorIndex_Active = 0,
42  CursorIndex_DownArr = 3,
43  CursorIndex_HandPu = 6,
44  CursorIndex_Idle = 11,
45  CursorIndex_Left = 12,
46  CursorIndex_Right = 13,
47  CursorIndex_UpArr = 17,
48  CursorIndex_ItemIdle = 18,
49  CursorIndex_ItemAct = 19
50 };
51 
59 public:
60  CursorManager(ZVision *engine, const Graphics::PixelFormat pixelFormat);
61 
62 private:
63  static const int NUM_CURSORS = 18;
64 
65  // 18 default cursors in up/down states, +2 for items idle/act cursors
66  ZorkCursor _cursors[NUM_CURSORS + 2][2];
67 
68  ZVision *_engine;
69  const Graphics::PixelFormat _pixelFormat;
70  bool _cursorIsPushed;
71  int _item;
72  int _lastitem;
73  int _currentCursor;
74 
75  static const char *_cursorNames[];
76  static const char *_zgiCursorFileNames[];
77  static const char *_zNemCursorFileNames[];
78 
79 public:
81  void initialize();
82 
89  void changeCursor(int id);
90 
98  int getCursorId(const Common::String &name);
99 
106  void setItemID(int id);
107 
113  void cursorDown(bool pushed);
114 
120  void showMouse(bool vis);
121 
122 private:
128  void changeCursor(const ZorkCursor &cursor);
129 };
130 
131 } // End of namespace ZVision
132 
133 #endif
Definition: str.h:59
Definition: pixelformat.h:138
Definition: clock.h:29
CursorIndex
Definition: cursor_manager.h:40
Definition: cursor.h:38
Definition: formatinfo.h:28
Definition: cursor_manager.h:58