aboutsummaryrefslogtreecommitdiff
path: root/graphics/cursorman.cpp
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.cpp
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.cpp')
-rw-r--r--graphics/cursorman.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 84578a3911..5fe58314b3 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -56,6 +56,33 @@ bool CursorManager::showMouse(bool visible) {
// Should work, even if there's just a dummy cursor on the stack.
return g_system->showMouse(visible);
}
+#ifdef ENABLE_16BIT
+void CursorManager::pushCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor, int targetScale) {
+ Cursor16 *cur = new Cursor16(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
+
+ cur->_visible = isVisible();
+ _cursor16Stack.push(cur);
+
+ if (buf) {
+ g_system->setMouseCursor16(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale);
+ }
+}
+
+void CursorManager::popCursor16() {
+ if (_cursor16Stack.empty())
+ return;
+
+ Cursor16 *cur = _cursor16Stack.pop();
+ delete cur;
+
+ if (!_cursorStack.empty()) {
+ cur = _cursor16Stack.top();
+ g_system->setMouseCursor16(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale);
+ }
+
+ g_system->showMouse(isVisible());
+}
+#endif
void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
@@ -104,7 +131,7 @@ void CursorManager::popAllCursors() {
//HACK Made a separate method to avoid massive linker errors on every engine
void CursorManager::replaceCursor16(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint16 keycolor, int targetScale) {
if (_cursorStack.empty()) {
- pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
+ pushCursor16(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
return;
}