aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2007-05-04 08:55:28 +0000
committerFilippos Karapetis2007-05-04 08:55:28 +0000
commit3fccd9c06f3677042a8091ca89c9685411e44101 (patch)
tree2932ebc99c63e11ae1fd8a20ba94ec14001f4059 /engines
parent0e27c9c33919db1e2746e7eec40fd8f4c9ae7e04 (diff)
downloadscummvm-rg350-3fccd9c06f3677042a8091ca89c9685411e44101.tar.gz
scummvm-rg350-3fccd9c06f3677042a8091ca89c9685411e44101.tar.bz2
scummvm-rg350-3fccd9c06f3677042a8091ca89c9685411e44101.zip
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
svn-id: r26743
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/agi.h3
-rw-r--r--engines/agi/detection.cpp10
-rw-r--r--engines/agi/keyboard.cpp2
-rw-r--r--engines/agi/view.cpp24
4 files changed, 27 insertions, 12 deletions
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index 385bf6b247..6db5494fcc 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -112,7 +112,8 @@ enum AgiGameFeatures {
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;
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 8dd970b5ca..d88af458d4 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -737,7 +737,7 @@ static const AGIGameDescription gameDescriptions[] = {
Common::ADGF_NO_FLAGS
},
GType_V3,
- GF_ESC_MENU,
+ GF_KQ4,
0x3086,
},
@@ -753,7 +753,7 @@ static const AGIGameDescription gameDescriptions[] = {
Common::ADGF_NO_FLAGS
},
GType_V3,
- GF_ESC_MENU,
+ GF_KQ4,
0x3086,
},
@@ -769,7 +769,7 @@ static const AGIGameDescription gameDescriptions[] = {
Common::ADGF_NO_FLAGS
},
GType_V3,
- GF_ESC_MENU,
+ GF_KQ4,
0x3086,
},
@@ -785,7 +785,7 @@ static const AGIGameDescription gameDescriptions[] = {
Common::ADGF_NO_FLAGS
},
GType_V3,
- GF_ESC_MENU,
+ GF_KQ4,
0x3086,
},
@@ -801,7 +801,7 @@ static const AGIGameDescription gameDescriptions[] = {
Common::ADGF_NO_FLAGS
},
GType_V3,
- GF_ESC_MENU,
+ GF_KQ4,
0x3149,
},
diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp
index 8eea4c0c96..20c81847db 100644
--- a/engines/agi/keyboard.cpp
+++ b/engines/agi/keyboard.cpp
@@ -104,7 +104,7 @@ int AgiEngine::handleController(int key) {
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) &&
diff --git a/engines/agi/view.cpp b/engines/agi/view.cpp
index ea3f2be9bd..7adf09378c 100644
--- a/engines/agi/view.cpp
+++ b/engines/agi/view.cpp
@@ -41,9 +41,19 @@ void AgiEngine::lSetCel(VtEntry *v, int n) {
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 @@ void AgiEngine::lSetLoop(VtEntry *v, int n) {
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];
}