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  * 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 GROOVIE_CURSOR_H
23 #define GROOVIE_CURSOR_H
24 
25 #include "common/array.h"
26 #include "common/system.h"
27 
28 namespace Common {
29 class MacResManager;
30 }
31 
32 namespace Groovie {
33 
34 class Cursor {
35 public:
36  virtual ~Cursor() {}
37  uint16 getFrames() { return _numFrames; }
38  virtual void enable() = 0;
39  virtual void showFrame(uint16 frame) = 0;
40 
41 protected:
42  uint16 _width;
43  uint16 _height;
44  uint16 _hotspotX;
45  uint16 _hotspotY;
46  uint16 _numFrames;
47 };
48 
49 class GrvCursorMan {
50 public:
51  GrvCursorMan(OSystem *system);
52  virtual ~GrvCursorMan();
53 
54  virtual void show(bool visible);
55  virtual void animate();
56  virtual void setStyle(uint16 newStyle);
57  virtual uint16 getStyle();
58 
59 protected:
60  OSystem *_syst;
61 
62  // Animation variables
63  uint8 _lastFrame;
64  uint32 _lastTime;
65 
66  // Styles
67  Common::Array<Cursor *> _cursors;
68  uint16 _current;
69  Cursor *_cursor;
70 };
71 
73 public:
74  GrvCursorMan_t7g(OSystem *system, Common::MacResManager *macResFork = 0);
75  ~GrvCursorMan_t7g() override;
76 
77 private:
78  // Styles data
79  static const uint _cursorImg[];
80  static const uint _cursorPal[];
81 
82  // Cursors data
83  Common::Array<byte *> _images;
84  Common::Array<byte *> _palettes;
85 
86  // Loading functions
87  byte *loadImage(Common::SeekableReadStream &file);
88  byte *loadPalette(Common::SeekableReadStream &file);
89 };
90 
91 class GrvCursorMan_v2 : public GrvCursorMan {
92 public:
93  GrvCursorMan_v2(OSystem *system);
94  ~GrvCursorMan_v2() override;
95 
96  void animate() override;
97  void setStyle(uint16 newStyle) override;
98 
99 private:
100  Cursor *_cursor2;
101  uint8 _lastFrame2;
102 };
103 
104 } // End of Groovie namespace
105 
106 #endif // GROOVIE_CURSOR_H
Definition: macresman.h:125
Definition: array.h:52
Definition: cursor.h:34
Definition: cursor.h:72
Definition: stream.h:745
Definition: cursor.h:91
Definition: algorithm.h:29
Definition: cursor.h:49
Definition: system.h:161
Definition: cursor.h:32