259 Commits

Author SHA1 Message Date
Bastien Bouclet
3a7f85971f MOHAWK: MYST: Add support for the localized 25th games 2018-07-30 20:13:16 +02:00
Bastien Bouclet
1f914ea759 MOHAWK: MYST: Don't call the mouse up handler if executeMouseUp was used
Fixes Trac#10573.
2018-07-21 09:56:33 +02:00
David Fioramonti
bd21a5c0f3 MOHAWK: MYST: Have Mech fortress west direction persists after returning
Fixes Trac#10575.

When stepping away or pressing the buttom for the mechanical age fortress
rotator after setting it west it would be south. This is because some variables
used for a workaround were being reset everytime the rotator puzzle
was being reinitalized (in o_fortressRotation_int). Which happens when
the player steps back up to the rotator controls.

This change simply removes the variables being reset so they retain
the variables they had before. Those variables are already initalized
in the Mechanical constructor.
2018-07-15 07:59:44 +02:00
David Fioramonti
b1aec443c4 MOHAWK: MYST: Don't set Mech direction when elevator button is pressed
The direction that the fortress is pointing is calculated when
the user locks on using the left throttle (after the gears have
stopped). It also happens when the user hits the button.

There is only a difference in the two behaviors when the user has
changed the direction, but not locked on.

The 2nd case can lead to the direction be different than
what the last locked on direction was. Since the user
can lock the direction to say north, turn it to west, not
lock on and hit the button, which will set the direction
to west. This can lead to confusion since a direction sound
isn't played in this case.

This change removes code, to prevent the recalculation
of the direction when the button is pressed so that direction
is always what it was last locked onto.
2018-07-15 07:32:47 +02:00
Bastien Bouclet
5dd38b8660 MOHAWK: MYST: Play complete audio clip when changing the boiler pressure
Fixes Trac#10607.
2018-07-08 21:55:09 +02:00
David Fioramonti
a01babbd38 MOHAWK: MYST: Use degree conversion common math funcs 2018-07-03 23:08:48 +01:00
Bastien Bouclet
9aeb4a356e MOHAWK: MYST: Always clear the screen before playing fullscreen movies
Fixes the broderbund logo movie being partially visible when the Cyan
logo is playing.

Fixes Trac#10595.
2018-07-02 21:48:19 +02:00
Bastien Bouclet
73b3a43b89 MOHAWK: MYST: Introduce a main menu stack
Used in the 25th Anniversary edition of Myst ME
2018-06-29 13:15:01 +02:00
Bastien Bouclet
1d731cb6c0
Merge pull request #1220 from dafioram/mystDaySlider
MOHAWK: MYST: Increment y_pos of observatory day slider faster
2018-06-24 17:17:54 +02:00
David Fioramonti
f5e26d22b2 MOHAWK: MYST: Turn FortressRotation into a Direction enum 2018-06-24 16:49:56 +02:00
Bastien Bouclet
6237bc6e7b MOHAWK: MYST: Fix out of bounds read when redrawing the observatory
The observatory go button computes random 105x106 rectangles in the
512x512 star image. The previous code would allow to go out of bounds by
3 pixels. Interestingly the bug is in the original engine disassembly
perhaps it could crash as well.

Fixes Trac#10576.
2018-06-19 20:21:53 +02:00
David Fioramonti
bfeb2d48e2 MOHAWK: MYST: Increment y_pos of observatory day slider faster
Fixes Trac#10572.

The day slider does not go all the way to the bottom (day 31st)
when the down arrow is used to increment the day. This change
increases how much y displacement happens with each change
in the day so that the bottom is reach on day 31st.

This is just a graphical bug and doesn't affect the logic
of the puzzle. The day slider can also be dragged to the bottom
without using the buttons.
2018-06-19 05:23:59 -07:00
Bastien Bouclet
2de359f23d MOHAWK: MYST: Make the scripts time accounting pause safe 2018-06-13 08:00:29 +02:00
Bastien Bouclet
47ddd9c214 MOHAWK: MYST: Move the current stack id to ScriptParser 2018-06-13 07:55:55 +02:00
Bastien Bouclet
13b3371f1a MOHAWK: MYST: Extract a Card class out of the main engine class
This is to allow having multiple cards loaded at the same time in the
future.
2018-06-13 07:55:55 +02:00
Bastien Bouclet
4e77445086 MOHAWK: MYST: Opcode 102 in Channelwood can only set the volume to non 0 values
Fixes Trac#10532.
2018-05-17 20:49:28 +02:00
Bastien Bouclet
4ce71f3922 MOHAWK: MYST: Fix two Atrus videos playing at the same time in D'ni
In D'ni, after giving the white page to Atrus, or after coming without a
page, too videos of Atrus would play on top of each other after waiting
long enough for the first video to loop.

