Commit Graph

75 Commits

Author SHA1 Message Date
nashmuhandes 578bf9b09c Added "local" parameters to A_PlaySound and ACS PlaySound 2016-11-01 13:21:32 -04:00
Christoph Oelckers 36bf099d54 - fixed: object pointers as array members may not be skipped if they are null.
- changed S_GetMusic to return a const pointer to the actual music name instead of a copy. The only thing this is used for is the savegame code and it has no use for a copy, it can work far more efficiently with a const pointer.
2016-09-23 21:24:56 +02:00
Christoph Oelckers 810ef8f775 - save global savegame data to JSON as well.
This is incomplete and untested, just a safety commit before going on.
2016-09-21 12:19:13 +02:00
Christoph Oelckers 3a1191281f - some preparations for converting the player serialization code.
- converted sound and canvas texture serialization.
- refactored file_zip, so that it can be used to load loose zip files and extract their compressed data directly.
- added handling to FSerializer to generate and consume compressed Zip file entries.

If all goes well this will allow saving savegames as Zips when the rework is done, which will make analyzing them a lot easier.
2016-09-20 23:13:12 +02:00
Christoph Oelckers 970c168b13 - re-added serialization of treanslations.
- removed more dead code.
2016-09-20 19:45:32 +02:00
Christoph Oelckers 718614a820 - cleanup 2016-09-19 01:07:51 +02:00
Chris Robinson 8334189d66 Merge remote-tracking branch 'zdoom/master' 2016-05-05 12:55:16 -07:00
Chris Robinson 0d402618a3 Load mono copies of multichannel sounds that are used in 3D 2016-05-01 21:44:03 +02:00
Chris Robinson 6e25d3f618 Use a background thread for processing OpenAL streams 2016-04-26 06:12:56 -07:00
Christoph Oelckers 5e1c79c050 - floatified the rest of p_mobj_cpp and removed a large part of the conversion cruft from the headers that was needed to keep the code compileable. 2016-03-28 12:03:07 +02:00
Christoph Oelckers 7c87479eea - parameter rework of several spawning functions. 2016-03-23 13:31:12 +01:00
Randy Heit 55142078d8 Normalize line endings 2016-03-01 09:47:10 -06:00
Christoph Oelckers 8da6483223 - fixed some places where FStrings were incorrectly used.
- replace all implicit conversions from FString to const char * in the header files (so that it can be test compiled with the implicit type conversion turned off without throwing thousands of identical errors.)
2016-02-05 10:40:45 +01:00
Christoph Oelckers 5e975ac9f6 - extended $mididevice to add an optional parameter, which has the following meaning for the different MIDI devices:
* OPL: specify the core to use for playing this song
* FluidSynth: specify a soundfont that should be used for playing the song.
* WildMidi: specify a config file that should be used for playing the song.
* Timidity++: specify an executable that should be used for playing the song. At least under Windows this allows using Timidity++ with different configs if the executable and each single config are placed in different directories.
* GUS: currently not operational, but should later also specify the config. This will need some work, because right now this is initialized only when the sound system is initialized.
* all other: no function.

These options should mainly be for end users who want to fine-tune how to play the music.
2015-12-31 23:03:53 +01:00
Christoph Oelckers a03b947729 - WildMidi generally working, some cleanup left to do... 2015-11-28 20:58:14 +01:00
Christoph Oelckers dccd35ef29 - uncoupled OpenAL music updates from UpdateSounds.
UpdateSounds will not be called during screen wipes and the entire setup of this function suggests that this is not advisable at all.
The OpenAL stream updates were done deep inside this function implicitly.
This caused music to stop while a wipe was in progress. So in order to allow uninterrupted music playback during screen wipes the music updates need to be handled separately from sound updates and be called both in the main loop and the wipe loop.

I think that the OpenAL music updating should be offloaded to a separate thread but at least it's working now without causing interruptions during wipes.
2015-04-25 10:26:14 +02:00
Chris Robinson ff6eb6df5c Merge remote-tracking branch 'zdoom/master' into openal
Conflicts:
	src/s_sound.cpp
2014-09-09 14:45:53 -07:00
Randy Heit 449a17c2f4 Correctly assign the sample rate for all Blood SFX formats
- Blood can do 44100 Hz sounds!
2014-07-29 21:09:29 -05:00
Chris Robinson 1a40c95f84 Rename some FMOD references to be generic sound system
Since they relates to other sound backends as well, there's no need to single
out FMOD in these places.
2014-06-26 16:58:18 -07:00
Randy Heit 1b9c71b252 - Added S_ChangeSoundVolume() to change the volume of an already playing sound, accessible
through the new ACS function SoundVolume.

SVN r4318 (trunk)
2013-06-01 17:46:50 +00:00
Randy Heit 971eca7d61 - Fixed: Player sounds that explicitly use dsempty will now properly silence the sound instead of
looking for a more audible version.

