aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/script.cpp
diff options
context:
space:
mode:
authorMax Horn2007-06-29 23:08:15 +0000
committerMax Horn2007-06-29 23:08:15 +0000
commit0723e3e24a906c2935965df2ccd555ef314c58cb (patch)
tree5ddbadd6878f6abf1b4f38ad58766889268a1840 /engines/scumm/script.cpp
parent314ef72bb188240bb145e13c620310af142b693e (diff)
downloadscummvm-rg350-0723e3e24a906c2935965df2ccd555ef314c58cb.tar.gz
scummvm-rg350-0723e3e24a906c2935965df2ccd555ef314c58cb.tar.bz2
scummvm-rg350-0723e3e24a906c2935965df2ccd555ef314c58cb.zip
Introduced ClickArea enum, some related cleanup in runInputScript and checkExecVerbs
svn-id: r27778
Diffstat (limited to 'engines/scumm/script.cpp')
-rw-r--r--engines/scumm/script.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index 46e4e64347..cc56adf622 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -1156,39 +1156,39 @@ void ScummEngine::checkAndRunSentenceScript() {
runScript(sentenceScript, 0, 0, localParamList);
}
-void ScummEngine_v2::runInputScript(int a, int cmd, int mode) {
+void ScummEngine_v2::runInputScript(int clickArea, int val, int mode) {
int args[24];
int verbScript;
verbScript = 4;
- VAR(VAR_CLICK_AREA) = a;
- switch (a) {
- case 1: // Verb clicked
- VAR(VAR_CLICK_VERB) = cmd;
+ VAR(VAR_CLICK_AREA) = clickArea;
+ switch (clickArea) {
+ case kVerbClickArea: // Verb clicked
+ VAR(VAR_CLICK_VERB) = val;
break;
- case 3: // Inventory clicked
- VAR(VAR_CLICK_OBJECT) = cmd;
+ case kInventoryClickArea: // Inventory clicked
+ VAR(VAR_CLICK_OBJECT) = val;
break;
}
memset(args, 0, sizeof(args));
- args[0] = a;
- args[1] = cmd;
+ args[0] = clickArea;
+ args[1] = val;
args[2] = mode;
if (verbScript)
runScript(verbScript, 0, 0, args);
}
-void ScummEngine::runInputScript(int a, int cmd, int mode) {
+void ScummEngine::runInputScript(int clickArea, int val, int mode) {
int args[24];
int verbScript;
verbScript = VAR(VAR_VERB_SCRIPT);
memset(args, 0, sizeof(args));
- args[0] = a;
- args[1] = cmd;
+ args[0] = clickArea;
+ args[1] = val;
args[2] = mode;
// All HE 72+ games but only some HE 71 games.
if (_game.heversion >= 71) {
@@ -1198,18 +1198,18 @@ void ScummEngine::runInputScript(int a, int cmd, int mode) {
// Macintosh verison of indy3ega used different interface, so adjust values.
if (_game.id == GID_INDY3 && _game.platform == Common::kPlatformMacintosh) {
- if (a == 1 && (cmd >= 101 && cmd <= 108)) {
- if (cmd == 107) {
+ if (clickArea == kVerbClickArea && (val >= 101 && val <= 108)) {
+ if (val == 107) {
VAR(67) -= 2;
inventoryScript();
return;
- } else if (cmd == 108) {
+ } else if (val == 108) {
VAR(67) += 2;
inventoryScript();
return;
} else {
args[0] = 3;
- args[1] = VAR(83 + (cmd - 101));
+ args[1] = VAR(83 + (val - 101));
}
}
}