From 1dcad179888fbcbb0e92838cc52efd00a6ab672a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 9 Oct 2011 19:13:16 +0300 Subject: SCI32: Documented the extra 2 params in kCreateTextBitmap(0) --- engines/sci/graphics/text32.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'engines/sci/graphics/text32.cpp') diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp index 82740c0ad9..6ec1261a88 100644 --- a/engines/sci/graphics/text32.cpp +++ b/engines/sci/graphics/text32.cpp @@ -56,7 +56,7 @@ void GfxText32::purgeCache() { _textCache.clear(); } -void GfxText32::createTextBitmap(reg_t textObject) { +void GfxText32::createTextBitmap(reg_t textObject, uint16 maxWidth, uint16 maxHeight) { if (_textCache.size() >= MAX_CACHED_TEXTS) purgeCache(); @@ -70,7 +70,7 @@ void GfxText32::createTextBitmap(reg_t textObject) { _textCache.erase(textId); } - _textCache[textId] = createTextEntry(textObject); + _textCache[textId] = createTextEntry(textObject, maxWidth, maxHeight); } // TODO: Finish this! @@ -133,9 +133,11 @@ TextEntry *GfxText32::getTextEntry(reg_t textObject) { } // TODO: Finish this! Currently buggy. -TextEntry *GfxText32::createTextEntry(reg_t textObject) { +TextEntry *GfxText32::createTextEntry(reg_t textObject, uint16 maxWidth, uint16 maxHeight) { reg_t stringObject = readSelector(_segMan, textObject, SELECTOR(text)); + // TODO: maxWidth, maxHeight (if > 0) + // The object in the text selector of the item can be either a raw string // or a Str object. In the latter case, we need to access the object's data // selector to get the raw string. @@ -174,10 +176,9 @@ TextEntry *GfxText32::createTextEntry(reg_t textObject) { memset(newEntry->surface, 0, newEntry->width * newEntry->height); newEntry->text = _segMan->getString(stringObject); - int16 maxTextWidth, charCount; + int16 maxTextWidth = 0, charCount = 0; uint16 curX = 0, curY = 0; - maxTextWidth = 0; while (*text) { charCount = GetLongest(text, planeRect.width(), font); if (charCount == 0) -- cgit v1.2.3