[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.66,2.67 intern.h,2.72,2.73 script_v2.cpp,2.37,2.38 script_v5.cpp,1.63,1.64

Max Horn fingolfin at users.sourceforge.net
Sat May 3 18:11:20 CEST 2003


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

Modified Files:
	gfx.cpp intern.h script_v2.cpp script_v5.cpp 
Log Message:
cleanup; got rid of o2_printEgo

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.66
retrieving revision 2.67
diff -u -d -r2.66 -r2.67
--- gfx.cpp	3 May 2003 20:49:52 -0000	2.66
+++ gfx.cpp	4 May 2003 01:10:45 -0000	2.67
@@ -39,7 +39,7 @@
 // Note: This is purely experimental, NOT WORKING COMPLETLY and very buggy.
 // Please do not make reports about problems with it - this is only in CVS
 // to get it fixed and so that really interested parties can experiment it.
-// It is NOT FIT FOR GENERAL USAGE!. You have been warned.
+// It is NOT FIT FOR GENERAL USAGE! You have been warned.
 //
 // Doing this correctly will be quite some more complicated. Basically, with smooth
 // scrolling, the virtual screen strips don't match the display screen strips.

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.72
retrieving revision 2.73
diff -u -d -r2.72 -r2.73
--- intern.h	4 May 2003 00:29:51 -0000	2.72
+++ intern.h	4 May 2003 01:10:45 -0000	2.73
@@ -44,7 +44,7 @@
 	virtual void executeOpcode(int i);
 	virtual const char *getOpcodeDesc(int i);
 
-	void decodeParseString();
+	virtual void decodeParseString();
 	int getWordVararg(int *ptr);
 
 	/* Version 5 script opcodes */
@@ -172,9 +172,6 @@
 };
 
 class Scumm_v2 : public Scumm_v3 {
-public:
-	Scumm_v2(GameDetector *detector, OSystem *syst) : Scumm_v3(detector, syst) {}
-
 protected:
 	void readIndexFile();
 	void loadCharset(int no);
@@ -188,11 +185,18 @@
 
 	const OpcodeEntryV2 *_opcodesV2;
 
-	virtual void setupScummVars();
+public:
+	Scumm_v2(GameDetector *detector, OSystem *syst) : Scumm_v3(detector, syst) {}
 
+protected:
 	virtual void setupOpcodes();
 	virtual void executeOpcode(int i);
 	virtual const char *getOpcodeDesc(int i);
+
+	virtual void setupScummVars();
+
+	virtual void decodeParseString();
+
 	virtual void ifStateCommon(byte type);
 	virtual void ifNotStateCommon(byte type);
 	virtual void setStateCommon(byte type);
@@ -225,7 +229,6 @@
 	void o2_ifNotState02();
 	void o2_ifState01();
 	void o2_ifNotState01();
-	void o2_printEgo();
 	void o2_actorSet();
 	void o2_waitForActor();
 	void o2_waitForSentence();
@@ -296,18 +299,16 @@
 
 protected:
 	virtual void setupOpcodes();
-
 	virtual void executeOpcode(int i);
 	virtual const char *getOpcodeDesc(int i);
 
 	virtual void setupScummVars();
 
-	int popRoomAndObj(int *room);
-	
-	void shuffleArray(int num, int minIdx, int maxIdx);
-
 	virtual void decodeParseString(int a, int b);
+
 	int getStackList(int *args, uint maxnum);
+	int popRoomAndObj(int *room);
+	void shuffleArray(int num, int minIdx, int maxIdx);
 
 	/* Version 6 script opcodes */
 	void o6_setBlastObjectWindow();
@@ -509,19 +510,18 @@
 
 protected:
 	virtual void setupOpcodes();
-
 	virtual void executeOpcode(int i);
 	virtual const char *getOpcodeDesc(int i);
 
 	virtual void setupScummVars();
 
+	virtual void decodeParseString(int m, int n);
+
 	virtual uint fetchScriptWord();
 	virtual int fetchScriptWordSigned();
 	
 	virtual int readVar(uint var);
 	virtual void writeVar(uint var, int value);
-
-	virtual void decodeParseString(int m, int n);
 
 	/* Version 8 script opcodes */
 	void o8_mod();

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.37
retrieving revision 2.38
diff -u -d -r2.37 -r2.38
--- script_v2.cpp	4 May 2003 00:41:52 -0000	2.37
+++ script_v2.cpp	4 May 2003 01:10:45 -0000	2.38
@@ -303,7 +303,7 @@
 		OPCODE(o5_getActorMoving),
 		OPCODE(o2_setState02),
 		/* D8 */
-		OPCODE(o2_printEgo),
+		OPCODE(o5_printEgo),
 		OPCODE(o2_doSentence),
 		OPCODE(o5_add),
 		OPCODE(o2_setBitVar),
@@ -832,14 +832,11 @@
 	}
 }
 
-void Scumm_v2::o2_printEgo() {
-	//_actorToPrintStrFor = (unsigned char)_vars[VAR_EGO];
-	//_messagePtr = _scriptPointer;
-
-	char buffer[256];	// FIXME
-	char *ptr = buffer;
-	char c;
-	while ((c = *_scriptPointer++)) {
+void Scumm_v2::decodeParseString() {
+	byte buffer[256];	// FIXME
+	byte *ptr = buffer;
+	byte c;
+	while ((c = fetchScriptByte())) {
 		if (c & 0x80) {
 			*ptr++ = c & 0x7f;
 			*ptr++ = ' ';
@@ -852,17 +849,14 @@
 			*ptr++ = c;
 			if (c > 3) {
 				*ptr++ = 0;
-				*ptr++ = *_scriptPointer++;
+				*ptr++ = fetchScriptByte();
 			}
 		} else
 			*ptr++ = c;
 	}
 	*ptr = 0;
 
-	printf("o2_printEgo(%s)\n", buffer);
-	
-	//_messagePtr = addMessageToStack(_messagePtr);
-	//_scriptPointer = _messagePtr;
+	printf("TODO: Scumm_v2::decodeParseString(\"%s\")\n", buffer);
 }
 
 void Scumm_v2::o2_ifClassOfIs() {

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- script_v5.cpp	4 May 2003 00:29:52 -0000	1.63
+++ script_v5.cpp	4 May 2003 01:10:45 -0000	1.64
@@ -1440,7 +1440,7 @@
 }
 
 void Scumm_v5::o5_printEgo() {
-	_actorToPrintStrFor = (unsigned char)_vars[VAR_EGO];
+	_actorToPrintStrFor = (byte)_vars[VAR_EGO];
 	decodeParseString();
 }
 





More information about the Scummvm-git-logs mailing list