[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.485,2.486 gfx.h,1.124,1.125 script_v5.cpp,1.302,1.303 string.cpp,1.316,1.317 verbs.cpp,1.144,1.145

Max Horn fingolfin at users.sourceforge.net
Mon Jan 9 16:35:01 CET 2006


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

Modified Files:
	gfx.cpp gfx.h script_v5.cpp string.cpp verbs.cpp 
Log Message:
Cleanup; moving things around a bit

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.485
retrieving revision 2.486
diff -u -d -r2.485 -r2.486
--- gfx.cpp	6 Jan 2006 15:02:07 -0000	2.485
+++ gfx.cpp	10 Jan 2006 00:34:02 -0000	2.486
@@ -687,7 +687,7 @@
 		// Resize main virtual screen in V7 games. This is necessary
 		// because in V7, rooms may be higher than one screen, so we have
 		// to accomodate for that.
-		initVirtScreen(kMainVirtScreen, virtscr[0].topline, _screenWidth, height, 1, 1);
+		initVirtScreen(kMainVirtScreen, virtscr[0].topline, _screenWidth, height, true, true);
 	}
 
 	if (_heversion >= 70)

Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.h,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- gfx.h	1 Jan 2006 09:51:11 -0000	1.124
+++ gfx.h	10 Jan 2006 00:34:13 -0000	1.125
@@ -88,10 +88,6 @@
 	/**
 	 * Vertical position of the virtual screen. Tells how much the virtual
 	 * screen is shifted along the y axis relative to the real screen.
-	 * If you wonder why there is no horizontal position: there is none,
-	 * because all virtual screens are always exactly as wide as the
-	 * real screen. This might change in the future to allow smooth
-	 * horizontal scrolling in V7-V8 games.
 	 */
 	uint16 topline;
 
