aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Haisch2008-09-23 23:16:47 +0000
committerBenjamin Haisch2008-09-23 23:16:47 +0000
commita776beb2b99cfaaec75c9c4f158d3e2348e4c380 (patch)
treefa7272c4063234bb46a74f0ada0b6c29641f6074
parent7166d43774e0f790415bdf52a95b2bc5c28f020b (diff)
downloadscummvm-rg350-a776beb2b99cfaaec75c9c4f158d3e2348e4c380.tar.gz
scummvm-rg350-a776beb2b99cfaaec75c9c4f158d3e2348e4c380.tar.bz2
scummvm-rg350-a776beb2b99cfaaec75c9c4f158d3e2348e4c380.zip
Improved updateScreenAndWait; the mouse cursor is less jerky now in some scenes in Manhole:N&E
svn-id: r34638
-rw-r--r--engines/made/screen.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp
index 0c22d40259..38a4baffc5 100644
--- a/engines/made/screen.cpp
+++ b/engines/made/screen.cpp
@@ -174,13 +174,15 @@ void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 f
if (_vm->getGameID() != GID_RTZ)
maskp = (byte*)_maskDrawCtx.destSurface->getBasePtr(x, y);
- int32 sourcePitch, linePtrAdd;
+ int32 sourcePitch, linePtrAdd, sourceAdd;
byte *linePtr;
if (flipX) {
linePtrAdd = -1;
+ sourceAdd = sourceSurface->w;
} else {
linePtrAdd = 1;
+ sourceAdd = 0;
}
if (flipY) {
@@ -191,11 +193,7 @@ void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 f
}
for (int16 yc = 0; yc < clipHeight; yc++) {
- if (flipX) {
- linePtr = source + sourceSurface->w;
- } else {
- linePtr = source;
- }
+ linePtr = source + sourceAdd;
for (int16 xc = 0; xc < clipWidth; xc++) {
if (*linePtr && (_vm->getGameID() == GID_RTZ || (mask == 0 || maskp[xc] == 0))) {
if (*linePtr)
@@ -688,7 +686,7 @@ void Screen::printText(const char *text) {
for (int textPos = 0; textPos < textLen; textPos++) {
- uint c = ((byte*)text)[textPos];
+ uint c = ((const byte*)text)[textPos];
int charWidth = _font->getCharWidth(c);
if (c == 9) {
@@ -806,7 +804,12 @@ void Screen::showWorkScreen() {
void Screen::updateScreenAndWait(int delay) {
_vm->_system->updateScreen();
- _vm->_system->delayMillis(delay);
+ uint32 startTime = _vm->_system->getMillis();
+ while (_vm->_system->getMillis() < startTime + delay) {
+ _vm->handleEvents();
+ _vm->_system->updateScreen();
+ _vm->_system->delayMillis(5);
+ }
}
int16 Screen::addToSpriteList(int16 index, int16 xofs, int16 yofs) {