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
This commit is contained in:
sluicebox 2022-01-16 13:50:39 -05:00
parent b370e43004
commit 1b4660a508
2 changed files with 7 additions and 2 deletions

View File

@ -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).

View File

@ -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,