Commit Graph
59 Commits
Author SHA1 Message Date
Kaloyan Chehlarski b1a861b50d NANCY: JANITORIAL: Fix trailing whitespace/tabs 2024-02-19 20:46:17 +01:00
Kaloyan Chehlarski 7ad2367d8b NANCY: Implement forced reloading of sounds
In cases where a sound needs to be rapidly replayed
without the need to wait for it to end, loadSound() now
has a parameter for forcing a reload.
2023-12-30 00:16:14 +02:00
Kaloyan Chehlarski 586225d614 NANCY: JANITORIAL: Spaces to tabs / double spaces
Fixed all cases where spaces were used instead of tabs, and
all cases where a space was erroneously doubled.
2023-12-28 23:58:17 +02:00
Le Philousophe 1c2d757dbd NANCY: Migrate engine to Path 2023-12-24 13:19:25 +01:00
Kaloyan Chehlarski 939d3d0e46 NANCY: Adjust volume when playing same sound twice
Earlier games did not have a StopSound action record, so
there is at least one scene in nancy2 where, in order to get
a sound to stop playing, the devs just played it again but
with a zero volume. In such cases, we now adjust the
volume of the sound being played without restarting it.
2023-11-05 23:15:46 +02:00
Kaloyan Chehlarski 8b7c7f9b17 NANCY: Implement SetVolume action record 2023-10-07 14:45:21 +03:00
Kaloyan Chehlarski a4e7dfee97 NANCY: Block SoundManager from creating Scene state
Added a check inside SoundManager that makes sure it
doesn't prematurely create a new Scene state. This fixes
the chain reaction that results in the load/save menu having
clickable Save buttons.
2023-10-02 12:19:30 +03:00
Kaloyan Chehlarski 60ffa2ee81 NANCY: Adjust SecondaryMovie timing
Added an improvement to the ActionRecord processing
code that fixes timing-related issues with secondary movies.
As a result, movies are now better-synchronized than they
ever were in the original engine.
2023-09-25 14:37:37 +03:00
Kaloyan Chehlarski 9dd73a5edb NANCY: Only set minimum volume in nancy3 and up
It seems the addition of a minimum volume for sounds only
got added when the sound system was revamped in nancy3.
This fixes an incorrect clock sound playing in the diner
in nancy1.
2023-09-24 17:43:29 +03:00
Kaloyan Chehlarski e5d3c8614d NANCY: Fix sound interpolation between scenes
Fixed a couple of errors made when implementing
3D sound interpolation.
2023-09-20 16:16:22 +03:00
Kaloyan Chehlarski 2e64313d91 NANCY: Add minimum allowed sound volume
Added a minimum volume for all sounds, which makes
sure all sounds can be heard, even if their volume in
the data is set to 0.
2023-09-20 16:16:21 +03:00
Kaloyan Chehlarski f0d189498d NANCY: Fix 3D sound pop when changing scenes
Added a short interpolation to listener position and sound
panning when changing a scene. This (somewhat) fixes the
audible pop when a loud 3D sound is playing while the
character is moving (e.g. the clock chime in nancy3).
2023-09-19 17:38:26 +03:00
Kaloyan Chehlarski 087d9c4f39 NANCY: Correctly initialize 3D sound
Fixed an issue where 3D sounds would only get their
correct positions in space after the viewport has been moved.
2023-09-19 17:38:25 +03:00
Kaloyan Chehlarski cdb0d4aaff NANCY: Do not restart already playing sounds
If a sound is already loaded in a channel and we try to re-load it,
or play it for the second time, the sound manager just ignores
the calls and continues playing the sound as normal, rather than
restarting it.
2023-09-19 17:38:25 +03:00
Kaloyan Chehlarski bfc576fb8d NANCY: Fix for some 3D sounds not playing
Added a fix for an edge case where if a sound is exactly
the minimum distance away from the listener, its volume
would be set to zero.
2023-09-19 17:38:25 +03:00
Kaloyan Chehlarski abc4168433 NANCY: Properly pause all scene sounds
Fixed an issue where certain sound channels wouldn't get
paused when changing state. Collapsed the pause/unpause
functions inside Scene into a single function, and placed it
inside SoundManager.
2023-09-16 13:14:52 +03:00
Kaloyan Chehlarski 99b358b056 NANCY: Fix Coverity warnings 2023-08-28 19:53:33 +03:00
Kaloyan Chehlarski 0ec7f97605 NANCY: Add getters for sound rate and volume 2023-08-24 12:47:50 +03:00
Kaloyan Chehlarski 4a3e074b7d NANCY: Do not apply 3D effects to inappropriate sounds
Added a missing check without which some sounds that
weren't marked as 3D would still get positioned in space.
2023-08-22 21:08:17 +03:00
Kaloyan Chehlarski 67188041d7 NANCY: Pause all sounds in GMM and console
Fixes an issue where some sounds would still play even
when the GMM or console were open.
2023-08-22 21:08:17 +03:00
Kaloyan Chehlarski 2db6e05ef6 NANCY: Use log2f instead of log2 in sound code 2023-08-22 13:31:28 +03:00
Kaloyan Chehlarski 860f5cd090 NANCY: Add 3D sound support
Added support for 3D sound, as introduced in nancy3.
The original engine used DirectSound 3D, which enabled
for easy sound panning, attenuation based on distance,
and doppler effect simulation. The DS3D algorithm
has only been approximated; in particular, there are some
minor differences when it comes to sound panning.
2023-08-22 12:15:26 +03:00
Kaloyan Chehlarski d8fe9cb4c1 NANCY: Implement new nancy.dat format
The new nancy.dat structure is now read correctly by
the engine. As a result, sound channels are no longer
hardcoded, and some new logic has been added to
dialogue condition handling.
2023-08-10 14:28:50 +03:00
Kaloyan Chehlarski e4f2cb4acd NANCY: Improve sound reading
Fixed several inaccuracies with reading sound data. Added
enumerations describing the sound playing commands
introduced in nancy3. Added a flag for sound debugging,
which will be used in implementing said play commands.
2023-08-10 14:28:49 +03:00
Kaloyan Chehlarski e9779c0c36 NANCY: Implement SoundEqualizerPuzzle
Implemented the SoundEqualizerPuzzle, used for nancy2's
mixing console sequence. Also extended the SoundManager
to accommodate the need to change volume and playback
rate while a sound is playing.
2023-07-13 14:32:46 +03:00
Kaloyan Chehlarski 685eccf1c2 NANCY: Separate SoundDescription reading functions 2023-05-10 16:57:33 +03:00
Kaloyan Chehlarski f6878e59a2 NANCY: Fix build error 2023-04-19 15:32:47 +03:00
Kaloyan Chehlarski bc4f0251f8 NANCY: Improve sound data reading
The samplesPerSec property found in some SoundDescriptions
is no longer ignored. This results in the correct playback of
certain sounds (e.g. the button press sounds in nancy2's
OverrideLockPuzzle).
2023-04-19 15:02:33 +03:00
Kaloyan Chehlarski 525d2383fb NANCY: Change loading of common sounds
loadCommonSounds() now takes the BOOT iff as an argument,
removing the need to store the sound chunks in memory.
2023-03-30 20:21:45 +03:00
Kaloyan Chehlarski 79d3d248cf NANCY: Do not unload persistent sounds
Persistent sounds no longer get unloaded when calling stopSound().
2023-03-26 11:44:00 +03:00
Kaloyan Chehlarski 8665aa3b4f NANCY: Remove nonsense comment 2023-03-26 11:43:57 +03:00
Kaloyan Chehlarski 7b572e378c NANCY: Make sure menu sound is loaded on startup 2023-03-26 11:43:56 +03:00
Kaloyan Chehlarski fed8207725 NANCY: Map improvements
The Map state no longer reads its data from disk every time it needs to
be opened. The Vampire Diaries scenes where the map music keeps
playing are now respected.
2023-03-15 18:25:04 +02:00
Kaloyan Chehlarski 3749b21f18 NANCY: Formatting fixes
Changed spaces to tabs, fixed some double spaces and cleaned up
trailing whitespaces.
2023-03-07 21:19:24 +02:00
Kaloyan Chehlarski d6a48e7d16 NANCY: Preload The Vampire Diaries-specific persistent sounds 2023-03-05 16:31:22 +02:00
Kaloyan Chehlarski f42bd8cb2d NANCY: Automatically calculate channel panning
Added a per-channel function to calculate the panning of a sound channel,
and made sure to have it automatically called any time a sound is played.
2023-02-23 22:20:12 +02:00
Kaloyan Chehlarski 7a1cc19b91 NANCY: Add support for panning stereo effect
Added support for sounds that pan in 360-degree space, as used in
The Vampire Diaries.
2023-02-23 22:20:12 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 3a51911db2 NANCY: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Kaloyan Chehlarski 0bab0e8160 NANCY: Clean up sound code 2021-05-18 00:44:18 +03:00
Kaloyan Chehlarski 3013d07e81 NANCY: Implement PlaySoundPanFrameAnchorAndDie action record
Implemented the PlaySoundPanFrameAnchorAndDie action record
type and added support for panning audio to the sound manager.
2021-05-07 23:09:51 +03:00
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Kaloyan Chehlarski 4b48535395 NANCY: Add support for DiamondWare v1.1 sound files
Bumped up the supported version of DWD files to 1.1 so a couple of
special cases in The Vampire Diaries can play.
2021-04-29 15:58:59 +03:00
Kaloyan Chehlarski cf43a600f5 NANCY: Implement sound in The Vampire Diaries
Unlike all later games using the engine, TVD sounds are stored in
an obscure file format (.dwd, DiamondWare Digitized). This commit adds support for uncompressed .dwd files and thus enables audio
in the game.
2021-04-28 17:02:59 +03:00
fracturehill 90c4f0c4dc NANCY: Move hardcoded data
Moved all hardcoded engine data that changes between games (e.g. number
of items, number of event flags) to a dedicated file and added a function for
accessing it in NancyEngine.
2021-04-24 23:59:03 +03:00
fracturehill 9bb543a69e NANCY: Common sound handling changes
SoundManager is now responsible for loading and storing all common sounds (sounds with their own BOOT chunk). All playSound() calls with a hardcoded channel ID now use the chunk name instead. Also fixed some sound inaccuracies when switching between states.
2021-04-08 21:42:52 +03:00
fracturehill 85f8bf294d NANCY: Includes cleanup
Reordered and cleaned up #includes in the engine.
2021-04-01 21:25:32 +03:00
fracturehill ff078328bc NANCY: Includes cleanup
Cleaned up the engine's #includes. Also moved the NancyEngine::GameState enum to commontypes.h and renamed it to NancyState.
2021-03-26 01:17:07 +02:00
fracturehill 0656e2473c NANCY: Initialize local variables
Initialize local variables in a couple of functions to silence warnings.
2021-03-25 19:52:51 +02:00
fracturehill 89fd430243 NANCY: Fix wrong sound channel id checks
Fixed an incorrect check for maximum channelID inside SoundManager.
2021-03-25 19:52:50 +02:00