@@ -103,8 +99,8 @@
 	uint16 xstart;
 
 	/**
-	 * Flag indicating  which tells whether this screen has a back buffer or
-	 * not. This is yet another feature which is only used by the main screen.
+	 * Flag indicating whether this screen has a back buffer or not. This is
+	 * yet another feature which is only used by the main screen.
 	 * Strictly spoken one could remove this variable and replace checks
 	 * on it with checks on backBuf. But since some code needs to temporarily
 	 * disable the backBuf (so it can abuse drawBitmap; see drawVerbBitmap()

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.302
retrieving revision 1.303
diff -u -d -r1.302 -r1.303
--- script_v5.cpp	18 Oct 2005 01:30:21 -0000	1.302
+++ script_v5.cpp	10 Jan 2006 00:34:13 -0000	1.303
@@ -2818,7 +2818,7 @@
 				int byte_2FCCF = 0;
 
 				// For now, we force a redraw of the screen background. This
-				// Makes the Zak end credits work more or less correctly.
+				// way the Zak end credits seem to work mostly correct.
 				VirtScreen *vs = &virtscr[0];
 				restoreBG(Common::Rect(0,vs->topline, vs->w, vs->topline + vs->h));
 				vs->setDirtyRange(0, vs->h);

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.316
retrieving revision 1.317
diff -u -d -r1.316 -r1.317
--- string.cpp	10 Jan 2006 00:28:10 -0000	1.316
+++ string.cpp	10 Jan 2006 00:34:13 -0000	1.317
@@ -36,6 +36,13 @@
 
 namespace Scumm {
 
+
+
+#pragma mark -
+#pragma mark --- "High level" message code ---
+#pragma mark -
+
+
 void ScummEngine::printString(int m, const byte *msg) {
 	switch (m) {
 	case 0:
@@ -95,6 +102,95 @@
 	VAR(VAR_KEYPRESS) = runDialog(dialog);
 }
 
+
+#pragma mark -
+#pragma mark --- V6 blast text queue code ---
+#pragma mark -
+
+
+void ScummEngine_v6::enqueueText(const byte *text, int x, int y, byte color, byte charset, bool center) {
+	BlastText &bt = _blastTextQueue[_blastTextQueuePos++];
+	assert(_blastTextQueuePos <= ARRAYSIZE(_blastTextQueue));
+
+	convertMessageToString(text, bt.text, sizeof(bt.text));
+	bt.xpos = x;
+	bt.ypos = y;
+	bt.color = color;
+	bt.charset = charset;
+	bt.center = center;
+}
+
+void ScummEngine_v6::drawBlastTexts() {
+	byte *buf;
+	int c;
+	int i;
+
+	for (i = 0; i < _blastTextQueuePos; i++) {
+
+		buf = _blastTextQueue[i].text;
+
+		_charset->_top = _blastTextQueue[i].ypos + _screenTop;
+		_charset->_right = _screenWidth - 1;
+		_charset->_center = _blastTextQueue[i].center;
+		_charset->setColor(_blastTextQueue[i].color);
+		_charset->_disableOffsX = _charset->_firstChar = true;
+		_charset->setCurID(_blastTextQueue[i].charset);
+
+		do {
+			_charset->_left = _blastTextQueue[i].xpos;
+
+			// Center text if necessary
+			if (_charset->_center) {
+				_charset->_left -= _charset->getStringWidth(0, buf) / 2;
+				if (_charset->_left < 0)
+					_charset->_left = 0;
+			}
+
+			do {
+				c = *buf++;
+				
+				// FIXME: This is a workaround for bugs #864030 and #1399843:
+				// In COMI, some text contains ASCII character 11 = 0xB. It's
+				// not quite clear what it is good for; so for now we just ignore
+				// it, which seems to match the original engine (BTW, traditionally,
+				// this is a 'vertical tab').
+				if (c == 0x0B)
+					continue;
+				
+				if (c != 0 && c != 0xFF && c != '\n') {
+					if (c & 0x80 && _useCJKMode) {
+						if (_language == Common::JA_JPN && !checkSJISCode(c)) {
+							c = 0x20; //not in S-JIS
+						} else {
+							c += *buf++ * 256;
+						}
+					}
+					_charset->printChar(c, true);
+				}
+			} while (c && c != '\n');
+
+			_charset->_top += _charset->getFontHeight();
+		} while (c);
+
+		_blastTextQueue[i].rect = _charset->_str;
+	}
+}
+
+void ScummEngine_v6::removeBlastTexts() {
+	int i;
+
+	for (i = 0; i < _blastTextQueuePos; i++) {
+		restoreBG(_blastTextQueue[i].rect);
+	}
+	_blastTextQueuePos = 0;
+}
+
+
+#pragma mark -
+#pragma mark --- V7 subtitle queue code ---
+#pragma mark -
+
+
 #ifndef DISABLE_SCUMM_7_8
 void ScummEngine_v7::processSubtitleQueue() {
 	for (int i = 0; i < _subtitleQueuePos; ++i) {
@@ -135,6 +231,13 @@
 }
 #endif
 
+
+
+#pragma mark -
+#pragma mark --- Core message/subtitle code ---
+#pragma mark -
+
+
 bool ScummEngine::handleNextCharsetCode(Actor *a, int *code) {
 	uint32 talk_sound_a = 0;
 	uint32 talk_sound_b = 0;
@@ -817,6 +920,12 @@
 	return 0;
 }
 
+
+#pragma mark -
+#pragma mark --- Charset initialisation ---
+#pragma mark -
+
+
 #ifndef DISABLE_HE
 void ScummEngine_v80he::initCharset(int charsetno) {
 	ScummEngine::initCharset(charsetno);
@@ -843,82 +952,11 @@
 
 }
 
-void ScummEngine_v6::enqueueText(const byte *text, int x, int y, byte color, byte charset, bool center) {
-	BlastText &bt = _blastTextQueue[_blastTextQueuePos++];
-	assert(_blastTextQueuePos <= ARRAYSIZE(_blastTextQueue));
 
-	convertMessageToString(text, bt.text, sizeof(bt.text));
-	bt.xpos = x;
-	bt.ypos = y;
-	bt.color = color;
-	bt.charset = charset;
-	bt.center = center;
-}
-
-void ScummEngine_v6::drawBlastTexts() {
-	byte *buf;
-	int c;
-	int i;
-
-	for (i = 0; i < _blastTextQueuePos; i++) {
-
-		buf = _blastTextQueue[i].text;
-
-		_charset->_top = _blastTextQueue[i].ypos + _screenTop;
-		_charset->_right = _screenWidth - 1;
-		_charset->_center = _blastTextQueue[i].center;
-		_charset->setColor(_blastTextQueue[i].color);
-		_charset->_disableOffsX = _charset->_firstChar = true;
-		_charset->setCurID(_blastTextQueue[i].charset);
-
-		do {
-			_charset->_left = _blastTextQueue[i].xpos;
-
-			// Center text if necessary
-			if (_charset->_center) {
-				_charset->_left -= _charset->getStringWidth(0, buf) / 2;
-				if (_charset->_left < 0)
-					_charset->_left = 0;
-			}
-
-			do {
-				c = *buf++;
-				
-				// FIXME: This is a workaround for bugs #864030 and #1399843:
-				// In COMI, some text contains ASCII character 11 = 0xB. It's
-				// not quite clear what it is good for; so for now we just ignore
-				// it, which seems to match the original engine (BTW, traditionally,
-				// this is a 'vertical tab').
-				if (c == 0x0B)
-					continue;
-				
-				if (c != 0 && c != 0xFF && c != '\n') {
-					if (c & 0x80 && _useCJKMode) {
-						if (_language == Common::JA_JPN && !checkSJISCode(c)) {
-							c = 0x20; //not in S-JIS
-						} else {
-							c += *buf++ * 256;
-						}
-					}
-					_charset->printChar(c, true);
-				}
-			} while (c && c != '\n');
-
-			_charset->_top += _charset->getFontHeight();
-		} while (c);
-
-		_blastTextQueue[i].rect = _charset->_str;
-	}
-}
-
-void ScummEngine_v6::removeBlastTexts() {
-	int i;
+#pragma mark -
+#pragma mark --- Translation/localization code ---
+#pragma mark -
 
-	for (i = 0; i < _blastTextQueuePos; i++) {
-		restoreBG(_blastTextQueue[i].rect);
-	}
-	_blastTextQueuePos = 0;
-}
 
 #ifndef DISABLE_SCUMM_7_8
 static int indexCompare(const void *p1, const void *p2) {

Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.cpp,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -d -r1.144 -r1.145
--- verbs.cpp	18 Oct 2005 01:30:21 -0000	1.144
+++ verbs.cpp	10 Jan 2006 00:34:13 -0000	1.145
@@ -723,7 +723,7 @@
 	gdi.disableZBuffer();
 
 	twobufs = vs->hasTwoBuffers;
-	vs->hasTwoBuffers = 0;
+	vs->hasTwoBuffers = false;
 
 	xstrip = x / 8;
 	ydiff = y - vs->topline;





More information about the Scummvm-git-logs mailing list