aboutsummaryrefslogtreecommitdiff
path: root/graphics/cursorman.h
diff options
context:
space:
mode:
authorJody Northup2009-06-05 23:59:40 +0000
committerJody Northup2009-06-05 23:59:40 +0000
commitd65bbe1d7a5efbcf04831dbb68a45ca833db1ae1 (patch)
tree9061e150b7671af93508c1017381e8d7ba3cad3d /graphics/cursorman.h
parentccee18a489ece14c499c4e0c43aeb7fc216451fb (diff)
downloadscummvm-rg350-d65bbe1d7a5efbcf04831dbb68a45ca833db1ae1.tar.gz
scummvm-rg350-d65bbe1d7a5efbcf04831dbb68a45ca833db1ae1.tar.bz2
scummvm-rg350-d65bbe1d7a5efbcf04831dbb68a45ca833db1ae1.zip
Fixes ScummEngine_v70he::setDefaultCursor to work in 16-bit, using a temporary hack.
svn-id: r41204
Diffstat (limited to 'graphics/cursorman.h')
-rw-r--r--graphics/cursorman.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 8ad42fe0d4..b54ef31439 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -64,6 +64,13 @@ public:
*/
void popCursor();
+#ifdef ENABLE_16BIT
+ //HACK This is such a incredible hack
+ //I really need to make the one method
+ //work under multiple bitdepths
+ void pushCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor = 65535, int targetScale = 1);
+ void popCursor16();
+#endif
/**
* Replace the current cursor on the stack. If the stack is empty, the
* cursor is pushed instead. It's a slightly more optimized way of
@@ -137,7 +144,37 @@ public:
private:
friend class Common::Singleton<SingletonBaseType>;
CursorManager();
+#ifdef ENABLE_16BIT
+ struct Cursor16 {
+ byte *_data;
+ bool _visible;
+ uint _width;
+ uint _height;
+ int _hotspotX;
+ int _hotspotY;
+ uint16 _keycolor;
+ byte _targetScale;
+
+ uint _size;
+ Cursor16(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor = 65535, int targetScale = 1) {
+ _size = w * h * 2;
+ _data = new byte[_size];
+ if (data && _data)
+ memcpy(_data, data, _size);
+ _width = w;
+ _height = h;
+ _hotspotX = hotspotX;
+ _hotspotY = hotspotY;
+ _keycolor = keycolor;
+ _targetScale = targetScale;
+ }
+
+ ~Cursor16() {
+ delete[] _data;
+ }
+ };
+#endif
struct Cursor {
byte *_data;
bool _visible;
@@ -197,6 +234,9 @@ private:
};
Common::Stack<Cursor *> _cursorStack;
+#ifdef ENABLE_16BIT
+ Common::Stack<Cursor16 *> _cursor16Stack;
+#endif
Common::Stack<Palette *> _cursorPaletteStack;
};