mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 07:53:36 +00:00
GOB: Move keyPressed() to Util
This commit is contained in:
parent
dbb70e3d6f
commit
26dd2f5f60
@ -362,8 +362,6 @@ protected:
|
||||
void oGeisha_caress2(OpGobParams ¶ms);
|
||||
|
||||
int16 loadSound(int16 slot);
|
||||
|
||||
bool keyPressed();
|
||||
};
|
||||
|
||||
class Inter_v2 : public Inter_v1 {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user