[Scummvm-cvs-logs] scummvm master -> 5fadff59f9b15936bd903d5e0bd51f225d243b82

bluegr bluegr at gmail.com
Sat May 11 16:11:28 CEST 2013


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c75480bf2f AGI: Remove obsolete TODO
5fadff59f9 AGI: Fix bug #3600733 - "AGI FANMADE: function slowing down game"


Commit: c75480bf2f4936c202d32c96a2b8331184963087
    https://github.com/scummvm/scummvm/commit/c75480bf2f4936c202d32c96a2b8331184963087
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-05-11T07:09:58-07:00

Commit Message:
AGI: Remove obsolete TODO

We now set the play time - commit 5e10737015faa15d225f70b364096982923eb415

Changed paths:
    engines/agi/detection.cpp



diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 54a8b9e..3f55117 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -318,8 +318,6 @@ SaveStateDescriptor AgiMetaEngine::querySaveMetaInfos(const char *target, int sl
 			int minutes = saveTime & 0xFF;
 
 			desc.setSaveTime(hour, minutes);
-
-			// TODO: played time
 		}
 
 


Commit: 5fadff59f9b15936bd903d5e0bd51f225d243b82
    https://github.com/scummvm/scummvm/commit/5fadff59f9b15936bd903d5e0bd51f225d243b82
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-05-11T07:09:59-07:00

Commit Message:
AGI: Fix bug #3600733 - "AGI FANMADE: function slowing down game"

We now only test for events in testKeypressed() without updating the
game cycle at all (NAGI doesn't update the game cycle either). This
fixes the slowdowns in some animations where have.key() is issued,
like Manannan's lightnings in the intro of KQ3 and the bullets in the
intro of PQ1

Changed paths:
    engines/agi/agi.h
    engines/agi/cycle.cpp
    engines/agi/op_test.cpp



diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index 520b0aa..93a456b 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -942,7 +942,7 @@ public:
 	void setvar(int, int);
 	void decrypt(uint8 *mem, int len);
 	void releaseSprites();
-	int mainCycle();
+	int mainCycle(bool onlyCheckForEvents = false);
 	int viewPictures();
 	int runGame();
 	void inventory();
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index 86f0b9e..702ca90 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -187,12 +187,14 @@ void AgiEngine::oldInputMode() {
 }
 
 // If main_cycle returns false, don't process more events!
-int AgiEngine::mainCycle() {
+int AgiEngine::mainCycle(bool onlyCheckForEvents) {
 	unsigned int key, kascii;
 	VtEntry *v = &_game.viewTable[0];
 
-	pollTimer();
-	updateTimer();
+	if (!onlyCheckForEvents) {
+		pollTimer();
+		updateTimer();
+	}
 
 	key = doPollKeyboard();
 
@@ -205,7 +207,13 @@ int AgiEngine::mainCycle() {
 		_game.vars[29] = _mouse.y;
 	//}
 
-	if (key == KEY_PRIORITY) {
+	if (key == KEY_STATUSLN) {	// F11
+		_debug.statusline = !_debug.statusline;
+		writeStatus();
+		key = 0;
+	}
+
+	if (key == KEY_PRIORITY) {	// F12
 		_sprites->eraseBoth();
 		_debug.priority = !_debug.priority;
 		_picture->showPic();
@@ -214,14 +222,8 @@ int AgiEngine::mainCycle() {
 		key = 0;
 	}
 
-	if (key == KEY_STATUSLN) {
-		_debug.statusline = !_debug.statusline;
-		writeStatus();
-		key = 0;
-	}
-
 	// Click-to-walk mouse interface
-	if (_game.playerControl && v->flags & fAdjEgoXY) {
+	if (_game.playerControl && (v->flags & fAdjEgoXY)) {
 		int toX = v->parm1;
 		int toY = v->parm2;
 
@@ -289,10 +291,13 @@ int AgiEngine::mainCycle() {
 			break;
 		}
 	} while (restartProcessKey);
-	_gfx->doUpdate();
 
-	if (_game.msgBoxTicks > 0)
-		_game.msgBoxTicks--;
+	if (!onlyCheckForEvents) {
+		_gfx->doUpdate();
+
+		if (_game.msgBoxTicks > 0)
+			_game.msgBoxTicks--;
+	}
 
 	return true;
 }
diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp
index 124a1cf..18861a2 100644
--- a/engines/agi/op_test.cpp
+++ b/engines/agi/op_test.cpp
@@ -259,7 +259,12 @@ uint8 AgiEngine::testKeypressed() {
 		InputMode mode = _game.inputMode;
 
 		_game.inputMode = INPUT_NONE;
-		mainCycle();
+		// Only check for events here, without updating the game cycle,
+		// otherwise the animations in some games are drawn too quickly
+		// like, for example, Manannan's lightnings in the intro of KQ3
+		// and the bullets opened in the logo of PQ1, during its intro.
+		// Fixes bug #3600733
+		mainCycle(true);
 		_game.inputMode = mode;
 	}
 






More information about the Scummvm-git-logs mailing list