aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/text32.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2011-10-09 19:13:16 +0300
committerFilippos Karapetis2011-10-09 19:16:05 +0300
commit1dcad179888fbcbb0e92838cc52efd00a6ab672a (patch)
tree6f05df934abb340c03931341c5b295283bb864e4 /engines/sci/graphics/text32.cpp
parentd2bdcf8051d782ccd9d2d01f4dab4f0b9c5172ec (diff)
downloadscummvm-rg350-1dcad179888fbcbb0e92838cc52efd00a6ab672a.tar.gz
scummvm-rg350-1dcad179888fbcbb0e92838cc52efd00a6ab672a.tar.bz2
scummvm-rg350-1dcad179888fbcbb0e92838cc52efd00a6ab672a.zip
SCI32: Documented the extra 2 params in kCreateTextBitmap(0)
Diffstat (limited to 'engines/sci/graphics/text32.cpp')
-rw-r--r--engines/sci/graphics/text32.cpp11
1 files changed, 6 insertions, 5 deletions
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)