diff options
author | uruk | 2013-08-16 17:29:22 +0200 |
---|---|---|
committer | uruk | 2013-08-16 17:29:22 +0200 |
commit | dc1e9022b1c6276af8065e72260b8ae9084bcd57 (patch) | |
tree | 53bf55f4f83e85d5995e017870edc3b69872dc90 /engines | |
parent | 5e2627542af823c4faad7350a56fab097d10b5b8 (diff) | |
download | scummvm-rg350-dc1e9022b1c6276af8065e72260b8ae9084bcd57.tar.gz scummvm-rg350-dc1e9022b1c6276af8065e72260b8ae9084bcd57.tar.bz2 scummvm-rg350-dc1e9022b1c6276af8065e72260b8ae9084bcd57.zip |
AVALANCHE: Add AvalancheEngine::getMousePos(), remove Gyro::hopto(), implement Scrolls::dodgem() and Scrolls::undodgem().
Diffstat (limited to 'engines')
-rw-r--r-- | engines/avalanche/avalanche.cpp | 4 | ||||
-rw-r--r-- | engines/avalanche/avalanche.h | 2 | ||||
-rw-r--r-- | engines/avalanche/gyro2.cpp | 4 | ||||
-rw-r--r-- | engines/avalanche/gyro2.h | 2 | ||||
-rw-r--r-- | engines/avalanche/scrolls2.cpp | 20 | ||||
-rw-r--r-- | engines/avalanche/scrolls2.h | 6 |
6 files changed, 16 insertions, 22 deletions
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 922f701981..8196065bef 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -147,7 +147,9 @@ bool AvalancheEngine::getEvent(Common::Event &event) { return _eventMan->pollEvent(event); } - +Common::Point AvalancheEngine::getMousePos() { + return _eventMan->getMousePos(); +} diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index 1eea813182..2f20393faf 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -115,6 +115,8 @@ public: bool getEvent(Common::Event &event); // A warpper around _eventMan->pollEvent(), se we can use it in Scrolls::normscroll() for example. + Common::Point getMousePos(); + protected: // Engine APIs Common::Error run(); diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index 96b45b44e5..fa95a538c7 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -291,10 +291,6 @@ void Gyro::xycheck() { warning("STUB: Gyro::xycheck()"); } -void Gyro::hopto(int16 x, int16 y) { - warning("STUB: Gyro::hopto()"); -} - void Gyro::check() { warning("STUB: Gyro::check()"); } diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h index f5dc209040..7ddfe62de4 100644 --- a/engines/avalanche/gyro2.h +++ b/engines/avalanche/gyro2.h @@ -621,8 +621,6 @@ public: void xycheck(); // Only updates mx & my, not all other mouse vars. - void hopto(int16 x, int16 y); // Moves mouse pointer to x,y. - void check(); void note(uint16 hertz); diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp index a5dd7d088f..4e7507a7d3 100644 --- a/engines/avalanche/scrolls2.cpp +++ b/engines/avalanche/scrolls2.cpp @@ -260,19 +260,15 @@ void Scrolls::dingdongbell() { /* Pussy's in the well. Who put her in? Little. _vm->_lucerna->errorled(); /* ring the bell "x" times */ } -void Scrolls::dodgem() { /* This moves the mouse pointer off the scroll so that you can read it. */ - _vm->_gyro->xycheck(); /* Mx & my now contain xy pos of mouse */ - dodgex = _vm->_gyro->mx; - dodgey = _vm->_gyro->my; /* Store 'em */ - _vm->_gyro->hopto(dodgex, _vm->_gyro->underscroll); /* Move the pointer off the scroll. */ +void Scrolls::dodgem() { + dodgeCoord = _vm->getMousePos(); + g_system->warpMouse(dodgeCoord.x, _vm->_gyro->underscroll); // Move the pointer off the scroll. } -void Scrolls::undodgem() { /* This is the opposite of Dodgem. It moves the - mouse pointer back, IF you haven't moved it in the meantime. */ - _vm->_gyro->xycheck(); - if ((_vm->_gyro->mx == dodgex) && (_vm->_gyro->my == _vm->_gyro->underscroll)) - /* No change, so restore the pointer's original position. */ - _vm->_gyro->hopto(dodgex, dodgey); +void Scrolls::undodgem() { + Common::Point actCoord = _vm->getMousePos(); + if ((actCoord.x == dodgeCoord.x) && (actCoord.y == _vm->_gyro->underscroll)) + g_system->warpMouse(dodgeCoord.x, dodgeCoord.y); // No change, so restore the pointer's original position. } void Scrolls::geticon(int16 x, int16 y, byte which) { @@ -446,7 +442,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t my += 12; } - _vm->_gyro->underscroll = my + 3; + _vm->_gyro->underscroll = my * 2 + 12 + 1; // Multiplying because of the doubled screen height. //setvisualpage(1 - cp); dingdongbell(); //my = getpixel(0, 0); diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h index b90f280ae7..c16d983a4f 100644 --- a/engines/avalanche/scrolls2.h +++ b/engines/avalanche/scrolls2.h @@ -108,7 +108,7 @@ private: byte cfont; // Current font - int16 dodgex, dodgey; + Common::Point dodgeCoord; byte param; // For using arguments code byte use_icon; @@ -133,9 +133,9 @@ private: void dingdongbell(); - void dodgem(); + void dodgem(); // This moves the mouse pointer off the scroll so that you can read it. - void undodgem(); + void undodgem(); // This is the opposite of Dodgem. It moves the mouse pointer back, IF you haven't moved it in the meantime. void geticon(int16 x, int16 y, byte which); |