diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/inter.h | 2 | ||||
-rw-r--r-- | engines/gob/inter_geisha.cpp | 14 | ||||
-rw-r--r-- | engines/gob/util.cpp | 12 | ||||
-rw-r--r-- | engines/gob/util.h | 1 |
4 files changed, 14 insertions, 15 deletions
diff --git a/engines/gob/inter.h b/engines/gob/inter.h index c84cc384ce..d1c28fcb2f 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -362,8 +362,6 @@ protected: void oGeisha_caress2(OpGobParams ¶ms); int16 loadSound(int16 slot); - - bool keyPressed(); }; class Inter_v2 : public Inter_v1 { diff --git a/engines/gob/inter_geisha.cpp b/engines/gob/inter_geisha.cpp index 6c3e97c2a7..d72dd798a4 100644 --- a/engines/gob/inter_geisha.cpp +++ b/engines/gob/inter_geisha.cpp @@ -82,18 +82,6 @@ void Inter_Geisha::oGeisha_loadCursor(OpFuncParams ¶ms) { o1_loadCursor(params); } -bool Inter_Geisha::keyPressed() { - int16 key = _vm->_util->checkKey(); - if (key) - return true; - - int16 x, y; - MouseButtons buttons; - - _vm->_util->getMouseState(&x, &y, &buttons); - return buttons != kMouseButtonsNone; -} - struct TOTTransition { const char *to; const char *from; @@ -134,7 +122,7 @@ void Inter_Geisha::oGeisha_loadTot(OpFuncParams ¶ms) { } if (needWait) - while (!keyPressed()) + while (!_vm->_util->keyPressed()) _vm->_util->longDelay(1); } diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp index 58dfc9c7ad..7f9c6131fd 100644 --- a/engines/gob/util.cpp +++ b/engines/gob/util.cpp @@ -257,6 +257,18 @@ bool Util::checkKey(int16 &key) { return true; } +bool Util::keyPressed() { + int16 key = checkKey(); + if (key) + return true; + + int16 x, y; + MouseButtons buttons; + + getMouseState(&x, &y, &buttons); + return buttons != kMouseButtonsNone; +} + void Util::getMouseState(int16 *pX, int16 *pY, MouseButtons *pButtons) { Common::Point mouse = g_system->getEventManager()->getMousePos(); *pX = mouse.x + _vm->_video->_scrollOffsetX - _vm->_video->_screenDeltaX; diff --git a/engines/gob/util.h b/engines/gob/util.h index 7c1e44c0f6..4228dac768 100644 --- a/engines/gob/util.h +++ b/engines/gob/util.h @@ -108,6 +108,7 @@ public: int16 getKey(); int16 checkKey(); bool checkKey(int16 &key); + bool keyPressed(); void getMouseState(int16 *pX, int16 *pY, MouseButtons *pButtons); void setMousePos(int16 x, int16 y); |