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
This commit is contained in:
parent
5de9e36ff8
commit
23e4199699
4 changed files with 8 additions and 2 deletions
|
@ -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() {
|
||||
|
|
|
@ -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) {}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -311,6 +311,7 @@ bool ScummEngine::loadState(int slot, bool compat) {
|
|||
|
||||
// Reset charset mask
|
||||
_charset->_hasMask = false;
|
||||
_charset->clearTextSurface();
|
||||
|
||||
_lastCodePtr = NULL;
|
||||
_drawObjectQueNr = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue