[Scummvm-cvs-logs] SF.net SVN: scummvm:[42149] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sun Jul 5 21:57:55 CEST 2009


Revision: 42149
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42149&view=rev
Author:   drmccoy
Date:     2009-07-05 19:57:55 +0000 (Sun, 05 Jul 2009)

Log Message:
-----------
Renaming FontDesc::extraData to charWidths

Modified Paths:
--------------
    scummvm/trunk/engines/gob/draw.cpp
    scummvm/trunk/engines/gob/draw_v2.cpp
    scummvm/trunk/engines/gob/hotspots.cpp
    scummvm/trunk/engines/gob/util.cpp
    scummvm/trunk/engines/gob/video.h

Modified: scummvm/trunk/engines/gob/draw.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw.cpp	2009-07-05 19:57:37 UTC (rev 42148)
+++ scummvm/trunk/engines/gob/draw.cpp	2009-07-05 19:57:55 UTC (rev 42149)
@@ -360,9 +360,9 @@
 
 	} 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 @@
 
 	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 @@
 	_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;

Modified: scummvm/trunk/engines/gob/draw_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw_v2.cpp	2009-07-05 19:57:37 UTC (rev 42148)
+++ scummvm/trunk/engines/gob/draw_v2.cpp	2009-07-05 19:57:55 UTC (rev 42149)
@@ -762,7 +762,7 @@
 
 		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 @@
 						_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

Modified: scummvm/trunk/engines/gob/hotspots.cpp
===================================================================
--- scummvm/trunk/engines/gob/hotspots.cpp	2009-07-05 19:57:37 UTC (rev 42148)
+++ scummvm/trunk/engines/gob/hotspots.cpp	2009-07-05 19:57:55 UTC (rev 42149)
@@ -713,7 +713,7 @@
 		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 @@
 		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 @@
 
 	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 @@
 			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 @@
 		}
 
 		font = _vm->_draw->_fonts[inputs[inputCount].fontIndex];
-		if (!font->extraData)
+		if (!font->charWidths)
 			right = left + width * font->itemWidth - 1;
 
 		funcEnter = 0;

Modified: scummvm/trunk/engines/gob/util.cpp
===================================================================
--- scummvm/trunk/engines/gob/util.cpp	2009-07-05 19:57:37 UTC (rev 42148)
+++ scummvm/trunk/engines/gob/util.cpp	2009-07-05 19:57:55 UTC (rev 42149)
@@ -403,10 +403,10 @@
 	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;
 }

Modified: scummvm/trunk/engines/gob/video.h
===================================================================
--- scummvm/trunk/engines/gob/video.h	2009-07-05 19:57:37 UTC (rev 42148)
+++ scummvm/trunk/engines/gob/video.h	2009-07-05 19:57:55 UTC (rev 42149)
@@ -78,7 +78,7 @@
 		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() {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list