Commit Graph
233 Commits
Author SHA1 Message Date
AndywinXp 5caac7e013 SCUMM: Attempt at fixing #14781 2024-01-23 21:03:11 +01:00
Torbjörn Andersson c7ab59293f SCUMM: Split MacGui into MacGui and MacGuiImpl
The idea here is to expose a much smaller part of the MacGui headers to
the SCUMM engine, but introducing a new class that simply relays calls
to the actual Mac GUI. I hope this will allow me to further untangle
things.
2023-12-22 15:09:06 +01:00
Torbjörn Andersson fb2bd1166d SCUMM: Split up gfx_mac.cpp into new macgui directory
The Mac GUI code is getting unwieldy, and this is an attempt at breaking
it up into more manageable chunks.
2023-12-22 15:09:06 +01:00
Torbjörn Andersson 1c8088ec9a SCUMM: Move Mac Loom drafts inventory into MacLoomGui 2023-11-27 18:12:06 +01:00
Torbjörn Andersson 3800f8f33f SCUMM: Simplify launching of Mac Loom drafts inventory
It's now the Mac dialog class that's responsible for saving/restoring
the screen shaking. (They were already responsible for pausing and
unpausing.) There are some other minor cleanups along the way, and the
drafts inventory can now be launched from the Apple menu.
2023-11-21 18:58:24 +01:00
AndywinXp b599b254f5 SCUMM: MACGUI: Implement Loom's Drafts inventory using a MacDialogWindow 2023-11-20 14:39:17 +01:00
AndywinXp 4232178ab2 SCUMM: MACGUI: Implement restart dialog handling outside the Mac menu 2023-11-18 18:47:39 +01:00
AndywinXp 3f707d009d SCUMM: MACGUI: Implement quit dialog handling for out-of-menu quit events 2023-11-18 18:47:39 +01:00
AndywinXp 204d900dd8 SCUMM: MACGUI: Wire up quit and restart callbacks 2023-11-18 18:47:39 +01:00
Torbjörn Andersson e2ca711d5b SCUMM: Finish migrating Mac banner drawing to Mac GUI 2023-11-18 18:47:39 +01:00
Torbjörn Andersson ec1ab82283 SCUMM: Initial work on a common MacGui class that handles Mac menus etc.
This will be used for Last Crusade and Loom. Loom is currently the more
broken of the two, though.
2023-11-18 18:47:39 +01:00
AndywinXp 5d5cc05610 SCUMM: Improve numpad remapping following PR #5406
In particular we set the _keyPressed object only when we find
an event.kbd for the numpad keys. Otherwise we immediately
get double events when pressing any key.
2023-11-13 19:53:32 +01:00
Lars Sundström e8ea447c90 SCUMM: Fix remapping of numpad keys on EVENT_KEYUP
Dpad buttons are by default remapped to numpad keys. Up/Down are
KEYCODE_KP8/KEYCODE_KP2 and Left/right are KEYCODE_KP4/KEYCODE_KP6.

The numpad keys are remapped to have a corresponding ASCII value
since the state of the keys are stored in the _keyDownMap array,
indexed by the ASCII value.

It was found that the ASCII values were calculated incorrectly for
EVENT_KEYUP events but correctly for EVENT_KEY DOWN events. In the
latter cases the keyboard event was stored to the _keyPressed member
variable. The keycode was checked and if being a numpad key the
corresponding ASCII value was calculated. The key state was then
stored in the _keyDownMap array using the calculated ASCII value.

For the EVENT_KEYUP events the keyboard event was not stored to the
_keyPressed member variable. The keycode was still checked using the
_keyPressed variable. However the _keyPressed could have been reset
causing the ASCII calculation to fail for the numpad key. The raw
ASCII value of the keyboard event was instead being used to reset
the key state in the _keyDownMap array causing the numpad key to be
left in a pressed state.

This was found when plaing the Lunar Lander mini game in "The Dig"
using the virtual gamepad controller in iOS.

Fix it by writing the keyboard event to the _keyPressed variable
and use the corresponding ASCII value when reseting the key state
in the _keyDownMap array.
2023-11-13 12:11:53 +01:00
AndywinXp 8461f25218 SCUMM: Rename enhancementClassActive to enhancementEnabled 2023-11-08 11:46:06 +01:00
AndywinXp d5fa7aeb90 SCUMM: Mark all enhancements with their respective classes 2023-11-08 11:46:06 +01:00
AndywinXp c62e4c5829 SCUMM: LOOM: Begin work on Drafts Inventory enhancement 2023-10-29 20:22:52 +01:00
Torbjörn Andersson 2223c96395 SCUMM: More Indy 3 Mac GUI cleanups 2023-10-16 17:40:29 +02:00
Torbjörn Andersson a67b1e9758 SCUMM: Remove Indy 3 Mac GUI verb script check
It seems it's no longer needed. Also, cleaned up naming a bit so that
instead of "active" and "visible", the GUI is now "allowed" and
"active".
2023-10-16 17:40:29 +02:00
Torbjörn Andersson e40c3a2fbb SCUMM: More Indy 3 Mac GUI cleanup + inventory scrolling 2023-10-16 17:40:29 +02:00
Torbjörn Andersson 6f8f3b4b13 SCUMM: Update Indy 3 Mac GUI less frequently
It's enough to do it after thigns have had a chance to change. Not every
iteration of waitForTimer(). This means we no longer have as precise
resolution for our animation timers, but I don't think that's any reason
not to cut down on the (admittedly small) amount of extra work the GUI
has to do.
2023-10-16 17:40:29 +02:00
Torbjörn Andersson c6d1a256ef SCUMM: Moved Mac Indy 3 GUI into its own class
This is still just a mock-up, and a bad one at that. It will all be for
nought unless I can figure out how to wire up these buttons to the SCUMM
verbs.
2023-10-16 17:40:29 +02:00
AndywinXp f4455e773e SCUMM: Relabel part of the general sound code
Albeit not 100% necessary for rewriting the HE sound engine,
I decided to make this change in order to:
- Give proper meaning to magic numbers and variables
  which were given temporary names 20 years ago;
