diff options
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/text32.cpp | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 19cbbd1e01..0a04b40ae4 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -607,4 +607,4 @@ void GfxFrameout::kernelFrameout() { g_sci->getEngineState()->_throttleTrigger = true; } -} // End of namespace Sci
\ No newline at end of file +} // End of namespace Sci diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp index 50b782d3e6..ff26845c51 100644 --- a/engines/sci/graphics/text32.cpp +++ b/engines/sci/graphics/text32.cpp @@ -86,6 +86,10 @@ reg_t GfxText32::createTextBitmap(reg_t textObject, uint16 maxWidth, uint16 maxH memset(memoryPtr, backColor, entrySize); byte *bitmap = memoryPtr + BITMAP_HEADER_SIZE; + // Save totalWidth, totalHeight + WRITE_LE_UINT16((void *)memoryPtr, width); + WRITE_LE_UINT16((void *)(memoryPtr + 2), height); + int16 charCount = 0; uint16 curX = 0, curY = 0; const char *txt = text.c_str(); @@ -130,22 +134,20 @@ void GfxText32::drawTextBitmap(reg_t textObject) { byte *surface = memoryPtr + BITMAP_HEADER_SIZE; int curByte = 0; - Common::Rect nsRect = g_sci->_gfxCompare->getNSRect(textObject); Common::Rect planeRect = getPlaneRect(textObject); uint16 x = readSelectorValue(_segMan, textObject, SELECTOR(x)); uint16 y = readSelectorValue(_segMan, textObject, SELECTOR(y)); uint16 skipColor = readSelectorValue(_segMan, textObject, SELECTOR(skip)); uint16 textX = planeRect.left + x; uint16 textY = planeRect.top + y; - uint16 width = nsRect.width() + 1; - uint16 height = nsRect.height() + 1; + // Get totalWidth, totalHeight + uint16 width = READ_LE_UINT16((void *)memoryPtr); + uint16 height = READ_LE_UINT16((void *)(memoryPtr + 2)); // Upscale the coordinates/width if the fonts are already upscaled if (_screen->fontIsUpscaled()) { textX = textX * _screen->getDisplayWidth() / _screen->getWidth(); textY = textY * _screen->getDisplayHeight() / _screen->getHeight(); - width = width * _screen->getDisplayWidth() / _screen->getWidth(); - height = height * _screen->getDisplayHeight() / _screen->getHeight(); } for (int curY = 0; curY < height; curY++) { @@ -282,4 +284,4 @@ int16 GfxText32::Size(Common::Rect &rect, const char *text, GuiResourceId fontId return rect.right; } -} // End of namespace Sci
\ No newline at end of file +} // End of namespace Sci |