Commit graph

131 commits

Author SHA1 Message Date
Randy Heit
9c1e03a21b - In S_Shutdown(), stop the song and forget traces of it so that people who feel like setting
snd_musicvolume in their atexit don't crash because it tries to restart the song at the new
  volume.

SVN r3570 (trunk)
2012-04-19 02:27:10 +00:00
Randy Heit
78d28dedda - Fixed: S_ChangeMusic() would not necessarily restart non-looping songs that had finished playing.
SVN r3462 (trunk)
2012-03-22 21:09:20 +00:00
Randy Heit
540473cbe0 - Fixed: Sound limiting applied even to sounds that were already playing on the same
actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit
  it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so
  it shouldn't be exceeded if we restart it now.)


SVN r3355 (trunk)
2012-02-12 02:41:55 +00:00
Randy Heit
68fbd75897 - Fixed compilation with FMOD 4.38+. The removal of hardware voices and EAX was a fairly
major change, so I'm making no provisions for using older FMOD DLLs when compiled with the
  4.38 API. However, sound positioning is still broken like in 4.28, so you are recommended
  to continue building with 4.26. Also, the Freeverb-based DSP unit is no longer present in
  FMOD, so the underwater effect is currently unavailable when using 4.38 until I can figure
  out how to make it work with the SFX Reverb unit instead. (And on that topic, the Freeverb
  DSP was officially only for stereo outputs, so I really shouldn't have been using it in the
  first place.)
- Since I would like to eventually figure out the sound positioning issues with the newer
  FMODs, the following have been added:
  * snd_drawoutput now labels its outputs with the speakers they represent.
  * DCanvas::DrawTextA was added as an alias for DrawText, since the Windows headers #define
    DrawText to a Unicode/non-Unicode variant.
  * The loopsound console command was added to spawn an actor at the player's location and
    have it loop a sound infinitely.
  Hopefully I can figure it out. FMOD's 3D example works, so I assume the problem lies with
  my code, though I don't really know where to begin looking for the problem.

SVN r3350 (trunk)
2012-02-10 00:53:50 +00:00
Christoph Oelckers
163301dcd5 - took all includes of farchive.h out of headers. This file will have to be included explicitly in each source file that needs it.
SVN r3259 (trunk)
2011-07-06 14:20:54 +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
770a879f6a - fixed: The TouchedActors array in the Dehacked parser was not freed after parsing was done.
- Initialize the alt HUD explicitly in D_DoomMain.
- don't let S_UnloadReverbDef leave a broken list of sound environments behind.
- Added more code to explicitly delete data before initializing it.

SVN r3039 (trunk)
2010-12-15 00:09:31 +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
0490c35347 - added Edward-san's improvements for changemus command.
SVN r2902 (trunk)
2010-10-05 22:35:59 +00:00
Christoph Oelckers
5ff3b3f329 - added Gez's VOC loader.
SVN r2901 (trunk)
2010-10-05 22:31:22 +00:00
Christoph Oelckers
5464676603 - cleaned up i_music.cpp.
SVN r2866 (trunk)
2010-09-29 19:29:14 +00:00
Christoph Oelckers
4ca21e8e38 - added Edward-san's 'changemus' submission for printing the currently playing music track.
SVN r2782 (trunk)
2010-09-15 13:49:11 +00:00
Christoph Oelckers
1dd3ecd6e2 - fixed: -nosfx deactivated the entire sound system which also made music inoperable. Changed it so that all it does is block sound effects from being started.
SVN r2621 (trunk)
2010-08-28 13:36:41 +00:00
Christoph Oelckers
4ac64b6df7 - merged polyobject branch into trunk and made some adjustments for savegame compatibility.
SVN r2448 (trunk)
2010-07-23 05:56:25 +00:00
Christoph Oelckers
32f3d00514 - fixed: Stopping music did not clear the variable used to restart the last played song.
SVN r2369 (trunk)
2010-06-13 10:24:56 +00:00
Christoph Oelckers
4d86ebddf9 - Added support for Risen3D/PrBoom+'s MUSINFO lump.
SVN r2366 (trunk)
2010-06-13 08:47:38 +00:00
Christoph Oelckers
d875a0c674 - fixed: Loading a savegame with music switched off forced a restart of the map's default music
because starting an empty music was considered an error.


