diff options
author | Benjamin Haisch | 2008-05-12 20:14:07 +0000 |
---|---|---|
committer | Benjamin Haisch | 2008-05-12 20:14:07 +0000 |
commit | 9b911cadcdcc897a9e92cf1967d1b7fccf5f27dd (patch) | |
tree | c1700df0b3dee1281278c56c214228946a76cb60 | |
parent | 3e133f3a9fedbd597d88108853570dc08288cf26 (diff) | |
download | scummvm-rg350-9b911cadcdcc897a9e92cf1967d1b7fccf5f27dd.tar.gz scummvm-rg350-9b911cadcdcc897a9e92cf1967d1b7fccf5f27dd.tar.bz2 scummvm-rg350-9b911cadcdcc897a9e92cf1967d1b7fccf5f27dd.zip |
Fixed printTextEx segment fault bug.
svn-id: r32071
-rw-r--r-- | engines/made/screen.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp index d9512af922..ac683f90ca 100644 --- a/engines/made/screen.cpp +++ b/engines/made/screen.cpp @@ -604,6 +604,7 @@ void Screen::show() { if (!_paletteLock) setRGBPalette(_palette, 0, _paletteColorCount); + _vm->_system->copyRectToScreen((const byte*)_screen2->pixels, _screen2->pitch, 0, 0, _screen2->w, _screen2->h); @@ -649,7 +650,7 @@ void Screen::printChar(uint c, int16 x, int16 y, byte color) { if (!_font) return; - int height = _font->getHeight(); + uint width = 8, height = _font->getHeight(); byte *charData = _font->getChar(c); if (!charData) @@ -657,10 +658,10 @@ void Screen::printChar(uint c, int16 x, int16 y, byte color) { byte p; byte *dest = (byte*)_fontDrawCtx.destSurface->getBasePtr(x, y); - + for (int16 yc = 0; yc < height; yc++) { p = charData[yc]; - for (int16 xc = 0; xc < 8; xc++) { + for (int16 xc = 0; xc < width; xc++) { if (p & 0x80) dest[xc] = color; p <<= 1; @@ -751,7 +752,7 @@ void Screen::printText(const char *text) { } void Screen::printTextEx(const char *text, int16 x, int16 y, int16 fontNum, int16 textColor, int16 outlineColor, const ClipInfo &clipInfo) { - if (*text == 0 || x == 0 || y == 0) + if (*text == 0 || x < 0 || y < 0) return; int16 oldFontNum = _currentFontNum; |