[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.145,2.146 charset.h,2.43,2.44

Max Horn fingolfin at users.sourceforge.net
Thu May 26 09:39:13 CEST 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29553

Modified Files:
	charset.cpp charset.h 
Log Message:
Take the font height from the charset header for V3 fonts, too; determine the number of chars for V4/V5 fonts, too

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.145
retrieving revision 2.146
diff -u -d -r2.145 -r2.146
--- charset.cpp	26 May 2005 12:26:02 -0000	2.145
+++ charset.cpp	26 May 2005 16:38:01 -0000	2.146
@@ -233,6 +233,10 @@
 		_fontPtr += 17;
 	else
 		_fontPtr += 29;
+
+	//_bitDepth = _fontPtr[0];
+	_fontHeight = _fontPtr[1];
+	_numChars = READ_LE_UINT16(_fontPtr + 2);
 }
 
 void CharsetRendererV3::setCurID(byte id) {
@@ -244,7 +248,10 @@
 	if (_fontPtr == 0)
 		error("CharsetRendererCommon::setCurID: charset %d not found!", id);
 
+	//_bitDepth = 1;
 	_numChars = _fontPtr[4];
+	_fontHeight = _fontPtr[5];
+
 	_fontPtr += 6;
 	_widthTable = _fontPtr;
 	_fontPtr += _numChars;
@@ -252,16 +259,16 @@
 
 int CharsetRendererCommon::getFontHeight() {
 	if (_vm->_useCJKMode)
-		return MAX(_vm->_2byteHeight + 1, (int)_fontPtr[1]);
+		return MAX(_vm->_2byteHeight + 1, _fontHeight);
 	else
-		return _fontPtr[1];
+		return _fontHeight;
 }
 
 int CharsetRendererV3::getFontHeight() {
 	if (_vm->_useCJKMode)
-		return MAX(_vm->_2byteHeight + 1, 8);
+		return MAX(_vm->_2byteHeight + 1, _fontHeight);
 	else
-		return 8;
+		return _fontHeight;
 }
 
 // do spacing for variable width old-style font
@@ -1098,6 +1105,8 @@
 CharsetRendererV2::CharsetRendererV2(ScummEngine *vm, Common::Language language)
 	: CharsetRendererV3(vm) {
 
+	_fontHeight = 8;
+
 	switch (language) {
 	case Common::DE_DEU:
 		_fontPtr = germanCharsetDataV2;

Index: charset.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.h,v
retrieving revision 2.43
retrieving revision 2.44
diff -u -d -r2.43 -r2.44
--- charset.h	26 May 2005 12:26:03 -0000	2.43
+++ charset.h	26 May 2005 16:38:02 -0000	2.44
@@ -114,11 +114,13 @@
 class CharsetRendererCommon : public CharsetRenderer {
 protected:
 	byte *_fontPtr;
+	int _numChars;
+	int _fontHeight;
 
 	void drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height);
 
 public:
-	CharsetRendererCommon(ScummEngine *vm) : CharsetRenderer(vm) {}
+	CharsetRendererCommon(ScummEngine *vm) : CharsetRenderer(vm), _numChars(0), _fontHeight(0) {}
 
 	void setCurID(byte id);
 	
@@ -157,7 +159,6 @@
 
 class CharsetRendererV3 : public CharsetRendererCommon {
 protected:
-	int _numChars;
 	byte *_widthTable;
 
 public:





More information about the Scummvm-git-logs mailing list