Commit Graph

35 Commits

Author SHA1 Message Date
sluicebox
1b4660a508 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
2022-01-16 13:52:09 -05:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Colin Snover
9a8070da3c SCI: Do some clean-up of event handling system
Convert macros and vars to enums, rename keyboard events in
preparation for adding key up events, clean up unnecessary nested
conditionals, add TODOs for potential future work.
2017-09-27 20:27:33 -05:00
Colin Snover
0beb259278 SCI32: Improve performance when flushing events during video playback
Calling through EventManager::getSciEvent to flush events is
pretty inefficient and created stalls that lead to dropped
frames during the chapter 7 chase in Phantasmagoria 1.

If necessary, performance could be improved further by extending
Common::EventManager to expose SDL_FlushEvents, but this seems to
finish in 0-1ms so should be OK for now.

Refs Trac#9974, Trac#9975.
2017-07-23 10:35:13 -05:00
Colin Snover
3d92f05261 SCI32: Fix hot rectangle events
This fixes delayed mouse cursor updates during the chase scene in
Phant1.

Refs Trac#9975.
2017-07-23 10:35:13 -05:00
Colin Snover
6379498303 SCI: Fix kMenuSelect to understand control characters
In b4c0be8b42 keyboard events were
adjusted to send control characters to game scripts, which matches
how keyboard input works in SSCI. Unfortunately this broke games
using kMenuSelect because that kernel code was not expecting to
receive control characters.

Here is an amended list of known types of keyboard shortcuts, for
future reference:

* All games with text inputs (Ctrl+C clears text boxes)
* Most games using MenuBar, like QFG1EGA (Ctrl+P pauses the
  game, Tab or Ctrl+I show inventory)
* QFG1VGA (Ctrl+S shows stats)
* Torin (Ctrl+N, Ctrl+O, Ctrl+S, etc. activate menu commands)
* LSL1VGA & LSL3 (Ctrl+Alt+X to bypass age check)
* Most in-game debuggers (Alt+T for teleport)

The shortcut handling code is still not 100% accurate since there
are some edge cases that are not implemented (e.g. in DOS/SSCI,
Shift+Ctrl+<key> usually sends the same key information as
Ctrl+<key>, but not if <key> is Tab), but it should now be working
in a consistent and rational manner for end-users.
2017-07-16 14:26:30 -05:00
Colin Snover
44dd029cb1 SCI32: Implement kSetHotRectangles
Used only by chapter 7 of Phant1.
2016-09-29 19:39:16 -05:00
Colin Snover
1337cd3dec SCI32: Implement kEditText 2016-03-06 21:34:43 -06:00
Filippos Karapetis
cdbd7c8add SCI: Use uint32 instead of unsigned int 2016-03-01 01:12:58 +02:00
Martin Kiewitz
b726513b1e SCI: code/define formatting 2016-02-03 20:51:46 +01:00
Martin Kiewitz
e91bdf0262 SCI: Remove hardcoded value in getScummVMEvent() 2016-02-03 20:45:08 +01:00
Martin Kiewitz
604d906038 SCI: make event type, modifiers + character uint16 2016-02-02 15:07:36 +01:00
Martin Kiewitz
7aeadba863 SCI: Removed ".data" from SciEvent
Was the ScummVM-system-Keycode, sometimes modified.
Changed Menu/Portrait/Controls32-code to use .character instead.
Cleaned up a bit of code in getScummVMEvent()
2016-02-02 11:33:40 +01:00
Martin Kiewitz
59d2c4b27e SCI: Do not pass/use .data for mouse button type
Also added comment about .data field. Should be renamed.
2016-02-02 02:10:43 +01:00
Johannes Schickel
8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Johannes Schickel
463e475bd6 SCI: Save mouse position in SciEvent.
Instead of querying the event manager for the current mouse cursor coordinates
kGetEvent now uses the saved mouse positions, which will assure every event
will be processed with the correct coordinates instead of the current ones.
Various other functions using SciEvent directly were adapted too.

This fixes cursor click positions for the WinCE backend.

