Skip to content

Commit

Permalink
SCUMM: Do not set Surface::pixels directly anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schickel committed Aug 3, 2013
1 parent 260ec7a commit c22d914
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions engines/scumm/base-costume.cpp
Expand Up @@ -32,13 +32,13 @@ byte BaseCostumeRenderer::drawCostume(const VirtScreen &vs, int numStrips, const

_out = vs;
if (drawToBackBuf)
_out.pixels = vs.getBackPixels(0, 0);
_out.setPixels(vs.getBackPixels(0, 0));
else
_out.pixels = vs.getPixels(0, 0);
_out.setPixels(vs.getPixels(0, 0));

_actorX += _vm->_virtscr[kMainVirtScreen].xstart & 7;
_out.w = _out.pitch / _vm->_bytesPerPixel;
_out.pixels = (byte *)_out.getBasePtr(-(_vm->_virtscr[kMainVirtScreen].xstart & 7), 0);
_out.setPixels((byte *)_out.getPixels() - (_vm->_virtscr[kMainVirtScreen].xstart & 7));

_numStrips = numStrips;

Expand Down
8 changes: 3 additions & 5 deletions engines/scumm/cursor.cpp
Expand Up @@ -417,13 +417,11 @@ void ScummEngine_v5::redefineBuiltinCursorFromChar(int index, int chr) {
Graphics::Surface s;
byte buf[16*17];
memset(buf, 123, 16*17);
s.pixels = buf;
s.w = _charset->getCharWidth(chr);
s.h = _charset->getFontHeight();
s.pitch = s.w;
s.init(_charset->getCharWidth(chr), _charset->getFontHeight(),
_charset->getCharWidth(chr), buf,
Graphics::PixelFormat::createFormatCLUT8());
// s.h = 17 for FM-TOWNS Loom Japanese. Fixes bug #1166917
assert(s.w <= 16 && s.h <= 17);
s.format = Graphics::PixelFormat::createFormatCLUT8();

_charset->drawChar(chr, s, 0, 0);

Expand Down
2 changes: 1 addition & 1 deletion engines/scumm/gfx.cpp
Expand Up @@ -421,7 +421,7 @@ void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int
}

_res->createResource(rtBuffer, slot + 1, size);
vs->pixels = getResourceAddress(rtBuffer, slot + 1);
vs->setPixels(getResourceAddress(rtBuffer, slot + 1));
memset(vs->getPixels(0, 0), 0, size); // reset background

if (twobufs) {
Expand Down
2 changes: 1 addition & 1 deletion engines/scumm/object.cpp
Expand Up @@ -1715,7 +1715,7 @@ void ScummEngine_v6::drawBlastObject(BlastObject *eo) {
error("object %d is not a blast object", eo->number);

bdd.dst = *vs;
bdd.dst.pixels = vs->getPixels(0, 0);
bdd.dst.setPixels(vs->getPixels(0, 0));
bdd.x = eo->rect.left;
bdd.y = eo->rect.top;

Expand Down

0 comments on commit c22d914

Please sign in to comment.