SVN r2272 (trunk)
2010-04-05 09:17:34 +00:00
Randy Heit
69c777df4c - Allow defaultenvironment to take names as well as numeric IDs.
SVN r2262 (trunk)
2010-03-31 23:33:18 +00:00
Randy Heit
6c63ce51e4 - Fixed: The listener used a different coordinate system than sounds, which meant that sounds
were never made head-relative, so stereo effects would disappear if they were played by
  the listener.

SVN r2231 (trunk)
2010-03-18 21:54:24 +00:00
Randy Heit
44e877a243 - After experimenting with Blood, I think ROLLOFF_Linear is a better choice for ambient
sounds than ROLLOFF_Doom.

SVN r2225 (trunk)
2010-03-18 05:27:36 +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
Christoph Oelckers
85c683e0c7 - Reintroduced Doom.exe's player_t::usedown variable so that respawning a
player does not immediately activate switches. oldbuttons was not usable
  for this. This also required that CopyPlayer preserves this info.
- Fixed: When restarting the music there was a NULL pointer check missing
  so it crashed when the game was started wi
- Fixed: If the Use key is used to respawn the player it must be cleared
  so that it doesn't trigger any subsequent actions after respawning.
- Fixed: Resurrecting a monster did not restore flags5 and flags6.
- Fixed: Projectiles which killed a non-monster were unable to determine
  what precisely they hit because MF_CORPSE is only valid for monsters.
  A new flag, MF6_KILLED that gets set for all objects that die, was added
  for this case.
- Added a generic A_Weave function that exposes all possible options of
  A_BishopMissileWeave and A_CStaffMissileSlither. These 2 functions are
  no longer needed from DECORATE and therefore deprecated.


SVN r2045 (trunk)
2009-12-25 11:09:56 +00:00
Randy Heit
6beaf818e3 - Fixed: Calling S_ChangeMusic() with the same song but a different looping
flag now restarts the song so that the new looping setting can be applied.
  (This was easier than modifying every music handler to support modifying
  loop changes on the fly, which seems like overkill.)


SVN r2041 (trunk)
2009-12-25 00:41:15 +00:00
Randy Heit
51eb6465a2 - Fixed two bugs in FMODSoundRenderer::HandleChannelDelay():
* Looping sounds that have been playing for a very long time, were evicted,
    and then were restarted need to have their positions clamped to lie
    within the bounds of the sounds. If we try to set a start position very
    far beyond the end, it will overflow inside FMOD and not work.
  * A start time of 0 is not actually valid and means the sound was never
    assigned a start time.
- The latter bug also reveals a problem with starting looped sounds evicted:
  They need to be assigned a start time so if they should have the opportunity
  to start later, they will be properly synchronized.


SVN r1987 (trunk)
2009-11-18 04:45:20 +00:00
Randy Heit
704895f9b9 - Fixed: S_RestartSound() cleared the evicted flag even if the sound
was not restarted because it was too close to too many other identical
  sounds that were already playing.


SVN r1962 (trunk)
2009-11-04 02:37:05 +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
50b0340a56 - Fixed: S_EvictAllChannels() must replace the channel's start time with its
position when evicting sounds, because restarting the sound system causes
  the DSP clock to restart at 0, so start times that were recorded before
  the reset are no longer applicable after the reset.
- Fixed: S_StopChannel() always set the channel's actor to NULL, eliminating
  origin information when resetting the sound system.


SVN r1949 (trunk)
2009-10-30 02:18:07 +00:00
Randy Heit
6214177f1f - Fixed: S_LoadSound() did not byte-swap the frequency and length it reads
from DMX sounds.



SVN r1792 (trunk)
2009-09-04 22:59:41 +00:00
Randy Heit
e4af82ae96 - Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
  are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
  are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
  continue to work as aliases from DECORATE. The ACS functions, however,
  require you to use the new name, since they never saw an official release
  yet.


SVN r1689 (trunk)
2009-06-30 20:57:51 +00:00
Randy Heit
a8de4fc2da - Fixed compilation of i_keyboard.cpp with MinGW, because w32api still doesn't have
everything that was new for XP.
- Swapped snes_spc out for the full Game Music Emu library.

SVN r1631 (trunk)
2009-06-03 03:05:02 +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
4d5692bf80 - Fixed: Doom's fullscreen HUD was limited to 6 keys.
- Made 'next endgame' work again for cases where it is supposed to be
  the same as 'next endgame4'.
