aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
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
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')
-rw-r--r--engines/sci/graphics/text32.cpp11
-rw-r--r--engines/sci/graphics/text32.h4
2 files changed, 8 insertions, 7 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)
diff --git a/engines/sci/graphics/text32.h b/engines/sci/graphics/text32.h
index 7f70afc880..620bcfc155 100644
--- a/engines/sci/graphics/text32.h
+++ b/engines/sci/graphics/text32.h
@@ -51,7 +51,7 @@ class GfxText32 {
public:
GfxText32(SegManager *segMan, GfxCache *fonts, GfxScreen *screen);
~GfxText32();
- void createTextBitmap(reg_t textObject);
+ void createTextBitmap(reg_t textObject, uint16 maxWidth = 0, uint16 maxHeight = 0);
void drawTextBitmap(reg_t textObject, uint16 textX, uint16 textY, uint16 planeWidth);
int16 GetLongest(const char *text, int16 maxWidth, GfxFont *font);
TextEntry *getTextEntry(reg_t textObject);
@@ -59,7 +59,7 @@ public:
void kernelTextSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight);
private:
- TextEntry *createTextEntry(reg_t textObject);
+ TextEntry *createTextEntry(reg_t textObject, uint16 maxWidth, uint16 maxHeight);
int16 Size(Common::Rect &rect, const char *text, GuiResourceId fontId, int16 maxWidth);
void Width(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight, bool restoreFont);
void StringWidth(const char *str, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight);