[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.294,2.295 script_v90he.cpp,2.83,2.84

Gregory Montoir cyx at users.sourceforge.net
Fri Oct 8 11:08:53 CEST 2004


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

Modified Files:
	intern.h script_v90he.cpp 
Log Message:
more math opcodes

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.294
retrieving revision 2.295
diff -u -d -r2.294 -r2.295
--- intern.h	8 Oct 2004 07:13:13 -0000	2.294
+++ intern.h	8 Oct 2004 17:56:08 -0000	2.295
@@ -868,10 +868,13 @@
 	
 	/* HE version 90 script opcodes */
 	void o90_dup();
-	void o90_getLT();
-	void o90_getGT();
+	void o90_min();
+	void o90_max();
 	void o90_sin();
 	void o90_cos();
+	void o90_sqrt();
+	void o90_atan2();
+	void o90_getSegmentAngle();
 	void o90_startLocalScript();
 	void o90_wizImageOps();
 	void o90_unknown25();

Index: script_v90he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v90he.cpp,v
retrieving revision 2.83
retrieving revision 2.84
diff -u -d -r2.83 -r2.84
--- script_v90he.cpp	8 Oct 2004 07:13:13 -0000	2.83
+++ script_v90he.cpp	8 Oct 2004 17:56:08 -0000	2.84
@@ -80,14 +80,14 @@
 		OPCODE(o72_isAnyOf),
 		/* 1C */
 		OPCODE(o90_wizImageOps),
-		OPCODE(o90_getLT),
-		OPCODE(o90_getGT),
+		OPCODE(o90_min),
+		OPCODE(o90_max),
 		OPCODE(o90_sin),
 		/* 20 */
 		OPCODE(o90_cos),
-		OPCODE(o6_invalid),
-		OPCODE(o6_invalid),
-		OPCODE(o6_invalid),
+		OPCODE(o90_sqrt),
+		OPCODE(o90_atan2),
+		OPCODE(o90_getSegmentAngle),
 		/* 24 */
 		OPCODE(o6_invalid),
 		OPCODE(o90_unknown25),
@@ -388,7 +388,7 @@
 	}
 }
 
-void ScummEngine_v90he::o90_getLT() {
+void ScummEngine_v90he::o90_min() {
 	int a = pop();
 	int b = pop();
 
@@ -399,7 +399,7 @@
 	}
 }
 
-void ScummEngine_v90he::o90_getGT() {
+void ScummEngine_v90he::o90_max() {
 	int a = pop();
 	int b = pop();
 
@@ -420,6 +420,37 @@
 	push((int)(cos(a) * 100000));	
 }
 
+void ScummEngine_v90he::o90_sqrt() {
+	int i = pop();
+	if (i < 2) {
+		push(i);
+	} else {
+		push((int)sqrt(i + 1));
+	}
+}
+
+void ScummEngine_v90he::o90_atan2() {
+	int y = pop();
+	int x = pop();
+	int a = (int)(atan2(y, x) * 180. / PI);
+	if (a < 0) {
+		a += 360;
+	}
+	push(a);
+}
+
+void ScummEngine_v90he::o90_getSegmentAngle() {
+	int y1 = pop();
+	int x1 = pop();
+	int dy = y1 - pop();
+	int dx = x1 - pop();
+	int a = (int)(atan2(dy, dx) * 180. / PI);
+	if (a < 0) {
+		a += 360;
+	}
+	push(a);
+}
+
 void ScummEngine_v90he::o90_startLocalScript() {
 	int args[16];
 	int script, entryp;





More information about the Scummvm-git-logs mailing list