- GCC nitpick fix: Classes being used as template parameters may not be
  defined locally in a function. Fixed FWadFile::SetNamespace for that.
- Improved error reporting for incorrect textures in maps.
- Fixed: When music was stopped this was not set in the global music state.
- Fixed: Friendly monsters did not target enemy players in deathmatch.

SVN r1567 (trunk)
2009-05-02 09:14:01 +00:00
Randy Heit
e865d95070 - Removed obsolete snd_surround cvar.
SVN r1550 (trunk)
2009-04-16 23:58:41 +00:00
Christoph Oelckers
18b4577bbd - Fixed: S_StopSound may not assume that after stopping a sound channel
its link to the next item in the list is still valid.
- Fixed typo in src/CMakeLists.txt.
- Fixed: Armor only worked for players.


SVN r1489 (trunk)
2009-03-19 22:48:55 +00:00
Randy Heit
4535382031 - The SFX Reverb unit is now moved so that it serves as an input to the water
effect rather than as an input to the ChannelGroup Target Unit. This means
  the water effect is now applied after any room reverb, rather than in
  parallel with it.
- Fixed: UI sounds should not have reverb applied to them.


SVN r1450 (trunk)
2009-02-26 06:23:05 +00:00
Christoph Oelckers
1f5cf23418 - fixed: nextmap and nextsecret CCMDs set skill to 0.
SVN r1449 (trunk)
2009-02-25 23:25:47 +00:00
Christoph Oelckers
2c65d5b8f5 - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame
version and removed old compatibility handlings.

SVN r1448 (trunk)
2009-02-25 22:10:06 +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
Christoph Oelckers
4bcd3faef8 - moved all code related to global ACS variables to p_acs.cpp where it belongs.
- fixed: The nextmap and nextsecret CCMDs need to call G_DeferedInitNew instead of G_InitNew.
- merged MAPINFO branch back into trunk.

SVN r1393 (trunk)
2009-02-03 19:11:43 +00:00
Randy Heit
07a2da40f1 - Changed FMOD init() to allocate some virtual channels.
SVN r1387 (trunk)
2009-02-01 04:10:36 +00:00
Randy Heit
6ebbc920fb - Removed the SoundChans bitfield from AActor, since it seems there are race
conditions I don't fully understand where it simply doesn't work.


SVN r1367 (trunk)
2009-01-25 01:52:38 +00:00
Christoph Oelckers
6a321fd8f5 - Changed pickup sounds of local player to unpaused to resolve problems with
the time freezer and make them behave better.
- Fixed: When sounds are paused not all newly started sounds should actually
  be played.
- Fixed: SBARINFO had no means to check if a weapon uses any ammo at all and
  as a result the inventory icon was misplaced if a no-ammo weapon was selected.

SVN r1343 (trunk)
2009-01-01 15:09:49 +00:00
Randy Heit
835ed26370 - Decal changes as per Xaser's suggestions: Smaller decal for PhoenixFX2,
CrossbowFX2 and MaceFX4 were missing decals, and HornRodFX2 gets a whole
  new decal.
- Fixed: bfgscrc2.png had some holes in the middle that did not look so good.
  (From previously being handled through WinTex, maybe?)


SVN r1325 (trunk)
2008-12-19 03:57:24 +00:00
Christoph Oelckers
6b9129105a - Added: inventorybarnotvisible to check to see if the inventory bar is up.
- Added the following flags to drawselectedinventory center, centerbottom, and
  drawshadow.
- Fixed: The translucent flag for drawinventorybar should only have affected
  the artibox image.

- Fixed: compatf_limitpain must check for 21 Lost Souls, not 20.


SVN r1297 (trunk)
2008-11-29 16:37:54 +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
6e83d231fe - The co-op summary screen now has a totals row at the bottom (if it fits).
- Changed WI_drawPercent() when wi_percents is false so that the total
  display is optional, and it formats it like Heretic's intermission, with
  a slash and a fixed-width right column.
- Font is no longer a property of the screen object. Pass the font to
  DrawText and DrawChar directly instead.
- Doom's intermission characters are now collected together as a font
  so they can be colorized.


SVN r1294 (trunk)
2008-11-27 17:43:36 +00:00