aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/gfx.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-07 12:24:59 -0700
committerJohannes Schickel2013-08-07 12:24:59 -0700
commit7f8308e0eb50c4e13ec0684619b5474983a93a66 (patch)
tree0a057f01385a11d99add1e294f70891a8e8bf6c9 /engines/scumm/gfx.cpp
parent6e9390feb8166d5f9d6c6fdfe00a336b4f71de4c (diff)
parente5f0c42a65f38611272542a144228753e0496493 (diff)
downloadscummvm-rg350-7f8308e0eb50c4e13ec0684619b5474983a93a66.tar.gz
scummvm-rg350-7f8308e0eb50c4e13ec0684619b5474983a93a66.tar.bz2
scummvm-rg350-7f8308e0eb50c4e13ec0684619b5474983a93a66.zip
Merge pull request #365 from lordhoto/protected-pixels
Make Graphics::Surface::pixels protected.
Diffstat (limited to 'engines/scumm/gfx.cpp')
-rw-r--r--engines/scumm/gfx.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 50ff0b3988..4c1fdaf673 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -421,8 +421,8 @@ void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int
}
_res->createResource(rtBuffer, slot + 1, size);
- vs->pixels = getResourceAddress(rtBuffer, slot + 1);
- memset(vs->pixels, 0, size); // reset background
+ vs->setPixels(getResourceAddress(rtBuffer, slot + 1));
+ memset(vs->getBasePtr(0, 0), 0, size); // reset background
if (twobufs) {
vs->backBuf = _res->createResource(rtBuffer, slot + 5, size);
@@ -612,7 +612,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
// Some paranoia checks
assert(top >= 0 && bottom <= vs->h);
assert(x >= 0 && width <= vs->pitch);
- assert(_textSurface.pixels);
+ assert(_textSurface.getPixels());
// Perform some clipping
if (width > vs->w - x)
@@ -1135,7 +1135,7 @@ void ScummEngine::clearTextSurface() {
_townsScreen->fillLayerRect(1, 0, 0, _textSurface.w, _textSurface.h, 0);
#endif
- fill((byte *)_textSurface.pixels, _textSurface.pitch,
+ fill((byte *)_textSurface.getPixels(), _textSurface.pitch,
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
_game.platform == Common::kPlatformFMTowns ? 0 :
#endif
@@ -1590,7 +1590,7 @@ void GdiV2::prepareDrawBitmap(const byte *ptr, VirtScreen *vs,
if (vs->hasTwoBuffers)
dst = vs->backBuf + y * vs->pitch + x * 8;
else
- dst = (byte *)vs->pixels + y * vs->pitch + x * 8;
+ dst = (byte *)vs->getBasePtr(x * 8, y);
mask_ptr = getMaskBuffer(x, y, 1);
@@ -1827,7 +1827,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
if (vs->hasTwoBuffers)
dstPtr = vs->backBuf + y * vs->pitch + (x * 8 * vs->format.bytesPerPixel);
else
- dstPtr = (byte *)vs->pixels + y * vs->pitch + (x * 8 * vs->format.bytesPerPixel);
+ dstPtr = (byte *)vs->getBasePtr(x * 8, y);
transpStrip = drawStrip(dstPtr, vs, x, y, width, height, stripnr, smap_ptr);
@@ -1836,7 +1836,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
transpStrip = true;
if (vs->hasTwoBuffers) {
- byte *frontBuf = (byte *)vs->pixels + y * vs->pitch + (x * 8 * vs->format.bytesPerPixel);
+ byte *frontBuf = (byte *)vs->getBasePtr(x * 8, y);
if (lightsOn)
copy8Col(frontBuf, vs->pitch, dstPtr, height, vs->format.bytesPerPixel);
else
@@ -2262,7 +2262,7 @@ void Gdi::resetBackground(int top, int bottom, int strip) {
vs->bdirty[strip] = bottom;
bgbak_ptr = (byte *)vs->backBuf + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->format.bytesPerPixel;
- backbuff_ptr = (byte *)vs->pixels + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->format.bytesPerPixel;
+ backbuff_ptr = (byte *)vs->getBasePtr((strip + vs->xstart/8) * 8, top);
numLinesToProcess = bottom - top;
if (numLinesToProcess) {