diff options
author | Joost Peters | 2005-11-18 00:01:46 +0000 |
---|---|---|
committer | Joost Peters | 2005-11-18 00:01:46 +0000 |
commit | f8eb9cc5024b06df5775b9c29890b2997c2a7ece (patch) | |
tree | f14debc52223c455acfee70640e0381da9058d9e | |
parent | e173a05e46bac522d2531b50daec62761345ab3b (diff) | |
download | scummvm-rg350-f8eb9cc5024b06df5775b9c29890b2997c2a7ece.tar.gz scummvm-rg350-f8eb9cc5024b06df5775b9c29890b2997c2a7ece.tar.bz2 scummvm-rg350-f8eb9cc5024b06df5775b9c29890b2997c2a7ece.zip |
Don't do full-screen updates when smooth-scrolling, but only update the changed part(s) (Patch from Cody56, enhanced by Fingolfin).
This should help speed it up on lower-spec devices.
svn-id: r19632
-rw-r--r-- | scumm/gfx.cpp | 26 | ||||
-rw-r--r-- | scumm/object.cpp | 6 |
2 files changed, 17 insertions, 15 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index caa8a7a93e..21f5855b36 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -802,24 +802,26 @@ void ScummEngine::redrawBGAreas() { if (_features & GF_NEW_CAMERA) { diff = camera._cur.x / 8 - camera._last.x / 8; - if (!_fullRedraw && diff == 1) { - val = 2; - redrawBGStrip(gdi._numStrips - 1, 1); - } else if (!_fullRedraw && diff == -1) { - val = 1; - redrawBGStrip(0, 1); - } else if (_fullRedraw || diff != 0) { + if (_fullRedraw) { _bgNeedsRedraw = false; redrawBGStrip(0, gdi._numStrips); + } else if (diff > 0) { + assert(gdi._numStrips > diff); + val = -diff; + redrawBGStrip(gdi._numStrips - diff, diff); + } else if (diff < 0) { + val = -diff; + redrawBGStrip(0, -diff); } } else { - if (!_fullRedraw && camera._cur.x - camera._last.x == 8) { - val = 2; + diff = camera._cur.x - camera._last.x; + if (!_fullRedraw && diff == 8) { + val = -1; redrawBGStrip(gdi._numStrips - 1, 1); - } else if (!_fullRedraw && camera._cur.x - camera._last.x == -8) { - val = 1; + } else if (!_fullRedraw && diff == -8) { + val = +1; redrawBGStrip(0, 1); - } else if (_fullRedraw || camera._cur.x != camera._last.x) { + } else if (_fullRedraw || diff != 0) { _bgNeedsRedraw = false; _flashlight.isDrawn = false; redrawBGStrip(0, gdi._numStrips); diff --git a/scumm/object.cpp b/scumm/object.cpp index 2212f23e88..390c884e98 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -472,11 +472,11 @@ void ScummEngine::drawObject(int obj, int arg) { for (a = numstrip = 0; a < width; a++) { tmp = xpos + a; - if (arg == 1 && _screenStartStrip != tmp) + if (tmp < _screenStartStrip || _screenEndStrip < tmp) continue; - if (arg == 2 && _screenEndStrip != tmp) + if (arg > 0 && _screenStartStrip + arg <= tmp) continue; - if (tmp < _screenStartStrip || tmp > _screenEndStrip) + if (arg < 0 && tmp <= _screenEndStrip + arg) continue; setGfxUsageBit(tmp, USAGE_BIT_DIRTY); if (tmp < x) |