[Scummvm-cvs-logs] CVS: scummvm script_v1.cpp,1.121,1.122 script_v2.cpp,1.73,1.74 scummvm.cpp,1.176,1.177 actor.h,1.9,1.10

Max Horn fingolfin at users.sourceforge.net
Sun Jul 14 18:39:02 CEST 2002


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

Modified Files:
	script_v1.cpp script_v2.cpp scummvm.cpp actor.h 
Log Message:
fixed pause mode; changed semantics of getRandomNumber slightly

Index: script_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v1.cpp,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- script_v1.cpp	13 Jul 2002 15:59:11 -0000	1.121
+++ script_v1.cpp	15 Jul 2002 01:38:51 -0000	1.122
@@ -783,7 +783,7 @@
 			getWordVararg(args);
 			for (i = 0; i < 16; i++)
 				if (args[i] != 0xFF)
-					a->palette[i] = args[i] /* & 0x0F */;
+					a->palette[i] = args[i];
 #endif
 			break;
 		case 16:										/* width */
@@ -1393,7 +1393,7 @@
 void Scumm::o5_getRandomNr()
 {
 	getResultPos();
-	setResult(getRandomNumber(getVarOrDirectByte(0x80) + 1));
+	setResult(getRandomNumber(getVarOrDirectByte(0x80)));
 }
 
 void Scumm::o5_getScriptRunning()

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v2.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- script_v2.cpp	13 Jul 2002 14:07:37 -0000	1.73
+++ script_v2.cpp	15 Jul 2002 01:38:51 -0000	1.74
@@ -1511,7 +1511,7 @@
 void Scumm::o6_getRandomNumber()
 {
 	int rnd;
-	rnd = getRandomNumber(pop() + 1);
+	rnd = getRandomNumber(pop());
 	_vars[VAR_V6_RANDOM_NR] = rnd;
 	push(rnd);
 }
@@ -1520,7 +1520,7 @@
 {
 	int max = pop();
 	int min = pop();
-	int rnd = getRandomNumber(max - min + 1) + min;
+	int rnd = getRandomNumberRng(min, max);
 	_vars[VAR_V6_RANDOM_NR] = rnd;
 	push(rnd);
 }

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -d -r1.176 -r1.177
--- scummvm.cpp	14 Jul 2002 04:54:56 -0000	1.176
+++ scummvm.cpp	15 Jul 2002 01:38:52 -0000	1.177
@@ -47,12 +47,12 @@
 	/* TODO: my own random number generator */
 	_randSeed1 = 0xDEADBEEF * (_randSeed1 + 1);
 	_randSeed1 = (_randSeed1 >> 13) | (_randSeed1 << 19);
-	return _randSeed1 % max;
+	return _randSeed1 % (max + 1);
 }
 
 uint Scumm::getRandomNumberRng(uint min, uint max)
 {
-	return getRandomNumber(max - min + 1) + min;
+	return getRandomNumber(max - min) + min;
 }
 
 
@@ -1260,6 +1260,14 @@
 	for(;;) {
 		while (_system->poll_event(&event)) {
 
+
+			// if newgui is running, copy event to EventList, and let the GUI handle it itself
+			// we might consider this approach for ScummLoop as well, and clean up the current mess
+			if (_newgui->isActive()) {
+				_newgui->handleEvent(event);
+				continue;
+			}
+
 			switch(event.event_code) {
 			case OSystem::EVENT_KEYDOWN:
 				if (event.kbd.keycode >= '0' && event.kbd.keycode<='9'
@@ -1315,12 +1323,6 @@
 				_rightBtnPressed &= ~msDown;
 				break;
 			}
-
-			// if newgui is running, copy event to EventList, and let the GUI handle it itself
-			// we might consider this approach for ScummLoop as well, and clean up the current mess
-			if (_newgui->isActive())
-				_newgui->handleEvent(event);
-
 		}
 #ifdef COMPRESSED_SOUND_FILE
 		if (updateMP3CD() == -1)

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- actor.h	7 Jul 2002 19:31:50 -0000	1.9
+++ actor.h	15 Jul 2002 01:38:52 -0000	1.10
@@ -63,7 +63,9 @@
 		for (int i = 0; i < 16; i++) {
 			active[i] = 0;
 			curpos[i] = start[i] = end[i] = frame[i] = 0xFFFF;
-}}};
+		}
+	}
+};
 
 class Actor {
 





More information about the Scummvm-git-logs mailing list