Thanks to wjp and waltervn for helping me with this.
2011-03-09 01:19:12 +01:00
md5
906f024831 SCI: Cleanup of the event code 2011-03-09 01:47:53 +02:00
md5
bd64c5078c SCI: Cleaned up kMapKeyToDir and removed an incorrect heuristic
The heuristic in question was used to detect the pseudo mouse control
functionality, however the change in controls seems to have occurred with the
transition to cursor views. Fixes keypad control in Conquest of the Longbow.
Moreover, the code also checked for key scan code 76 when checking for the middle
keypad button, which seems to be a mistake, as that case never occurred.
2011-02-15 15:46:15 +02:00
Martin Kiewitz
6b63c951eb SCI: updating screen within kAnimate as well - fixes pseudo hang in eq1 credits (bug #3036154)
svn-id: r51459
2010-07-29 10:48:54 +00:00
Martin Kiewitz
a7fa0649df SCI: implemented checking of keyboard driver in case of SCI1EGA/EARLY, also renamed SCI_EVENT_JOYSTICK to SCI_EVENT_DIRECTION
svn-id: r50045
2010-06-19 09:46:04 +00:00
Max Horn
2556ea192c SCI: Turn _modifierStates into member of class EventManager
svn-id: r49963
2010-06-17 23:12:17 +00:00
Max Horn
fabba55e6d SCI: cleanup
svn-id: r49961
2010-06-17 23:11:34 +00:00
Max Horn
a2bcf9ac31 SCI: Rename sciEvent to SciEvent
svn-id: r49960
2010-06-17 23:11:12 +00:00
Max Horn
8e07a1e167 SCI: Moved the event code a little bit around.
* Move sleep() from EventManager to SciEngine
* Rename EventManager methods: get -> getSciEvent, and
  getFromScummVM -> getScummVMEvent
* Make scancode_rows static const
* Turn altify & numlockify from EventManager methods into static
  functions (and comment out the currently unused numlockify)

svn-id: r49959
2010-06-17 23:10:37 +00:00
Filippos Karapetis
5cb311ee2c Renamed the SciEvent class to EventManager, to separate it from the sciEvent structure, and removed it from the engine state
svn-id: r49534
2010-06-09 07:59:42 +00:00
Martin Kiewitz
194bdd9b83 SCI: reverting r48787 port updates were actually introduced (heard that before) in SCI1. I used the outdated wiki before and that one lists qfg2 and xmas90ega being SCI01. They are actually SCI1
svn-id: r48789
2010-04-24 21:45:17 +00:00
Martin Kiewitz
cbd8faa82e SCI: r48786 port updates were actually introduced during SCI01, qfg2 and xmas90ega only. We enable port updates only for non-multilingual SCI01 games now - fixes percentage bar for qfg1 japanese as well
svn-id: r48787
2010-04-24 20:41:26 +00:00
Martin Kiewitz
aaa6e7ee54 SCI: key presses of extended chars (umlauts, etc.) will now get ignored in games that don't support them (which is all non-multilingual games)
svn-id: r48693
2010-04-17 20:43:09 +00:00
Max Horn
2e68de1e5a SCI: Turn kernel_sleep() into SciEvent::sleep()
svn-id: r48119
2010-02-23 22:47:53 +00:00
Johannes Schickel
aed02365ec Strip trailing spaces/tabs.
svn-id: r47541
2010-01-25 01:39:44 +00:00
Martin Kiewitz
af8298d4f8 SCI: removed controlify() to ease readability of code
svn-id: r47186
2010-01-08 22:52:50 +00:00
Martin Kiewitz
3db1912759 SCI: Renamed "buckybits" to "modifiers" in SciEvent
svn-id: r46256
2009-12-04 18:02:48 +00:00
Martin Kiewitz
d982d10505 SCI: Make event constants more verbose
svn-id: r46255
2009-12-04 17:58:26 +00:00
Martin Kiewitz
a5f1808c83 SCI: SciEvent created, kernel_sleep() created
svn-id: r46252
2009-12-04 17:38:24 +00:00