Commit Graph

202 Commits

Author SHA1 Message Date
Matthew Hoops
ddf170de4a ZVISION: Silence gcc warnings 2015-04-11 16:12:47 -04:00
Torbjörn Andersson
ec16861ec9 ZVISION: Silence Cppcheck warning 2015-03-22 08:14:18 +01:00
Filippos Karapetis
b45e706012 ZVISION: Fix script bug #6803 (tuning fork box state) 2015-02-17 01:49:59 +02:00
Filippos Karapetis
53a2c30cb0 ZVISION: Fix script bug #6791 (max value of delay_render)
This fixes the delay outside the Frobozz Electric building.
In all other places, delay_render is called with a value
ranging from 1 to 10, so the 100 here looks to be a script
bug, and causes an unnecessary long pause in that scene.
Thus, we're capping the frame delay value to 10.
2015-02-14 15:27:01 +02:00
Filippos Karapetis
9ce285a11e ZVISION: Also reference the script manager in ResultAction members 2015-02-14 15:08:28 +02:00
Filippos Karapetis
60c06b84b6 ZVISION: Fix script bug #6794 - "ZVISION: Yoruk's coffin instant death"
Fixes an edge case where the player goes to the dark room with the grue
without holding a torch, and then quickly runs away before the grue's
sound effect finishes. Many thanks to eriktorbjorn for the original
workaround
2015-02-14 15:08:28 +02:00
Filippos Karapetis
14914b2a31 ZVISION: Add custom equality operators for game location
This makes the location checks more readable
2015-02-14 15:08:28 +02:00
RichieSams
a851fa8e1a ZVISION: Refactor text rendering code in order to fix word wrapping
and clarify the logic. Fixes bug #6801
2015-02-11 15:13:19 -06:00
Torbjörn Andersson
cbbd1a9219 ZVISION: Set safe control state value after animation finishes
If we set it before the animation starts, the final turn of the
wheel won't be animated, because the puzzle will already be solved.
2015-02-08 15:47:20 +01:00
Torbjörn Andersson
8725f2cff2 ZVISION: Limit input text to the width of the input control
This is to prevent the player from entering ridiculously long
savegame descriptions.
2015-02-08 13:56:01 +01:00
Torbjörn Andersson
b7b4e9cc58 ZVISION: Draw transparent text in original save dialog
Before this change, text was drawn in black boxes in Zork Nemesis,
so while this does make it look better (and more like the original)
this may actually make the text slightly harder to read. The
original dialogs allowed only upper-case letters, but I think that
it's better to leave that to the player.
2015-02-08 10:13:18 +01:00
Filippos Karapetis
6c07f918c6 ZVISION: Fix for script bug #6783 (no sound in the ZNem fist puzzle)
This is a bug in the original game script of the Zork Nemesis fist
puzzle, which we now patch so that the sound checks are correct for the
left fist animation
2015-02-03 12:31:58 +02:00
Filippos Karapetis
1adcb23d71 ZVISION: Fix bug #6784 (wrong scaling in the fist control) 2015-02-03 04:16:02 +02:00
Torbjörn Andersson
bc2c1c6a3c ZVISION: Remove \n from debug message 2015-02-02 01:11:53 +01:00
Torbjörn Andersson
8c8261aa2a ZVISION: Cleanup.
We usually don't check a pointer before deleting it.
2015-01-26 22:18:23 +01:00
Torbjörn Andersson
dd5cd42f2e ZVISION: Use ValueSlot for volume in ActionMusic
As suggested by Marisa-Chan. I had based my earlier implementation
on parseCritera(), and was unaware of this alternative. The good
thing is that the diff from the old code is now much smaller, which
should reduce the risk of regressions. (There is a lot I haven't
tested here...)
2015-01-26 22:18:23 +01:00
Torbjörn Andersson
51e90b2422 ZVISION: Fix ActionMusic volume
The volume can be either a constant or a state value. The latter is
used by ZGI to simulate a sound being heard at different distances,
e.g. the beehive in the Dungeon Master's hideout.
2015-01-26 19:34:21 +01:00
Marisa-Chan
568c13b115 ZVISION: Use correct virtual class type instead of MusicNode 2015-01-23 16:31:10 +06:00
Marisa-Chan
9b498d576e ZVISION: Correct value for attenuate 2015-01-23 16:26:17 +06:00
Marisa-Chan
0bc61d3c21 ZVISION: Volume is not linear value, use dB map to linear for -100...0dB 2015-01-23 16:25:21 +06:00
Marisa-Chan
ad2ab98474 ZVISION: Use correct int type for volume 2015-01-23 16:20:59 +06:00
Marisa-Chan
d67727a7a4 ZVISION: Fix sound bug #6767 by making pan_track code similar to original 2015-01-23 11:13:06 +06:00
Filippos Karapetis
d75fbe79f0 ZVISION: Error out when a script file can't be found or be parsed
This should be an error, as we've effectively reached a non-existing
scene (such as in bug #6780), or we haven't parsed script files of a
scene fully, thus unexpected behavior will likely occur
2015-01-23 03:04:50 +02:00
Filippos Karapetis
1bd83a96f0 ZVISION: Fix script bug #6780 (invalid hotspot at base of tower in ZGI) 2015-01-23 03:02:24 +02:00
Torbjörn Andersson
796fb134f1 ZVISION: Remove unnecessary spaces 2015-01-21 01:24:59 +01:00
Filippos Karapetis
1330cb7c99 ZVISION: Remove superfluous check 2015-01-21 01:42:01 +02:00
Torbjörn Andersson
ad83f03315 ZVISION: Fix mis-parsing of criteria, a.k.a bug #6774
A condition in a criteria is made up of three tokens: An id, an
operator and an id/value. However, in my copy of ZGI, puzzle:07507
has "[00202] !3  # SPELL_12_IN_BOOK", i.e. there was no space
between the second and third tokens. This caused the "glorf" spell
to not be properly inscribed in your spell book.

To fix this, if the second token is more than one character we use
the rest of it as the third token.
2015-01-20 19:21:39 +01:00
Filippos Karapetis
750d72812b ZVISION: Properly skip commented out puzzle criteria - fixes bug #6776
In the Zork: Nemesis version bundled in the ZGI SE DVD, the bell rope
puzzle has been modified so that it's non-interactive, i.e. there isn't
a hotspot to click while the video is playing, and the player is
transported to the next room. In the patched script, all criteria of
that puzzle were commented out, resulting in an invalid criteria list.
Skip any commented out criteria, to avoid ending with an invalid list.
2015-01-20 02:16:21 +02:00
Filippos Karapetis
5f9858844a ZVISION: Fix saving when using the original save dialog
A regression from commit dcac5be493
2015-01-20 01:21:16 +02:00
Filippos Karapetis
5df2e08c16 ZVISION: Fix bug #6771 (unable to leave room when loading a game)
Avoid overwriting the previous location when loading a saved game
2015-01-19 23:54:42 +02:00
Filippos Karapetis
dcac5be493 ZVISION: Simplify the checks in the location changing code 2015-01-19 23:54:41 +02:00
Filippos Karapetis
68b7839d99 ZVISION: Fix bug #6768 (unable to save in the prison area)
The save buffer preparation code had a bug, which triggered in the
jail area because its room is 'j'
2015-01-19 05:09:03 +02:00
RichieSams
3a31e1de96 ZVISION: Don't change location when coming back from ScummVM save dialog and do change location when coming back from restore dialog
Fixes bug # 6771

We don't need to change locations, since we use the ScummVM save dialog instead
of the original one (which is actually a location). Instead we just need to reset _nextLocation to
_currentLocation so the engine can stop trying to save. If we change locations, the
StateKey_LastWorld/Room/etc. end up being overwritten with the current room. So if a script
refers to location 0, 0, 0, 0 (aka, the last room), the engine will try to change location to the same room.

On restore, we have to force a location change, just in case we restore to the same room. (Since the logic
will only do a location change if _nextLocation != _currentLocation)
2015-01-18 20:22:02 -06:00
RichieSams
0fafb6a62c Revert "ZVISION: Don't change location when coming back from ScummVM save dialog"
This reverts commit b835eacc0c.
2015-01-18 20:11:10 -06:00
RichieSams
b835eacc0c ZVISION: Don't change location when coming back from ScummVM save dialog
Fixes bug # 6771

We don't need to change locations, since we use the ScummVM save dialog instead
of the original one (which is actually a location). Instead we just need to reset _nextLocation to
_currentLocation so the engine can stop trying to save. If we change locations, the
StateKey_LastWorld/Room/etc. end up being overwritten with the current room. So if a script
refers to location 0, 0, 0, 0 (aka, the last room), the engine will try to change location to the same room.
2015-01-18 19:26:49 -06:00
RichieSams
a26a9c7268 ZVISION: Fix formatting and add curlies 2015-01-18 17:06:37 -06:00
Sven Hesse
3f66f28624 ZVISION: Remove trailing whitespace 2015-01-18 20:35:51 +01:00
Filippos Karapetis
263c592490 ZVISION: Fix bug #6769 (the "Alchemical debacle" video in ZGI) 2015-01-17 23:38:50 +02:00
Filippos Karapetis
9f00880aa4 ZVISION: Properly handle sounds reusing the same sound slot (bug #6761)
This is based on Marisa-Chan's observations in commit 28e27ea1d9.
Tested with both ZNEM and ZGI
2015-01-16 14:08:15 +02:00
RichieSams
89f233f488 ZVISION: Set the state value for the lever position during user dragging
Not just during the "returning" animation. Addresses part of bug #6761
2015-01-15 00:41:13 -06:00
RichieSams
4f28cec6ac ZVISION: Keep the hand cursor during lever movement
We have to explicitly set the cursor each call otherwise the cursor will
be reset to the idle cursor. Addresses part of bug #6761
2015-01-15 00:40:37 -06:00
RichieSams
28e27ea1d9 ZVISION: Allow multiple sound effects to play at the same time
This is the original behavior. This was noted in bug #6761. Specifically,
the knocker on the door plays a sound whenever it is a the top of the bottom
of the swing. By only allowing one sound effect to play at the same time, the
knocker would only play once, even though it bounces at the bottom.
2015-01-15 00:31:39 -06:00
Filippos Karapetis
21e9007d80 Revert "ZVISION: Remove ActionRestoreGame and loading of r.svr (restart slot)"
This reverts commit 9f642074ba, as it
broke the credits screen in ZGI.

This has been rewritten to use the common save code
2015-01-10 22:03:15 +02:00
Filippos Karapetis
899cf4813c ZVISION: Change screen resolution for the hires DVD videos to 800x600
Also, this hooks up the MPEG-PS decoder, but only if libmpeg2 is
compiled in. The DVD videos are still disabled until AC3 audio support
is implemented.
The hires DVD videos are encoded a 720x480 resolution, with double the
frame rate of the lowres ones (29.97FPS up from 15FPS)
2015-01-10 21:32:15 +02:00
Filippos Karapetis
616b34e629 ZVISION: Change wording 2015-01-10 17:30:11 +02:00
Filippos Karapetis
79b92fe046 ZVISION: Clean up save logic, and fix a thumbnail-related FIXME
This fixes the save game thumbnails when using the original save/load
screens
2015-01-09 01:09:53 +02:00
Filippos Karapetis
4ffaf4df37 ZVISION: Add stubs for the hires VOB MPEG2 videos of ZGI DVD
VOB file handling is based on clone2727's work. The lowres videos are
played for now, until AC3 sound handling is implemented
2015-01-07 11:42:27 +02:00
Filippos Karapetis
cdbc06d0f7 ZVISION: Use a common function for loading game animations 2015-01-07 11:42:26 +02:00
Filippos Karapetis
9f642074ba ZVISION: Remove ActionRestoreGame and loading of r.svr (restart slot)
This is handled internally now, so r.svr isn't needed anymore
2015-01-07 11:42:24 +02:00
Filippos Karapetis
64979d5e45 ZVISION: Fix regression in the handling of multiple animations
A regression from 0c4e0673c3. Thanks to Marisa-Chan for noticing
2014-12-30 15:38:03 +02:00