Index: scummvm/engines/gob/video.cpp =================================================================== --- scummvm/engines/gob/video.cpp (Revision 28653) +++ scummvm/engines/gob/video.cpp (Arbeitskopie) @@ -94,7 +94,6 @@ _splitHeight1 = 200; _splitHeight2 = 0; _splitStart = 0; - _lastRetraceLength = 0; _curSparse = 0; _lastSparse = 0xFFFFFFFF; @@ -162,8 +161,6 @@ } void Video::retrace(bool mouse) { - uint32 time = _vm->_util->getTimeKey(); - if (mouse) CursorMan.showMouse((_vm->_draw->_showCursor & 2) != 0); if (_vm->_global->_primarySurfDesc) { @@ -176,13 +173,12 @@ _vm->_height - _splitHeight2, _vm->_width, _splitHeight2); g_system->updateScreen(); } - - _lastRetraceLength = _vm->_util->getTimeKey() - time; } void Video::waitRetrace(bool mouse) { + uint32 time = _vm->_util->getTimeKey(); retrace(mouse); - _vm->_util->delay(MAX(1, 10 - (int) _lastRetraceLength)); + _vm->_util->delay(MAX(1, 10 - (int)(_vm->_util->getTimeKey() - time))); } void Video::sparseRetrace(int max) { Index: scummvm/engines/gob/driver_vga.cpp =================================================================== --- scummvm/engines/gob/driver_vga.cpp (Revision 28653) +++ scummvm/engines/gob/driver_vga.cpp (Arbeitskopie) @@ -113,19 +113,27 @@ byte *srcPos = source->getVidMem() + (top * source->getWidth()) + left; byte *destPos = dest->getVidMem() + (y * dest->getWidth()) + x; - while (height--) { - if (transp) { + if (transp) + { + while (height--) { for (int16 i = 0; i < width; ++i) { if (srcPos[i]) destPos[i] = srcPos[i]; - } - } else - for (int16 i = 0; i < width; ++i) - destPos[i] = srcPos[i]; + } - srcPos += source->getWidth(); - destPos += dest->getWidth(); + srcPos += source->getWidth(); + destPos += dest->getWidth(); + } } + else + { + while (height--) { + memcpy(destPos, srcPos, width); + + srcPos += source->getWidth(); + destPos += dest->getWidth(); + } + } } void VGAVideoDriver::drawPackedSprite(byte *sprBuf, int16 width, int16 height, Index: scummvm/engines/gob/video.h =================================================================== --- scummvm/engines/gob/video.h (Revision 28653) +++ scummvm/engines/gob/video.h (Arbeitskopie) @@ -104,7 +104,6 @@ int16 _splitHeight1; int16 _splitHeight2; int16 _splitStart; - uint32 _lastRetraceLength; void freeDriver(); void initPrimary(int16 mode); Index: scummvm/engines/gob/game_v1.cpp =================================================================== --- scummvm/engines/gob/game_v1.cpp (Revision 28653) +++ scummvm/engines/gob/game_v1.cpp (Arbeitskopie) @@ -345,6 +345,7 @@ int16 oldIndex; int16 oldId; uint32 timeKey; + bool firstIteration = true; if (deltaTime >= -1) { _lastCollKey = 0; @@ -357,6 +358,8 @@ resIndex = 0; + timeKey = _vm->_util->getTimeKey(); + if ((_vm->_draw->_cursorIndex == -1) && (handleMouse != 0) && (_lastCollKey == 0)) { _lastCollKey = checkMousePoint(1, &_lastCollId, &_lastCollAreaIndex); @@ -374,7 +377,6 @@ if (handleMouse != 0) _vm->_draw->animateCursor(-1); - timeKey = _vm->_util->getTimeKey(); while (1) { if (_vm->_inter->_terminate) { if (handleMouse) @@ -395,7 +397,7 @@ // Additionally, I added a 'deltaTime == -1' check there, since // when this function is called with deltaTime == -1 in inputArea, // and the return value is then discarded. - if (deltaTime < 0) { + if (deltaTime < 0 && !firstIteration) { uint32 curtime = _vm->_util->getTimeKey(); if ((deltaTime == -1) || ((curtime + deltaTime) > timeKey)) { if (pResId != 0) @@ -538,7 +540,10 @@ if (handleMouse != 0) _vm->_draw->animateCursor(-1); - _vm->_util->delay(10); + if (deltaTime < -10) + _vm->_util->delay(10); + + firstIteration = false; } } @@ -617,7 +622,7 @@ int16 var_26; int16 collStackPos; Collision *collPtr; - int16 timeKey; + uint32 timeKey; byte *savedIP; if (_shouldPushColls) @@ -910,9 +915,9 @@ _shouldPushColls = 0; _vm->_global->_inter_execPtr = savedIP; + deltaTime = timeVal - - ((_vm->_util->getTimeKey() - timeKey) - - _vm->_video->_lastRetraceLength); + (_vm->_util->getTimeKey() - timeKey); if (deltaTime < 2) deltaTime = 2;