[Scummvm-cvs-logs] SF.net SVN: scummvm: [25250] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jan 28 21:11:32 CET 2007


Revision: 25250
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25250&view=rev
Author:   fingolfin
Date:     2007-01-28 12:11:31 -0800 (Sun, 28 Jan 2007)

Log Message:
-----------
Moved some stuff from CharsetRenderer (back) to ScummEngine, added comments

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/actor.cpp
    scummvm/trunk/engines/scumm/charset.cpp
    scummvm/trunk/engines/scumm/charset.h
    scummvm/trunk/engines/scumm/gfx.cpp
    scummvm/trunk/engines/scumm/he/script_v70he.cpp
    scummvm/trunk/engines/scumm/he/script_v90he.cpp
    scummvm/trunk/engines/scumm/saveload.cpp
    scummvm/trunk/engines/scumm/script_v6.cpp
    scummvm/trunk/engines/scumm/scumm.cpp
    scummvm/trunk/engines/scumm/scumm.h
    scummvm/trunk/engines/scumm/string.cpp

Modified: scummvm/trunk/engines/scumm/actor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/actor.cpp	2007-01-28 18:47:10 UTC (rev 25249)
+++ scummvm/trunk/engines/scumm/actor.cpp	2007-01-28 20:11:31 UTC (rev 25250)
@@ -1895,7 +1895,7 @@
 		((ScummEngine_v7 *)this)->clearSubtitleQueue();
 #endif
 	} else {
-		_charset->restoreCharsetBg();
+		restoreCharsetBg();
 	}
 }
 

Modified: scummvm/trunk/engines/scumm/charset.cpp
===================================================================
--- scummvm/trunk/engines/scumm/charset.cpp	2007-01-28 18:47:10 UTC (rev 25249)
+++ scummvm/trunk/engines/scumm/charset.cpp	2007-01-28 20:11:31 UTC (rev 25250)
@@ -29,6 +29,19 @@
 
 namespace Scumm {
 
+/*
+TODO:
+Right now our charset renderers directly access _textSurface, as well as the
+virtual screens of ScummEngine. Ideally, this would not be the case. Instead,
+ScummVM would simply pass the appropriate Surface to the resp. methods. 
+Of course it is not quite as simple, various flags and offsets have to
+be taken into account for that.
+
+The advantage will be cleaner coder (easier to debug, in particular), and a 
+better separation of the various modules.
+*/
+
+
 void ScummEngine::loadCJKFont() {
 	Common::File fp;
 	_useCJKMode = false;
@@ -186,10 +199,6 @@
 
 
 CharsetRenderer::CharsetRenderer(ScummEngine *vm) {
-
-	_nextLeft = 0;
-	_nextTop = 0;
-
 	_top = 0;
 	_left = 0;
 	_startLeft = 0;
@@ -206,18 +215,9 @@
 
 	_vm = vm;
 	_curId = 0;
-
-	const int size = _vm->_screenWidth * _vm->_screenHeight;
-	_textSurface.pixels = malloc(size);
-	_textSurface.w = _vm->_screenWidth;
-	_textSurface.h = _vm->_screenHeight;
-	_textSurface.pitch = _vm->_screenWidth;
-	_textSurface.bytesPerPixel = 1;
-	clearTextSurface();
 }
 
 CharsetRenderer::~CharsetRenderer() {
-	free(_textSurface.pixels);
 }
 
 CharsetRendererCommon::CharsetRendererCommon(ScummEngine *vm)
@@ -1258,8 +1258,8 @@
 		dst = vs->getPixels(_left, drawTop);
 		drawBits1(*vs, dst, charPtr, drawTop, origWidth, origHeight);
 	} else {
-		dst = (byte *)_textSurface.pixels + _top * _textSurface.pitch + _left;
-		drawBits1(_textSurface, dst, charPtr, drawTop, origWidth, origHeight);
+		dst = (byte *)_vm->_textSurface.pixels + _top * _vm->_textSurface.pitch + _left;
+		drawBits1(_vm->_textSurface, dst, charPtr, drawTop, origWidth, origHeight);
 	}
 
 	if (_str.left > _left)
@@ -1317,7 +1317,7 @@
 	int offsX, offsY;
 	VirtScreen *vs;
 	const byte *charPtr;
-	int is2byte = (chr >= 0x80 && _vm->_useCJKMode) ? 1 : 0;
+	bool is2byte = (chr >= 0x80 && _vm->_useCJKMode);
 
 	assertRange(1, _curId, _vm->_numCharsets - 1, "charset");
 
@@ -1400,20 +1400,38 @@
 
 	_vm->markRectAsDirty(vs->number, _left, _left + width, drawTop, drawTop + height);
 
-	byte *dstPtr;
-	byte *back = NULL;
-
 	if (!ignoreCharsetMask) {
 		_hasMask = true;
 		_textScreenID = vs->number;
 	}
 
+	printCharIntern(is2byte, charPtr, origWidth, origHeight, width, height, vs, ignoreCharsetMask);
+
+	_left += origWidth;
+
+	if (_str.right < _left) {
+		_str.right = _left;
+		if (_shadowMode != kNoShadowMode)
+			_str.right++;
+	}
+
+	if (_str.bottom < _top + height)
+		_str.bottom = _top + height;
+
+	_top -= offsY;
+}
+
+void CharsetRendererClassic::printCharIntern(bool is2byte, const byte *charPtr, int origWidth, int origHeight, int width, int height, VirtScreen *vs, bool ignoreCharsetMask) {
+	byte *dstPtr;
+	byte *back = NULL;
+	int drawTop = _top - vs->topline;
+
 	if ((_vm->_game.heversion >= 71 && _bitDepth >= 8) || (_vm->_game.heversion >= 90 && _bitDepth == 0)) {
 #ifndef DISABLE_HE
 		if (ignoreCharsetMask || !vs->hasTwoBuffers) {
 			dstPtr = vs->getPixels(0, 0);
 		} else {
-			dstPtr = (byte *)_textSurface.pixels;
+			dstPtr = (byte *)_vm->_textSurface.pixels;
 		}
 
 		if (_blitAlso && vs->hasTwoBuffers) {
@@ -1442,8 +1460,8 @@
 			dstSurface = *vs;
 			dstPtr = vs->getPixels(_left, drawTop);
 		} else {
-			dstSurface = _textSurface;
-			dstPtr = (byte *)_textSurface.pixels + (_top - _vm->_screenTop) * _textSurface.pitch + _left;
+			dstSurface = _vm->_textSurface;
+			dstPtr = (byte *)_vm->_textSurface.pixels + (_top - _vm->_screenTop) * _vm->_textSurface.pitch + _left;
 		}
 
 		if (_blitAlso && vs->hasTwoBuffers) {
@@ -1498,19 +1516,6 @@
 			}
 		}
 	}
