aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/minigames
diff options
context:
space:
mode:
authorSven Hesse2011-09-04 19:34:38 +0200
committerSven Hesse2011-09-14 18:54:28 +0200
commitac3593c63143e7bea9dfab6b237a812186c9dcee (patch)
tree052804813f1196c36d31685637e71e34492330b7 /engines/gob/minigames
parent00a5ccfce09d02e55515ef9e0e25a7e7b1f74c39 (diff)
downloadscummvm-rg350-ac3593c63143e7bea9dfab6b237a812186c9dcee.tar.gz
scummvm-rg350-ac3593c63143e7bea9dfab6b237a812186c9dcee.tar.bz2
scummvm-rg350-ac3593c63143e7bea9dfab6b237a812186c9dcee.zip
GOB: Init "Diving" cursor
Diffstat (limited to 'engines/gob/minigames')
-rw-r--r--engines/gob/minigames/geisha/diving.cpp23
-rw-r--r--engines/gob/minigames/geisha/diving.h1
2 files changed, 24 insertions, 0 deletions
diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp
index c3a8a30328..f0eae3219c 100644
--- a/engines/gob/minigames/geisha/diving.cpp
+++ b/engines/gob/minigames/geisha/diving.cpp
@@ -52,6 +52,7 @@ Diving::~Diving() {
bool Diving::play(uint16 playerCount, bool hasPearlLocation) {
init();
initScreen();
+ initCursor();
_vm->_draw->blitInvalidated();
_vm->_video->retrace();
@@ -88,6 +89,8 @@ bool Diving::play(uint16 playerCount, bool hasPearlLocation) {
(*o)->advance();
}
+ _vm->_draw->animateCursor(1);
+
_vm->_draw->blitInvalidated();
_vm->_util->waitEndFrame();
@@ -135,6 +138,9 @@ void Diving::init() {
}
void Diving::deinit() {
+ _vm->_draw->_cursorHotspotX = -1;
+ _vm->_draw->_cursorHotspotY = -1;
+
delete _heart;
delete _lungs;
delete _water;
@@ -169,6 +175,23 @@ void Diving::initScreen() {
_vm->_draw->dirtiedRect(_vm->_draw->_backSurface, 0, 0, 319, 199);
}
+void Diving::initCursor() {
+ const int index = _vm->_draw->_cursorIndex;
+
+ const int16 left = index * _vm->_draw->_cursorWidth;
+ const int16 top = 0;
+ const int16 right = left + _vm->_draw->_cursorWidth - 1;
+ const int16 bottom = _vm->_draw->_cursorHeight - 1;
+
+ _vm->_draw->_cursorSprites->fillRect(left, top, right, bottom, 0);
+
+ _objects->draw(*_vm->_draw->_cursorSprites, 31, 0, left, top);
+ _vm->_draw->_cursorAnimLow[index] = 0;
+
+ _vm->_draw->_cursorHotspotX = 8;
+ _vm->_draw->_cursorHotspotY = 8;
+}
+
void Diving::foundBlackPearl() {
_blackPearlCount++;
diff --git a/engines/gob/minigames/geisha/diving.h b/engines/gob/minigames/geisha/diving.h
index 9975b0f53f..023ac919a7 100644
--- a/engines/gob/minigames/geisha/diving.h
+++ b/engines/gob/minigames/geisha/diving.h
@@ -64,6 +64,7 @@ private:
void deinit();
void initScreen();
+ void initCursor();
void foundBlackPearl();
void foundWhitePearl();