Fixes #10503.
2018-04-27 19:29:18 +02:00
David Fioramonti
52e247e239 MOHAWK: MYST: Make Dni/Atrus endings an enum
The global variable "ending" tracks various
states that Atrus can be in.

This variable determines what video of
Atrus will be playing and if the brother
books have been destroyed.

Despite this variable being called ending
there are other endings not captured by
this variable (like the brother endings).

Also change spelling of Dini to Dni for one
usage of ActiveAge from a previous commit.
2018-04-27 19:22:00 +02:00
Bastien Bouclet
3d2509a89c MOHAWK: MYST: Reset the main cursor when starting the credits
The credit stack does not have the data required to display all the
cursors, especially the page cursors.

Fixes Trac#10501.
2018-04-26 22:12:58 +02:00
David Fioramonti
ab7cdc5907 MOHAWK: MYST: Make global currentAge an enum
This global basically tracks what age/book/stack
the player is in.

It is also used to change stacks via
MohawkEngine_Myst::changeToStack() by
being an index for MystScriptParser::_stackMap
and MystScriptParser::_startCard.

E.x., instead of _global.currentAge = 2
now _global.currentAge = kMystLibrary.

Also two of the endings are considered Ages
instead of being apart of _global.ending.
2018-04-26 22:09:46 +02:00
dafioram
519e02da47 MOHAWK: MYST: Turn held page state into an enum
Previously, the held page stage was an unsigned int 16
with values 0-13. The enum will make its state more clear.
2018-04-25 18:46:50 +02:00
Bastien Bouclet
c1a12c2475 MOHAWK: MYST: Redraw the tower angle line after the rotation completes
Fixes Trac#10499.
2018-04-24 20:12:29 +02:00
Bastien Bouclet
dd425413b5 MOHAWK: Remove extra coma 2018-04-21 17:50:30 +02:00
Bastien Bouclet
e421b18c38 Merge branch 'dafioram-myst_soundrecvrChanges' 2018-04-21 17:36:46 +02:00
Bastien Bouclet
7c7010204b MOHAWK: MYST: Always redraw the sound receiver at constant speeds
Fixes the sound receiver display stopping for a little while
every second or so when keeping a direction button pressed.
2018-04-21 17:32:11 +02:00
David Fioramonti
bfa97d8f7a MOHAWK: MYST: Make sound receiver hint boundary line up with orig
In the original the sound reciever would provide a hint of the
source sound direction when the user was less than 5 degrees
away. In ScummVM it was less than or equal to 5 degrees.
Now it matches the behavior of the original.
2018-04-21 07:27:59 -07:00
David Fioramonti
5a1fc8c230 MOHAWK: MYST: Enhance: slow down sound receiver max spin rate
This slows down the Selentic age sound receiver spin rate
when fully depressing either of the turn buttons.

This is a deviation from the original and improves
the users experience.

In the original when the button is fully depressed
the receiver turns so fast that it is impossible
to predict what angle you full be at when you let go.
2018-04-21 07:27:54 -07:00
Eugene Sandulenko
0e02da6000 JANITORIAL: Fix code formatting 2018-04-15 23:55:07 +02:00
David Fioramonti
284f720830 MOHAWK: MYST: Fix Observatory displayed hour from 0:XX to 12:XX
Fixes #Trac10486.

For 12 Hr format versions, in ScummVM when the hour was set to
what should be 12:XX it was displayed as 0:XX.

This differs with the original English versions which displays
the 12:xx.