-
-	_left += origWidth;
-
-	if (_str.right < _left) {
-		_str.right = _left;
-		if (_shadowMode != kNoShadowMode)
-			_str.right++;
-	}
-
-	if (_str.bottom < _top + height)
-		_str.bottom = _top + height;
-
-	_top -= offsY;
 }
 
 void CharsetRendererClassic::drawChar(int chr, const Graphics::Surface &s, int x, int y) {
@@ -1686,7 +1691,7 @@
 		s = *vs;
 		s.pixels = vs->getPixels(0, 0);
 	} else {
-		s = _textSurface;
+		s = _vm->_textSurface;
 		drawTop -= _vm->_screenTop;
 	}
 
@@ -1753,8 +1758,8 @@
 		dst = vs->getPixels(_left, drawTop);
 		drawBits1(*vs, dst, charPtr, drawTop, origWidth, origHeight);
 	} else {
-		dst = (byte *)_textSurface.pixels + _top * _textSurface.pitch + _left;
-		drawBits1(_textSurface, dst, charPtr, drawTop, origWidth, origHeight);
+		dst = (byte *)_vm->_textSurface.pixels + _top * _vm->_textSurface.pitch + _left;
+		drawBits1(_vm->_textSurface, dst, charPtr, drawTop, origWidth, origHeight);
 	}
 
 	if (_str.left > _left)

Modified: scummvm/trunk/engines/scumm/charset.h
===================================================================
--- scummvm/trunk/engines/scumm/charset.h	2007-01-28 18:47:10 UTC (rev 25249)
+++ scummvm/trunk/engines/scumm/charset.h	2007-01-28 20:11:31 UTC (rev 25250)
@@ -43,7 +43,6 @@
 public:
 
 	Common::Rect _str;
