aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2009-07-29 20:35:50 +0000
committerMax Horn2009-07-29 20:35:50 +0000
commitd91d68a9ca03b69d285517736c62d5cd9f70d63b (patch)
tree09937c68609c45187193e3db1e0a347d94528aaa /engines
parente779747ca4e86e52ab22b11591fcd16b79902407 (diff)
downloadscummvm-rg350-d91d68a9ca03b69d285517736c62d5cd9f70d63b.tar.gz
scummvm-rg350-d91d68a9ca03b69d285517736c62d5cd9f70d63b.tar.bz2
scummvm-rg350-d91d68a9ca03b69d285517736c62d5cd9f70d63b.zip
SCUMM: Fix verb/sentence handling in Indy3 mac (there, a double click must be used to trigger a verb/sentence)
svn-id: r42907
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/script.cpp9
-rw-r--r--engines/scumm/scumm.cpp1
-rw-r--r--engines/scumm/scumm.h6
-rw-r--r--engines/scumm/sound.cpp9
4 files changed, 17 insertions, 8 deletions
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index fd1ed6f1e4..2c3fe09db2 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -23,10 +23,9 @@
*
*/
-
-
#include "common/config-manager.h"
#include "common/util.h"
+#include "common/system.h"
#include "scumm/actor.h"
#include "scumm/object.h"
@@ -1195,6 +1194,12 @@ void ScummEngine::runInputScript(int clickArea, int val, int mode) {
args[1] = VAR(82 + (val - 100));
}
}
+
+ // Clicks are handled differently in Indy3 mac: param 2 of the
+ // input script is set to 0 for normal clicks, and to 1 for double clicks.
+ uint32 time = _system->getMillis();
+ args[2] = (time < _lastInputScriptTime + 500); // 500 ms double click delay
+ _lastInputScriptTime = time;
}
if (verbScript)
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 600b9ec385..8c5731d539 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -184,6 +184,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_mouseAndKeyboardStat = 0;
_leftBtnPressed = 0;
_rightBtnPressed = 0;
+ _lastInputScriptTime = 0;
_bootParam = 0;
_dumpScripts = false;
_debugMode = 0;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 6582ef0230..bfb188f1c7 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -615,6 +615,12 @@ protected:
uint16 _mouseAndKeyboardStat;
byte _leftBtnPressed, _rightBtnPressed;
+ /**
+ * Last time runInputScript was run (measured in terms of OSystem::getMillis()).
+ * This is currently only used for Indy3 mac to detect "double clicks".
+ */
+ uint32 _lastInputScriptTime;
+
/** The bootparam, to be passed to the script 1, the bootscript. */
int _bootParam;
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index dc7f942668..2362427779 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -23,6 +23,9 @@
*
*/
+#include "common/config-manager.h"
+#include "common/timer.h"
+#include "common/util.h"
#include "scumm/actor.h"
#include "scumm/file.h"
@@ -32,10 +35,6 @@
#include "scumm/sound.h"
#include "scumm/util.h"
-#include "common/config-manager.h"
-#include "common/timer.h"
-#include "common/util.h"
-
#include "sound/adpcm.h"
#include "sound/audiocd.h"
#include "sound/flac.h"
@@ -46,8 +45,6 @@
#include "sound/vorbis.h"
#include "sound/wave.h"
-
-
namespace Scumm {
struct MP3OffsetTable { /* Compressed Sound (.SO3) */