SVN r3938 (trunk)
2012-11-03 03:43:05 +00:00
Randy Heit 0ac94c5265 - Precache player sounds at level load.
SVN r3841 (trunk)
2012-08-22 23:46:47 +00:00
Randy Heit 625482aaeb - Added actors' BounceSound, WallBounceSound, and CrushPainSound to preloading.
- Moved marking of actor sounds for precaching into a virtual Actor function.

SVN r3838 (trunk)
2012-08-22 23:17:49 +00:00
Randy Heit 45027e4620 - Added SNDINFO $attenuation command. This multiplies the attenuation passed to S_Sound. e.g.
$attenuation Boom 0
  Will make the "Boom" sound play with 0 attenuation, or in other words, at full volume throughout
  the level.

SVN r3629 (trunk)
2012-05-07 01:16:56 +00:00
Randy Heit 1579fd1c1c - Fixed: Selecting TiMidity++ as a MIDI device without a working timidity.exe, then switching to a different MIDI device would leave music silent until a new song was started.
(The discrepancy between mus_playing.handle and currSong is one which should probably be handled properly at some point.)

SVN r3212 (trunk)
2011-05-20 00:26:22 +00:00
Christoph Oelckers f0f17e531c - move static AM color initialization into the AM_StaticInit function.
- move D_LoadWadSettings to keysections.cpp.
- made some more data reloadable.
- data structures filled by P_SetupLevel should be cleared before loading the level. They can remain non-empty in case of an error. There's probably more to fix here...
- fixed: MidiDevices and MusicAliases were not cleared before reloading local SNDINFOs.
- fixed signed/unsigned warnings in AddSwitchPair for real (GCC really allows -1u? MSVC prints a warning for that.)


SVN r3036 (trunk)
2010-12-14 00:50:02 +00:00
Christoph Oelckers 2fcf1af21b - added a $musicalias command to SNDINFO that allows remapping of music tracks. Mapping to 'none' means that starting the remapped song will have no effect at all. There's one limitation though: If you load a WAD with the same music name after the one with the SNDINFO lump the mapping will be ignored. This is so that music resources can use this command without interfering with WADs that replace the music with their own.
SVN r3002 (trunk)
2010-11-08 17:24:27 +00:00
Christoph Oelckers e2c105b447 - fixed: XMI music files were not converted for playback with FMod or Timidity++.
- Was there any reason why the MIDI_GUS device was so well hidden from the user? It sure does not sound broken. Added it to MIDI menu and $mididevice.