-	int _nextLeft, _nextTop;
 
 	int _top;
 	int _left, _startLeft;
@@ -62,12 +61,6 @@
 	bool _firstChar;
 	bool _disableOffsX;
 
-	/**
-	 * All text is normally rendered into this overlay surface. Then later
-	 * drawStripToScreen() composits it over the game graphics.
-	 */
-	Graphics::Surface _textSurface;
-
 protected:
 	ScummEngine *_vm;
 	byte _curId;
@@ -76,10 +69,6 @@
 	CharsetRenderer(ScummEngine *vm);
 	virtual ~CharsetRenderer();
 
-	void restoreCharsetBg();
-	void clearCharsetMask();
-	void clearTextSurface();
-
 	virtual void printChar(int chr, bool ignoreCharsetMask) = 0;
 	virtual void drawChar(int chr, const Graphics::Surface &s, int x, int y) {}
 
@@ -127,6 +116,8 @@
 protected:
 	void drawBitsN(const Graphics::Surface &s, byte *dst, const byte *src, byte bpp, int drawTop, int width, int height);
 
+	void printCharIntern(bool is2byte, const byte *charPtr, int origWidth, int origHeight, int width, int height, VirtScreen *vs, bool ignoreCharsetMask);
+
 public:
 	CharsetRendererClassic(ScummEngine *vm) : CharsetRendererCommon(vm) {}
 

Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp	2007-01-28 18:47:10 UTC (rev 25249)
+++ scummvm/trunk/engines/scumm/gfx.cpp	2007-01-28 20:11:31 UTC (rev 25250)
@@ -545,7 +545,7 @@
 
 	assert(top >= 0 && bottom <= vs->h);	// Paranoia checks
 	assert(x >= 0 && width <= vs->pitch);
-	assert(_charset->_textSurface.pixels);
+	assert(_textSurface.pixels);
 	assert(_compositeBuf);
 	
 	if (width > vs->w - x)
@@ -570,10 +570,10 @@
 
 	if (_game.version < 7) {
 		// Handle the text mask in older games; newer (V7/V8) games do not use it anymore.
-		const byte *text = (byte *)_charset->_textSurface.getBasePtr(x, y);
+		const byte *text = (byte *)_textSurface.getBasePtr(x, y);
 	
 #ifdef __DS__
-		DS::asmDrawStripToScreen(height, width, text, src, dst, vs->pitch, _screenWidth, _charset->_textSurface.pitch);
+		DS::asmDrawStripToScreen(height, width, text, src, dst, vs->pitch, _screenWidth, _textSurface.pitch);
 #else	
 		// Compose the text over the game graphics
 		for (int h = 0; h < height; ++h) {
@@ -585,7 +585,7 @@
 			}
 			src += vs->pitch;
 			dst += _screenWidth;
-			text += _charset->_textSurface.pitch;
+			text += _textSurface.pitch;
 		}
 #endif
 	} else {
@@ -904,36 +904,36 @@
 	if (vs->hasTwoBuffers && _currentRoom != 0 && isLightOn()) {
 		blit(screenBuf, vs->pitch, vs->getBackPixels(rect.left, rect.top), vs->pitch, width, height);
 		if (vs->number == kMainVirtScreen && _charset->_hasMask) {
-			byte *mask = (byte *)_charset->_textSurface.getBasePtr(rect.left, rect.top - _screenTop);
-			fill(mask, _charset->_textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width, height);
+			byte *mask = (byte *)_textSurface.getBasePtr(rect.left, rect.top - _screenTop);
+			fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width, height);
 		}
 	} else {
 		fill(screenBuf, vs->pitch, backColor, width, height);
 	}
 }
 
