diff options
author | Max Horn | 2004-01-08 21:44:03 +0000 |
---|---|---|
committer | Max Horn | 2004-01-08 21:44:03 +0000 |
commit | 84f4a137307f06562a6adbb0c735287ecc2771b5 (patch) | |
tree | 8a538624071601d3212cb35012a410976c3c46bb /scumm | |
parent | 04b002bbaaef75f45c2fb962dbbce23db53116e7 (diff) | |
download | scummvm-rg350-84f4a137307f06562a6adbb0c735287ecc2771b5.tar.gz scummvm-rg350-84f4a137307f06562a6adbb0c735287ecc2771b5.tar.bz2 scummvm-rg350-84f4a137307f06562a6adbb0c735287ecc2771b5.zip |
more cleanup
svn-id: r12264
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/gfx.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index adbbc8a3ec..1ef003741f 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -544,9 +544,7 @@ void ScummEngine::redrawBGStrip(int start, int num) { void ScummEngine::restoreBG(Common::Rect rect, byte backColor) { VirtScreen *vs; - int topline, height, width; byte *backbuff; - bool lightsOn; if (rect.top < 0) rect.top = 0; @@ -559,8 +557,9 @@ void ScummEngine::restoreBG(Common::Rect rect, byte backColor) { if (rect.left > vs->width) return; - topline = vs->topline; + const int topline = vs->topline; + // Move rect up rect.top -= topline; rect.bottom -= topline; @@ -571,16 +570,18 @@ void ScummEngine::restoreBG(Common::Rect rect, byte backColor) { int offset = rect.top * vs->width + vs->xstart + rect.left; backbuff = vs->screenPtr + offset; - height = rect.height(); - width = rect.width(); - - // Check whether lights are turned on or not - lightsOn = isLightOn(); + const int height = rect.height(); + const int width = rect.width(); - if (vs->hasTwoBuffers && _currentRoom != 0 && lightsOn ) { + if (vs->hasTwoBuffers && _currentRoom != 0 && isLightOn()) { blit(backbuff, vs->backBuf + offset, width, height); if (vs->number == kMainVirtScreen && _charset->_hasMask && height) { byte *mask; + + // Move rect back + rect.top += topline; + rect.bottom += topline; + // Note: At first sight it may look as if this could // be optimized to (rect.right - rect.left) / 8 and // thus to width / 8, but that's not the case since @@ -591,8 +592,6 @@ void ScummEngine::restoreBG(Common::Rect rect, byte backColor) { mask_width++; mask = getMaskBuffer(rect.left, rect.top + topline, 0); - if (vs->number == kMainVirtScreen) - mask += vs->topline * gdi._numStrips; do { memset(mask, 0, mask_width); |