aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/actor.cpp2
-rw-r--r--engines/scumm/charset.cpp3
-rw-r--r--engines/scumm/gfx.cpp24
-rw-r--r--engines/scumm/gfx.h2
-rw-r--r--engines/scumm/he/animation_he.cpp2
-rw-r--r--engines/scumm/he/floodfill_he.cpp2
-rw-r--r--engines/scumm/he/intern_he.h2
-rw-r--r--engines/scumm/he/script_v100he.cpp2
-rw-r--r--engines/scumm/he/script_v72he.cpp2
-rw-r--r--engines/scumm/he/sprite_he.cpp6
-rw-r--r--engines/scumm/he/wiz_he.cpp4
-rw-r--r--engines/scumm/script_c64.cpp2
-rw-r--r--engines/scumm/script_v2.cpp4
-rw-r--r--engines/scumm/script_v5.cpp2
-rw-r--r--engines/scumm/scumm.h4
-rw-r--r--engines/scumm/string.cpp2
-rw-r--r--engines/scumm/verbs.cpp4
17 files changed, 35 insertions, 34 deletions
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index eb2e46893d..db43d00cca 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -2095,7 +2095,7 @@ void ScummEngine_v71he::preProcessAuxQueue() {
for (int i = 0; i < _auxBlocksNum; ++i) {
AuxBlock *ab = &_auxBlocks[i];
if (ab->r.top <= ab->r.bottom) {
- _gdi->copyVirtScreenBuffers(ab->r);
+ restoreBackgroundHE(ab->r);
}
}
}
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 164e84ae65..87600faf78 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -24,6 +24,7 @@
#include "scumm/scumm.h"
#include "scumm/nut_renderer.h"
#include "scumm/util.h"
+#include "scumm/he/intern_he.h"
#include "scumm/he/wiz_he.h"
namespace Scumm {
@@ -1429,7 +1430,7 @@ void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {
if (_blitAlso && vs->hasTwoBuffers) {
Common::Rect dst(_left, _top, _left + origWidth, _top + origHeight);
- _vm->_gdi->copyVirtScreenBuffers(dst);
+ ((ScummEngine_v71he *)_vm)->restoreBackgroundHE(dst);
}
#endif
} else {
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index bfe90a32df..59a79cd089 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -846,7 +846,7 @@ void ScummEngine::redrawBGStrip(int start, int num) {
_gdi->drawBitmap(room + _IM00_offs, &virtscr[0], s, 0, _roomWidth, virtscr[0].h, s, num, 0);
}
-void ScummEngine::restoreBG(Common::Rect rect, byte backColor) {
+void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) {
VirtScreen *vs;
byte *screenBuf;
@@ -898,7 +898,7 @@ void CharsetRenderer::restoreCharsetBg() {
_left = -1;
// Restore background on the whole text area. This code is based on
- // restoreBG(), but was changed to only restore those parts which are
+ // restoreBackground(), but was changed to only restore those parts which are
// currently covered by the charset mask.
VirtScreen *vs = &_vm->virtscr[_textScreenID];
@@ -1730,7 +1730,7 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) {
debug(0, "Gdi::drawBMAPBg: default case %d", code);
}
- copyVirtScreenBuffers(Common::Rect(vs->w, vs->h));
+ ((ScummEngine_v71he *)_vm)->restoreBackgroundHE(Common::Rect(vs->w, vs->h));
int numzbuf = getZPlanes(ptr, zplane_list, true);
if (numzbuf <= 1)
@@ -1798,14 +1798,14 @@ void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y,
rect1.top -= rect2.top;
rect1.bottom -= rect2.top;
- copyVirtScreenBuffers(rect1);
+ ((ScummEngine_v71he *)_vm)->restoreBackgroundHE(rect1);
}
#endif
}
-void Gdi::copyVirtScreenBuffers(Common::Rect rect, int dirtybit) {
+void ScummEngine_v70he::restoreBackgroundHE(Common::Rect rect, int dirtybit) {
byte *src, *dst;
- VirtScreen *vs = &_vm->virtscr[0];
+ VirtScreen *vs = &virtscr[0];
if (rect.top > vs->h || rect.bottom < 0)
return;
@@ -1831,13 +1831,13 @@ void Gdi::copyVirtScreenBuffers(Common::Rect rect, int dirtybit) {
if (rw == 0 || rh == 0)
return;
- src = _vm->virtscr[0].getBackPixels(rect.left, rect.top);
- dst = _vm->virtscr[0].getPixels(rect.left, rect.top);
+ src = virtscr[0].getBackPixels(rect.left, rect.top);
+ dst = virtscr[0].getPixels(rect.left, rect.top);
- assert(rw <= _vm->_screenWidth && rw > 0);
- assert(rh <= _vm->_screenHeight && rh > 0);
- blit(dst, _vm->virtscr[0].pitch, src, _vm->virtscr[0].pitch, rw, rh);
- _vm->markRectAsDirty(kMainVirtScreen, rect, dirtybit);
+ assert(rw <= _screenWidth && rw > 0);
+ assert(rh <= _screenHeight && rh > 0);
+ blit(dst, virtscr[0].pitch, src, virtscr[0].pitch, rw, rh);
+ markRectAsDirty(kMainVirtScreen, rect, dirtybit);
}
/**
diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index 9aa8461c2c..fd101af1fa 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -280,8 +280,6 @@ public:
void drawBMAPBg(const byte *ptr, VirtScreen *vs);
void drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, int w, int h);
- void copyVirtScreenBuffers(Common::Rect rect, int dirtybit = 0);
-
byte *getMaskBuffer(int x, int y, int z);
void disableZBuffer() { _zbufferDisabled = true; }
void enableZBuffer() { _zbufferDisabled = false; }
diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp
index 76184633e1..0c737ed899 100644
--- a/engines/scumm/he/animation_he.cpp
+++ b/engines/scumm/he/animation_he.cpp
@@ -93,7 +93,7 @@ void MoviePlayer::handleNextFrame() {
copyFrameToBuffer(pvs->getBackPixels(0, 0), 0, 0, _vm->_screenWidth);
Common::Rect imageRect(_width, _height);
- _vm->_gdi->copyVirtScreenBuffers(imageRect);
+ _vm->restoreBackgroundHE(imageRect);
} else {
copyFrameToBuffer(pvs->getPixels(0, 0), 0, 0, _vm->_screenWidth);
diff --git a/engines/scumm/he/floodfill_he.cpp b/engines/scumm/he/floodfill_he.cpp
index fb9fa73513..dd45cf56bc 100644
--- a/engines/scumm/he/floodfill_he.cpp
+++ b/engines/scumm/he/floodfill_he.cpp
@@ -220,7 +220,7 @@ void floodFill(FloodFillParameters *ffp, ScummEngine_v90he *vm) {
if (r.left <= r.right && r.top <= r.bottom) {
if (ffp->flags & 0x8000) {
- vm->_gdi->copyVirtScreenBuffers(r);
+ vm->restoreBackgroundHE(r);
} else {
++r.bottom;
vm->markRectAsDirty(kMainVirtScreen, r);
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h
index 08e2c5554e..f7e56eb45d 100644
--- a/engines/scumm/he/intern_he.h
+++ b/engines/scumm/he/intern_he.h
@@ -142,6 +142,8 @@ public:
byte *heFindResource(uint32 tag, byte *ptr);
byte *findWrappedBlock(uint32 tag, byte *ptr, int state, bool flagError);
+ void restoreBackgroundHE(Common::Rect rect, int dirtybit = 0);
+
protected:
virtual void setupOpcodes();
virtual void executeOpcode(byte i);
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index f576c294cf..d3ac0c2f32 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -2151,7 +2151,7 @@ void ScummEngine_v100he::o100_systemOps() {
debug(0, "Start executable (%s)", string);
break;
case 75:
- _gdi->copyVirtScreenBuffers(Common::Rect(_screenWidth, _screenHeight));
+ restoreBackgroundHE(Common::Rect(_screenWidth, _screenHeight));
updatePalette();
break;
default:
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index a708b3baad..db54180f5b 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -1528,7 +1528,7 @@ void ScummEngine_v72he::o72_systemOps() {
clearDrawObjectQueue();
break;
case 26: // HE80+
- _gdi->copyVirtScreenBuffers(Common::Rect(_screenWidth, _screenHeight));
+ restoreBackgroundHE(Common::Rect(_screenWidth, _screenHeight));
updatePalette();
break;
case 158:
diff --git a/engines/scumm/he/sprite_he.cpp b/engines/scumm/he/sprite_he.cpp
index 40b05e2f68..ca64fe8c28 100644
--- a/engines/scumm/he/sprite_he.cpp
+++ b/engines/scumm/he/sprite_he.cpp
@@ -1066,7 +1066,7 @@ void Sprite::resetTables(bool refreshScreen) {
resetGroup(curGrp);
if (refreshScreen) {
- _vm->_gdi->copyVirtScreenBuffers(Common::Rect(_vm->_screenWidth, _vm->_screenHeight));
+ _vm->restoreBackgroundHE(Common::Rect(_vm->_screenWidth, _vm->_screenHeight));
}
_numSpritesToProcess = 0;
}
@@ -1084,7 +1084,7 @@ void Sprite::resetBackground() {
spi->flags &= ~kSFChanged;
if (spi->bbox.left <= spi->bbox.right && spi->bbox.top <= spi->bbox.bottom) {
if (spi->flags & kSFBlitDirectly) {
- _vm->_gdi->copyVirtScreenBuffers(spi->bbox, USAGE_BIT_RESTORED);
+ _vm->restoreBackgroundHE(spi->bbox, USAGE_BIT_RESTORED);
} else if (firstLoop) {
xmin = spi->bbox.left;
ymin = spi->bbox.top;
@@ -1113,7 +1113,7 @@ void Sprite::resetBackground() {
}
}
if (refreshScreen) {
- _vm->_gdi->copyVirtScreenBuffers(Common::Rect(xmin, ymin, xmax, ymax), USAGE_BIT_RESTORED);
+ _vm->restoreBackgroundHE(Common::Rect(xmin, ymin, xmax, ymax), USAGE_BIT_RESTORED);
}
}
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 252423a2ef..15c488c850 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -1226,7 +1226,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
++rImage.bottom;
_vm->markRectAsDirty(kMainVirtScreen, rImage);
} else {
- _vm->_gdi->copyVirtScreenBuffers(rImage);
+ _vm->restoreBackgroundHE(rImage);
}
}
}
@@ -1485,7 +1485,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int
if (flags & kWIFMarkBufferDirty) {
_vm->markRectAsDirty(kMainVirtScreen, bound);
} else {
- _vm->_gdi->copyVirtScreenBuffers(bound);
+ _vm->restoreBackgroundHE(bound);
}
free(srcWizBuf);
diff --git a/engines/scumm/script_c64.cpp b/engines/scumm/script_c64.cpp
index 1185ce40c3..0f613bfa62 100644
--- a/engines/scumm/script_c64.cpp
+++ b/engines/scumm/script_c64.cpp
@@ -557,7 +557,7 @@ void ScummEngine_c64::drawSentence() {
sentenceline.bottom = virtscr[kVerbVirtScreen].topline + 8;
sentenceline.left = 0;
sentenceline.right = virtscr[kVerbVirtScreen].w - 1;
- restoreBG(sentenceline);
+ restoreBackground(sentenceline);
drawString(2, (byte*)string);
}
diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp
index 66b1ea8bb3..472c6dc41f 100644
--- a/engines/scumm/script_v2.cpp
+++ b/engines/scumm/script_v2.cpp
@@ -1095,7 +1095,7 @@ void ScummEngine_v2::o2_drawSentence() {
sentenceline.left = 0;
sentenceline.right = virtscr[kVerbVirtScreen].w - 1;
}
- restoreBG(sentenceline);
+ restoreBackground(sentenceline);
drawString(2, (byte*)string);
}
@@ -1608,7 +1608,7 @@ void ScummEngine_v2::setUserState(byte state) {
} else {
rect.left = 0;
}
- restoreBG(rect);
+ restoreBackground(rect);
// Draw all verbs and inventory
redrawVerbs();
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 887137fe47..fdc73edac3 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -2793,7 +2793,7 @@ void ScummEngine_v5::o5_oldRoomEffect() {
// For now, we force a redraw of the screen background. This
// way the Zak end credits seem to work mostly correct.
VirtScreen *vs = &virtscr[0];
- restoreBG(Common::Rect(0,vs->topline, vs->w, vs->topline + vs->h));
+ restoreBackground(Common::Rect(0,vs->topline, vs->w, vs->topline + vs->h));
vs->setDirtyRange(0, vs->h);
updateDirtyScreen(kMainVirtScreen);
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 91d9cc3f33..5b6a91e046 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1011,7 +1011,7 @@ protected:
void moveScreen(int dx, int dy, int height);
- void restoreBG(Common::Rect rect, byte backcolor = 0);
+ void restoreBackground(Common::Rect rect, byte backcolor = 0);
void redrawBGStrip(int start, int num);
virtual void redrawBGAreas();
@@ -1109,7 +1109,7 @@ protected:
* needs to be redrawn.
*
* The second leftmost bit is set by removeBlastObject() and
- * restoreBG(), but I'm not yet sure why.
+ * restoreBackground(), but I'm not yet sure why.
*/
uint32 gfxUsageBits[410 * 3];
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 7ef80eb6ad..58bcc0b82d 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -184,7 +184,7 @@ void ScummEngine_v6::removeBlastTexts() {
int i;
for (i = 0; i < _blastTextQueuePos; i++) {
- restoreBG(_blastTextQueue[i].rect);
+ restoreBackground(_blastTextQueue[i].rect);
}
_blastTextQueuePos = 0;
}
diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp
index 55232a9fd8..c9a3ecc253 100644
--- a/engines/scumm/verbs.cpp
+++ b/engines/scumm/verbs.cpp
@@ -365,7 +365,7 @@ void ScummEngine_v2::redrawV2Inventory() {
inventoryBox.bottom = vs->topline + virtscr[kVerbVirtScreen].h;
inventoryBox.left = 0;
inventoryBox.right = vs->w;
- restoreBG(inventoryBox);
+ restoreBackground(inventoryBox);
_string[1].charset = 1;
@@ -795,7 +795,7 @@ void ScummEngine::restoreVerbBG(int verb) {
vs = &_verbs[verb];
if (vs->oldRect.left != -1) {
- restoreBG(vs->oldRect, vs->bkcolor);
+ restoreBackground(vs->oldRect, vs->bkcolor);
vs->oldRect.left = -1;
}
}