- Avoid going insane when making comparison with HE code
  and ours, when rewriting the sound code.
2023-08-18 22:20:45 +02:00
AndywinXp 142924cec4 SCUMM: GUI: Fix some FM-Towns banner not disappearing properly 2023-07-09 20:50:09 +02:00
AndywinXp f484ad6545 SCUMM: SAMNMAX: Fix bug #14467
This was caused by the fact that the pre and post save screen scripts
were not being called, and this messed up the cursor state with savegames
created as quicksaves.

Also, renamed the variables containing said scripts numbers, so that
they are a little bit more meaningful now.
2023-05-21 21:17:36 +02:00
AndywinXp 9416772cb1 SCUMM: Fix keyboard inputs being lost during mouse inputs
The line we're amending was applied a while ago when there had
been issues with COMI losing mouse inputs during a keyboard press;
apparently this has been resolved in a different way, and keeping it
(on the contrary) loses keyboard inputs.

This has been tested by the speedrun community.
2023-04-02 11:35:35 +02:00
AndywinXp e28b3f09b1 SCUMM: GUI: Use correct heap message for some v6 games 2023-03-19 19:26:15 +01:00
AndywinXp e689c5116f SCUMM: GUI: Fix text not being entirely cleared in edge cases
When clearBanner() is called for versions lower than 7, it can cause some pixels
from the previous dialog text to remain on screen and not be cleared when the
text speed banner is displayed and cleared out.
2023-03-17 18:40:13 +01:00
AndywinXp 122eab3e4a SCUMM: Remove leftover debug print 2023-02-11 16:46:15 +01:00
AndywinXp ca59d016e5 SCUMM: MI1 (SegaCD): Improve input handling during dialogs
We allow ENTER to be used to confirm the dialog choice, swap the left and right
arrow keys, and correctly map the numpad keys (so that joypad now actually work!)
2023-02-11 11:32:48 +01:00
Cameron Cawley f7785f463a SCUMM: Use the keymapper for bike fights in Full Throttle 2023-02-08 00:11:40 +01:00
Little Cat 2f6b3df250 SCUMM: INPUT: Don't subsitute clicks in HE games.
These (later) games can have scripts that accept Enter and Tab keys.
2023-01-26 11:01:58 +01:00
AndywinXp 27f9345bed SCUMM: Fix bug #14051 2023-01-19 19:41:10 +01:00
AndywinXp 0a665007d5 JANITORIAL: SCUMM: Fix spelling error 2023-01-19 19:37:38 +01:00
AndywinXp b376f0010f SCUMM: GUI: Add support for Maniac NES 2022-12-29 11:19:45 +01:00
AndywinXp 995b83c546 SCUMM: GUI: Allow quitting with ALT-X and ALT-Q combinations 2022-12-28 19:15:39 +01:00
AndywinXp bc531b3738 SCUMM: GUI: Allow SHIFT-B to be also used for the buffer shortcut 2022-12-27 15:37:30 +01:00
AndywinXp 4d6d76b60b SCUMM: GUI: Implement missing banners for v6 games 2022-12-20 22:38:26 +01:00
D G Turner 9d1d5ba338 SCUMM: GUI: Fix GCC Compiler Parantheses Needed Warning 2022-12-14 09:18:26 +00:00
AndywinXp f463d032d8 SCUMM: GUI: Improve readability 2022-12-13 18:40:11 +01:00
AndywinXp 06f352f8e4 SCUMM: GUI: Fix restart prompt banner appearing for MI1 SegaCD 2022-12-13 18:40:11 +01:00
AndywinXp b1eaf2ea0f SCUMM: GUI: Implement MI1 SegaCD menu 2022-12-13 18:40:11 +01:00
AndywinXp 2a1708b2c0 SCUMM: GUI: Fix wrong textSpeed range in GUI string 2022-12-01 19:54:49 +01:00
AndywinXp 1d206fbc53 SCUMM: v0-1-2-3: Implement actual saving\loading system
This commit implements saving and loading in the same way the original interpreters
for MANIAC v0-1-2, ZAK v1-2-3, LOOM v3 and INDY v3 do. This makes it possible to
use the original save menus without glitches or crashes.

Saves done from GMM can also be loaded from the original menu.
2022-11-28 23:21:45 +01:00
AndywinXp 9900bbd616 SCUMM: GUI: Implement original save/load menus for v5 FM-Towns games 2022-11-28 23:21:45 +01:00
AndywinXp 3bc9064278 SCUMM: GUI: Make the restart prompt more consistent
Also make it work for v3 Towns games, which have their own mapping for the F keys
2022-11-28 23:21:45 +01:00
AndywinXp b8e4fbb72b SCUMM: GUI: Fix GMM not opening on F5 press for v3 Mac games 2022-11-28 23:21:45 +01:00
AndywinXp 6560244a81 SCUMM: GUI: Fix regression in snap scroll message 2022-11-28 23:21:45 +01:00
AndywinXp 9cb7293de3 SCUMM: Clean-up and implement remaining messages for v0-1-2-3 2022-11-28 23:21:45 +01:00
AndywinXp 13e7c9d4d9 SCUMM: Implement basic support for v0-3 GUI 2022-11-28 23:21:45 +01:00
AndywinXp 078bfa70cd SCUMM: FT: Fix mouse button-up events being lost during INSANE sequences 2022-11-14 00:15:45 +01:00