[Scummvm-cvs-logs] SF.net SVN: scummvm: [26743] scummvm/trunk/engines/agi

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri May 4 10:55:29 CEST 2007


Revision: 26743
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26743&view=rev
Author:   thebluegr
Date:     2007-05-04 01:55:28 -0700 (Fri, 04 May 2007)

Log Message:
-----------
AGI: Changed a nasty workaround regarding views to only apply to a specific view in the KQ4 introduction. This fixes several bugs and crashes in AGI V3 games and closes KQ4 bugs #1660486, #1660169, #1660192, #1660162 and #1660354

Modified Paths:
--------------
    scummvm/trunk/engines/agi/agi.h
    scummvm/trunk/engines/agi/detection.cpp
    scummvm/trunk/engines/agi/keyboard.cpp
    scummvm/trunk/engines/agi/view.cpp

Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h	2007-05-03 22:56:02 UTC (rev 26742)
+++ scummvm/trunk/engines/agi/agi.h	2007-05-04 08:55:28 UTC (rev 26743)
@@ -112,7 +112,8 @@
 	GF_FANMADE =     (1 << 6),
 	GF_ESC_MENU =    (1 << 7),
 	GF_MANHUNTER =   (1 << 8),
-	GF_SQ1 =         (1 << 9)
+	GF_SQ1 =         (1 << 9),
+	GF_KQ4 =         (1 << 10)
 };
 
 struct AGIGameDescription;

Modified: scummvm/trunk/engines/agi/detection.cpp
===================================================================
--- scummvm/trunk/engines/agi/detection.cpp	2007-05-03 22:56:02 UTC (rev 26742)
+++ scummvm/trunk/engines/agi/detection.cpp	2007-05-04 08:55:28 UTC (rev 26743)
@@ -737,7 +737,7 @@
 			Common::ADGF_NO_FLAGS
 		},
 		GType_V3,
-		GF_ESC_MENU,
+		GF_KQ4,
 		0x3086,
 	},
 
@@ -753,7 +753,7 @@
 			Common::ADGF_NO_FLAGS
 		},
 		GType_V3,
-		GF_ESC_MENU,
+		GF_KQ4,
 		0x3086,
 	},
 
@@ -769,7 +769,7 @@
 			Common::ADGF_NO_FLAGS
 		},
 		GType_V3,
-		GF_ESC_MENU,
+		GF_KQ4,
 		0x3086,
 	},
 
@@ -785,7 +785,7 @@
 			Common::ADGF_NO_FLAGS
 		},
 		GType_V3,
-		GF_ESC_MENU,
+		GF_KQ4,
 		0x3086,
 	},
 
@@ -801,7 +801,7 @@
 			Common::ADGF_NO_FLAGS
 		},
 		GType_V3,
-		GF_ESC_MENU,
+		GF_KQ4,
 		0x3149,
 	},
 

Modified: scummvm/trunk/engines/agi/keyboard.cpp
===================================================================
--- scummvm/trunk/engines/agi/keyboard.cpp	2007-05-03 22:56:02 UTC (rev 26742)
+++ scummvm/trunk/engines/agi/keyboard.cpp	2007-05-04 08:55:28 UTC (rev 26743)
@@ -104,7 +104,7 @@
 	int i;
 
 	/* AGI 3.149 games need KEY_ESCAPE to use menus */
-	if (key == 0 || (key == KEY_ESCAPE && (getFeatures() & GF_ESC_MENU)) )
+	if (key == 0 || (key == KEY_ESCAPE && (getFeatures() & GF_ESC_MENU || getFeatures() & GF_KQ4)) )
 		return false;
 
 	if ((getFeatures() & GF_MANHUNTER) && (key == KEY_ENTER) &&

Modified: scummvm/trunk/engines/agi/view.cpp
===================================================================
--- scummvm/trunk/engines/agi/view.cpp	2007-05-03 22:56:02 UTC (rev 26742)
+++ scummvm/trunk/engines/agi/view.cpp	2007-05-04 08:55:28 UTC (rev 26743)
@@ -41,9 +41,19 @@
 	if (currentVl->numCels == 0)
 		return;
 
-	if (!(v->flags & UPDATE)
-			&& (agiGetRelease() >= 0x3000))
-		return;
+	// WORKAROUND: This is a very nasty hack to fix a bug in the KQ4 introduction
+	// In its original form, it caused a lot of regressions, including KQ4 bugs and crashes
+	// Refer to Sarien bug #588899 for the original issue
+	// Modifying this workaround to only work for a specific view in the KQ4 intro fixes several 
+	// ScummVM bugs. Refer to bugs #1660486, #1660169, #1660192, #1660162 and #1660354
+	// FIXME: Remove this workaround and investigate the reason for the erroneous actor behavior
+	// in the KQ4 introduction
+	// It seems there's either a bug with KQ4's logic script 120 (the intro script)
+	// or flag 64 is not set correctly, which causes the erroneous behavior from the actors
+	// Check below in lSetLoop for the second part of this workaround
+	if (getFeatures() & GF_KQ4)
+		if (!(v->flags & UPDATE) && (v->currentView == 172))
+			return;
 
 	currentVc = &currentVl->cel[n];
 	v->celData = currentVc;
@@ -68,8 +78,12 @@
 	if (v->currentCel >= v->numCels)
 		v->currentCel = 0;
 
-	if (!(v->flags & UPDATE) && (agiGetRelease() >= 0x3000))
-		return;
+	// WORKAROUND: This is the second part of the hack to fix the KQ4 introduction.
+	// Refer above to function lSetCel for the first part and an explanation
+	// FIXME: Remove this workaround
+	if (getFeatures() & GF_KQ4)
+		if (!(v->flags & UPDATE) && (v->currentView == 172))
+			return;
 
 	v->loopData = &_game.views[v->currentView].loop[n];
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list