mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-24 03:24:50 +00:00
GOB: Keep the mouse responsive while waiting for the frame to end
This commit is contained in:
parent
1cb6cc0218
commit
b5fa752b78
@ -505,7 +505,7 @@ bool Penetration::play(bool hasAccessPass, bool hasMaxEnergy, bool testMode) {
|
||||
// Draw, fade in if necessary and wait for the end of the frame
|
||||
_vm->_draw->blitInvalidated();
|
||||
fadeIn();
|
||||
_vm->_util->waitEndFrame();
|
||||
_vm->_util->waitEndFrame(false);
|
||||
|
||||
// Handle the input
|
||||
checkInput();
|
||||
|
@ -367,21 +367,29 @@ void Util::notifyNewAnim() {
|
||||
_startFrameTime = getTimeKey();
|
||||
}
|
||||
|
||||
void Util::waitEndFrame() {
|
||||
void Util::waitEndFrame(bool handleInput) {
|
||||
int32 time;
|
||||
|
||||
_vm->_video->waitRetrace();
|
||||
|
||||
time = getTimeKey() - _startFrameTime;
|
||||
if ((time > 1000) || (time < 0)) {
|
||||
_vm->_video->retrace();
|
||||
_startFrameTime = getTimeKey();
|
||||
return;
|
||||
}
|
||||
|
||||
int32 toWait = _frameWaitTime - time;
|
||||
int32 toWait = 0;
|
||||
do {
|
||||
if (toWait > 0)
|
||||
delay(MIN<int>(toWait, 10));
|
||||
|
||||
if (toWait > 0)
|
||||
delay(toWait);
|
||||
if (handleInput)
|
||||
processInput();
|
||||
|
||||
_vm->_video->retrace();
|
||||
|
||||
time = getTimeKey() - _startFrameTime;
|
||||
toWait = _frameWaitTime - time;
|
||||
} while (toWait > 0);
|
||||
|
||||
_startFrameTime = getTimeKey();
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ public:
|
||||
int16 getFrameRate();
|
||||
void setFrameRate(int16 rate);
|
||||
void notifyNewAnim();
|
||||
void waitEndFrame();
|
||||
void waitEndFrame(bool handleInput = true);
|
||||
void setScrollOffset(int16 x = -1, int16 y = -1);
|
||||
|
||||
static void insertStr(const char *str1, char *str2, int16 pos);
|
||||
|
Loading…
x
Reference in New Issue
Block a user