Commit Graph
77 Commits
Author SHA1 Message Date
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 d8eccdec32 SCI: Clarify Tab character & modifier workarounds in GfxMenu 2017-07-16 14:26:30 -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
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 c0bdbe1ca8 SCI: Fix control/Fx keys not working anymore
Was effectively caused by commit adding the keyboard driver bug
for SCI0/SCI01, although the bug is actually real and happens.

It seems Sierra did not check the key-modifier in kMenuSelect.
We do and that's why the code didn't recognize all sorts of
menu keys anymore.
We now isolate the lower byte before comparing.

I also noticed, that Sierra passed keyboard modifiers in mouse
events. This was probably done, so that owners of a 1-button
mouse were able to right-click. We do this now too.

Also added information about mouse modifiers in kGetEvent.

Moved the mouse modifier code into getScummVMEvent().

This should fix bug #7009.
2016-02-02 01:56:08 +01:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Filippos Karapetis 2d90cc4ac3 SCI: Fix a non-initialized variable in GfxMenu - CID 1003110 2013-05-01 01:51:11 +03:00
Willem Jan Palenstijn 2d1fd3b554 ALL: Fix typo (existant->existent) 2013-02-23 22:07:32 +01:00
Filippos Karapetis 2b50824133 SCI: Add setter/getter methods to reg_t's
No functionality change has been made with this commit. This avoids
setting and getting the reg_t members directly, and is the basis of any
future work on large SCI3 scripts (larger than 64KB)
2012-06-18 05:24:06 +03:00
Christoph Mallon 75efdd2d84 JANITORIAL: Replace (x ? false : true) by !(x). 2012-03-13 15:43:36 +01:00
Max Horn 88913c0139 ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
  git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-06-20 00:59:48 +02:00
md5 60943efafd SCI: Fixed bug #3295931 - "SCI: JONES: Disabled commands are available using shortcuts" 2011-06-12 17:58:25 +03:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
md5 fd2c39591f SCI: Fixed the flashing icon bar in the Mac version of Castle of Dr. Brain
Thanks to waltervn for his work and help on this
2011-03-13 23:34:08 +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
Willem Jan Palenstijn eece58df7f SCI: Remove unused argument to said 2011-03-08 22:50:32 +01:00
Filippos Karapetis 0309f36552 SCI: Plugged 2 memory leaks, reported by digitall
- Plugged 2 memory leaks in the SCI0 menu code (the lists of menu and submenu entries)
- Got rid of the _listCount variable

svn-id: r55254
2011-01-15 23:55:35 +00:00
Filippos Karapetis 505e1888e5 SCI: Some function renaming
Draw_Status -> DrawStatus
Draw_String -> DrawString

svn-id: r55178
2011-01-08 23:16:44 +00:00
Filippos Karapetis 32d7e687ee SCI: debugC calls no longer require a debug level of 2 to show output
svn-id: r55086
2011-01-01 12:48:12 +00:00
Max Horn ba3e826872 SCI: Remove any use of printf
svn-id: r54037
2010-11-02 09:49:47 +00:00
Martin Kiewitz cd6aa62702 SCI: adding separate status drawing code
now also draws "IV" in KQ4 correctly. This wasn't the case before because we reused the regular drawing code, which would see the 0xA ("IV") as linebreak

save for backport

svn-id: r52913
2010-09-26 18:23:53 +00:00
Matthew Hoops bc54fde8e1 SCI: Ignore setAttribute() on any non-existent menu items
This fixes two fan games: Al Pond 2 and Aquarius. The original interpreter did this as well.

svn-id: r51477
2010-07-29 19:08:07 +00:00
Matthew Hoops 07b67fe44b SCI: Fix using the parser in SCI Fan Games
Get a pointer to the said spec instead of copying to a buffer. The fan games use a said spec with size < 64. Also, make said() take a const pointer as the spec cannot change. Thanks to waltervn and wjp.

svn-id: r51432
2010-07-28 19:03:49 +00:00
Filippos Karapetis 3c8a606e71 SCI: Added bug report numbers for all the recently fixed bugs
svn-id: r51407
2010-07-28 07:51:49 +00:00
Filippos Karapetis 27ce375a95 SCI: Fixed bug #3034507, "PQ2 Demo: Non-existant menu item"
svn-id: r51294
2010-07-26 05:49:00 +00:00
Martin Kiewitz c2577da7e0 SCI: fixed jones/ega/vga port issue
getPortById() error was caused by us remembering port when going interactive, restoring it and restoring it all the time afterwards as well

