[Scummvm-cvs-logs] CVS: scummvm/sky hufftext.cpp,1.1,1.2 text.cpp,1.39,1.40 text.h,1.22,1.23

Robert G?ffringmann lavosspawn at users.sourceforge.net
Sun Jul 6 14:04:07 CEST 2003


Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv1963/sky

Modified Files:
	hufftext.cpp text.cpp text.h 
Log Message:
fixed decoding for special characters. 0.0303 is still incorrect, need joost's help for that.

Index: hufftext.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/hufftext.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- hufftext.cpp	5 Jul 2003 02:21:19 -0000	1.1
+++ hufftext.cpp	6 Jul 2003 21:03:39 -0000	1.2
@@ -26,381 +26,381 @@
 	{ 2, 7, 0 },
 	{ 3, 6, 0 },
 	{ 4, 5, 0 },
-	{ 0, 0, (char)0x20 },
-	{ 0, 0, (char)0x65 },
-	{ 0, 0, (char)0x73 },
+	{ 0, 0, 0x20 },
+	{ 0, 0, 0x65 },
+	{ 0, 0, 0x73 },
 	{ 8, 15, 0 },
 	{ 9, 12, 0 },
[...2472 lines suppressed...]
 	{ 232, 235, 0 },
 	{ 233, 234, 0 },
-	{ 0, 0, (char)130 },
+	{ 0, 0, 130 },
 	{ 0, 0, '%' },
-	{ 0, 0, (char)9 },
+	{ 0, 0, 9 },
 	{ 237, 240, 0 },
 	{ 238, 239, 0 },
-	{ 0, 0, (char)156 },
-	{ 0, 0, (char)151 },
+	{ 0, 0, 156 },
+	{ 0, 0, 151 },
 	{ 241, 242, 0 },
 	{ 0, 0, '{' },
 	{ 243, 244, 0 },
-	{ 0, 0, (char)148 },
+	{ 0, 0, 148 },
 	{ 0, 0, '!' },
 };

Index: text.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/text.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- text.cpp	5 Jul 2003 02:21:19 -0000	1.39
+++ text.cpp	6 Jul 2003 21:03:39 -0000	1.40
@@ -221,7 +221,7 @@
 	
 	//Render text pointed to by *textPtr in buffer *dest
 
-	char textChar;
+	uint8 textChar;
 	char *curPos = textPtr;
 	char *lastSpace = curPos;
 	byte *centerTblPtr = _centreTable;
@@ -235,7 +235,7 @@
 	_dtText = textPtr;
 	_dtCentre = centre;
 
-	textChar = *curPos++;
+	textChar = (uint8)*curPos++;
 	_dtLetters++;
 
 	while (textChar >= 0x20) {
@@ -261,7 +261,7 @@
 			curPos = lastSpace;	//go back for new count
 		}
 
-		textChar = *curPos++;
+		textChar = (uint8)*curPos++;
 		_dtLetters++;
 	}
 
@@ -309,7 +309,7 @@
 			curDest += width;
 		}
 
-		textChar = *curPos++;
+		textChar = (uint8)*curPos++;
 		while (textChar >= 0x20) {
 			textChar -= 0x20;
 			makeGameCharacter(textChar, _characterSet, curDest, color);
@@ -328,7 +328,7 @@
 	return ret;
 }
 
-void SkyText::makeGameCharacter(char textChar, uint8 *charSetPtr, uint8 *&dest, uint8 color) {
+void SkyText::makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&dest, uint8 color) {
 
 	bool maskBit, dataBit;	
 	uint8 charWidth = (uint8)((*(charSetPtr + textChar)) + 1 - _dtCharSpacing);

Index: text.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/text.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- text.h	5 Jul 2003 02:21:19 -0000	1.22
+++ text.h	6 Jul 2003 21:03:39 -0000	1.23
@@ -28,7 +28,7 @@
 struct HuffTree {
 	unsigned char lChild;
 	unsigned char rChild;
-	char value;
+	unsigned char value;
 };
 
 class SkyText {
@@ -38,7 +38,7 @@
 	void getText(uint32 textNr);
 	struct displayText_t displayText(uint8 *dest, bool centre, uint16 pixelWidth, uint8 color);
 	struct displayText_t displayText(char *textPtr, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color);
-	void makeGameCharacter(char textChar, uint8 *charSetPtr, uint8 *&data, uint8 color);
+	void makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&data, uint8 color);
 	struct lowTextManager_t lowTextManager(uint32 textNum, uint16 width, uint16 logicNum, uint8 color, bool centre);
 	void fnSetFont(uint32 fontNr);
 	void fnTextModule(uint32 textInfoId, uint32 textNo);





More information about the Scummvm-git-logs mailing list