[Scummvm-git-logs] scummvm master -> 1b4660a50899a697f16cc8d09443cbb10e08e44a
sluicebox
noreply at scummvm.org
Sun Jan 16 18:52:59 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1b4660a508 SCI32: Fix event type for Direction events
Commit: 1b4660a50899a697f16cc8d09443cbb10e08e44a
https://github.com/scummvm/scummvm/commit/1b4660a50899a697f16cc8d09443cbb10e08e44a
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-01-16T13:52:09-05:00
Commit Message:
SCI32: Fix event type for Direction events
The direction event type changed from 64 in SCI16 to 16 in SCI32.
Fixes direction events not appearing when pressing arrow keys in SCI32
games, such as on the QFG4 character creation screen: bug #13223
Changed paths:
engines/sci/engine/kevent.cpp
engines/sci/event.h
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 6ff3b328c53..247a9733164 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -295,7 +295,11 @@ reg_t kMapKeyToDir(EngineState *s, int argc, reg_t *argv) {
if (readSelectorValue(segMan, obj, SELECTOR(type)) == kSciEventKeyDown) {
uint16 message = readSelectorValue(segMan, obj, SELECTOR(message));
- SciEventType eventType = kSciEventDirection;
+#ifdef ENABLE_SCI32
+ SciEventType eventType = (getSciVersion() < SCI_VERSION_2) ? kSciEventDirection16 : kSciEventDirection32;
+#else
+ SciEventType eventType = kSciEventDirection16;
+#endif
// It seems with SCI1 Sierra started to add the kSciEventDirection bit instead of setting it directly.
// It was done inside the keyboard driver and is required for the PseudoMouse functionality and class
// to work (script 933).
diff --git a/engines/sci/event.h b/engines/sci/event.h
index d01bbcadc90..8dedc7c9df4 100644
--- a/engines/sci/event.h
+++ b/engines/sci/event.h
@@ -35,9 +35,10 @@ enum SciEventType {
kSciEventKeyDown = 1 << 2,
kSciEventKeyUp = 1 << 3,
kSciEventKey = kSciEventKeyDown | kSciEventKeyUp,
- kSciEventDirection = 1 << 6,
+ kSciEventDirection16 = 1 << 6, // SCI16
kSciEventSaid = 1 << 7,
#ifdef ENABLE_SCI32
+ kSciEventDirection32 = 1 << 4, // SCI32
kSciEventHotRectangle = 1 << 10,
#endif
kSciEventQuit = 1 << 11,
More information about the Scummvm-git-logs
mailing list