svn-id: r51071
2010-07-20 19:42:48 +00:00
Martin Kiewitz 28d07c7e0a SCI: calculate widths for menu after switching to menuport, i guess this was the reason why we sometimes had issues drawing parts of the menu (random issue)
svn-id: r50784
2010-07-10 16:22:08 +00:00
Martin Kiewitz a7cd1534c6 SCI: fix regression of r50721 - pausing/resuming only on actual menu usage
svn-id: r50724
2010-07-06 14:10:09 +00:00
Max Horn 8db0f726c0 SCI: Rewrap more comments
svn-id: r50500
2010-06-29 14:55:32 +00:00
Filippos Karapetis 0a102981f0 Moved the SelectorCache struct inside selector.h, where it belongs, and fixed some header dependencies in the process
svn-id: r50183
2010-06-23 15:23:37 +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
Martin Kiewitz b25aba1d1e SCI: SciGui/SciGui32 gone for good...
svn-id: r49860
2010-06-15 15:44:24 +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
Filippos Karapetis 67de5b1bd3 Mass renaming of selector-related functions, and removed some defines which were just cloaking functions with a different name
- GET_SEL32 -> readSelector
- GET_SEL32V -> readSelectorValue
- PUT_SEL32 -> writeSelector
- PUT_SEL32V -> writeSelectorValue
Also, changed some selector-related function names and variables to CamelCase

svn-id: r49317
2010-05-29 23:37:15 +00:00
Martin Kiewitz 5e4868fb00 SCI: handle TAB like Ctrl-I on menu key checking, sci0 also did it that way - makes TAB work for inventory in iceman/qfg1ega
svn-id: r49044
2010-05-15 21:28:26 +00:00
Martin Kiewitz 59a255226f SCI: SCI_SCREEN_MASK_* now GFX_SCREEN_MASK_*, using enum - added new enum GFX_SCREEN_UPSCALED_*
svn-id: r49039
2010-05-15 08:57:13 +00:00
Martin Kiewitz aaaab9ec34 SCI: fix regression of r48659 - now calculating menu width and splitting text on kernelDrawMenuBar() as well - fixes menu not displaying all the time in hoyle 1&2
svn-id: r48791
2010-04-25 09:35:34 +00:00
Martin Kiewitz ad24968f56 SCI: menu - handle right aligned "=" as actual text not as tag marker, also handle "=" as being a supported shortcut key
svn-id: r48747
2010-04-20 15:28:19 +00:00
Martin Kiewitz e70a484415 SCI: remove lone spaces at the end of right aligned menu items. fixes "wrongly" aligned menu items in some games
svn-id: r48746
2010-04-20 15:10:27 +00:00
Martin Kiewitz f68dfd61de SCI: fix regression from r48685 - english got always used for menu entries
svn-id: r48698
2010-04-18 10:15:56 +00:00
Martin Kiewitz 2ac3e93dab SCI: move menu window inside the screen, if parts of it are outside (happens in multilingual sq3 and lsl3)
svn-id: r48686
2010-04-17 13:42:19 +00:00
Martin Kiewitz 08ad84d556 SCI: implement ability to handle multilingual menu separators (is actually 2 separators with a language separator inbetween)
svn-id: r48685
2010-04-17 13:34:16 +00:00
Walter van Niftrik 20c461e541 SCI: Remove subtitles in menu.
svn-id: r48683
2010-04-17 03:11:54 +00:00
Martin Kiewitz 20392ebee8 SCI: split menu/item strings when displaying instead of when initializing - makes on-the-fly menu language changes possible (used by multilingual SCI01 games)
svn-id: r48659
2010-04-15 16:40:37 +00:00
Max Horn 2e68de1e5a SCI: Turn kernel_sleep() into SciEvent::sleep()
svn-id: r48119
2010-02-23 22:47:53 +00:00
Max Horn b9a11ddb0b SCI: Move language related code from EngineState to SciEngine
svn-id: r48052
2010-02-13 17:46:44 +00:00
Max Horn ac4d325e0d SCI: Add global g_sci pointer to the active SciEngine instance
svn-id: r48046
2010-02-13 17:42:49 +00:00
Martin Kiewitz a4039182ce SCI: also reset some variables inside reset(), so we dont error() out in lsl2 and other games that reset game engine inbetween
svn-id: r48015
2010-02-09 18:24:54 +00:00
Max Horn f86618f92b SCI: Add a 'SELECTOR' macro
svn-id: r47918
2010-02-05 22:55:18 +00:00