SVN r2862 (trunk)
2010-09-29 00:35:47 +00:00
Christoph Oelckers eed5812799 - added 'fluidsynth' option for $mididevice command.
SVN r2598 (trunk)
2010-08-26 16:46:01 +00:00
Randy Heit 99a2014ead - Added support for custom loop points for songs. This does not work with MP3 because of the
way MP3 obfuscates custom tags. Vorbis and FLAC are fine. (I could make it work with MP3,
  but you should be using Vorbis instead.) They are:
  * LOOP_START: Start time for the loop. If omitted, the song repeats from the beginning.
  * LOOP_END: End time for the loop. If omitted, the song loops at the end. (If you need to specify this, why aren't you using a shorter song.)
  You only need to specify one of these tags to set the custom loop. Naturally, you can set
  them both, as well. The format for each tag is the same:
  * If it contains a colon (:), it specifies by time. This may be of the form 00:00:00.00
    (HH:MM:SS.ss) to specify by play. Various parts may be left off. e.g. To start the loop
    at 20 seconds in, you can use ":20", 0:20", "00:00:20", ":20.0", etc. Values after the
    decimal are fractions of a second and accurate to one millisecond.
  * If you don't include a colon but just have a raw number, then it's the number of PCM
    samples at which to loop.
  * Any characters other than digits (0-9), colons (:), or a single decimal point for the
    seconds portion will result in the tag being ignored.

SVN r2424 (trunk)
2010-07-10 02:59:34 +00:00
Christoph Oelckers 4d86ebddf9 - Added support for Risen3D/PrBoom+'s MUSINFO lump.
SVN r2366 (trunk)
2010-06-13 08:47:38 +00:00
Randy Heit 740d52cf5b - Added support for Blood's SFX loop start markers.
SVN r2221 (trunk)
2010-03-18 04:26:22 +00:00
Randy Heit c079a3ea5b - Add more parameters to the ambient sound things:
* Second argument: Volume scalar. 0 and 128 are normal volume. (Where "normal" is whatever
    it was defined with in SNDINFO.) Other values scale it accordingly.
  * Third argument: Minimum distance before volume fading starts.
  * Fourth argument: Maximum distance at which the sound is audible. Setting either of these to 0
    will use whatever they were defined with in SNDINFO.

SVN r2214 (trunk)
2010-03-18 00:32:35 +00:00
Christoph Oelckers 6c9748b603 - ported a few cleanup changes from Gez's recent GZDoom patch.
- fixed: The sound channel structure should not store the sound table's entries' addresses which are stored in a TArray by pointer. In case the array gets reallocated very bad things can happen. This caused some bad crashes when GZDoom's FraggleScript implementation created new sound entries.


SVN r2114 (trunk)
2010-01-16 07:51:50 +00:00
Randy Heit fb74d9b1ec - Added virtual status and audibility to the noise debug display.
SVN r1961 (trunk)
2009-11-04 02:07:39 +00:00
Randy Heit 466b6e4535 - Moved SetSoundPaused() out of i_input.cpp and into s_sound.cpp.
SVN r1598 (trunk)
2009-05-23 03:09:50 +00:00
Randy Heit 749de6c156 - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music
that isn't piped through the digital sound system. (Was removed in r1004.)


SVN r1595 (trunk)
2009-05-20 02:52:07 +00:00
Christoph Oelckers 4b064d9b5d - Added a range parameter to SNDINFO's $limit.
- Restored Dehacked music name replacement.


SVN r1416 (trunk)
2009-02-08 11:28:30 +00:00
Randy Heit cbe0c57911 - Removed S_MarkSoundChannels(), as it caused all non-actor sounds to
have their origins zeroed during collections.
- WI_drawLF() now draws the level name at the top of the screen, always.


SVN r1296 (trunk)
2008-11-27 18:46:09 +00:00
Randy Heit 3b4479df44 - Removed GC barriers from the sound channels. If we must, we can always
do it the old way and scan every channel to see if it matches an actor/
  entchannel pair.
- Fixed: S_RelinkSounds() did not move the SoundChans bitfield to the new
  actor.
- Fixed: Stolen channels could be kept around by the high-level channels
  indefinitely.


SVN r1289 (trunk)
2008-11-15 01:01:04 +00:00
Christoph Oelckers a8a3aca601 - Added read and write barriers to the actor pointer in the sound channel
structure.
- Fixed: Items which should stay but had an IF_ALWAYSPICKUP flag were removed.
- Fixed: The pickup flash must only play when an item is picked up so the 
  correct place to spawn it is in AInventory::Touch, not in AInventory::GoAway.


SVN r1278 (trunk)
2008-10-26 17:06:47 +00:00
Christoph Oelckers d1f8518a79 - Separated low level sound code from all high level dependencies.
SVN r1228 (trunk)
2008-09-15 18:18:04 +00:00
Christoph Oelckers 5d9483b632 - Moved some more high level sound logic out of FMODSoundRenderer:
The rolloff and channel ended callbacks now call functions in s_sound.cpp
  instead of working on the data itself and GSnd->StopSound has been replaced
  with S_StopChannel.


SVN r1227 (trunk)
2008-09-15 16:02:05 +00:00
Christoph Oelckers db5723997c - Cleaned up some include dependencies.
SVN r1224 (trunk)
2008-09-14 23:54:38 +00:00
Christoph Oelckers d02097976e - Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.


SVN r1209 (trunk)
2008-09-09 21:23:09 +00:00
Christoph Oelckers e033cbf9f8 - Since loading of the sound lump is now done in S_LoadSound I added an IsNull
method to the SoundRenderer class so that this function doesn't need to 
  load the sound for the NullSoundRenderer.
- Took some more non-FMOD related code out of fmodsound.cpp, including the
  code that checks for raw and Doom sounds. This means that sfxinfo_t is no
  longer needed in the SoundRenderer class so I took out all references to it.


SVN r1208 (trunk)
2008-09-09 20:49:53 +00:00
Christoph Oelckers 3b35ad2db2 - Fixed: FMODSoundRenderer::StartSound3D must set the static variable pointing
to the rolloff information back to NULL when starting the sound fails.
- Fixed: Rolloff information was taken from the sfxinfo that contained the
  actual sound data, not the one that was used for starting the sound.



SVN r1206 (trunk)
2008-09-09 09:22:47 +00:00
Christoph Oelckers 2df65c70cb - Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.


SVN r1203 (trunk)
2008-09-07 14:45:50 +00:00
Christoph Oelckers bcbd2162b7 - Changed sound interface so that all references to game data like actors
and sectors are done in s_sound.cpp and not in fmodsound.cpp. Also removed
  several 'sector' parameters because they were never used inside the sound code.


SVN r1200 (trunk)
2008-09-06 11:07:27 +00:00
Randy Heit 78890d57bc - Fixed: Screenwipes now pause sounds, since there can be sounds playing
during it.
- UI sounds are now omitted from savegames.
- Fixed: Menu sounds had been restricted to one at a time again.
- Moved the P_SerializeSounds() call to the end of G_SerializeLevel() so that
  it will occur after the players are loaded.
- Added fixes from FreeBSD for 0-length and very large string buffers
  passed to myvsnprintf.


SVN r1063 (trunk)
2008-07-05 03:32:44 +00:00