From bad5721c63e2e8c494e30f69fc529b4e54617f35 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 24 Sep 2004 22:30:51 +0000 Subject: Fix charset text in V7_SMOOTH_SCROLLING_HACK mode svn-id: r15257 --- scumm/charset.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'scumm/charset.cpp') diff --git a/scumm/charset.cpp b/scumm/charset.cpp index 5481b187d1..4e95977110 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -1289,21 +1289,28 @@ void CharsetRendererClassic::printChar(int chr) { _hasMask = true; _textScreenID = vs->number; } + + Graphics::Surface dstSurface; + Graphics::Surface backSurface; if (_ignoreCharsetMask || !vs->hasTwoBuffers) { + dstSurface = *vs; dst = vs->getPixels(_left, drawTop); } else { + dstSurface = _vm->gdi._textSurface; dst = (byte *)_vm->gdi._textSurface.pixels + (_top - _vm->_screenTop) * _vm->gdi._textSurface.pitch + _left; } if (_blitAlso && vs->hasTwoBuffers) { + backSurface = dstSurface; back = dst; + dstSurface = *vs; dst = vs->getBackPixels(_left, drawTop); } if (is2byte) { - drawBits1(*vs, dst, charPtr, drawTop, origWidth, origHeight); + drawBits1(dstSurface, dst, charPtr, drawTop, origWidth, origHeight); } else { - drawBitsN(*vs, dst, charPtr, *_fontPtr, drawTop, origWidth, origHeight); + drawBitsN(dstSurface, dst, charPtr, *_fontPtr, drawTop, origWidth, origHeight); } if (_blitAlso && vs->hasTwoBuffers) { @@ -1319,8 +1326,8 @@ void CharsetRendererClassic::printChar(int chr) { int h = height; do { memcpy(back, dst, width); - back += vs->pitch; - dst += vs->pitch; + back += backSurface.pitch; + dst += dstSurface.pitch; } while (--h); } -- cgit v1.2.3