I verified this fix in both Myst ME and Myst English CD.
2018-04-15 18:33:04 +02:00
Bastien Bouclet
24956f0a56 MOHAWK: MYST: Fix observatory slider sounds repeating too quickly
Add delays to simulate running at a lower framerate.
2018-04-15 07:53:32 +02:00
Bastien Bouclet
63592e6a0f MOHAWK: MYST: Fix missing sound effect when using the rocket slider
Fixes #10485.
2018-04-11 07:49:12 +02:00
Bastien Bouclet
5fec35d045 MOHAWK: MYST: Initialize more variables
To make static analysis tools quiet.
2018-04-02 13:38:57 +02:00
Bastien Bouclet
235893fb44 MOHAWK: MYST: Implement opcodes 178 and 179
Used when turning pages in the library. Some versions of the game appear
to use them.

Fixes #10474.
2018-04-02 08:00:59 +02:00
Bastien Bouclet
84b2dc5cc8 MOHAWK: Fix some clang-tidy warnings 2018-03-31 13:36:09 +02:00
Bastien Bouclet
e62e28732f MOHAWK: Myst: Fix one Atrus video being off position by one pixel
Fixes #10114.
2017-08-12 15:38:13 +02:00
Bastien Bouclet
fb26a42aad MOHAWK: Myst: Restore the backbuffer after toggling off fireplace buttons
Fixes #10064
2017-08-10 20:52:23 +02:00
Bastien Bouclet
cf9646e72b MOHAWK: Myst: Stop gears video before calling elevator on mechanical
Fixes #10108.
2017-08-10 19:02:10 +02:00
Bastien Bouclet
09be9b2c2d MOHAWK: Myst: Fix off by one pixel map position when rotating the tower
Fixes #10081.
2017-08-08 20:11:22 +02:00
Bastien Bouclet
cd6a4423ef MOHAWK: Myst: Display every second fireplace button animation frame
The animation is too slow when displaying each frame at 60 fps.

Fixes #10053
2017-08-05 08:36:32 +02:00
Bastien Bouclet
07aaed5659 MOHAWK: Myst: Set the mixer sound type to SFX for videos
Also simplify video filename construction.
2017-07-30 17:42:01 +02:00
Bastien Bouclet
2597e69f29 MOHAWK: Myst: Fix Selenitic sound receiver buttons not flashing
The new screen update strategy does not allow scripts to draw twice at
the same location for blinking.
2017-07-22 20:38:56 +02:00
Bastien Bouclet
7ac1bd9a57 MOHAWK: Myst: Fix error when checking the rocket sliders solution twice
The game was trying to start playing the linking book video in a
blocking way whereas it was set to loop by the first check.

Fixes #9914.
2017-07-22 20:38:56 +02:00
Bastien Bouclet
757459bd49 MOHAWK: Myst: Don't cast function pointers when registering commands 2017-07-22 20:38:56 +02:00
Bastien Bouclet
a99397f126 MOHAWK: Myst: Improve script execution tracing 2017-07-22 20:38:56 +02:00
Bastien Bouclet
3e99dd8ccc MOHAWK: Myst: Switch to bounds checked opcode arguments 2017-07-22 20:38:56 +02:00
Bastien Bouclet
75040819c6 MOHAWK: Myst: Rewrite the sound code
It now more closely matches the original. Effect sounds are now stopped
when resuming background sounds.

Fixes #9574, Fixes #9920.
2017-07-22 20:38:56 +02:00
Bastien Bouclet
a2fc282e1c MOHAWK: Myst: Move the sound code to its own class 2017-07-22 20:38:56 +02:00
Bastien Bouclet
64303abb07 MOHAWK: Myst: Update the screen only once per frame
Change all inner loops to call the same frame function.

Remove the draw delay code. Now that we have proper frame pacing it is
not necessary anymore to wait before drawing to make sure the previous
frame stayed on the screen long enough.

Fixes #9915, #9922, #9923.
2017-07-22 20:38:56 +02:00
Bastien Bouclet
9cb6c872b7 MOHAWK: Myst: Decorrelate hotspot handling from event handling
This makes sure doFrame can be called from anywhere, including scripts.
2017-07-22 20:38:56 +02:00
Bastien Bouclet
8f0fa86fbc MOHAWK: Myst: Change blocking sounds to use the main loop 2017-07-22 20:38:56 +02:00