aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2011-10-28 22:18:10 +0300
committerFilippos Karapetis2011-10-28 22:20:33 +0300
commitd8db7b11c14c03704c7b1a50bbaff72008eddf7a (patch)
treed17e43865786842413a3c3fd844508172b1ff2b4 /engines/sci
parent1ee923f8d271d019336dbdff0516f814898eee22 (diff)
downloadscummvm-rg350-d8db7b11c14c03704c7b1a50bbaff72008eddf7a.tar.gz
scummvm-rg350-d8db7b11c14c03704c7b1a50bbaff72008eddf7a.tar.bz2
scummvm-rg350-d8db7b11c14c03704c7b1a50bbaff72008eddf7a.zip
SCI: Use the original text buffer width/height when drawing it
Fixes the display of overlay text
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/frameout.cpp2
-rw-r--r--engines/sci/graphics/text32.cpp14
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