[Scummvm-cvs-logs] CVS: scummvm script_v2.cpp,1.66,1.67 scumm.h,1.169,1.170 string.cpp,1.42,1.43

Pawe? Ko?odziejski aquadran at users.sourceforge.net
Sat May 25 01:54:01 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv2720

Modified Files:
	script_v2.cpp scumm.h string.cpp 
Log Message:
The Dig: implement descriptions

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v2.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- script_v2.cpp	23 May 2002 00:37:00 -0000	1.66
+++ script_v2.cpp	25 May 2002 08:53:08 -0000	1.67
@@ -2728,10 +2728,18 @@
 			_insaneFlag = args[1];
 			break;
 		case 16:
-			byte buf[200];
-			_msgPtrToAdd = buf;
-			addMessageToStack(getStringAddressVar(VAR_STRING2DRAW));
-			
+			if (_gameId == GID_DIG) {
+				_msgPtrToAdd = charset._buffer;
+				_messagePtr = addMessageToStack(getStringAddressVar(VAR_STRING2DRAW));
+				i = 0;
+				while (charset._buffer[i] != 0)	{
+					if (charset._buffer[i] == '/') {
+						charset._bufPos = i + 1;
+					}
+					i++;
+				}
+				description();
+			}
 			break;
 		case 17:
 			warning("o6_miscOps: stub17(%d,%d,%d,%d)", args[1], args[2], args[3],

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -d -r1.169 -r1.170
--- scumm.h	23 May 2002 21:22:07 -0000	1.169
+++ scumm.h	25 May 2002 08:53:08 -0000	1.170
@@ -1210,6 +1210,7 @@
 	void restoreCharsetBg();
 	int hasCharsetMask(int x, int y, int x2, int y2);
 	void CHARSET_1();
+	void description();
 	byte *_msgPtrToAdd;
 	byte *addMessageToStack(byte *msg);
 	void unkAddMsgToStack2(int var);

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/string.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- string.cpp	14 May 2002 23:32:34 -0000	1.42
+++ string.cpp	25 May 2002 08:53:08 -0000	1.43
@@ -440,6 +440,57 @@
 	gdi._mask_bottom = charset._strBottom;
 }
 
+void Scumm::description()
+{
+	int c;
+	byte *buffer;
+
+	buffer = charset._buffer + charset._bufPos;
+	string[0].ypos = camera._cur.y + 88;
+	string[0].xpos = 160 - (charset.getStringWidth(0, buffer, 0) >> 1);
+	if (string[0].xpos < 0)
+		string[0].xpos = 0;
+
+	charset._top = string[0].ypos;
+	charset._left = string[0].xpos;
+	charset._left2 = string[0].xpos;
+	charset._right = 319;
+	charset._xpos2 = string[0].xpos;
+	charset._ypos2 = string[0].ypos;
+	charset._disableOffsX = charset._unk12 = 1;
+	charset._curId = 3;
+	charset._center = false;
+	charset._color = 15;
+	_bkColor = 0;
+	_talkDelay = 1;
+
+	restoreCharsetBg();
+
+	_lastXstart = virtscr[0].xstart;
+
+	do {
+		c = *buffer++;
+		if (c == 0) {
+			_haveMsg = 1;
+			break;
+		}
+		if (c != 0xFF) {
+			charset._left = charset._xpos2;
+			charset._top = charset._ypos2;
+			charset.printChar(c);
+			charset._xpos2 = charset._left;
+			charset._ypos2 = charset._top;
+			continue;
+		}
+
+	} while (1);
+
+	gdi._mask_left = charset._strLeft;
+	gdi._mask_right = charset._strRight;
+	gdi._mask_top = charset._strTop;
+	gdi._mask_bottom = charset._strBottom;
+}
+
 void Scumm::drawString(int a)
 {
 	byte buf[256];





More information about the Scummvm-git-logs mailing list