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
This commit is contained in:
Joost Peters 2005-11-18 00:01:46 +00:00
parent e173a05e46
commit f8eb9cc502
2 changed files with 17 additions and 15 deletions

View file

@ -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);

View file

@ -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)