diff options
author | Max Horn | 2003-01-15 03:10:28 +0000 |
---|---|---|
committer | Max Horn | 2003-01-15 03:10:28 +0000 |
commit | b1c570aa6ec368f22249dae0cb9baf2848ced8d1 (patch) | |
tree | e4eca2f97352259cb496f0f2c47ee2733ad076d2 /scumm | |
parent | 5a180bbea9dc15175515dc9eb79b8374c7a33e23 (diff) | |
download | scummvm-rg350-b1c570aa6ec368f22249dae0cb9baf2848ced8d1.tar.gz scummvm-rg350-b1c570aa6ec368f22249dae0cb9baf2848ced8d1.tar.bz2 scummvm-rg350-b1c570aa6ec368f22249dae0cb9baf2848ced8d1.zip |
made NUT font rendered honor _ignoreCharsetMask
svn-id: r6466
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/bundle.cpp | 3 | ||||
-rw-r--r-- | scumm/charset.cpp | 2 | ||||
-rw-r--r-- | scumm/gfx.cpp | 1 | ||||
-rw-r--r-- | scumm/nut_renderer.cpp | 22 | ||||
-rw-r--r-- | scumm/nut_renderer.h | 4 |
5 files changed, 19 insertions, 13 deletions
diff --git a/scumm/bundle.cpp b/scumm/bundle.cpp index 9a03938af5..5adb33ac81 100644 --- a/scumm/bundle.cpp +++ b/scumm/bundle.cpp @@ -280,7 +280,8 @@ int32 Bundle::decompressVoiceSampleByIndex(int32 index, byte *comp_final, int32 output_size = decompressCodec(_compVoiceTable[i].codec, comp_input, comp_output, _compVoiceTable[i].size, i, channels); - memcpy((byte *)&comp_final[final_size], comp_output, output_size); + assert(output_size <= 10000); + memcpy(comp_final + final_size, comp_output, output_size); final_size += output_size; free(comp_input); diff --git a/scumm/charset.cpp b/scumm/charset.cpp index b596a38d96..dcf09be9e3 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -451,7 +451,7 @@ void CharsetRendererNut::printChar(int chr) int height = _current->getCharHeight(chr); _hasMask = true; - _current->drawChar((char)chr, _left, _top, _color); + _current->drawChar((char)chr, _left, _top, _color, !_ignoreCharsetMask); _vm->updateDirtyRect(0, _left, _left + width, _top, _top + height, 0); _left += width; diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 50f3810c97..9355c2581b 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -757,7 +757,6 @@ void Scumm::restoreBG(int left, int top, int right, int bottom, byte backColor) topline = vs->topline; height = topline + vs->height; -// right++; // FIXME - why did we increment here?!? it caused bug if (left < 0) left = 0; if (right < 0) diff --git a/scumm/nut_renderer.cpp b/scumm/nut_renderer.cpp index 6aaa7dee7b..46ed23515b 100644 --- a/scumm/nut_renderer.cpp +++ b/scumm/nut_renderer.cpp @@ -163,6 +163,7 @@ int32 NutRenderer::getStringWidth(char *string) { return length; } +/* void NutRenderer::drawString(const char *string, int32 x, int32 y, byte color, int32 mode) { debug(2, "NutRenderer::drawString() called"); if (_loaded == false) { @@ -189,9 +190,10 @@ void NutRenderer::drawString(const char *string, int32 x, int32 y, byte color, i _vm->updateDirtyRect(0, left, x, y, y + height, 0); } +*/ -void NutRenderer::drawChar(char c, int32 x, int32 y, byte color) { - debug(2, "NutRenderer::drawChar('%c', %d, %d, %d) called", c, x, y, (int)color); +void NutRenderer::drawChar(char c, int32 x, int32 y, byte color, bool useMask) { + debug(2, "NutRenderer::drawChar('%c', %d, %d, %d, %d) called", c, x, y, (int)color, useMask); if (_loaded == false) { debug(2, "NutRenderer::drawChar() Font is not loaded"); return; @@ -215,17 +217,19 @@ void NutRenderer::drawChar(char c, int32 x, int32 y, byte color) { int offsetX[7] = { -1, 0, 1, 0, 1, 2, 0 }; int offsetY[7] = { 0, -1, 0, 1, 2, 1, 0 }; int cTable[7] = { 0, 0, 0, 0, 0, 0, color }; + + byte *dst, *mask = NULL; + byte maskmask; + int maskpos; for (int i = 0; i < 7; i++) { x += offsetX[i]; y += offsetY[i]; color = cTable[i]; - byte *dst = _vm->virtscr[0].screenPtr + y * _vm->_realWidth + x + _vm->virtscr[0].xstart; - byte *mask = _vm->getResourceAddress(rtBuffer, 9) + dst = _vm->virtscr[0].screenPtr + y * _vm->_realWidth + x + _vm->virtscr[0].xstart; + mask = _vm->getResourceAddress(rtBuffer, 9) + (y * _vm->_realWidth + x) / 8 + _vm->_screenStartStrip; - byte maskmask; - int maskpos; src = _tmpCodecBuffer; @@ -237,7 +241,8 @@ void NutRenderer::drawChar(char c, int32 x, int32 y, byte color) { #if 1 if (pixel != 0) { dst[tx] = color; - mask[maskpos] |= maskmask; + if (useMask) + mask[maskpos] |= maskmask; } #else if (pixel != 0) { @@ -246,7 +251,8 @@ void NutRenderer::drawChar(char c, int32 x, int32 y, byte color) { if (pixel == 0xff) pixel = 0x0; dst[tx] = pixel; - mask[maskpos] |= maskmask; + if (useMask) + mask[maskpos] |= maskmask; } #endif maskmask >>= 1; diff --git a/scumm/nut_renderer.h b/scumm/nut_renderer.h index 03bee41c89..df0d484f23 100644 --- a/scumm/nut_renderer.h +++ b/scumm/nut_renderer.h @@ -41,8 +41,8 @@ public: ~NutRenderer(); bool loadFont(const char *filename, const char *dir); - void drawChar(char c, int32 x, int32 y, byte color); - void drawString(const char *string, int32 x, int32 y, byte color, int32 mode); + void drawChar(char c, int32 x, int32 y, byte color, bool useMask); +// void drawString(const char *string, int32 x, int32 y, byte color, int32 mode); int32 getCharWidth(char c); int32 getCharHeight(char c); int32 getStringWidth(char *string); |