aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-09-05 11:30:40 +0000
committerFilippos Karapetis2010-09-05 11:30:40 +0000
commitf17a9f9fb09d4eaac333514bae70e770c5378b76 (patch)
tree4564bf7ca20e903f84d8da7f0f34b2a7a3a035ac /engines
parent047979b4093c376e4cd82da0e2debf43e0de5b91 (diff)
downloadscummvm-rg350-f17a9f9fb09d4eaac333514bae70e770c5378b76.tar.gz
scummvm-rg350-f17a9f9fb09d4eaac333514bae70e770c5378b76.tar.bz2
scummvm-rg350-f17a9f9fb09d4eaac333514bae70e770c5378b76.zip
SCI: Changed consecutive ifs to a switch
A table would be better, but the switch will do for now svn-id: r52543
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/script_patches.cpp44
1 files changed, 30 insertions, 14 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 5d7ae49589..fbd58cf20c 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -739,31 +739,47 @@ int32 Script::findSignature(const SciScriptSignature *signature, const byte *scr
void Script::matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uint32 scriptSize) {
const SciScriptSignature *signatureTable = NULL;
- if (g_sci->getGameId() == GID_ECOQUEST)
+ switch (g_sci->getGameId()) {
+ case GID_ECOQUEST:
signatureTable = ecoquest1Signatures;
- if (g_sci->getGameId() == GID_ECOQUEST2)
+ break;
+ case GID_ECOQUEST2:
signatureTable = ecoquest2Signatures;
- if (g_sci->getGameId() == GID_FREDDYPHARKAS)
+ break;
+ case GID_FREDDYPHARKAS:
signatureTable = freddypharkasSignatures;
- if (g_sci->getGameId() == GID_GK1)
+ break;
+ case GID_GK1:
signatureTable = gk1Signatures;
-// hoyle4 now works due workaround inside GfxPorts
-// if (g_sci->getGameId() == GID_HOYLE4)
-// signatureTable = hoyle4Signatures;
- if (g_sci->getGameId() == GID_KQ5)
+ break;
+ // hoyle4 now works due to workaround inside GfxPorts
+ //case GID_HOYLE4:
+ // signatureTable = hoyle4Signatures;
+ // break;
+ case GID_KQ5:
signatureTable = kq5Signatures;
- if (g_sci->getGameId() == GID_LAURABOW2)
+ break;
+ case GID_LAURABOW2:
signatureTable = laurabow2Signatures;
- if (g_sci->getGameId() == GID_LSL6)
+ break;
+ case GID_LSL6:
signatureTable = larry6Signatures;
- if (g_sci->getGameId() == GID_MOTHERGOOSE256)
+ break;
+ case GID_MOTHERGOOSE256:
signatureTable = mothergoose256Signatures;
- if (g_sci->getGameId() == GID_QFG1VGA)
+ break;
+ case GID_QFG1VGA:
signatureTable = qfg1vgaSignatures;
- if (g_sci->getGameId() == GID_SQ4)
+ break;
+ case GID_SQ4:
signatureTable = sq4Signatures;
- if (g_sci->getGameId() == GID_SQ5)
+ break;
+ case GID_SQ5:
signatureTable = sq5Signatures;
+ break;
+ default:
+ break;
+ }
if (signatureTable) {
while (signatureTable->data) {