diff options
author | Torbjörn Andersson | 2005-04-05 07:53:46 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2005-04-05 07:53:46 +0000 |
commit | 23e419969975d0da935498bfbb255448be7b6c2a (patch) | |
tree | 716f60913bbd79e777e9ddf7971f8c033424c83b /scumm | |
parent | 5de9e36ff84c64a56c2ec4434d802270543dbd5f (diff) | |
download | scummvm-rg350-23e419969975d0da935498bfbb255448be7b6c2a.tar.gz scummvm-rg350-23e419969975d0da935498bfbb255448be7b6c2a.tar.bz2 scummvm-rg350-23e419969975d0da935498bfbb255448be7b6c2a.zip |
Clear the text surface when loading a saved game, otherwise any text that
was displayed before loading the game will remain.
I hope this is the correct fix.
svn-id: r17382
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/charset.cpp | 2 | ||||
-rw-r--r-- | scumm/charset.h | 1 | ||||
-rw-r--r-- | scumm/gfx.cpp | 6 | ||||
-rw-r--r-- | scumm/saveload.cpp | 1 |
4 files changed, 8 insertions, 2 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp index 9f1ddbc3c0..09e167d422 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -208,11 +208,11 @@ CharsetRenderer::CharsetRenderer(ScummEngine *vm) { const int size = _vm->_screenWidth * _vm->_screenHeight; _textSurface.pixels = malloc(size); - memset(_textSurface.pixels, CHARSET_MASK_TRANSPARENCY, size); _textSurface.w = _vm->_screenWidth; _textSurface.h = _vm->_screenHeight; _textSurface.pitch = _vm->_screenWidth; _textSurface.bytesPerPixel = 1; + clearTextSurface(); } CharsetRenderer::~CharsetRenderer() { diff --git a/scumm/charset.h b/scumm/charset.h index a9be1dd231..cbf44e0540 100644 --- a/scumm/charset.h +++ b/scumm/charset.h @@ -92,6 +92,7 @@ public: void restoreCharsetBg(); void clearCharsetMask(); + void clearTextSurface(); virtual void printChar(int chr) = 0; virtual void drawChar(int chr, const Graphics::Surface &s, int x, int y) {} diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index b5bdcb312a..ae5334ece7 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -887,7 +887,7 @@ void CharsetRenderer::restoreCharsetBg() { if (vs->hasTwoBuffers) { // Clean out the charset mask - memset(_textSurface.pixels, CHARSET_MASK_TRANSPARENCY, _textSurface.pitch * _textSurface.h); + clearTextSurface(); } } } @@ -896,6 +896,10 @@ void CharsetRenderer::clearCharsetMask() { memset(_vm->getResourceAddress(rtBuffer, 9), 0, _vm->gdi._imgBufOffs[1]); } +void CharsetRenderer::clearTextSurface() { + memset(_textSurface.pixels, CHARSET_MASK_TRANSPARENCY, _textSurface.pitch * _textSurface.h); +} + byte *ScummEngine::getMaskBuffer(int x, int y, int z) { return gdi.getMaskBuffer((x + virtscr[0].xstart) / 8, y, z); } diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index 9f228b191e..afd2180ed6 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -311,6 +311,7 @@ bool ScummEngine::loadState(int slot, bool compat) { // Reset charset mask _charset->_hasMask = false; + _charset->clearTextSurface(); _lastCodePtr = NULL; _drawObjectQueNr = 0; |