[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.87,1.88 charset.h,2.13,2.14 gfx.cpp,2.97,2.98 script_v2.cpp,2.64,2.65 scumm.h,1.187,1.188 scummvm.cpp,2.144,2.145 string.cpp,1.109,1.110 vars.cpp,1.47,1.48

Max Horn fingolfin at users.sourceforge.net
Wed May 14 06:31:15 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv18630

Modified Files:
	actor.cpp charset.h gfx.cpp script_v2.cpp scumm.h scummvm.cpp 
	string.cpp vars.cpp 
Log Message:
V2 text drawing

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- actor.cpp	14 May 2003 09:49:44 -0000	1.87
+++ actor.cpp	14 May 2003 13:30:52 -0000	1.88
@@ -1162,6 +1162,8 @@
 	_talkDelay = 0;
 	_haveMsg = 0xFF;
 	VAR(VAR_HAVE_MSG) = 0xFF;
+	if (VAR_CHARCOUNT != 0xFF)
+		VAR(VAR_CHARCOUNT) = 0;
 	CHARSET_1();
 }
 

Index: charset.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.h,v
retrieving revision 2.13
retrieving revision 2.14
diff -u -d -r2.13 -r2.14
--- charset.h	14 May 2003 12:12:55 -0000	2.13
+++ charset.h	14 May 2003 13:30:52 -0000	2.14
@@ -110,6 +110,7 @@
 	void printChar(int chr);
 	void setCurID(byte id);
 	void setColor(byte color);
