aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Hesse2009-07-05 19:57:55 +0000
committerSven Hesse2009-07-05 19:57:55 +0000
commitd6c99ae861aa857b24023ecc66bd1507fa895ecd (patch)
treef089938e95d2d5ee798e377cc53802d679543e97
parent62fcf1177d7782fd30ec908676e3cd287d0ae507 (diff)
downloadscummvm-rg350-d6c99ae861aa857b24023ecc66bd1507fa895ecd.tar.gz
scummvm-rg350-d6c99ae861aa857b24023ecc66bd1507fa895ecd.tar.bz2
scummvm-rg350-d6c99ae861aa857b24023ecc66bd1507fa895ecd.zip
Renaming FontDesc::extraData to charWidths
svn-id: r42149
-rw-r--r--engines/gob/draw.cpp14
-rw-r--r--engines/gob/draw_v2.cpp4
-rw-r--r--engines/gob/hotspots.cpp12
-rw-r--r--engines/gob/util.cpp4
-rw-r--r--engines/gob/video.h2
5 files changed, 18 insertions, 18 deletions
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp
index b3e5e7418c..c20bece7b4 100644
--- a/engines/gob/draw.cpp
+++ b/engines/gob/draw.cpp
@@ -360,9 +360,9 @@ int Draw::stringLength(const char *str, int16 fontIndex) {
} else {
- if (_fonts[fontIndex]->extraData)
+ if (_fonts[fontIndex]->charWidths)
while (*str != 0)
- len += *(_fonts[fontIndex]->extraData + (*str++ - _fonts[fontIndex]->startItem));
+ len += *(_fonts[fontIndex]->charWidths + (*str++ - _fonts[fontIndex]->startItem));
else
len = (strlen(str) * _fonts[fontIndex]->itemWidth);
@@ -376,10 +376,10 @@ void Draw::drawString(const char *str, int16 x, int16 y, int16 color1, int16 col
while (*str != '\0') {
_vm->_video->drawLetter(*str, x, y, font, transp, color1, color2, dest);
- if (!font->extraData)
+ if (!font->charWidths)
x += font->itemWidth;
else
- x += *(font->extraData + (*str - font->startItem));
+ x += *(font->charWidths + (*str - font->startItem));
str++;
}
}
@@ -415,12 +415,12 @@ void Draw::printTextCentered(int16 id, int16 left, int16 top, int16 right,
_fontIndex = fontIndex;
_frontColor = color;
_textToPrint = str;
- if (_fonts[fontIndex]->extraData != 0) {
- byte *data = _fonts[fontIndex]->extraData;
+ if (_fonts[fontIndex]->charWidths != 0) {
+ uint8 *widths = _fonts[fontIndex]->charWidths;
int length = strlen(str);
for (int i = 0; i < length; i++)
- width += *(data + (str[i] - _fonts[_fontIndex]->startItem));
+ width += *(widths + (str[i] - _fonts[_fontIndex]->startItem));
}
else
width = strlen(str) * _fonts[fontIndex]->itemWidth;
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp
index e09c565b79..a0be23516c 100644
--- a/engines/gob/draw_v2.cpp
+++ b/engines/gob/draw_v2.cpp
@@ -762,7 +762,7 @@ void Draw_v2::spriteOperation(int16 operation) {
if ((_fontIndex >= 4) || (_fontToSprite[_fontIndex].sprite == -1)) {
- if (!_fonts[_fontIndex]->extraData) {
+ if (!_fonts[_fontIndex]->charWidths) {
if (((int8) _textToPrint[0]) == -1) {
_vm->validateLanguage();
@@ -785,7 +785,7 @@ void Draw_v2::spriteOperation(int16 operation) {
_vm->_video->drawLetter(_textToPrint[i], _destSpriteX,
_destSpriteY, _fonts[_fontIndex], _transparency,
_frontColor, _backColor, *_spritesArray[_destSurface]);
- _destSpriteX += *(_fonts[_fontIndex]->extraData +
+ _destSpriteX += *(_fonts[_fontIndex]->charWidths +
(_textToPrint[i] - _fonts[_fontIndex]->startItem));
}
else
diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp
index ca345f690c..7cbefcc922 100644
--- a/engines/gob/hotspots.cpp
+++ b/engines/gob/hotspots.cpp
@@ -713,7 +713,7 @@ void Hotspots::getTextCursorPos(const Video::FontDesc &font, const char *str,
uint32 pos, uint16 x, uint16 y, uint16 width, uint16 height,
uint16 &cursorX, uint16 &cursorY, uint16 &cursorWidth, uint16 &cursorHeight) const {
- if (font.extraData) {
+ if (font.charWidths) {
// Cursor to the right of the current character
cursorX = x;
@@ -722,7 +722,7 @@ void Hotspots::getTextCursorPos(const Video::FontDesc &font, const char *str,
cursorHeight = height;
for (uint32 i = 0; i < pos; i++)
- cursorX += font.extraData[str[i] - font.startItem];
+ cursorX += font.charWidths[str[i] - font.startItem];
} else {
// Cursor underlining the current character
@@ -748,7 +748,7 @@ uint16 Hotspots::readString(uint16 xPos, uint16 yPos, uint16 width, uint16 heigh
const Video::FontDesc &font = *_vm->_draw->_fonts[fontIndex];
- bool monoSpaced = (font.extraData == 0);
+ bool monoSpaced = (font.charWidths == 0);
uint32 pos = strlen(str);
uint32 editSize = monoSpaced ? (width / font.itemWidth) : 0;
@@ -925,8 +925,8 @@ uint16 Hotspots::readString(uint16 xPos, uint16 yPos, uint16 width, uint16 heigh
if ((key >= ' ') && (key <= 0xFF)) {
if (editSize == 0) {
int length = _vm->_draw->stringLength(str, fontIndex) +
- font.extraData[' ' - font.startItem] +
- font.extraData[key - font.startItem];
+ font.charWidths[' ' - font.startItem] +
+ font.charWidths[key - font.startItem];
if (length > width)
continue;
@@ -1258,7 +1258,7 @@ void Hotspots::evaluateNew(uint16 i, uint16 *ids, InputDesc *inputs,
}
font = _vm->_draw->_fonts[inputs[inputCount].fontIndex];
- if (!font->extraData)
+ if (!font->charWidths)
right = left + width * font->itemWidth - 1;
funcEnter = 0;
diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp
index bb206eb52d..429b0269cf 100644
--- a/engines/gob/util.cpp
+++ b/engines/gob/util.cpp
@@ -403,10 +403,10 @@ Video::FontDesc *Util::loadFont(const char *path) {
fontDesc->bitWidth = fontDesc->itemWidth;
if (data[0] & 0x80)
- fontDesc->extraData = data + 4 + fontDesc->itemSize *
+ fontDesc->charWidths = data + 4 + fontDesc->itemSize *
(fontDesc->endItem - fontDesc->startItem + 1);
else
- fontDesc->extraData = 0;
+ fontDesc->charWidths = 0;
return fontDesc;
}
diff --git a/engines/gob/video.h b/engines/gob/video.h
index c71a18daa6..8716a637c2 100644
--- a/engines/gob/video.h
+++ b/engines/gob/video.h
@@ -78,7 +78,7 @@ public:
uint8 endItem;
int8 itemSize;
int8 bitWidth;
- byte *extraData;
+ uint8 *charWidths;
FontDesc() : dataPtr(0), itemWidth(0), itemHeight(0), startItem(0),
endItem(0), itemSize(0), bitWidth(0) {}
~FontDesc() {