aboutsummaryrefslogtreecommitdiff
path: root/engines
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
parent00a5ccfce09d02e55515ef9e0e25a7e7b1f74c39 (diff)
downloadscummvm-rg350-ac3593c63143e7bea9dfab6b237a812186c9dcee.tar.gz
scummvm-rg350-ac3593c63143e7bea9dfab6b237a812186c9dcee.tar.bz2
scummvm-rg350-ac3593c63143e7bea9dfab6b237a812186c9dcee.zip
GOB: Init "Diving" cursor
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/draw.cpp3
-rw-r--r--engines/gob/draw.h3
-rw-r--r--engines/gob/draw_v1.cpp3
-rw-r--r--engines/gob/draw_v2.cpp3
-rw-r--r--engines/gob/minigames/geisha/diving.cpp23
-rw-r--r--engines/gob/minigames/geisha/diving.h1
6 files changed, 36 insertions, 0 deletions
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp
index 580696523f..4b659f51de 100644
--- a/engines/gob/draw.cpp
+++ b/engines/gob/draw.cpp
@@ -107,6 +107,9 @@ Draw::Draw(GobEngine *vm) : _vm(vm) {
_cursorHotspotXVar = -1;
_cursorHotspotYVar = -1;
+ _cursorHotspotX = -1;
+ _cursorHotspotY = -1;
+
_cursorAnim = 0;
for (int i = 0; i < 40; i++) {
_cursorAnimLow[i] = 0;
diff --git a/engines/gob/draw.h b/engines/gob/draw.h
index 57faefa314..393822c33a 100644
--- a/engines/gob/draw.h
+++ b/engines/gob/draw.h
@@ -133,6 +133,9 @@ public:
int32 _cursorHotspotXVar;
int32 _cursorHotspotYVar;
+ int32 _cursorHotspotX;
+ int32 _cursorHotspotY;
+
SurfacePtr _cursorSprites;
SurfacePtr _cursorSpritesBack;
SurfacePtr _scummvmCursor;
diff --git a/engines/gob/draw_v1.cpp b/engines/gob/draw_v1.cpp
index 064c74958a..8cb88b522c 100644
--- a/engines/gob/draw_v1.cpp
+++ b/engines/gob/draw_v1.cpp
@@ -112,6 +112,9 @@ void Draw_v1::animateCursor(int16 cursor) {
if (_cursorHotspotXVar != -1) {
newX -= hotspotX = (uint16) VAR(_cursorIndex + _cursorHotspotXVar);
newY -= hotspotY = (uint16) VAR(_cursorIndex + _cursorHotspotYVar);
+ } else if (_cursorHotspotX != -1) {
+ newX -= hotspotX = _cursorHotspotX;
+ newY -= hotspotY = _cursorHotspotY;
}
_scummvmCursor->clear();
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp
index 151ed42526..6e64d6fd06 100644
--- a/engines/gob/draw_v2.cpp
+++ b/engines/gob/draw_v2.cpp
@@ -138,6 +138,9 @@ void Draw_v2::animateCursor(int16 cursor) {
if (_cursorHotspotXVar != -1) {
newX -= hotspotX = (uint16) VAR(_cursorIndex + _cursorHotspotXVar);
newY -= hotspotY = (uint16) VAR(_cursorIndex + _cursorHotspotYVar);
+ } else if (_cursorHotspotX != -1) {
+ newX -= hotspotX = _cursorHotspotX;
+ newY -= hotspotY = _cursorHotspotY;
}
_scummvmCursor->clear();
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();