+	int getFontHeight() { return 8; }
 };
 
 class CharsetRendererV2 : public CharsetRendererV3 {
@@ -120,7 +121,6 @@
 	CharsetRendererV2(Scumm *vm) : CharsetRendererV3(vm) {}
 	
 	void setCurID(byte id);
-	int getFontHeight() { return 8; }
 };
 
 class CharsetRendererNut : public CharsetRenderer {

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.97
retrieving revision 2.98
diff -u -d -r2.97 -r2.98
--- gfx.cpp	14 May 2003 09:47:52 -0000	2.97
+++ gfx.cpp	14 May 2003 13:30:52 -0000	2.98
@@ -376,7 +376,7 @@
 	byte *src;
 
 	updateDirtyScreen(2);
-	if (_features & GF_AFTER_V3)
+	if (_features & GF_AFTER_V2 || _features & GF_AFTER_V3)
 		updateDirtyScreen(1);
 
 	if (camera._last.x == camera._cur.x && (camera._last.y == camera._cur.y || !(_features & GF_AFTER_V7))) {

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.64
retrieving revision 2.65
diff -u -d -r2.64 -r2.65
--- script_v2.cpp	14 May 2003 12:32:40 -0000	2.64
+++ script_v2.cpp	14 May 2003 13:30:52 -0000	2.65
@@ -395,6 +395,48 @@
 	*ptr = 0;
 
 	printf("TODO: Scumm_v2::decodeParseString(\"%s\") from %d\n", buffer, vm.slot[_currentScript].number);
+
+	int textSlot;
+
+	if (_actorToPrintStrFor < 128)
+		textSlot = 0;
+	else
+		textSlot = 1;
+
+	textSlot = 0;
+	
+	_string[textSlot].xpos = 0;
+	_string[textSlot].ypos = 0;
+	_string[textSlot].right = 320;
+	_string[textSlot].center = false;
+	_string[textSlot].overhead = false;
+	_string[textSlot].color = 13;	// HACK, make it pink, just for fun 8-)
+
+	_messagePtr = buffer;
+	switch (textSlot) {
+	case 0:
+		actorTalk();
+		break;
+	case 1:
+		drawString(1);
+		break;
+	case 2:
+		unkMessage1();
+		break;
+	case 3:
+		unkMessage2();
+		break;
+	}
+
+/*
+	_string[textSlot].t_xpos = _string[textSlot].xpos;
+	_string[textSlot].t_ypos = _string[textSlot].ypos;
+	_string[textSlot].t_center = _string[textSlot].center;
+	_string[textSlot].t_overhead = _string[textSlot].overhead;
+	_string[textSlot].t_right = _string[textSlot].right;
+	_string[textSlot].t_color = _string[textSlot].color;
+	_string[textSlot].t_charset = _string[textSlot].charset;
+*/
 }
 
 int Scumm_v2::readVar(uint var) {
@@ -752,9 +794,11 @@
 		int x = fetchScriptByte() << 3;
 		int y = fetchScriptByte() << 3;
 		slot = getVarOrDirectByte(0x80) + 1;
-		// int unk = fetchScriptByte(); // ?
-		fetchScriptByte();
+		/*int unk =*/ fetchScriptByte(); // ?
 		
+		//printf("o2_verbOps: verb = %d, slot = %d, x = %d, y = %d, unk = %d, name = %s\n",
+		//		verb, slot, x, y, unk, _scriptPointer);
+
 		VerbSlot *vs;
 		assert(0 < slot && slot < _maxVerbs);
 
@@ -773,9 +817,6 @@
 		
 		vs->x = x;
 		vs->y = y;
-
-		//printf("o2_verbOps: verb = %d, slot = %d, x = %d, y = %d, unk = %d, name = %s\n",
-		//		verb, slot, x, y, unk, _scriptPointer);
 
 		// It follows the verb name
 		loadPtrToResource(rtVerb, slot, NULL);

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -d -r1.187 -r1.188
--- scumm.h	13 May 2003 23:42:41 -0000	1.187
+++ scumm.h	14 May 2003 13:30:52 -0000	1.188
@@ -1091,6 +1091,7 @@
 	byte VAR_CUTSCENE_START_SCRIPT;
 	byte VAR_CUTSCENE_END_SCRIPT;
 	byte VAR_CHARINC;
+	byte VAR_CHARCOUNT;
 	byte VAR_WALKTO_OBJ;
 	byte VAR_DEBUGMODE;
 	byte VAR_HEAPSPACE;

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.144
retrieving revision 2.145
diff -u -d -r2.144 -r2.145
--- scummvm.cpp	14 May 2003 11:08:57 -0000	2.144
+++ scummvm.cpp	14 May 2003 13:30:52 -0000	2.145
@@ -439,6 +439,7 @@
 	VAR_CUTSCENE_START_SCRIPT = 0xFF;
 	VAR_CUTSCENE_END_SCRIPT = 0xFF;
 	VAR_CHARINC = 0xFF;
+	VAR_CHARCOUNT = 0xFF;
 	VAR_WALKTO_OBJ = 0xFF;
 	VAR_DEBUGMODE = 0xFF;
 	VAR_HEAPSPACE = 0xFF;

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- string.cpp	12 May 2003 22:08:39 -0000	1.109
+++ string.cpp	14 May 2003 13:30:52 -0000	1.110
@@ -141,7 +141,7 @@
 	_charset->_right = _string[0].right;
 	_charset->setColor(_charsetColor);
 
-	if (!(_features & GF_AFTER_V3))	// FIXME
+	if (!(_features & GF_AFTER_V2 || _features & GF_AFTER_V3))	// FIXME
 		for (i = 0; i < 4; i++)
 			_charsetColorMap[i] = _charsetData[_charset->getCurID()][i];
 
@@ -184,7 +184,7 @@
 	_talkDelay = _defaultTalkDelay;
 
 	if (!_keepText) {
-		if (_features & GF_AFTER_V3 && _gameId != GID_LOOM) {
+		if ((_features & GF_AFTER_V2 || _features & GF_AFTER_V3) && _gameId != GID_LOOM) {
 			gdi._mask_left = _string[0].xpos;
 			gdi._mask_top = _string[0].ypos;
 			gdi._mask_bottom = _string[0].ypos + 8;
@@ -224,22 +224,16 @@
 		}
 		if (c == 13) {
 		newLine:;
-			if (_features & GF_AFTER_V3) {
-				_charset->_nextTop += 8;
-				_charset->_nextLeft = _string[0].xpos;
-				if (_charset->_center) {
-					_charset->_nextLeft -= _charset->getStringWidth(0, buffer) >> 1;
-				}
-				continue;
-			} else {
-				_charset->_nextLeft = _string[0].xpos;
-				if (_charset->_center) {
-					_charset->_nextLeft -= _charset->getStringWidth(0, buffer) >> 1;
-				}
-				_charset->_nextTop += _charset->getFontHeight();
+			_charset->_nextLeft = _string[0].xpos;
+			if (_charset->_center) {
+				_charset->_nextLeft -= _charset->getStringWidth(0, buffer) >> 1;
+			}
+			_charset->_nextTop += _charset->getFontHeight();
+			if (!(_features & GF_AFTER_V2 || _features & GF_AFTER_V3)) {
+				// FIXME - is this really needed?
 				_charset->_disableOffsX = true;
-				continue;
 			}
+			continue;
 		}
 
 		if (c == 0xFE)
@@ -248,7 +242,7 @@
 		if (c != 0xFF) {
 			_charset->_left = _charset->_nextLeft;
 			_charset->_top = _charset->_nextTop;
-			if (_features & GF_AFTER_V3) {
+			if (_features & GF_AFTER_V2 || _features & GF_AFTER_V3) {
 				_charset->printChar(c);
 			} else if (_features & GF_AFTER_V6) {
 				if (!_noSubtitles || (_haveMsg != 0xFE && _haveMsg != 0xFF))
@@ -260,7 +254,11 @@
 
 			_charset->_nextLeft = _charset->_left;
 			_charset->_nextTop = _charset->_top;
-			_talkDelay += (int)VAR(VAR_CHARINC);
+			if (_features & GF_AFTER_V2) {
+				_talkDelay += _defaultTalkDelay / 20;
+				VAR(VAR_CHARCOUNT)++;
+			} else
+				_talkDelay += (int)VAR(VAR_CHARINC);
 			continue;
 		}
 
@@ -410,12 +408,12 @@
 	_charset->_disableOffsX = _charset->_firstChar = true;
 	_charset->setCurID(_string[a].charset);
 
-	if (!(_features & GF_AFTER_V3)) {
+	if (!(_features & GF_AFTER_V2 || _features & GF_AFTER_V3)) {
 		for (i = 0; i < 4; i++)
 			_charsetColorMap[i] = _charsetData[_charset->getCurID()][i];
-
-		fontHeight = _charset->getFontHeight();
 	}
+
+	fontHeight = _charset->getFontHeight();
 
 	_msgPtrToAdd = buf;
 

Index: vars.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/vars.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- vars.cpp	13 May 2003 17:51:56 -0000	1.47
+++ vars.cpp	14 May 2003 13:30:52 -0000	1.48
@@ -105,6 +105,7 @@
 	VAR_ROOM = 4;
 	VAR_OVERRIDE = 5;
 	VAR_MACHINE_SPEED = 6;
+	VAR_CHARCOUNT = 7;
 	VAR_NUM_ACTOR = 11;
 	VAR_CURRENT_LIGHTS = 12;
 	VAR_CURRENTDRIVE = 13;





More information about the Scummvm-git-logs mailing list