aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/pregob/pregob.cpp
diff options
context:
space:
mode:
authorSven Hesse2012-06-28 17:45:02 +0200
committerSven Hesse2012-07-30 01:44:42 +0200
commit27782700a5631a25129b12779abb540a906f6a96 (patch)
tree9c3fc6374dcc626a8696d29cde3973489b973d61 /engines/gob/pregob/pregob.cpp
parent38fe3c3cd9e656b3e3f2b35011895d6703a1a896 (diff)
downloadscummvm-rg350-27782700a5631a25129b12779abb540a906f6a96.tar.gz
scummvm-rg350-27782700a5631a25129b12779abb540a906f6a96.tar.bz2
scummvm-rg350-27782700a5631a25129b12779abb540a906f6a96.zip
GOB: Add some PreGob and Once Upon A Time cursor functions
Diffstat (limited to 'engines/gob/pregob/pregob.cpp')
-rw-r--r--engines/gob/pregob/pregob.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/engines/gob/pregob/pregob.cpp b/engines/gob/pregob/pregob.cpp
index aea290214c..18aac50352 100644
--- a/engines/gob/pregob/pregob.cpp
+++ b/engines/gob/pregob/pregob.cpp
@@ -20,9 +20,12 @@
*
*/
+#include "graphics/cursorman.h"
+
#include "gob/gob.h"
#include "gob/global.h"
#include "gob/util.h"
+#include "gob/surface.h"
#include "gob/palanim.h"
#include "gob/draw.h"
#include "gob/video.h"
@@ -90,4 +93,48 @@ void PreGob::setPalette(const byte *palette, uint16 size) {
_vm->_video->setFullPalette(_vm->_global->_pPaletteDesc);
}
+void PreGob::addCursor() {
+ CursorMan.pushCursor(0, 0, 0, 0, 0, 0);
+}
+
+void PreGob::removeCursor() {
+ CursorMan.popCursor();
+}
+
+void PreGob::setCursor(Surface &sprite, int16 hotspotX, int16 hotspotY) {
+ CursorMan.replaceCursor(sprite.getData(), sprite.getWidth(), sprite.getHeight(), hotspotX, hotspotY, 0);
+}
+
+void PreGob::setCursor(Surface &sprite, int16 left, int16 top, int16 right, int16 bottom,
+ int16 hotspotX, int16 hotspotY) {
+
+ const int width = right - left + 1;
+ const int height = bottom - top + 1;
+
+ if ((width <= 0) || (height <= 0))
+ return;
+
+ Surface cursor(width, height, 1);
+
+ cursor.blit(sprite, left, top, right, bottom, 0, 0);
+
+ setCursor(cursor, hotspotX, hotspotX);
+}
+
+void PreGob::showCursor() {
+ CursorMan.showMouse(true);
+
+ _vm->_draw->_showCursor = 4;
+}
+
+void PreGob::hideCursor() {
+ CursorMan.showMouse(false);
+
+ _vm->_draw->_showCursor = 0;
+}
+
+bool PreGob::isCursorVisible() const {
+ return CursorMan.isVisible();
+}
+
} // End of namespace Gob