-void CharsetRenderer::restoreCharsetBg() {
-	_nextLeft = _vm->_string[0].xpos;
-	_nextTop = _vm->_string[0].ypos + _vm->_screenTop;
+void ScummEngine::restoreCharsetBg() {
+	_nextLeft = _string[0].xpos;
+	_nextTop = _string[0].ypos + _screenTop;
 
-	if (_hasMask) {
-		_hasMask = false;
-		_str.left = -1;
-		_left = -1;
+	if (_charset->_hasMask) {
+		_charset->_hasMask = false;
+		_charset->_str.left = -1;
+		_charset->_left = -1;
 
 		// Restore background on the whole text area. This code is based on
 		// restoreBackground(), but was changed to only restore those parts which are
 		// currently covered by the charset mask.
 
-		VirtScreen *vs = &_vm->virtscr[_textScreenID];
+		VirtScreen *vs = &virtscr[_charset->_textScreenID];
 		if (!vs->h)
 			return;
 
-		_vm->markRectAsDirty(vs->number, Common::Rect(vs->w, vs->h), USAGE_BIT_RESTORED);
+		markRectAsDirty(vs->number, Common::Rect(vs->w, vs->h), USAGE_BIT_RESTORED);
 	
 		byte *screenBuf = vs->getPixels(0, 0);
 
-		if (vs->hasTwoBuffers && _vm->_currentRoom != 0 && _vm->isLightOn()) {
+		if (vs->hasTwoBuffers && _currentRoom != 0 && isLightOn()) {
 			if (vs->number != kMainVirtScreen) {
 				// Restore from back buffer
 				const byte *backBuf = vs->getBackPixels(0, 0);
@@ -951,11 +951,11 @@
 	}
 }
 
-void CharsetRenderer::clearCharsetMask() {
-	memset(_vm->getResourceAddress(rtBuffer, 9), 0, _vm->_gdi->_imgBufOffs[1]);
+void ScummEngine::clearCharsetMask() {
+	memset(getResourceAddress(rtBuffer, 9), 0, _gdi->_imgBufOffs[1]);
 }
 
-void CharsetRenderer::clearTextSurface() {
+void ScummEngine::clearTextSurface() {
 	memset(_textSurface.pixels, CHARSET_MASK_TRANSPARENCY, _textSurface.pitch * _textSurface.h);
 }
 
@@ -1098,8 +1098,8 @@
 			error("can only copy bg to main window");
 		blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height);
 		if (_charset->_hasMask) {
-			byte *mask = (byte *)_charset->_textSurface.getBasePtr(x, y - _screenTop);
-			fill(mask, _charset->_textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width, height);
+			byte *mask = (byte *)_textSurface.getBasePtr(x, y - _screenTop);
+			fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width, height);
 		}
 	} else if (_game.heversion == 100) {
 		// Flags are used for different methods in HE games

Modified: scummvm/trunk/engines/scumm/he/script_v70he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v70he.cpp	2007-01-28 18:47:10 UTC (rev 25249)
+++ scummvm/trunk/engines/scumm/he/script_v70he.cpp	2007-01-28 20:11:31 UTC (rev 25250)
@@ -784,7 +784,7 @@
 		_skipDrawObject = 0;
 		break;
 	case 23:
-		_charset->clearCharsetMask();
+		clearCharsetMask();
 		_fullRedraw = true;
 		break;
 	case 24:

Modified: scummvm/trunk/engines/scumm/he/script_v90he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v90he.cpp	2007-01-28 18:47:10 UTC (rev 25249)
+++ scummvm/trunk/engines/scumm/he/script_v90he.cpp	2007-01-28 20:11:31 UTC (rev 25250)
@@ -2594,7 +2594,7 @@
 		_skipDrawObject = 0;
 		break;
 	case 23:
-		_charset->clearCharsetMask();
+		clearCharsetMask();
 		_fullRedraw = true;
 		break;
 	case 24:

Modified: scummvm/trunk/engines/scumm/saveload.cpp
===================================================================
--- scummvm/trunk/engines/scumm/saveload.cpp	2007-01-28 18:47:10 UTC (rev 25249)
+++ scummvm/trunk/engines/scumm/saveload.cpp	2007-01-28 20:11:31 UTC (rev 25250)
@@ -353,7 +353,7 @@
 
 	// Reset charset mask
 	_charset->_hasMask = false;
-	_charset->clearTextSurface();
+	clearTextSurface();
 
 	_lastCodePtr = NULL;
 	_drawObjectQueNr = 0;

Modified: scummvm/trunk/engines/scumm/script_v6.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v6.cpp	2007-01-28 18:47:10 UTC (rev 25249)
+++ scummvm/trunk/engines/scumm/script_v6.cpp	2007-01-28 20:11:31 UTC (rev 25250)
@@ -2650,7 +2650,7 @@
 		setShadowPalette(args[3], args[4], args[5], args[1], args[2], 0, 256);
 		break;
 	case 110:
-		_charset->clearCharsetMask();
+		clearCharsetMask();
 		break;
 	case 111:
 		a = derefActor(args[1], "o6_kernelSetFunctions: 111");

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2007-01-28 18:47:10 UTC (rev 25249)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2007-01-28 20:11:31 UTC (rev 25250)
@@ -529,6 +529,8 @@
 	delete _costumeLoader;
 	delete _costumeRenderer;
 
+	_textSurface.free();
+
 	free(_shadowPalette);
 
 	free(_palManipPalette);
@@ -1074,6 +1076,10 @@
 	// Create the charset renderer
 	setupCharsetRenderer();
 
+	// Create and clear the text surface
+	_textSurface.create(_screenWidth, _screenHeight, 1);
+	clearTextSurface();
+
 	// Create the costume renderer
 	setupCostumeRenderer();
 
@@ -1324,6 +1330,8 @@
 	_defaultTalkDelay = 3;
 	_talkDelay = 0;
 	_keepText = false;
+	_nextLeft = 0;
+	_nextTop = 0;
 
 	_currentCursor = 0;
 	_cursor.state = 0;
@@ -1732,7 +1740,7 @@
 	scummLoop_handleSaveLoad();
 
 	if (_completeScreenRedraw) {
-		_charset->clearCharsetMask();
+		clearCharsetMask();
 		_charset->_hasMask = false;
 
 		// HACK as in game save stuff isn't supported currently

Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h	2007-01-28 18:47:10 UTC (rev 25249)
+++ scummvm/trunk/engines/scumm/scumm.h	2007-01-28 20:11:31 UTC (rev 25250)
@@ -1162,6 +1162,13 @@
 public:
 	CharsetRenderer *_charset;
 	byte _charsetColorMap[16];
+
+	/**
+	 * All text is normally rendered into this overlay surface. Then later
+	 * drawStripToScreen() composits it over the game graphics.
+	 */
+	Graphics::Surface _textSurface;
+
 protected:
 	byte _charsetColor;
 	byte _charsetData[23][16];
@@ -1171,6 +1178,12 @@
 
 	bool _keepText;
 
+	int _nextLeft, _nextTop;
+
+	void restoreCharsetBg();
+	void clearCharsetMask();
+	void clearTextSurface();
+
 	virtual void initCharset(int charset);
 
 	void printString(int m, const byte *msg);

Modified: scummvm/trunk/engines/scumm/string.cpp
===================================================================
--- scummvm/trunk/engines/scumm/string.cpp	2007-01-28 18:47:10 UTC (rev 25249)
+++ scummvm/trunk/engines/scumm/string.cpp	2007-01-28 20:11:31 UTC (rev 25250)
@@ -311,7 +311,7 @@
 			_charset->setCurID(*buffer++);
 			buffer += 2;
 			memcpy(_charsetColorMap, _charsetData[_charset->getCurID()], 4);
-			_charset->_nextTop -= _charset->getFontHeight() - oldy;
+			_nextTop -= _charset->getFontHeight() - oldy;
 			break;
 		default:
 			error("handleNextCharsetCode: invalid code %d", c);
@@ -506,18 +506,18 @@
 		if (_game.version >= 7) {
 #ifndef DISABLE_SCUMM_7_8
 			((ScummEngine_v7 *)this)->clearSubtitleQueue();
-			_charset->_nextLeft = _string[0].xpos;
-			_charset->_nextTop = _string[0].ypos;
+			_nextLeft = _string[0].xpos;
+			_nextTop = _string[0].ypos;
 #endif
 		} else {
-			_charset->restoreCharsetBg();
+			restoreCharsetBg();
 		}
 	}
 
 	t = _charset->_right - _string[0].xpos - 1;
 	if (_charset->_center) {
-		if (t > _charset->_nextLeft)
-			t = _charset->_nextLeft;
+		if (t > _nextLeft)
+			t = _nextLeft;
 		t *= 2;
 	}
 
@@ -525,9 +525,9 @@
 		_charset->addLinebreaks(0, _charsetBuffer + _charsetBufPos, 0, t);
 
 	if (_charset->_center) {
-		_charset->_nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2;
-		if (_charset->_nextLeft < 0)
-			_charset->_nextLeft = 0;
+		_nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2;
+		if (_nextLeft < 0)
+			_nextLeft = 0;
 	}
 
 	_charset->_disableOffsX = _charset->_firstChar = !_keepText;
@@ -542,7 +542,7 @@
 
 		if (c == 13) {
 		newLine:;
-			_charset->_nextLeft = _string[0].xpos;
+			_nextLeft = _string[0].xpos;
 #ifndef DISABLE_SCUMM_7_8			
 			if (_game.version >= 7 && subtitleLine != subtitleBuffer) {
 				((ScummEngine_v7 *)this)->addSubtitleToQueue(subtitleBuffer, subtitlePos, _charsetColor, _charset->getCurID());
@@ -550,15 +550,15 @@
 			}
 #endif
 			if (_charset->_center) {
-				_charset->_nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2;
+				_nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2;
 			}
 
 			if (_game.version == 0) {
 				break;
 			} else if (!(_game.platform == Common::kPlatformFMTowns) && _string[0].height) {
-				_charset->_nextTop += _string[0].height;
+				_nextTop += _string[0].height;
 			} else {
-				_charset->_nextTop += _charset->getFontHeight();
+				_nextTop += _charset->getFontHeight();
 			}
 			if (_game.version > 3) {
 				// FIXME - is this really needed?
@@ -568,16 +568,16 @@
 		}
 
 		// Handle line overflow for V3. See also bug #1306269.
-		if (_game.version == 3 && _charset->_nextLeft >= _screenWidth) {
-			_charset->_nextLeft = _screenWidth;
+		if (_game.version == 3 && _nextLeft >= _screenWidth) {
+			_nextLeft = _screenWidth;
 		}
 		// Handle line breaks for V1-V2
-		if (_game.version <= 2 && _charset->_nextLeft >= _screenWidth) {
+		if (_game.version <= 2 && _nextLeft >= _screenWidth) {
 			goto newLine;
 		}
 
-		_charset->_left = _charset->_nextLeft;
-		_charset->_top = _charset->_nextTop;
+		_charset->_left = _nextLeft;
+		_charset->_top = _nextTop;
 
 		if (_game.version >= 7) {
 #ifndef DISABLE_SCUMM_7_8
@@ -614,8 +614,8 @@
 					_charset->printChar(c, false);
 				}
 			}
-			_charset->_nextLeft = _charset->_left;
-			_charset->_nextTop = _charset->_top;
+			_nextLeft = _charset->_left;
+			_nextTop = _charset->_top;
 		}
 
 		if (_game.version <= 2) {
@@ -695,8 +695,6 @@
 		_charset->_left -= _charset->getStringWidth(a, buf) / 2;
 	}
 
-	const bool ignoreCharsetMask = (_game.version < 7);
-
 	if (!buf[0]) {
 		buf[0] = ' ';
 		buf[1] = 0;
@@ -732,7 +730,7 @@
 					_charset->_left = _charset->_startLeft;
 				}
 				if (!(_game.platform == Common::kPlatformFMTowns) && _string[0].height) {
-					_charset->_nextTop += _string[0].height;
+					_nextTop += _string[0].height;
 				} else {
 					_charset->_top += fontHeight;
 				}
@@ -774,7 +772,7 @@
 					}
 				}
 			}
-			_charset->printChar(c, ignoreCharsetMask);
+			_charset->printChar(c, (_game.version < 7));
 			_charset->_blitAlso = false;
 
 			if (cmi_pos_hack) {
@@ -785,8 +783,8 @@
 	}
 
 	if (a == 0) {
-		_charset->_nextLeft = _charset->_left;
-		_charset->_nextTop = _charset->_top;
+		_nextLeft = _charset->_left;
+		_nextTop = _charset->_top;
 	}
 
 	_string[a].xpos = _charset->_str.right + 8;	// Indy3: Fixes Grail Diary text positioning


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