2008-01-27 11:25:03 +00:00
|
|
|
// Emacs style mode select -*- C++ -*-
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// $Id: s_sound.c,v 1.3 1998/01/05 16:26:08 pekangas Exp $
|
|
|
|
//
|
|
|
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
|
|
|
//
|
|
|
|
// This source is available for distribution and/or modification
|
|
|
|
// only under the terms of the DOOM Source Code License as
|
|
|
|
// published by id Software. All rights reserved.
|
|
|
|
//
|
|
|
|
// The source is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// DESCRIPTION: none
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#ifdef _WIN32
|
|
|
|
#include <io.h>
|
|
|
|
#endif
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
|
|
#include "i_system.h"
|
|
|
|
#include "i_sound.h"
|
|
|
|
#include "i_music.h"
|
|
|
|
#include "i_cd.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "s_sndseq.h"
|
|
|
|
#include "s_playlist.h"
|
|
|
|
#include "c_dispatch.h"
|
|
|
|
#include "m_random.h"
|
|
|
|
#include "w_wad.h"
|
|
|
|
#include "doomdef.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "doomstat.h"
|
|
|
|
#include "cmdlib.h"
|
|
|
|
#include "v_video.h"
|
|
|
|
#include "v_text.h"
|
|
|
|
#include "a_sharedglobal.h"
|
|
|
|
#include "gstrings.h"
|
|
|
|
#include "gi.h"
|
|
|
|
#include "templates.h"
|
Update to ZDoom r905:
- Added Martin Howe's morph system update.
- Added support for defining composite textures in HIRESTEX. It is not fully tested
and right now can't do much more than the old TEXTUREx method.
- Added a few NULL pointer checks to the texture code.
- Made duplicate class names in DECORATE non-fatal. There is really no stability
concern here and the worst that can happen is that the wrong actor is spawned.
This was a constant hassle when testing with WADs that contain duplicate resources.
- Removed some GCC warnings.
- Fixed: MinGW doesn't have _get_pgmptr(), so it couldn't compile i_main.cpp.
- Fixed: MOD_WAVETABLE and MOD_SWSYNTH are not defined by w32api, so MinGW
failed compiling the new MIDI code.
- Fixed: LocalSndInfo and LocalSndSeq in S_Start() need to be const char
pointers, since "" is a constant.
- Fixed: parsecontext.h was missing a newline at the end of the file.
- Fixed: Timidity::Channel::mono, rpn, and nrpn were not initialized. In
particular, this meant that every channel was almost certainly in mono mode,
which can sound pretty bad if the song isn't meant to be played that way.
- Added bank numbers to the MIDI precaching for Timidity, since I guess I do
need to care about banks, if even the Duke MIDIs use various banks.
- Fixed: snd_midiprecache only exists in Win32 builds, so gameconfigfile.cpp
shouldn't unconditionally link against it.
- Fixed: pre_resample() was still disabled, and it left two samples at the end
of the new wave data uninitialized.
- Moved the xmap table from timidity/tables.cpp to playmidi.cpp. Now I can get
rid of timidity/tables.cpp, which conflicts in name with the main Doom
tables.cpp. (And interestingly, VC++ automatically renamed the object file,
so I wasn't aware of the problem with GCC.)
- Added a Gets function to the FileReader class which I planned to use
to enable Timidity to read its config and sound patches from Zips.
I put this on hold though after finding out that the sound quality
isn't even near that of Timidity++.
- GCC-Fixes (FString::GetChars() for Printf calls)
- Added a dummy Weapon.NOLMS flag so that Skulltag weapons using this flag
can be loaded
- Changed the MIDIStreamer to send the all notes off controller to each
channel when restarting the song, rather than emitting a single note off
event which only has 1 in 127 chance of being for a note that's playing
on that channel. Then I decided it would probably be a good idea to reset
all the controllers as well.
- Increasing the size of the internal Timidity stream buffer from 1/14 sec
(copied from the OPL player) improved its sound dramatically, so apparently
Timidity has issues with short stream buffers. It's now at 1/2 sec in
length. However, there seems to be something weird going on with
corazonazul_ff6boss.mid near the beginning where it stops and immediately
restarts a guitar on the exact same note.
- Added a new sound debugging cvar: snd_drawoutput, which can show various
oscilloscopes and spectrums.
- Eliminated some more global variables (onmobj, DoRipping, LastRipped,
MissileActor, bulletpitch and linetarget.)
- Internal TiMidity now plays music. Unfortunately, it doesn't sound right. :(
- Changed the progdir global variable into an FString.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@90 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-12 18:59:23 +00:00
|
|
|
#include "timidity/timidity.h"
|
2008-09-15 23:47:00 +00:00
|
|
|
#include "g_level.h"
|
2010-07-23 14:32:07 +00:00
|
|
|
#include "po_man.h"
|
2011-07-06 18:59:20 +00:00
|
|
|
#include "farchive.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// MACROS ------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifdef NeXT
|
|
|
|
// NeXT doesn't need a binary flag in open call
|
|
|
|
#define O_BINARY 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef O_BINARY
|
|
|
|
#define O_BINARY 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef FIXED2FLOAT
|
|
|
|
#define FIXED2FLOAT(f) (((float)(f))/(float)65536)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define NORM_PITCH 128
|
|
|
|
#define NORM_PRIORITY 64
|
2008-03-09 16:01:55 +00:00
|
|
|
#define NORM_SEP 0
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
#define S_PITCH_PERTURB 1
|
2008-03-12 15:21:17 +00:00
|
|
|
#define S_STEREO_SWING 0.75
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// TYPES -------------------------------------------------------------------
|
|
|
|
|
|
|
|
struct MusPlayingInfo
|
|
|
|
{
|
|
|
|
FString name;
|
2008-08-04 19:46:35 +00:00
|
|
|
MusInfo *handle;
|
2008-01-27 11:25:03 +00:00
|
|
|
int baseorder;
|
|
|
|
bool loop;
|
|
|
|
};
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
SOURCE_None, // Sound is always on top of the listener.
|
|
|
|
SOURCE_Actor, // Sound is coming from an actor.
|
|
|
|
SOURCE_Sector, // Sound is coming from a sector.
|
|
|
|
SOURCE_Polyobj, // Sound is coming from a polyobject.
|
|
|
|
SOURCE_Unattached, // Sound is not attached to any particular emitter.
|
|
|
|
};
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
|
|
|
|
|
|
|
|
extern float S_GetMusicVolume (const char *music);
|
|
|
|
|
|
|
|
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
|
|
|
|
|
|
|
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
|
|
|
|
|
* Updated to ZDoom r3360:
- Added ability to use a constant for the maximum comparator for health and armor drawbars.
- Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter).
- Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767).
- Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener.
- Added keys on the automap for Heretic in easy mode.
- 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.)
- Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open.
- Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking.
- Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for.
- Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
|
|
|
static bool S_CheckSoundLimit(sfxinfo_t *sfx, const FVector3 &pos, int near_limit, float limit_range, AActor *actor, int channel);
|
2009-01-25 22:03:47 +00:00
|
|
|
static bool S_IsChannelUsed(AActor *actor, int channel, int *seen);
|
2008-03-25 16:19:31 +00:00
|
|
|
static void S_ActivatePlayList(bool goBack);
|
2008-10-26 15:00:57 +00:00
|
|
|
static void CalcPosVel(FSoundChan *chan, FVector3 *pos, FVector3 *vel);
|
2008-07-04 16:54:29 +00:00
|
|
|
static void CalcPosVel(int type, const AActor *actor, const sector_t *sector, const FPolyObj *poly,
|
|
|
|
const float pt[3], int channel, int chanflags, FVector3 *pos, FVector3 *vel);
|
|
|
|
static void CalcSectorSoundOrg(const sector_t *sec, int channum, fixed_t *x, fixed_t *y, fixed_t *z);
|
|
|
|
static void CalcPolyobjSoundOrg(const FPolyObj *poly, fixed_t *x, fixed_t *y, fixed_t *z);
|
|
|
|
static FSoundChan *S_StartSound(AActor *mover, const sector_t *sec, const FPolyObj *poly,
|
2010-03-18 10:19:00 +00:00
|
|
|
const FVector3 *pt, int channel, FSoundID sound_id, float volume, float attenuation, FRolloffInfo *rolloff);
|
2008-09-06 11:49:09 +00:00
|
|
|
static void S_SetListener(SoundListener &listener, AActor *listenactor);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
|
|
|
|
2009-01-01 16:47:46 +00:00
|
|
|
static bool SoundPaused; // whether sound is paused
|
2008-01-27 11:25:03 +00:00
|
|
|
static bool MusicPaused; // whether music is paused
|
|
|
|
static MusPlayingInfo mus_playing; // music currently being played
|
|
|
|
static FString LastSong; // last music that was played
|
|
|
|
static FPlayList *PlayList;
|
2008-07-06 17:32:31 +00:00
|
|
|
static int RestartEvictionsAt; // do not restart evicted channels before this level.time
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
|
|
|
|
|
|
|
int sfx_empty;
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
FSoundChan *Channels;
|
|
|
|
FSoundChan *FreeChannels;
|
|
|
|
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
FRolloffInfo S_Rolloff;
|
2008-03-25 16:19:31 +00:00
|
|
|
BYTE *S_SoundCurve;
|
|
|
|
int S_SoundCurveSize;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
FBoolCVar noisedebug ("noise", false, 0); // [RH] Print sound debugging info?
|
2008-03-09 16:01:55 +00:00
|
|
|
CVAR (Int, snd_channels, 32, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) // number of channels available
|
2008-01-27 11:25:03 +00:00
|
|
|
CVAR (Bool, snd_flipstereo, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
|
|
|
|
|
|
|
// CODE --------------------------------------------------------------------
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_NoiseDebug
|
|
|
|
//
|
|
|
|
// [RH] Print sound debug info. Called by status bar.
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_NoiseDebug (void)
|
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
FSoundChan *chan;
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
FVector3 listener;
|
2008-07-04 16:54:29 +00:00
|
|
|
FVector3 origin;
|
2008-03-25 16:19:31 +00:00
|
|
|
int y, color;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
y = 32 * CleanYfac;
|
2008-11-27 23:28:48 +00:00
|
|
|
screen->DrawText (SmallFont, CR_YELLOW, 0, y, "*** SOUND DEBUG INFO ***", TAG_DONE);
|
2008-01-27 11:25:03 +00:00
|
|
|
y += 8;
|
|
|
|
|
2008-11-27 23:28:48 +00:00
|
|
|
screen->DrawText (SmallFont, CR_GOLD, 0, y, "name", TAG_DONE);
|
|
|
|
screen->DrawText (SmallFont, CR_GOLD, 70, y, "x", TAG_DONE);
|
|
|
|
screen->DrawText (SmallFont, CR_GOLD, 120, y, "y", TAG_DONE);
|
|
|
|
screen->DrawText (SmallFont, CR_GOLD, 170, y, "z", TAG_DONE);
|
|
|
|
screen->DrawText (SmallFont, CR_GOLD, 220, y, "vol", TAG_DONE);
|
|
|
|
screen->DrawText (SmallFont, CR_GOLD, 260, y, "dist", TAG_DONE);
|
|
|
|
screen->DrawText (SmallFont, CR_GOLD, 300, y, "chan", TAG_DONE);
|
2009-02-05 00:06:30 +00:00
|
|
|
screen->DrawText (SmallFont, CR_GOLD, 340, y, "pri", TAG_DONE);
|
|
|
|
screen->DrawText (SmallFont, CR_GOLD, 380, y, "flags", TAG_DONE);
|
2009-11-04 07:29:25 +00:00
|
|
|
screen->DrawText (SmallFont, CR_GOLD, 460, y, "aud", TAG_DONE);
|
2010-03-18 10:19:00 +00:00
|
|
|
screen->DrawText (SmallFont, CR_GOLD, 520, y, "pos", TAG_DONE);
|
2008-01-27 11:25:03 +00:00
|
|
|
y += 8;
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
if (Channels == NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
return;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
listener.X = FIXED2FLOAT(players[consoleplayer].camera->x);
|
2008-07-04 16:54:29 +00:00
|
|
|
listener.Y = FIXED2FLOAT(players[consoleplayer].camera->z);
|
|
|
|
listener.Z = FIXED2FLOAT(players[consoleplayer].camera->y);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
|
|
|
// Display the oldest channel first.
|
2008-03-25 16:19:31 +00:00
|
|
|
for (chan = Channels; chan->NextChan != NULL; chan = chan->NextChan)
|
|
|
|
{ }
|
|
|
|
while (y < SCREENHEIGHT - 16)
|
|
|
|
{
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
char temp[32];
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
CalcPosVel(chan, &origin, NULL);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
color = (chan->ChanFlags & CHAN_LOOP) ? CR_BROWN : CR_GREY;
|
|
|
|
|
|
|
|
// Name
|
2010-01-16 07:38:12 +00:00
|
|
|
Wads.GetLumpName (temp, S_sfx[chan->SoundID].lumpnum);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
temp[8] = 0;
|
2008-11-27 23:28:48 +00:00
|
|
|
screen->DrawText (SmallFont, color, 0, y, temp, TAG_DONE);
|
2008-03-25 16:19:31 +00:00
|
|
|
|
|
|
|
if (!(chan->ChanFlags & CHAN_IS3D))
|
|
|
|
{
|
2008-11-27 23:28:48 +00:00
|
|
|
screen->DrawText(SmallFont, color, 70, y, "---", TAG_DONE); // X
|
|
|
|
screen->DrawText(SmallFont, color, 120, y, "---", TAG_DONE); // Y
|
|
|
|
screen->DrawText(SmallFont, color, 170, y, "---", TAG_DONE); // Z
|
|
|
|
screen->DrawText(SmallFont, color, 260, y, "---", TAG_DONE); // Distance
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
// X coordinate
|
2008-11-27 23:28:48 +00:00
|
|
|
mysnprintf(temp, countof(temp), "%.0f", origin.X);
|
|
|
|
screen->DrawText(SmallFont, color, 70, y, temp, TAG_DONE);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
|
|
|
// Y coordinate
|
2008-11-27 23:28:48 +00:00
|
|
|
mysnprintf(temp, countof(temp), "%.0f", origin.Z);
|
|
|
|
screen->DrawText(SmallFont, color, 120, y, temp, TAG_DONE);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
|
|
|
// Z coordinate
|
2008-11-27 23:28:48 +00:00
|
|
|
mysnprintf(temp, countof(temp), "%.0f", origin.Y);
|
|
|
|
screen->DrawText(SmallFont, color, 170, y, temp, TAG_DONE);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
|
|
|
// Distance
|
|
|
|
if (chan->DistanceScale > 0)
|
|
|
|
{
|
2008-11-27 23:28:48 +00:00
|
|
|
mysnprintf(temp, countof(temp), "%.0f", (origin - listener).Length());
|
|
|
|
screen->DrawText(SmallFont, color, 260, y, temp, TAG_DONE);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-11-27 23:28:48 +00:00
|
|
|
screen->DrawText(SmallFont, color, 260, y, "---", TAG_DONE);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
2008-03-25 16:19:31 +00:00
|
|
|
}
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
|
|
|
// Volume
|
2008-11-27 23:28:48 +00:00
|
|
|
mysnprintf(temp, countof(temp), "%.2g", chan->Volume);
|
|
|
|
screen->DrawText(SmallFont, color, 220, y, temp, TAG_DONE);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
|
|
|
// Channel
|
2008-11-27 23:28:48 +00:00
|
|
|
mysnprintf(temp, countof(temp), "%d", chan->EntChannel);
|
|
|
|
screen->DrawText(SmallFont, color, 300, y, temp, TAG_DONE);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
2009-02-05 00:06:30 +00:00
|
|
|
// Priority
|
|
|
|
mysnprintf(temp, countof(temp), "%d", chan->Priority);
|
|
|
|
screen->DrawText(SmallFont, color, 340, y, temp, TAG_DONE);
|
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
// Flags
|
2009-11-04 07:29:25 +00:00
|
|
|
mysnprintf(temp, countof(temp), "%s3%sZ%sU%sM%sN%sA%sL%sE%sV",
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
(chan->ChanFlags & CHAN_IS3D) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK,
|
|
|
|
(chan->ChanFlags & CHAN_LISTENERZ) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK,
|
2008-07-04 16:54:29 +00:00
|
|
|
(chan->ChanFlags & CHAN_UI) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK,
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
(chan->ChanFlags & CHAN_MAYBE_LOCAL) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK,
|
|
|
|
(chan->ChanFlags & CHAN_NOPAUSE) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK,
|
|
|
|
(chan->ChanFlags & CHAN_AREA) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK,
|
|
|
|
(chan->ChanFlags & CHAN_LOOP) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK,
|
2009-11-04 07:29:25 +00:00
|
|
|
(chan->ChanFlags & CHAN_EVICTED) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK,
|
|
|
|
(chan->ChanFlags & CHAN_VIRTUAL) ? TEXTCOLOR_GREEN : TEXTCOLOR_BLACK);
|
2009-02-05 00:06:30 +00:00
|
|
|
screen->DrawText(SmallFont, color, 380, y, temp, TAG_DONE);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
2009-11-04 07:29:25 +00:00
|
|
|
// Audibility
|
|
|
|
mysnprintf(temp, countof(temp), "%.4f", GSnd->GetAudibility(chan));
|
|
|
|
screen->DrawText(SmallFont, color, 460, y, temp, TAG_DONE);
|
|
|
|
|
2010-03-18 10:19:00 +00:00
|
|
|
// Position
|
|
|
|
mysnprintf(temp, countof(temp), "%u", GSnd->GetPosition(chan));
|
|
|
|
screen->DrawText(SmallFont, color, 520, y, temp, TAG_DONE);
|
|
|
|
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
y += 8;
|
|
|
|
if (chan->PrevChan == &Channels)
|
|
|
|
{
|
|
|
|
break;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-03-25 16:19:31 +00:00
|
|
|
chan = (FSoundChan *)((size_t)chan->PrevChan - myoffsetof(FSoundChan, NextChan));
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2013-02-28 09:35:52 +00:00
|
|
|
V_SetBorderNeedRefresh();
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static FString LastLocalSndInfo;
|
|
|
|
static FString LastLocalSndSeq;
|
|
|
|
void S_AddLocalSndInfo(int lump);
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_Init
|
|
|
|
//
|
|
|
|
// Initializes sound stuff, including volume. Sets channels, SFX and
|
|
|
|
// music volume, allocates channel buffer, and sets S_sfx lookup.
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_Init ()
|
|
|
|
{
|
|
|
|
int curvelump;
|
|
|
|
|
|
|
|
atterm (S_Shutdown);
|
|
|
|
|
|
|
|
// remove old data (S_Init can be called multiple times!)
|
2008-03-25 16:19:31 +00:00
|
|
|
if (S_SoundCurve != NULL)
|
2008-03-09 16:01:55 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
delete[] S_SoundCurve;
|
2010-12-15 16:32:37 +00:00
|
|
|
S_SoundCurve = NULL;
|
2008-03-09 16:01:55 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// Heretic and Hexen have sound curve lookup tables. Doom does not.
|
|
|
|
curvelump = Wads.CheckNumForName ("SNDCURVE");
|
|
|
|
if (curvelump >= 0)
|
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
S_SoundCurveSize = Wads.LumpLength (curvelump);
|
|
|
|
S_SoundCurve = new BYTE[S_SoundCurveSize];
|
|
|
|
Wads.ReadLump(curvelump, S_SoundCurve);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
// Free all channels for use.
|
|
|
|
while (Channels != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
S_ReturnChannel(Channels);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
Update to ZDoom r905:
- Added Martin Howe's morph system update.
- Added support for defining composite textures in HIRESTEX. It is not fully tested
and right now can't do much more than the old TEXTUREx method.
- Added a few NULL pointer checks to the texture code.
- Made duplicate class names in DECORATE non-fatal. There is really no stability
concern here and the worst that can happen is that the wrong actor is spawned.
This was a constant hassle when testing with WADs that contain duplicate resources.
- Removed some GCC warnings.
- Fixed: MinGW doesn't have _get_pgmptr(), so it couldn't compile i_main.cpp.
- Fixed: MOD_WAVETABLE and MOD_SWSYNTH are not defined by w32api, so MinGW
failed compiling the new MIDI code.
- Fixed: LocalSndInfo and LocalSndSeq in S_Start() need to be const char
pointers, since "" is a constant.
- Fixed: parsecontext.h was missing a newline at the end of the file.
- Fixed: Timidity::Channel::mono, rpn, and nrpn were not initialized. In
particular, this meant that every channel was almost certainly in mono mode,
which can sound pretty bad if the song isn't meant to be played that way.
- Added bank numbers to the MIDI precaching for Timidity, since I guess I do
need to care about banks, if even the Duke MIDIs use various banks.
- Fixed: snd_midiprecache only exists in Win32 builds, so gameconfigfile.cpp
shouldn't unconditionally link against it.
- Fixed: pre_resample() was still disabled, and it left two samples at the end
of the new wave data uninitialized.
- Moved the xmap table from timidity/tables.cpp to playmidi.cpp. Now I can get
rid of timidity/tables.cpp, which conflicts in name with the main Doom
tables.cpp. (And interestingly, VC++ automatically renamed the object file,
so I wasn't aware of the problem with GCC.)
- Added a Gets function to the FileReader class which I planned to use
to enable Timidity to read its config and sound patches from Zips.
I put this on hold though after finding out that the sound quality
isn't even near that of Timidity++.
- GCC-Fixes (FString::GetChars() for Printf calls)
- Added a dummy Weapon.NOLMS flag so that Skulltag weapons using this flag
can be loaded
- Changed the MIDIStreamer to send the all notes off controller to each
channel when restarting the song, rather than emitting a single note off
event which only has 1 in 127 chance of being for a note that's playing
on that channel. Then I decided it would probably be a good idea to reset
all the controllers as well.
- Increasing the size of the internal Timidity stream buffer from 1/14 sec
(copied from the OPL player) improved its sound dramatically, so apparently
Timidity has issues with short stream buffers. It's now at 1/2 sec in
length. However, there seems to be something weird going on with
corazonazul_ff6boss.mid near the beginning where it stops and immediately
restarts a guitar on the exact same note.
- Added a new sound debugging cvar: snd_drawoutput, which can show various
oscilloscopes and spectrums.
- Eliminated some more global variables (onmobj, DoRipping, LastRipped,
MissileActor, bulletpitch and linetarget.)
- Internal TiMidity now plays music. Unfortunately, it doesn't sound right. :(
- Changed the progdir global variable into an FString.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@90 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-12 18:59:23 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// no sounds are playing, and they are not paused
|
|
|
|
MusicPaused = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_InitData
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_InitData ()
|
|
|
|
{
|
|
|
|
LastLocalSndInfo = LastLocalSndSeq = "";
|
2010-12-14 22:53:44 +00:00
|
|
|
S_ParseSndInfo (false);
|
2008-01-27 11:25:03 +00:00
|
|
|
S_ParseSndSeq (-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_Shutdown
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_Shutdown ()
|
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
FSoundChan *chan, *next;
|
|
|
|
|
2008-10-24 14:49:50 +00:00
|
|
|
chan = Channels;
|
|
|
|
while (chan != NULL)
|
2008-03-25 16:19:31 +00:00
|
|
|
{
|
2008-10-24 14:49:50 +00:00
|
|
|
next = chan->NextChan;
|
|
|
|
S_StopChannel(chan);
|
|
|
|
chan = next;
|
2008-03-25 16:19:31 +00:00
|
|
|
}
|
2008-10-24 14:49:50 +00:00
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
GSnd->UpdateSounds();
|
2008-03-25 16:19:31 +00:00
|
|
|
for (chan = FreeChannels; chan != NULL; chan = next)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
next = chan->NextChan;
|
|
|
|
delete chan;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-03-25 16:19:31 +00:00
|
|
|
FreeChannels = NULL;
|
|
|
|
|
|
|
|
if (S_SoundCurve != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
delete[] S_SoundCurve;
|
|
|
|
S_SoundCurve = NULL;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
if (PlayList != NULL)
|
|
|
|
{
|
|
|
|
delete PlayList;
|
|
|
|
PlayList = NULL;
|
|
|
|
}
|
2012-04-19 11:44:25 +00:00
|
|
|
S_StopMusic (true);
|
|
|
|
mus_playing.name = "";
|
|
|
|
LastSong = "";
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_Start
|
|
|
|
//
|
|
|
|
// Per level startup code. Kills playing sounds at start of level
|
|
|
|
// and starts new music.
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_Start ()
|
|
|
|
{
|
|
|
|
if (GSnd)
|
|
|
|
{
|
|
|
|
// kill all playing sounds at start of level (trust me - a good idea)
|
2008-03-25 16:19:31 +00:00
|
|
|
S_StopAllChannels();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// Check for local sound definitions. Only reload if they differ
|
|
|
|
// from the previous ones.
|
2009-02-05 00:06:30 +00:00
|
|
|
FString LocalSndInfo;
|
|
|
|
FString LocalSndSeq;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// To be certain better check whether level is valid!
|
2009-02-05 00:06:30 +00:00
|
|
|
if (level.info)
|
2008-04-05 16:46:26 +00:00
|
|
|
{
|
2009-02-05 00:06:30 +00:00
|
|
|
LocalSndInfo = level.info->SoundInfo;
|
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures
didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'.
Update to ZDoom r940:
SBarInfo Update #18:
- Simplified the DrawGraphic function in sbarinfo_display.cpp
- Added xOffset, yOffset, and alpha to every drawing function in
sbarinfo_display.cpp. So Strife popups can be handeled better and allow for
other effects (translucent bars?). I'm thinking about making a struct for
these five (also x and y) arguments so that the argument lists don't become a
mess.
- Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to
DrawGraphic.
- DrawKeyBar wasn't using screen->DrawTexture.
- Added a Fade transition for popups. It takes two args fade in rate and fade
out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete
and so on).
- Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible.
- Fixed: When an instrument's envelope runs out, it does not immediately ramp
to zero. Rather, it lets the remainder of the sample finish playing.
- Fixed: When playing a MIDI file with EMIDI track designations to turn a
track off, any ticks that had only events on the disabled track would cause
the delay for that track to be thrown away, and the following notes on
enabled tracks would play too soon. This could be heard quite clearly in
xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing
of tracks 13 and 14 (EP1 Melody and EP1 Echo).
- Fixed: DFlashFader did some operations in its destructor that had to be moved
to its Destroy method.
- Fixed: Dropped weapons from dying players should not double ammo.
- Fixed: When note_on() is called and another copy of the same note is
already playing on the channel, it should stop it with finish_note(), not
kill_note(). This can be clearly heard in the final cymbal crashes of
D_DM2TTL where TiMidity cuts them off because the final cymbals are played
with a velocity of 1 before the preceding cymbals have finished. (I wonder
if I should be setting the self_nonexclusive flag for GUS patches to
disable even this behavior, though, since gf1note.c doesn't turn off
duplicate notes.)
- Changed envelope handling to hopefully match the GUS player's. The most
egregious mistake TiMidity makes is to treat bit 6 as an envelope enable
bit. This is not what it does; every sample has an envelope. Rather, this
is a "no sampled release" flag. Also, despite fiddling with the
PATCH_SUSTAIN flag during instrument loading, TiMidity never actually
used it. Nor did it do anything at all with the PATCH_FAST_REL flag.
- Fixed: wbstartstruct's lump name fields were only 8 characters long
and not properly zero-terminated when all 8 characters were used.
- Fixed: Local sound sequence definitions caused a crash because a proper
NULL check was missing.
- Added translucent blending modes to FMultipatchTexture (not tested yet!)
- Also changed all true color texture creation functions to use proper alpha
values instead of inverted ones.
- Changed FRemapTable so that all palette entries must contain proper alpha
values.
- Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check.
- Changed: The boss brain's explosions play weapons/rocklx which is an
unlimited sound. This can become extremely loud. Replaced with a new
sound which is just an alias to weapons/rocklx but has a limit of 4.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
|
|
|
}
|
|
|
|
|
2009-02-05 00:06:30 +00:00
|
|
|
if (level.info)
|
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures
didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'.
Update to ZDoom r940:
SBarInfo Update #18:
- Simplified the DrawGraphic function in sbarinfo_display.cpp
- Added xOffset, yOffset, and alpha to every drawing function in
sbarinfo_display.cpp. So Strife popups can be handeled better and allow for
other effects (translucent bars?). I'm thinking about making a struct for
these five (also x and y) arguments so that the argument lists don't become a
mess.
- Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to
DrawGraphic.
- DrawKeyBar wasn't using screen->DrawTexture.
- Added a Fade transition for popups. It takes two args fade in rate and fade
out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete
and so on).
- Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible.
- Fixed: When an instrument's envelope runs out, it does not immediately ramp
to zero. Rather, it lets the remainder of the sample finish playing.
- Fixed: When playing a MIDI file with EMIDI track designations to turn a
track off, any ticks that had only events on the disabled track would cause
the delay for that track to be thrown away, and the following notes on
enabled tracks would play too soon. This could be heard quite clearly in
xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing
of tracks 13 and 14 (EP1 Melody and EP1 Echo).
- Fixed: DFlashFader did some operations in its destructor that had to be moved
to its Destroy method.
- Fixed: Dropped weapons from dying players should not double ammo.
- Fixed: When note_on() is called and another copy of the same note is
already playing on the channel, it should stop it with finish_note(), not
kill_note(). This can be clearly heard in the final cymbal crashes of
D_DM2TTL where TiMidity cuts them off because the final cymbals are played
with a velocity of 1 before the preceding cymbals have finished. (I wonder
if I should be setting the self_nonexclusive flag for GUS patches to
disable even this behavior, though, since gf1note.c doesn't turn off
duplicate notes.)
- Changed envelope handling to hopefully match the GUS player's. The most
egregious mistake TiMidity makes is to treat bit 6 as an envelope enable
bit. This is not what it does; every sample has an envelope. Rather, this
is a "no sampled release" flag. Also, despite fiddling with the
PATCH_SUSTAIN flag during instrument loading, TiMidity never actually
used it. Nor did it do anything at all with the PATCH_FAST_REL flag.
- Fixed: wbstartstruct's lump name fields were only 8 characters long
and not properly zero-terminated when all 8 characters were used.
- Fixed: Local sound sequence definitions caused a crash because a proper
NULL check was missing.
- Added translucent blending modes to FMultipatchTexture (not tested yet!)
- Also changed all true color texture creation functions to use proper alpha
values instead of inverted ones.
- Changed FRemapTable so that all palette entries must contain proper alpha
values.
- Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check.
- Changed: The boss brain's explosions play weapons/rocklx which is an
unlimited sound. This can become extremely loud. Replaced with a new
sound which is just an alias to weapons/rocklx but has a limit of 4.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
|
|
|
{
|
2009-02-05 00:06:30 +00:00
|
|
|
LocalSndSeq = level.info->SndSeq;
|
2008-04-05 16:46:26 +00:00
|
|
|
}
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
bool parse_ss = false;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// This level uses a different local SNDINFO
|
|
|
|
if (LastLocalSndInfo.CompareNoCase(LocalSndInfo) != 0 || !level.info)
|
|
|
|
{
|
|
|
|
// First delete the old sound list
|
2008-03-25 16:19:31 +00:00
|
|
|
for(unsigned i = 1; i < S_sfx.Size(); i++)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
S_UnloadSound(&S_sfx[i]);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Parse the global SNDINFO
|
2010-12-14 22:53:44 +00:00
|
|
|
S_ParseSndInfo(true);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (*LocalSndInfo)
|
|
|
|
{
|
|
|
|
// Now parse the local SNDINFO
|
- Fixed: The players were not added to FS's list of spawned things.
- Update to ZDoom r882
- Added the option to use $ as a prefix to a string table name everywhere in
MAPINFO where 'lookup' could be specified so that there is one consistent
way to do it.
- Externalized all default episode definitions. Added an 'optional' keyword
to handle M4 and 5 in Doom and Heretic.
- Added P_CheckMapData function and replaced all calls to P_OpenMapData that
only checked for a map's presence with it.
- Added Martin Howe's player statusbar face submission.
- Added an 'adddefaultmap' option for MAPINFO. This is the same as 'defaultmap'
but keeps all existing information in the default and just adds to it. This
is needed because Hexen and Strife set some information in their base
MAPINFO and using 'defaultmap' in a PWAD would override that.
- Fixed: Using MAPINFO's f1 option could cause memory leaks.
- Added option to load lumps by full name to several places:
* Finale texts loaded from a text lump
* Demos
* Local SNDINFOs
* Local SNDSEQs
* Image names in FONTDEFS
* intermission script names
- Changed the STCFN121 handling. The character is not an 'I' but a '|' so
instead of discarding it it should be inserted at position 124.
- Renamed indexfont.fon to indexfont so that I could remove a special case
from V_GetFont that was just added for this one font.
- Added a 'dumpspawnedthings' CVAR that enables a listing of all things in
the map and the actor type they spawned.
SBarInfo Update #16
- Added: fillzeros flag for drawnumber. When set the string will always have
a length of the specified size and zeros will fill in for the missing places.
If the number is negative the negative sign will take the place of the last
digit.
- Added: globalarray type to drawnumber which will display the value in a
global array with the index set to the player's number. Untested.
- Added: isselected command to SBarInfo.
- Fixed: Bi and Tri colored numbers didn't work.
- Fixed: Crash when using nullimage as the last image in drawswitchableimage.
- Applied Graf suggestion to include the y coord when calulating heights to fix
most of the gaps caused by round off errors. At least for now anyways and it
is only applied for drawimage.
- SBarInfo inventory bars have been converted to use screen->DrawTexture()
- Increased limit for demon/melee to 4.
- Fixed: P_CheckSwitchRange accessed invalid memory when testing a one-sided
line.
- Fixed: P_SpawnPuff assumed that all melee attacks have the same range
(MELEERANGE) and didn't set the puff to its melee state if the range
was different. Even worse, it checked a global variable for this so
the behavior was undefined when P_SpawnPuff was called from anywhere
else but P_LineAttack. To reduce the amount of parameters I combined
this information with the hitthing and temporary parameters into one
flags parameter. Also changed P_LineAttack so that it gets passed
an additional parameter that specifies whether the attack is a melee
attack or not and set this to true in all calls that are to be considered
melee attacks. I couldn't use the damage type because A_CustomPunch
and A_CustomMeleeAttack allow passing any damage type they want.
- Added a sprite option as an alternative of particles for FX_ROCKET
and FX_GRENADE.
- Fixed: The minimum parameter count for ACS_Execute and ACS_ExecuteAlways for
DECORATE was wrong (2 instead of 1.)
- Changed: Hexen set every cluster to be a hub if it hadn't been defined before
a level using this cluster. Now it will only do that if HexenHack is true,
i.e. when original Hexen format MAPINFOs are parsed. For ZDoom format
MAPINFOs it will now be the same as for the other games which means that
'hub' has to be declared explicitly.
- Added an Idle state that is entered in place of the spawn state if a monster
has to return to its inactive state if it can't find any more targets.
- Added MF5_NOINTERACTION flag which completely disables all physics related
code for any actor with this flag. Mostly useful for particle effects where
the actors just move a certain distance and then disappear.
- Removed the last remains of the antialias precalculation code from
am_map.cpp because it was no longer used.
- Fixed: Two-sided lines bordering a secret sector were not drawn in the
proper color
- Fixed: The automap didn't check ACS_LockedExecuteDoor for its lock color.
- Switched sounds local to the listener from head-relative 3D sounds to 2D
sounds so stereo sounds have full separation. I tried using set3DSpread,
but that still caused some blending of the channels.
- Changed FScanner so that opening a lump gives the complete wad+lump name
rather than a generic one, so identifying errors among files that all have
the same lump name no longer involves any degree of guesswork in
determining exactly which file the error occurred in.
- Added a check to S_ParseSndSeq() for SNDSEQ lumps with unterminated final
sequences.
- Fixed: Parts of s_sndseq.cpp that scan the Sequences array need NULL
pointer checks, in case an improper sequence was encountered during
parsing but not early enough to avoid creating a slot for it in the array.
- Added support for dumping from RAW/DRO/IMF files, so now anything that
can be played as OPL can also be dumped.
- Removed the opl_enable cvar, since OPL playback is now selectable as just
another MIDI device.
- Added support for DRO playback and dual-chip RAW playback.
- Removed MUS support from OPLMUSSong, since using the OPLMIDIDevice with
MUSSong2 works just as well. There are still lots of leftover bits in
the class that should probably be removed at some point, too.
- Added dual-chip dumping support for the RAW format.
- Added DosBox Raw OPL (.DRO) dumping support. For whatever reason,
in_adlib calculates the song length for this format wrong, even though
the exact length is stored right in the header. (But in_adlib seems buggy
in general; too bad it's the only Windows version of Adplug that seems to
exist.)
- Rewrote the OPL dumper to work with MIDI as well as MUS.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@86 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-05 13:28:48 +00:00
|
|
|
int j = Wads.CheckNumForFullName(LocalSndInfo, true);
|
2008-01-27 11:25:03 +00:00
|
|
|
if (j>=0) S_AddLocalSndInfo(j);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Also reload the SNDSEQ if the SNDINFO was replaced!
|
2008-03-25 16:19:31 +00:00
|
|
|
parse_ss = true;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (LastLocalSndSeq.CompareNoCase(LocalSndSeq) != 0)
|
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
parse_ss = true;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2009-02-05 00:06:30 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
if (parse_ss)
|
|
|
|
{
|
- Fixed: The players were not added to FS's list of spawned things.
- Update to ZDoom r882
- Added the option to use $ as a prefix to a string table name everywhere in
MAPINFO where 'lookup' could be specified so that there is one consistent
way to do it.
- Externalized all default episode definitions. Added an 'optional' keyword
to handle M4 and 5 in Doom and Heretic.
- Added P_CheckMapData function and replaced all calls to P_OpenMapData that
only checked for a map's presence with it.
- Added Martin Howe's player statusbar face submission.
- Added an 'adddefaultmap' option for MAPINFO. This is the same as 'defaultmap'
but keeps all existing information in the default and just adds to it. This
is needed because Hexen and Strife set some information in their base
MAPINFO and using 'defaultmap' in a PWAD would override that.
- Fixed: Using MAPINFO's f1 option could cause memory leaks.
- Added option to load lumps by full name to several places:
* Finale texts loaded from a text lump
* Demos
* Local SNDINFOs
* Local SNDSEQs
* Image names in FONTDEFS
* intermission script names
- Changed the STCFN121 handling. The character is not an 'I' but a '|' so
instead of discarding it it should be inserted at position 124.
- Renamed indexfont.fon to indexfont so that I could remove a special case
from V_GetFont that was just added for this one font.
- Added a 'dumpspawnedthings' CVAR that enables a listing of all things in
the map and the actor type they spawned.
SBarInfo Update #16
- Added: fillzeros flag for drawnumber. When set the string will always have
a length of the specified size and zeros will fill in for the missing places.
If the number is negative the negative sign will take the place of the last
digit.
- Added: globalarray type to drawnumber which will display the value in a
global array with the index set to the player's number. Untested.
- Added: isselected command to SBarInfo.
- Fixed: Bi and Tri colored numbers didn't work.
- Fixed: Crash when using nullimage as the last image in drawswitchableimage.
- Applied Graf suggestion to include the y coord when calulating heights to fix
most of the gaps caused by round off errors. At least for now anyways and it
is only applied for drawimage.
- SBarInfo inventory bars have been converted to use screen->DrawTexture()
- Increased limit for demon/melee to 4.
- Fixed: P_CheckSwitchRange accessed invalid memory when testing a one-sided
line.
- Fixed: P_SpawnPuff assumed that all melee attacks have the same range
(MELEERANGE) and didn't set the puff to its melee state if the range
was different. Even worse, it checked a global variable for this so
the behavior was undefined when P_SpawnPuff was called from anywhere
else but P_LineAttack. To reduce the amount of parameters I combined
this information with the hitthing and temporary parameters into one
flags parameter. Also changed P_LineAttack so that it gets passed
an additional parameter that specifies whether the attack is a melee
attack or not and set this to true in all calls that are to be considered
melee attacks. I couldn't use the damage type because A_CustomPunch
and A_CustomMeleeAttack allow passing any damage type they want.
- Added a sprite option as an alternative of particles for FX_ROCKET
and FX_GRENADE.
- Fixed: The minimum parameter count for ACS_Execute and ACS_ExecuteAlways for
DECORATE was wrong (2 instead of 1.)
- Changed: Hexen set every cluster to be a hub if it hadn't been defined before
a level using this cluster. Now it will only do that if HexenHack is true,
i.e. when original Hexen format MAPINFOs are parsed. For ZDoom format
MAPINFOs it will now be the same as for the other games which means that
'hub' has to be declared explicitly.
- Added an Idle state that is entered in place of the spawn state if a monster
has to return to its inactive state if it can't find any more targets.
- Added MF5_NOINTERACTION flag which completely disables all physics related
code for any actor with this flag. Mostly useful for particle effects where
the actors just move a certain distance and then disappear.
- Removed the last remains of the antialias precalculation code from
am_map.cpp because it was no longer used.
- Fixed: Two-sided lines bordering a secret sector were not drawn in the
proper color
- Fixed: The automap didn't check ACS_LockedExecuteDoor for its lock color.
- Switched sounds local to the listener from head-relative 3D sounds to 2D
sounds so stereo sounds have full separation. I tried using set3DSpread,
but that still caused some blending of the channels.
- Changed FScanner so that opening a lump gives the complete wad+lump name
rather than a generic one, so identifying errors among files that all have
the same lump name no longer involves any degree of guesswork in
determining exactly which file the error occurred in.
- Added a check to S_ParseSndSeq() for SNDSEQ lumps with unterminated final
sequences.
- Fixed: Parts of s_sndseq.cpp that scan the Sequences array need NULL
pointer checks, in case an improper sequence was encountered during
parsing but not early enough to avoid creating a slot for it in the array.
- Added support for dumping from RAW/DRO/IMF files, so now anything that
can be played as OPL can also be dumped.
- Removed the opl_enable cvar, since OPL playback is now selectable as just
another MIDI device.
- Added support for DRO playback and dual-chip RAW playback.
- Removed MUS support from OPLMUSSong, since using the OPLMIDIDevice with
MUSSong2 works just as well. There are still lots of leftover bits in
the class that should probably be removed at some point, too.
- Added dual-chip dumping support for the RAW format.
- Added DosBox Raw OPL (.DRO) dumping support. For whatever reason,
in_adlib calculates the song length for this format wrong, even though
the exact length is stored right in the header. (But in_adlib seems buggy
in general; too bad it's the only Windows version of Adplug that seems to
exist.)
- Rewrote the OPL dumper to work with MIDI as well as MUS.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@86 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-05 13:28:48 +00:00
|
|
|
S_ParseSndSeq(*LocalSndSeq? Wads.CheckNumForFullName(LocalSndSeq, true) : -1);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
LastLocalSndInfo = LocalSndInfo;
|
|
|
|
LastLocalSndSeq = LocalSndSeq;
|
|
|
|
}
|
|
|
|
|
2008-03-01 18:54:31 +00:00
|
|
|
// stop the old music if it has been paused.
|
|
|
|
// This ensures that the new music is started from the beginning
|
|
|
|
// if it's the same as the last one and it has been paused.
|
|
|
|
if (MusicPaused) S_StopMusic(true);
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// start new music for the level
|
|
|
|
MusicPaused = false;
|
|
|
|
|
2013-03-09 11:15:38 +00:00
|
|
|
// Don't start the music if loading a savegame, because the music is stored there.
|
|
|
|
// Don't start the music if revisiting a level in a hub for the same reason.
|
2013-03-16 20:48:20 +00:00
|
|
|
if (!savegamerestore && (level.info == NULL || level.info->snapshot == NULL || !level.info->isValid()))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (level.cdtrack == 0 || !S_ChangeCDMusic (level.cdtrack, level.cdid))
|
2009-02-05 00:06:30 +00:00
|
|
|
S_ChangeMusic (level.Music, level.musicorder);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_PrecacheLevel
|
|
|
|
//
|
|
|
|
// Like R_PrecacheLevel, but for sounds.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_PrecacheLevel ()
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
if (GSnd)
|
|
|
|
{
|
|
|
|
for (i = 0; i < S_sfx.Size(); ++i)
|
|
|
|
{
|
|
|
|
S_sfx[i].bUsed = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
AActor *actor;
|
|
|
|
TThinkerIterator<AActor> iterator;
|
|
|
|
|
2012-08-25 13:53:57 +00:00
|
|
|
// Precache all sounds known to be used by the currently spawned actors.
|
|
|
|
while ( (actor = iterator.Next()) != NULL )
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2012-08-25 13:53:57 +00:00
|
|
|
actor->MarkPrecacheSounds();
|
|
|
|
}
|
|
|
|
// Precache all extra sounds requested by this map.
|
|
|
|
for (i = 0; i < level.info->PrecacheSounds.Size(); ++i)
|
|
|
|
{
|
|
|
|
level.info->PrecacheSounds[i].MarkUsed();
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 1; i < S_sfx.Size(); ++i)
|
|
|
|
{
|
|
|
|
if (S_sfx[i].bUsed)
|
|
|
|
{
|
|
|
|
S_CacheSound (&S_sfx[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (i = 1; i < S_sfx.Size(); ++i)
|
|
|
|
{
|
|
|
|
if (!S_sfx[i].bUsed && S_sfx[i].link == sfxinfo_t::NO_LINK)
|
|
|
|
{
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
S_UnloadSound (&S_sfx[i]);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_CacheSound
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_CacheSound (sfxinfo_t *sfx)
|
|
|
|
{
|
|
|
|
if (GSnd)
|
|
|
|
{
|
|
|
|
if (sfx->bPlayerReserve)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if (sfx->bRandomHeader)
|
|
|
|
{
|
|
|
|
S_CacheRandomSound (sfx);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
while (sfx->link != sfxinfo_t::NO_LINK)
|
|
|
|
{
|
|
|
|
sfx = &S_sfx[sfx->link];
|
|
|
|
}
|
|
|
|
sfx->bUsed = true;
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
S_LoadSound (sfx);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_UnloadSound
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_UnloadSound (sfxinfo_t *sfx)
|
|
|
|
{
|
|
|
|
if (sfx->data.isValid())
|
|
|
|
{
|
|
|
|
GSnd->UnloadSound(sfx->data);
|
|
|
|
sfx->data.Clear();
|
|
|
|
DPrintf("Unloaded sound \"%s\" (%td)\n", sfx->name.GetChars(), sfx - &S_sfx[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_GetChannel
|
|
|
|
//
|
|
|
|
// Returns a free channel for the system sound interface.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-09-15 23:47:00 +00:00
|
|
|
FISoundChannel *S_GetChannel(void *syschan)
|
2008-03-25 16:19:31 +00:00
|
|
|
{
|
|
|
|
FSoundChan *chan;
|
|
|
|
|
|
|
|
if (FreeChannels != NULL)
|
|
|
|
{
|
|
|
|
chan = FreeChannels;
|
|
|
|
S_UnlinkChannel(chan);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
chan = new FSoundChan;
|
|
|
|
memset(chan, 0, sizeof(*chan));
|
|
|
|
}
|
|
|
|
S_LinkChannel(chan, &Channels);
|
|
|
|
chan->SysChannel = syschan;
|
|
|
|
return chan;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_ReturnChannel
|
|
|
|
//
|
|
|
|
// Returns a channel to the free pool.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_ReturnChannel(FSoundChan *chan)
|
|
|
|
{
|
|
|
|
S_UnlinkChannel(chan);
|
|
|
|
memset(chan, 0, sizeof(*chan));
|
|
|
|
S_LinkChannel(chan, &FreeChannels);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_UnlinkChannel
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_UnlinkChannel(FSoundChan *chan)
|
|
|
|
{
|
|
|
|
*(chan->PrevChan) = chan->NextChan;
|
|
|
|
if (chan->NextChan != NULL)
|
|
|
|
{
|
|
|
|
chan->NextChan->PrevChan = chan->PrevChan;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_LinkChannel
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_LinkChannel(FSoundChan *chan, FSoundChan **head)
|
|
|
|
{
|
|
|
|
chan->NextChan = *head;
|
|
|
|
if (chan->NextChan != NULL)
|
|
|
|
{
|
|
|
|
chan->NextChan->PrevChan = &chan->NextChan;
|
|
|
|
}
|
|
|
|
*head = chan;
|
|
|
|
chan->PrevChan = head;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// [RH] Split S_StartSoundAtVolume into multiple parts so that sounds can
|
|
|
|
// be specified both by id and by name. Also borrowed some stuff from
|
|
|
|
// Hexen and parameters from Quake.
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CalcPosVel
|
|
|
|
//
|
2008-07-04 16:54:29 +00:00
|
|
|
// Retrieves a sound's position and velocity for 3D sounds. This version
|
|
|
|
// is for an already playing sound.
|
|
|
|
//
|
2008-01-27 11:25:03 +00:00
|
|
|
//=========================================================================
|
|
|
|
|
2008-10-26 15:00:57 +00:00
|
|
|
static void CalcPosVel(FSoundChan *chan, FVector3 *pos, FVector3 *vel)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
CalcPosVel(chan->SourceType, chan->Actor, chan->Sector, chan->Poly, chan->Point,
|
|
|
|
chan->EntChannel, chan->ChanFlags, pos, vel);
|
|
|
|
}
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
//
|
|
|
|
// CalcPosVel
|
|
|
|
//
|
|
|
|
// This version is for sounds that haven't started yet so have no channel.
|
|
|
|
//
|
|
|
|
//=========================================================================
|
|
|
|
|
|
|
|
static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
|
|
|
|
const FPolyObj *poly, const float pt[3], int channum, int chanflags, FVector3 *pos, FVector3 *vel)
|
|
|
|
{
|
|
|
|
if (pos != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
fixed_t x, y, z;
|
|
|
|
|
|
|
|
if (players[consoleplayer].camera != NULL)
|
|
|
|
{
|
|
|
|
x = players[consoleplayer].camera->x;
|
|
|
|
y = players[consoleplayer].camera->z;
|
|
|
|
z = players[consoleplayer].camera->y;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
z = y = x = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case SOURCE_None:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SOURCE_Actor:
|
2008-12-21 08:31:23 +00:00
|
|
|
// assert(actor != NULL);
|
2008-07-19 23:52:06 +00:00
|
|
|
if (actor != NULL)
|
|
|
|
{
|
|
|
|
x = actor->x;
|
|
|
|
y = actor->z;
|
|
|
|
z = actor->y;
|
|
|
|
}
|
2008-07-04 16:54:29 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SOURCE_Sector:
|
2008-11-27 23:28:48 +00:00
|
|
|
assert(sector != NULL);
|
|
|
|
if (sector != NULL)
|
2008-07-04 16:54:29 +00:00
|
|
|
{
|
2008-11-27 23:28:48 +00:00
|
|
|
if (chanflags & CHAN_AREA)
|
|
|
|
{
|
|
|
|
CalcSectorSoundOrg(sector, channum, &x, &z, &y);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
x = sector->soundorg[0];
|
|
|
|
z = sector->soundorg[1];
|
|
|
|
chanflags |= CHAN_LISTENERZ;
|
|
|
|
}
|
2008-07-04 16:54:29 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SOURCE_Polyobj:
|
2008-11-27 23:28:48 +00:00
|
|
|
assert(poly != NULL);
|
2008-07-04 16:54:29 +00:00
|
|
|
CalcPolyobjSoundOrg(poly, &x, &z, &y);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SOURCE_Unattached:
|
|
|
|
pos->X = pt[0];
|
2008-07-06 17:32:31 +00:00
|
|
|
pos->Y = !(chanflags & CHAN_LISTENERZ) ? pt[1] : FIXED2FLOAT(y);
|
2008-07-04 16:54:29 +00:00
|
|
|
pos->Z = pt[2];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (type != SOURCE_Unattached)
|
|
|
|
{
|
2008-07-06 17:32:31 +00:00
|
|
|
if ((chanflags & CHAN_LISTENERZ) && players[consoleplayer].camera != NULL)
|
2008-07-04 16:54:29 +00:00
|
|
|
{
|
|
|
|
y = players[consoleplayer].camera != NULL ? players[consoleplayer].camera->z : 0;
|
|
|
|
}
|
|
|
|
pos->X = FIXED2FLOAT(x);
|
|
|
|
pos->Y = FIXED2FLOAT(y);
|
|
|
|
pos->Z = FIXED2FLOAT(z);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-07-04 16:54:29 +00:00
|
|
|
if (vel != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
// Only actors maintain velocity information.
|
2008-12-21 08:31:23 +00:00
|
|
|
if (type == SOURCE_Actor && actor != NULL)
|
2008-07-04 16:54:29 +00:00
|
|
|
{
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- 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.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
vel->X = FIXED2FLOAT(actor->velx) * TICRATE;
|
|
|
|
vel->Y = FIXED2FLOAT(actor->velz) * TICRATE;
|
|
|
|
vel->Z = FIXED2FLOAT(actor->vely) * TICRATE;
|
2008-07-04 16:54:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
vel->Zero();
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-07-04 16:54:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CalcSectorSoundOrg
|
|
|
|
//
|
|
|
|
// Returns the perceived sound origin for a sector. If the listener is
|
|
|
|
// inside the sector, then the origin is their location. Otherwise, the
|
|
|
|
// origin is from the nearest wall on the sector.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
static void CalcSectorSoundOrg(const sector_t *sec, int channum, fixed_t *x, fixed_t *y, fixed_t *z)
|
|
|
|
{
|
2008-07-19 23:52:06 +00:00
|
|
|
if (!(i_compatflags & COMPATF_SECTORSOUNDS))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-19 23:52:06 +00:00
|
|
|
// Are we inside the sector? If yes, the closest point is the one we're on.
|
|
|
|
if (P_PointInSector(*x, *y) == sec)
|
|
|
|
{
|
|
|
|
*x = players[consoleplayer].camera->x;
|
|
|
|
*y = players[consoleplayer].camera->y;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Find the closest point on the sector's boundary lines and use
|
|
|
|
// that as the perceived origin of the sound.
|
|
|
|
sec->ClosestPoint(*x, *y, *x, *y);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-07-19 23:52:06 +00:00
|
|
|
*x = sec->soundorg[0];
|
|
|
|
*y = sec->soundorg[1];
|
2008-07-04 16:54:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Set sound vertical position based on channel.
|
|
|
|
if (channum == CHAN_FLOOR)
|
|
|
|
{
|
|
|
|
*z = MIN(sec->floorplane.ZatPoint(*x, *y), *z);
|
|
|
|
}
|
|
|
|
else if (channum == CHAN_CEILING)
|
|
|
|
{
|
|
|
|
*z = MAX(sec->ceilingplane.ZatPoint(*x, *y), *z);
|
|
|
|
}
|
|
|
|
else if (channum == CHAN_INTERIOR)
|
|
|
|
{
|
|
|
|
*z = clamp(*z, sec->floorplane.ZatPoint(*x, *y), sec->ceilingplane.ZatPoint(*x, *y));
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CalcPolySoundOrg
|
|
|
|
//
|
|
|
|
// Returns the perceived sound origin for a polyobject. This is similar to
|
|
|
|
// CalcSectorSoundOrg, except there is no special case for being "inside"
|
|
|
|
// a polyobject, so the sound literally comes from the polyobject's walls.
|
|
|
|
// Vertical position of the sound always comes from the visible wall.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
static void CalcPolyobjSoundOrg(const FPolyObj *poly, fixed_t *x, fixed_t *y, fixed_t *z)
|
|
|
|
{
|
2010-07-23 14:32:07 +00:00
|
|
|
side_t *side;
|
2008-07-04 16:54:29 +00:00
|
|
|
sector_t *sec;
|
|
|
|
|
2010-07-23 14:32:07 +00:00
|
|
|
poly->ClosestPoint(*x, *y, *x, *y, &side);
|
|
|
|
sec = side->sector;
|
2008-07-04 16:54:29 +00:00
|
|
|
*z = clamp(*z, sec->floorplane.ZatPoint(*x, *y), sec->ceilingplane.ZatPoint(*x, *y));
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_StartSound
|
|
|
|
//
|
2008-07-04 16:54:29 +00:00
|
|
|
// 0 attenuation means full volume over whole level.
|
|
|
|
// 0 < attenuation means to scale the distance by that amount when
|
|
|
|
// calculating volume.
|
|
|
|
//
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
static FSoundChan *S_StartSound(AActor *actor, const sector_t *sec, const FPolyObj *poly,
|
2010-03-18 10:19:00 +00:00
|
|
|
const FVector3 *pt, int channel, FSoundID sound_id, float volume, float attenuation,
|
|
|
|
FRolloffInfo *forcedrolloff=NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
sfxinfo_t *sfx;
|
|
|
|
int chanflags;
|
2008-03-25 16:19:31 +00:00
|
|
|
int basepriority;
|
2008-01-27 11:25:03 +00:00
|
|
|
int org_id;
|
2008-03-25 16:19:31 +00:00
|
|
|
int pitch;
|
|
|
|
FSoundChan *chan;
|
2008-07-04 16:54:29 +00:00
|
|
|
FVector3 pos, vel;
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
FRolloffInfo *rolloff;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2010-10-06 08:03:11 +00:00
|
|
|
if (sound_id <= 0 || volume <= 0 || nosfx || nosound )
|
2008-06-15 17:17:31 +00:00
|
|
|
return NULL;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
int type;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
if (actor != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
type = SOURCE_Actor;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-07-04 16:54:29 +00:00
|
|
|
else if (sec != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
type = SOURCE_Sector;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-07-04 16:54:29 +00:00
|
|
|
else if (poly != NULL)
|
|
|
|
{
|
|
|
|
type = SOURCE_Polyobj;
|
|
|
|
}
|
|
|
|
else if (pt != NULL)
|
|
|
|
{
|
|
|
|
type = SOURCE_Unattached;
|
|
|
|
}
|
|
|
|
else
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
type = SOURCE_None;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-07-04 16:54:29 +00:00
|
|
|
|
|
|
|
org_id = sound_id;
|
|
|
|
chanflags = channel & ~7;
|
|
|
|
channel &= 7;
|
|
|
|
|
|
|
|
CalcPosVel(type, actor, sec, poly, &pt->X, channel, chanflags, &pos, &vel);
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
if (i_compatflags & COMPATF_MAGICSILENCE)
|
|
|
|
{ // For people who just can't play without a silent BFG.
|
2008-03-25 16:19:31 +00:00
|
|
|
channel = CHAN_WEAPON;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-07-04 16:54:29 +00:00
|
|
|
else if ((chanflags & CHAN_MAYBE_LOCAL) && (i_compatflags & COMPATF_SILENTPICKUP))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
if (actor != NULL && actor != players[consoleplayer].camera)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
return NULL;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sfx = &S_sfx[sound_id];
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
// Scale volume according to SNDINFO data.
|
|
|
|
volume = MIN(volume * sfx->Volume, 1.f);
|
|
|
|
if (volume <= 0)
|
2008-06-15 17:17:31 +00:00
|
|
|
return NULL;
|
2008-03-25 16:19:31 +00:00
|
|
|
|
2008-03-30 08:34:44 +00:00
|
|
|
// When resolving a link we do not want to get the NearLimit of
|
|
|
|
// the referenced sound so some additional checks are required
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
int near_limit = sfx->NearLimit;
|
2009-02-08 23:01:13 +00:00
|
|
|
float limit_range = sfx->LimitRange;
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
rolloff = &sfx->Rolloff;
|
2008-03-30 08:34:44 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// Resolve player sounds, random sounds, and aliases
|
|
|
|
while (sfx->link != sfxinfo_t::NO_LINK)
|
|
|
|
{
|
|
|
|
if (sfx->bPlayerReserve)
|
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
sound_id = FSoundID(S_FindSkinnedSound (actor, sound_id));
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
near_limit = S_sfx[sound_id].NearLimit;
|
2009-02-08 23:01:13 +00:00
|
|
|
limit_range = S_sfx[sound_id].LimitRange;
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
rolloff = &S_sfx[sound_id].Rolloff;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (sfx->bRandomHeader)
|
|
|
|
{
|
2012-05-07 08:58:41 +00:00
|
|
|
// Random sounds attenuate based on the original (random) sound as well as the chosen one.
|
|
|
|
attenuation *= sfx->Attenuation;
|
2008-06-15 17:17:31 +00:00
|
|
|
sound_id = FSoundID(S_PickReplacement (sound_id));
|
2009-02-08 23:01:13 +00:00
|
|
|
if (near_limit < 0)
|
|
|
|
{
|
|
|
|
near_limit = S_sfx[sound_id].NearLimit;
|
|
|
|
limit_range = S_sfx[sound_id].LimitRange;
|
|
|
|
}
|
2010-03-18 10:19:00 +00:00
|
|
|
if (rolloff->MinDistance == 0)
|
|
|
|
{
|
|
|
|
rolloff = &S_sfx[sound_id].Rolloff;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-06-15 17:17:31 +00:00
|
|
|
sound_id = FSoundID(sfx->link);
|
2009-02-08 23:01:13 +00:00
|
|
|
if (near_limit < 0)
|
|
|
|
{
|
|
|
|
near_limit = S_sfx[sound_id].NearLimit;
|
|
|
|
limit_range = S_sfx[sound_id].LimitRange;
|
|
|
|
}
|
2010-03-18 10:19:00 +00:00
|
|
|
if (rolloff->MinDistance == 0)
|
|
|
|
{
|
|
|
|
rolloff = &S_sfx[sound_id].Rolloff;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
sfx = &S_sfx[sound_id];
|
|
|
|
}
|
2008-03-25 16:19:31 +00:00
|
|
|
|
2012-05-07 08:58:41 +00:00
|
|
|
// Attenuate the attenuation based on the sound.
|
|
|
|
attenuation *= sfx->Attenuation;
|
|
|
|
|
2010-03-18 10:19:00 +00:00
|
|
|
// The passed rolloff overrides any sound-specific rolloff.
|
|
|
|
if (forcedrolloff != NULL && forcedrolloff->MinDistance != 0)
|
|
|
|
{
|
|
|
|
rolloff = forcedrolloff;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If no valid rolloff was set, use the global default.
|
|
|
|
if (rolloff->MinDistance == 0)
|
|
|
|
{
|
|
|
|
rolloff = &S_Rolloff;
|
|
|
|
}
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
// If this is a singular sound, don't play it if it's already playing.
|
|
|
|
if (sfx->bSingular && S_CheckSingular(sound_id))
|
2008-07-04 16:54:29 +00:00
|
|
|
{
|
|
|
|
chanflags |= CHAN_EVICTED;
|
|
|
|
}
|
2008-03-25 16:19:31 +00:00
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
// If the sound is unpositioned or comes from the listener, it is
|
|
|
|
// never limited.
|
2008-07-04 16:54:29 +00:00
|
|
|
if (type == SOURCE_None || actor == players[consoleplayer].camera)
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
{
|
|
|
|
near_limit = 0;
|
|
|
|
}
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
// If this sound doesn't like playing near itself, don't play it if
|
|
|
|
// that's what would happen.
|
* Updated to ZDoom r3360:
- Added ability to use a constant for the maximum comparator for health and armor drawbars.
- Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter).
- Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767).
- Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener.
- Added keys on the automap for Heretic in easy mode.
- 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.)
- Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open.
- Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking.
- Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for.
- Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
|
|
|
if (near_limit > 0 && S_CheckSoundLimit(sfx, pos, near_limit, limit_range, actor, channel))
|
2008-07-04 16:54:29 +00:00
|
|
|
{
|
|
|
|
chanflags |= CHAN_EVICTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If the sound is blocked and not looped, return now. If the sound
|
|
|
|
// is blocked and looped, pretend to play it so that it can
|
|
|
|
// eventually play for real.
|
|
|
|
if ((chanflags & (CHAN_EVICTED | CHAN_LOOP)) == CHAN_EVICTED)
|
|
|
|
{
|
2008-06-15 17:17:31 +00:00
|
|
|
return NULL;
|
2008-07-04 16:54:29 +00:00
|
|
|
}
|
2008-03-25 16:19:31 +00:00
|
|
|
|
|
|
|
// Make sure the sound is loaded.
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
sfx = S_LoadSound(sfx);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
// The empty sound never plays.
|
2008-01-27 11:25:03 +00:00
|
|
|
if (sfx->lumpnum == sfx_empty)
|
|
|
|
{
|
2008-06-15 17:17:31 +00:00
|
|
|
return NULL;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-03-25 16:19:31 +00:00
|
|
|
|
|
|
|
// Select priority.
|
2008-07-04 16:54:29 +00:00
|
|
|
if (type == SOURCE_None || actor == players[consoleplayer].camera)
|
2008-03-23 21:23:26 +00:00
|
|
|
{
|
2009-02-05 00:06:30 +00:00
|
|
|
basepriority = 80;
|
2008-03-23 21:23:26 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
basepriority = 0;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-01-25 22:03:47 +00:00
|
|
|
int seen = 0;
|
2008-07-04 16:54:29 +00:00
|
|
|
if (actor != NULL && channel == CHAN_AUTO)
|
2009-01-25 22:03:47 +00:00
|
|
|
{
|
|
|
|
// Select a channel that isn't already playing something.
|
2008-03-25 16:19:31 +00:00
|
|
|
// Try channel 0 first, then travel from channel 7 down.
|
2009-01-25 22:03:47 +00:00
|
|
|
if (!S_IsChannelUsed(actor, 0, &seen))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
channel = 0;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2008-03-25 16:19:31 +00:00
|
|
|
else
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-01-25 22:03:47 +00:00
|
|
|
for (channel = 7; channel > 0; --channel)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-01-25 22:03:47 +00:00
|
|
|
if (!S_IsChannelUsed(actor, channel, &seen))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2008-03-25 16:19:31 +00:00
|
|
|
if (channel == 0)
|
|
|
|
{ // Crap. No free channels.
|
2008-06-15 17:17:31 +00:00
|
|
|
return NULL;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
// If this actor is already playing something on the selected channel, stop it.
|
2009-01-25 22:03:47 +00:00
|
|
|
if (type != SOURCE_None && ((actor == NULL && channel != CHAN_AUTO) || (actor != NULL && S_IsChannelUsed(actor, channel, &seen))))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
for (chan = Channels; chan != NULL; chan = chan->NextChan)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
if (chan->SourceType == type && chan->EntChannel == channel)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
bool foundit;
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case SOURCE_Actor: foundit = (chan->Actor == actor); break;
|
|
|
|
case SOURCE_Sector: foundit = (chan->Sector == sec); break;
|
|
|
|
case SOURCE_Polyobj: foundit = (chan->Poly == poly); break;
|
|
|
|
case SOURCE_Unattached: foundit = (chan->Point[0] == pt->X && chan->Point[2] == pt->Z && chan->Point[1] == pt->Y); break;
|
|
|
|
default: foundit = false; break;
|
|
|
|
}
|
|
|
|
if (foundit)
|
|
|
|
{
|
2008-09-15 23:47:00 +00:00
|
|
|
S_StopChannel(chan);
|
2008-07-04 16:54:29 +00:00
|
|
|
break;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-01 16:47:46 +00:00
|
|
|
// sound is paused and a non-looped sound is being started.
|
|
|
|
// Such a sound would play right after unpausing which wouldn't sound right.
|
|
|
|
if (!(chanflags & CHAN_LOOP) && !(chanflags & (CHAN_UI|CHAN_NOPAUSE)) && SoundPaused)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
// Vary the sfx pitches.
|
2008-01-27 11:25:03 +00:00
|
|
|
if (sfx->PitchMask != 0)
|
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
pitch = NORM_PITCH - (M_Random() & sfx->PitchMask) + (M_Random() & sfx->PitchMask);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
pitch = NORM_PITCH;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
if (chanflags & CHAN_EVICTED)
|
|
|
|
{
|
|
|
|
chan = NULL;
|
|
|
|
}
|
2008-09-15 23:47:00 +00:00
|
|
|
else
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-09-15 23:47:00 +00:00
|
|
|
int startflags = 0;
|
|
|
|
if (chanflags & CHAN_LOOP) startflags |= SNDF_LOOP;
|
|
|
|
if (chanflags & CHAN_AREA) startflags |= SNDF_AREA;
|
|
|
|
if (chanflags & (CHAN_UI|CHAN_NOPAUSE)) startflags |= SNDF_NOPAUSE;
|
- version bump to 1.2.0.
- fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct.
- fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright.
Update to ZDoom r1456 (2.3.0 plus one additional fix):
- Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true
floor and ceiling heights. Otherwise the actor will fall right through
3DMidtex textures (and 3D-floors.)
- Fixed: The TeleporterBeacon tried to enter its See state rather than its
Drop state. Also changed it to fade out when it's done rather than
disappearing abruptly.
- Fixed: Strife's quest based line actions also work in Deathmatch.
- Fixed: Gravity application was not correct. For actors with no vertical
momentum the initial pull is supposed to be twice as strong as when
vertical movement already takes place.
- added invquery CCMD like in Strife. Also removed all underscores from the
tag strings so that they can be printed properly.
- Fixed: Skill baby was missing 'autousehealth' for all games.
- Added a new CVAR: sv_disableautohealth
- Autouse of health items is no longer hardwired to the default item classes.
There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small
Raven health item, 2 a large Raven health item and 3 a Strife item.
- Removed an early-out in wallscan_striped() that is invalid when drawing a
skybox.
- fixed: nextmap and nextsecret CCMDs set skill to 0.
- fixed: level.flags2 was not stored in savegames. Also bumped min. savegame
version and removed old compatibility handlings.
- 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.
- Removed the delay for starting all sounds from one tic at exactly the same
DSP position. Without also synchronizing the stopping of sounds, it can
cause problems with things like the chainsaw where the sound is stopped and
immediately restarted, causing occassional gaps between the stopping of the
sound and the starting of the new one. (I added the start synchronization to
combat flanging of paired moving polyobjects when moving around, but I think
just removing velocity from the player for sound calculations takes care of
that well enough.)
- Added GCC headers for intptr_t to tarray.h.
- Added MF5_PAINLESS flag for projectiles that don't make the target go into
the pain state.
- Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space-
efficient.
- Fixed: player->oldbuttons was copied from the current button set at the end
of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput.
- Fixed: The map name display on the automap was incomplete.
- Added FakeInventory.Respawns DECORATe property
- Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the
conversation by pressing Escape.
- added ML_BLOCKPROJECTILE flag to lines.
- Fixed: With opl_onechip set the second OPL chip was never set to anything valid
so it contained an invalid pointer. There were also a few other places that
simply assumed that the second chip is set to something valid.
- Fixed: NPCs which are engaged in a conversation should not move.
- Fixed: Player movement animation was not stopped when starting a conversation.
- Added selective compression of network packets. Interestingly, most packets
don't actually compress all that well, even the ones that aren't too short
to possibly compress. (Maybe make the whole thing one long, never-ending
zlib data stream with Z_SYNC_FLUSH used to chunk things at packet
boundaries? That would probably help the compression ratio, but it would
require changing the way the netcode determines sequence, which would be
a much more invasive change.)
- Fixed: Heretic's fullscreen HUD crashed when the player had armor without
a valid icon.
- Fixed: The StrifePlayer was missing a RunHealth setting.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
|
|
|
if (chanflags & CHAN_UI) startflags |= SNDF_NOREVERB;
|
2008-09-15 23:47:00 +00:00
|
|
|
|
|
|
|
if (attenuation > 0)
|
|
|
|
{
|
|
|
|
SoundListener listener;
|
|
|
|
S_SetListener(listener, players[consoleplayer].camera);
|
|
|
|
chan = (FSoundChan*)GSnd->StartSound3D (sfx->data, &listener, volume, rolloff, attenuation, pitch, basepriority, pos, vel, channel, startflags, NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
chan = (FSoundChan*)GSnd->StartSound (sfx->data, volume, pitch, startflags, NULL);
|
|
|
|
}
|
2008-07-04 16:54:29 +00:00
|
|
|
}
|
|
|
|
if (chan == NULL && (chanflags & CHAN_LOOP))
|
|
|
|
{
|
2008-09-15 23:47:00 +00:00
|
|
|
chan = (FSoundChan*)S_GetChannel(NULL);
|
2009-11-18 06:52:36 +00:00
|
|
|
GSnd->MarkStartTime(chan);
|
2008-07-04 16:54:29 +00:00
|
|
|
chanflags |= CHAN_EVICTED;
|
|
|
|
}
|
|
|
|
if (attenuation > 0)
|
|
|
|
{
|
|
|
|
chanflags |= CHAN_IS3D | CHAN_JUSTSTARTED;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
chanflags |= CHAN_LISTENERZ | CHAN_JUSTSTARTED;
|
2008-03-25 16:19:31 +00:00
|
|
|
}
|
|
|
|
if (chan != NULL)
|
|
|
|
{
|
|
|
|
chan->SoundID = sound_id;
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
chan->OrgID = FSoundID(org_id);
|
2008-03-25 16:19:31 +00:00
|
|
|
chan->EntChannel = channel;
|
|
|
|
chan->Volume = volume;
|
2008-04-20 10:26:25 +00:00
|
|
|
chan->ChanFlags |= chanflags;
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
chan->NearLimit = near_limit;
|
2009-02-08 23:01:13 +00:00
|
|
|
chan->LimitRange = limit_range;
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
chan->Pitch = pitch;
|
|
|
|
chan->Priority = basepriority;
|
2008-07-04 16:54:29 +00:00
|
|
|
chan->DistanceScale = attenuation;
|
|
|
|
chan->SourceType = type;
|
|
|
|
switch (type)
|
2008-03-25 16:19:31 +00:00
|
|
|
{
|
2009-01-25 22:03:47 +00:00
|
|
|
case SOURCE_Actor: chan->Actor = actor; break;
|
2008-07-04 16:54:29 +00:00
|
|
|
case SOURCE_Sector: chan->Sector = sec; break;
|
|
|
|
case SOURCE_Polyobj: chan->Poly = poly; break;
|
|
|
|
case SOURCE_Unattached: chan->Point[0] = pt->X; chan->Point[1] = pt->Y; chan->Point[2] = pt->Z; break;
|
|
|
|
default: break;
|
2008-03-25 16:19:31 +00:00
|
|
|
}
|
|
|
|
}
|
2008-06-15 17:17:31 +00:00
|
|
|
return chan;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_RestartSound
|
|
|
|
//
|
|
|
|
// Attempts to restart looping sounds that were evicted from their channels.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_RestartSound(FSoundChan *chan)
|
|
|
|
{
|
|
|
|
assert(chan->ChanFlags & CHAN_EVICTED);
|
|
|
|
|
|
|
|
FSoundChan *ochan;
|
2010-01-16 07:38:12 +00:00
|
|
|
sfxinfo_t *sfx = &S_sfx[chan->SoundID];
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
|
|
|
// If this is a singular sound, don't play it if it's already playing.
|
|
|
|
if (sfx->bSingular && S_CheckSingular(chan->SoundID))
|
|
|
|
return;
|
|
|
|
|
|
|
|
sfx = S_LoadSound(sfx);
|
|
|
|
|
|
|
|
// The empty sound never plays.
|
|
|
|
if (sfx->lumpnum == sfx_empty)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-09-15 23:47:00 +00:00
|
|
|
int oldflags = chan->ChanFlags;
|
|
|
|
|
|
|
|
int startflags = 0;
|
|
|
|
if (chan->ChanFlags & CHAN_LOOP) startflags |= SNDF_LOOP;
|
|
|
|
if (chan->ChanFlags & CHAN_AREA) startflags |= SNDF_AREA;
|
|
|
|
if (chan->ChanFlags & (CHAN_UI|CHAN_NOPAUSE)) startflags |= SNDF_NOPAUSE;
|
|
|
|
if (chan->ChanFlags & CHAN_ABSTIME) startflags |= SNDF_ABSTIME;
|
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
if (chan->ChanFlags & CHAN_IS3D)
|
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
FVector3 pos, vel;
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
CalcPosVel(chan, &pos, &vel);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
|
|
|
// If this sound doesn't like playing near itself, don't play it if
|
|
|
|
// that's what would happen.
|
* Updated to ZDoom r3360:
- Added ability to use a constant for the maximum comparator for health and armor drawbars.
- Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter).
- Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767).
- Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener.
- Added keys on the automap for Heretic in easy mode.
- 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.)
- Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open.
- Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking.
- Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for.
- Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
|
|
|
if (chan->NearLimit > 0 && S_CheckSoundLimit(&S_sfx[chan->SoundID], pos, chan->NearLimit, chan->LimitRange, NULL, 0))
|
2008-07-04 16:54:29 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-09-06 11:49:09 +00:00
|
|
|
SoundListener listener;
|
|
|
|
S_SetListener(listener, players[consoleplayer].camera);
|
|
|
|
|
2009-11-04 07:29:25 +00:00
|
|
|
chan->ChanFlags &= ~(CHAN_EVICTED|CHAN_ABSTIME);
|
2008-09-15 23:47:00 +00:00
|
|
|
ochan = (FSoundChan*)GSnd->StartSound3D(sfx->data, &listener, chan->Volume, &chan->Rolloff, chan->DistanceScale, chan->Pitch,
|
|
|
|
chan->Priority, pos, vel, chan->EntChannel, startflags, chan);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-11-04 07:29:25 +00:00
|
|
|
chan->ChanFlags &= ~(CHAN_EVICTED|CHAN_ABSTIME);
|
2008-09-15 23:47:00 +00:00
|
|
|
ochan = (FSoundChan*)GSnd->StartSound(sfx->data, chan->Volume, chan->Pitch, startflags, chan);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
|
|
|
assert(ochan == NULL || ochan == chan);
|
2009-01-25 22:03:47 +00:00
|
|
|
if (ochan == NULL)
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
{
|
2009-01-25 22:03:47 +00:00
|
|
|
chan->ChanFlags = oldflags;
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-06-15 17:17:31 +00:00
|
|
|
// S_Sound - Unpositioned version
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
void S_Sound (int channel, FSoundID sound_id, float volume, float attenuation)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
S_StartSound (NULL, NULL, NULL, NULL, channel, sound_id, volume, attenuation);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-06-15 17:17:31 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-07-04 16:54:29 +00:00
|
|
|
// S_Sound - An actor is source
|
2008-06-15 17:17:31 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
void S_Sound (AActor *ent, int channel, FSoundID sound_id, float volume, float attenuation)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-19 23:52:06 +00:00
|
|
|
if (ent == NULL || ent->Sector->Flags & SECF_SILENT)
|
2008-01-27 11:25:03 +00:00
|
|
|
return;
|
2008-07-04 16:54:29 +00:00
|
|
|
S_StartSound (ent, NULL, NULL, NULL, channel, sound_id, volume, attenuation);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2010-03-18 10:19:00 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_SoundMinMaxDist - An actor is source
|
|
|
|
//
|
|
|
|
// Attenuation is specified as min and max distances, rather than a scalar.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_SoundMinMaxDist(AActor *ent, int channel, FSoundID sound_id, float volume, float mindist, float maxdist)
|
|
|
|
{
|
|
|
|
if (ent == NULL || ent->Sector->Flags & SECF_SILENT)
|
|
|
|
return;
|
|
|
|
|
|
|
|
FRolloffInfo rolloff;
|
|
|
|
|
|
|
|
rolloff.RolloffType = ROLLOFF_Linear;
|
|
|
|
rolloff.MinDistance = mindist;
|
|
|
|
rolloff.MaxDistance = maxdist;
|
|
|
|
S_StartSound(ent, NULL, NULL, NULL, channel, sound_id, volume, 1, &rolloff);
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-07-04 16:54:29 +00:00
|
|
|
// S_Sound - A polyobject is source
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
void S_Sound (const FPolyObj *poly, int channel, FSoundID sound_id, float volume, float attenuation)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
S_StartSound (NULL, NULL, poly, NULL, channel, sound_id, volume, attenuation);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-06-15 17:17:31 +00:00
|
|
|
// S_Sound - A point is source
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
void S_Sound (fixed_t x, fixed_t y, fixed_t z, int channel, FSoundID sound_id, float volume, float attenuation)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
FVector3 pt(FIXED2FLOAT(x), FIXED2FLOAT(z), FIXED2FLOAT(y));
|
|
|
|
S_StartSound (NULL, NULL, NULL, &pt, channel, sound_id, volume, attenuation);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-06-15 17:17:31 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_Sound - An entire sector is source
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
void S_Sound (const sector_t *sec, int channel, FSoundID sfxid, float volume, float attenuation)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
S_StartSound (NULL, sec, NULL, NULL, channel, sfxid, volume, attenuation);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_LoadSound
|
|
|
|
//
|
|
|
|
// Returns a pointer to the sfxinfo with the actual sound data.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
sfxinfo_t *S_LoadSound(sfxinfo_t *sfx)
|
|
|
|
{
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
if (GSnd->IsNull()) return sfx;
|
|
|
|
|
|
|
|
while (!sfx->data.isValid())
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
{
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
// If the sound doesn't exist, replace it with the empty sound.
|
|
|
|
if (sfx->lumpnum == -1)
|
|
|
|
{
|
|
|
|
sfx->lumpnum = sfx_empty;
|
|
|
|
}
|
|
|
|
|
|
|
|
// See if there is another sound already initialized with this lump. If so,
|
|
|
|
// then set this one up as a link, and don't load the sound again.
|
|
|
|
for (i = 0; i < S_sfx.Size(); i++)
|
|
|
|
{
|
|
|
|
if (S_sfx[i].data.isValid() && S_sfx[i].link == sfxinfo_t::NO_LINK && S_sfx[i].lumpnum == sfx->lumpnum)
|
|
|
|
{
|
|
|
|
DPrintf ("Linked %s to %s (%d)\n", sfx->name.GetChars(), S_sfx[i].name.GetChars(), i);
|
|
|
|
sfx->link = i;
|
|
|
|
// This is necessary to avoid using the rolloff settings of the linked sound if its
|
|
|
|
// settings are different.
|
|
|
|
if (sfx->Rolloff.MinDistance == 0) sfx->Rolloff = S_Rolloff;
|
|
|
|
return &S_sfx[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DPrintf("Loading sound \"%s\" (%td)\n", sfx->name.GetChars(), sfx - &S_sfx[0]);
|
|
|
|
|
|
|
|
int size = Wads.LumpLength(sfx->lumpnum);
|
|
|
|
if (size > 0)
|
|
|
|
{
|
|
|
|
BYTE *sfxdata;
|
|
|
|
BYTE *sfxstart;
|
|
|
|
FWadLump wlump = Wads.OpenLumpNum(sfx->lumpnum);
|
|
|
|
sfxstart = sfxdata = new BYTE[size];
|
|
|
|
wlump.Read(sfxdata, size);
|
2009-09-06 16:58:38 +00:00
|
|
|
SDWORD len = LittleLong(((SDWORD *)sfxdata)[1]);
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
|
2010-10-06 08:03:11 +00:00
|
|
|
// If the sound is voc, use the custom loader.
|
|
|
|
if (strncmp ((const char *)sfxstart, "Creative Voice File", 19) == 0)
|
|
|
|
{
|
|
|
|
sfx->data = GSnd->LoadSoundVoc(sfxstart, len);
|
|
|
|
}
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
// If the sound is raw, just load it as such.
|
|
|
|
// Otherwise, try the sound as DMX format.
|
|
|
|
// If that fails, let FMOD try and figure it out.
|
2010-10-06 08:03:11 +00:00
|
|
|
else if (sfx->bLoadRAW ||
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
(((BYTE *)sfxdata)[0] == 3 && ((BYTE *)sfxdata)[1] == 0 && len <= size - 8))
|
|
|
|
{
|
|
|
|
int frequency;
|
|
|
|
|
|
|
|
if (sfx->bLoadRAW)
|
|
|
|
{
|
|
|
|
len = Wads.LumpLength (sfx->lumpnum);
|
|
|
|
frequency = (sfx->bForce22050 ? 22050 : 11025);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-09-06 16:58:38 +00:00
|
|
|
frequency = LittleShort(((WORD *)sfxdata)[1]);
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
if (frequency == 0)
|
|
|
|
{
|
|
|
|
frequency = 11025;
|
|
|
|
}
|
|
|
|
sfxstart = sfxdata + 8;
|
|
|
|
}
|
2010-03-18 10:19:00 +00:00
|
|
|
sfx->data = GSnd->LoadSoundRaw(sfxstart, len, frequency, 1, 8, sfx->LoopStart);
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
len = Wads.LumpLength (sfx->lumpnum);
|
|
|
|
sfx->data = GSnd->LoadSound(sfxstart, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sfxdata != NULL)
|
|
|
|
{
|
|
|
|
delete[] sfxdata;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!sfx->data.isValid())
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
{
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
if (sfx->lumpnum != sfx_empty)
|
|
|
|
{
|
|
|
|
sfx->lumpnum = sfx_empty;
|
|
|
|
continue;
|
|
|
|
}
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
break;
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
|
|
|
return sfx;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-03-25 16:19:31 +00:00
|
|
|
// S_CheckSingular
|
|
|
|
//
|
|
|
|
// Returns true if a copy of this sound is already playing.
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
bool S_CheckSingular(int sound_id)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan)
|
|
|
|
{
|
|
|
|
if (chan->OrgID == sound_id)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-03-25 16:19:31 +00:00
|
|
|
// S_CheckSoundLimit
|
|
|
|
//
|
|
|
|
// Limits the number of nearby copies of a sound that can play near
|
|
|
|
// each other. If there are NearLimit instances of this sound already
|
* Updated to ZDoom r3360:
- Added ability to use a constant for the maximum comparator for health and armor drawbars.
- Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter).
- Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767).
- Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener.
- Added keys on the automap for Heretic in easy mode.
- 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.)
- Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open.
- Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking.
- Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for.
- Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
|
|
|
// playing within sqrt(limit_range) (typically 256 units) of the new sound, the
|
|
|
|
// new sound will not start.
|
|
|
|
//
|
|
|
|
// If an actor is specified, and it is already playing the same sound on
|
|
|
|
// the same channel, this sound will not be limited. In this case, we're
|
|
|
|
// restarting an already playing sound, so there's no need to limit it.
|
|
|
|
//
|
|
|
|
// Returns true if the sound should not play.
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
* Updated to ZDoom r3360:
- Added ability to use a constant for the maximum comparator for health and armor drawbars.
- Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter).
- Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767).
- Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener.
- Added keys on the automap for Heretic in easy mode.
- 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.)
- Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open.
- Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking.
- Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for.
- Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
|
|
|
bool S_CheckSoundLimit(sfxinfo_t *sfx, const FVector3 &pos, int near_limit, float limit_range,
|
|
|
|
AActor *actor, int channel)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
FSoundChan *chan;
|
|
|
|
int count;
|
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
for (chan = Channels, count = 0; chan != NULL && count < near_limit; chan = chan->NextChan)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-01-16 07:38:12 +00:00
|
|
|
if (!(chan->ChanFlags & CHAN_EVICTED) && &S_sfx[chan->SoundID] == sfx)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
FVector3 chanorigin;
|
|
|
|
|
* Updated to ZDoom r3360:
- Added ability to use a constant for the maximum comparator for health and armor drawbars.
- Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter).
- Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767).
- Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener.
- Added keys on the automap for Heretic in easy mode.
- 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.)
- Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open.
- Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking.
- Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for.
- Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
|
|
|
if (actor != NULL && chan->EntChannel == channel &&
|
|
|
|
chan->SourceType == SOURCE_Actor && chan->Actor == actor)
|
|
|
|
{ // We are restarting a playing sound. Always let it play.
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
CalcPosVel(chan, &chanorigin, NULL);
|
2009-02-08 23:01:13 +00:00
|
|
|
if ((chanorigin - pos).LengthSquared() <= limit_range)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
count++;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
return count >= near_limit;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_StopSound
|
|
|
|
//
|
2008-07-04 16:54:29 +00:00
|
|
|
// Stops an unpositioned sound from playing on a specific channel.
|
|
|
|
//
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
void S_StopSound (int channel)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-03-21 08:08:18 +00:00
|
|
|
FSoundChan *chan = Channels;
|
|
|
|
while (chan != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-03-21 08:08:18 +00:00
|
|
|
FSoundChan *next = chan->NextChan;
|
2008-07-04 16:54:29 +00:00
|
|
|
if (chan->SourceType == SOURCE_None &&
|
|
|
|
(chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE)))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-09-15 23:47:00 +00:00
|
|
|
S_StopChannel(chan);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2009-03-21 08:08:18 +00:00
|
|
|
chan = next;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_StopSound
|
|
|
|
//
|
|
|
|
// Stops a sound from a single actor from playing on a specific channel.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_StopSound (AActor *actor, int channel)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-03-21 08:08:18 +00:00
|
|
|
FSoundChan *chan = Channels;
|
|
|
|
while (chan != NULL)
|
2008-03-25 16:19:31 +00:00
|
|
|
{
|
2009-03-21 08:08:18 +00:00
|
|
|
FSoundChan *next = chan->NextChan;
|
2009-01-25 22:03:47 +00:00
|
|
|
if (chan->SourceType == SOURCE_Actor &&
|
|
|
|
chan->Actor == actor &&
|
|
|
|
(chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE)))
|
2008-07-04 16:54:29 +00:00
|
|
|
{
|
2009-01-25 22:03:47 +00:00
|
|
|
S_StopChannel(chan);
|
2008-07-04 16:54:29 +00:00
|
|
|
}
|
2009-03-21 08:08:18 +00:00
|
|
|
chan = next;
|
2008-03-25 16:19:31 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-07-04 16:54:29 +00:00
|
|
|
// S_StopSound
|
|
|
|
//
|
|
|
|
// Stops a sound from a single sector from playing on a specific channel.
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
void S_StopSound (const sector_t *sec, int channel)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-03-21 08:08:18 +00:00
|
|
|
FSoundChan *chan = Channels;
|
|
|
|
while (chan != NULL)
|
2008-03-25 16:19:31 +00:00
|
|
|
{
|
2009-03-21 08:08:18 +00:00
|
|
|
FSoundChan *next = chan->NextChan;
|
2008-07-04 16:54:29 +00:00
|
|
|
if (chan->SourceType == SOURCE_Sector &&
|
|
|
|
chan->Sector == sec &&
|
|
|
|
(chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE)))
|
|
|
|
{
|
2008-09-15 23:47:00 +00:00
|
|
|
S_StopChannel(chan);
|
2008-07-04 16:54:29 +00:00
|
|
|
}
|
2009-03-21 08:08:18 +00:00
|
|
|
chan = next;
|
2008-07-04 16:54:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_StopSound
|
|
|
|
//
|
|
|
|
// Stops a sound from a single polyobject from playing on a specific channel.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_StopSound (const FPolyObj *poly, int channel)
|
|
|
|
{
|
2009-03-21 08:08:18 +00:00
|
|
|
FSoundChan *chan = Channels;
|
|
|
|
while (chan != NULL)
|
2008-07-04 16:54:29 +00:00
|
|
|
{
|
2009-03-21 08:08:18 +00:00
|
|
|
FSoundChan *next = chan->NextChan;
|
2008-07-04 16:54:29 +00:00
|
|
|
if (chan->SourceType == SOURCE_Polyobj &&
|
|
|
|
chan->Poly == poly &&
|
|
|
|
(chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE)))
|
|
|
|
{
|
2008-09-15 23:47:00 +00:00
|
|
|
S_StopChannel(chan);
|
2008-07-04 16:54:29 +00:00
|
|
|
}
|
2009-03-21 08:08:18 +00:00
|
|
|
chan = next;
|
2008-03-25 16:19:31 +00:00
|
|
|
}
|
2008-07-04 16:54:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_StopAllChannels
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_StopAllChannels ()
|
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
SN_StopAllSequences();
|
2008-10-24 14:49:50 +00:00
|
|
|
|
|
|
|
FSoundChan *chan = Channels;
|
|
|
|
while (chan != NULL)
|
2008-03-25 16:19:31 +00:00
|
|
|
{
|
2008-10-24 14:49:50 +00:00
|
|
|
FSoundChan *next = chan->NextChan;
|
|
|
|
S_StopChannel(chan);
|
|
|
|
chan = next;
|
2008-03-25 16:19:31 +00:00
|
|
|
}
|
|
|
|
GSnd->UpdateSounds();
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_RelinkSound
|
|
|
|
//
|
|
|
|
// Moves all the sounds from one thing to another. If the destination is
|
|
|
|
// NULL, then the sound becomes a positioned sound.
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_RelinkSound (AActor *from, AActor *to)
|
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
if (from == NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
return;
|
|
|
|
|
2009-03-21 08:08:18 +00:00
|
|
|
FSoundChan *chan = Channels;
|
|
|
|
while (chan != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-03-21 08:08:18 +00:00
|
|
|
FSoundChan *next = chan->NextChan;
|
2008-07-04 16:54:29 +00:00
|
|
|
if (chan->SourceType == SOURCE_Actor && chan->Actor == from)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
if (to != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
chan->Actor = to;
|
|
|
|
}
|
|
|
|
else if (!(chan->ChanFlags & CHAN_LOOP))
|
|
|
|
{
|
2008-10-26 16:18:03 +00:00
|
|
|
chan->Actor = NULL;
|
2008-07-04 16:54:29 +00:00
|
|
|
chan->SourceType = SOURCE_Unattached;
|
|
|
|
chan->Point[0] = FIXED2FLOAT(from->x);
|
|
|
|
chan->Point[1] = FIXED2FLOAT(from->z);
|
|
|
|
chan->Point[2] = FIXED2FLOAT(from->y);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-09-15 23:47:00 +00:00
|
|
|
S_StopChannel(chan);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
2009-03-21 08:08:18 +00:00
|
|
|
chan = next;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_GetSoundPlayingInfo
|
|
|
|
//
|
2008-07-04 16:54:29 +00:00
|
|
|
// Is a sound being played by a specific emitter?
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
bool S_GetSoundPlayingInfo (const AActor *actor, int sound_id)
|
|
|
|
{
|
|
|
|
if (sound_id > 0)
|
|
|
|
{
|
|
|
|
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan)
|
|
|
|
{
|
|
|
|
if (chan->OrgID == sound_id &&
|
|
|
|
chan->SourceType == SOURCE_Actor &&
|
|
|
|
chan->Actor == actor)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool S_GetSoundPlayingInfo (const sector_t *sec, int sound_id)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (sound_id > 0)
|
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
if (chan->OrgID == sound_id &&
|
|
|
|
chan->SourceType == SOURCE_Sector &&
|
|
|
|
chan->Sector == sec)
|
|
|
|
{
|
2008-01-27 11:25:03 +00:00
|
|
|
return true;
|
2008-07-04 16:54:29 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
bool S_GetSoundPlayingInfo (const FPolyObj *poly, int sound_id)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
if (sound_id > 0)
|
|
|
|
{
|
|
|
|
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan)
|
|
|
|
{
|
|
|
|
if (chan->OrgID == sound_id &&
|
|
|
|
chan->SourceType == SOURCE_Polyobj &&
|
|
|
|
chan->Poly == poly)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2009-01-25 22:03:47 +00:00
|
|
|
// S_IsChannelUsed
|
|
|
|
//
|
|
|
|
// Returns true if the channel is in use. Also fills in a bitmask of
|
|
|
|
// channels seen while scanning for this one, to make searching for unused
|
|
|
|
// channels faster. Initialize seen to 0 for the first call.
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2009-01-25 22:03:47 +00:00
|
|
|
bool S_IsChannelUsed(AActor *actor, int channel, int *seen)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-01-25 22:03:47 +00:00
|
|
|
if (*seen & (1 << channel))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-01-25 22:03:47 +00:00
|
|
|
if (chan->SourceType == SOURCE_Actor && chan->Actor == actor)
|
|
|
|
{
|
|
|
|
*seen |= 1 << chan->EntChannel;
|
|
|
|
if (chan->EntChannel == channel)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2009-01-25 22:03:47 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_IsActorPlayingSomething
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-01-25 22:03:47 +00:00
|
|
|
bool S_IsActorPlayingSomething (AActor *actor, int channel, int sound_id)
|
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
if (i_compatflags & COMPATF_MAGICSILENCE)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
channel = 0;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
if (chan->SourceType == SOURCE_Actor && chan->Actor == actor)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
if (channel == 0 || chan->EntChannel == channel)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
return sound_id <= 0 || chan->OrgID == sound_id;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_PauseSound
|
|
|
|
//
|
|
|
|
// Stop music and sound effects, during game PAUSE.
|
|
|
|
//==========================================================================
|
|
|
|
|
2009-05-23 10:24:33 +00:00
|
|
|
void S_PauseSound (bool notmusic, bool notsfx)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (!notmusic && mus_playing.handle && !MusicPaused)
|
|
|
|
{
|
2010-09-29 21:10:20 +00:00
|
|
|
mus_playing.handle->Pause();
|
2008-01-27 11:25:03 +00:00
|
|
|
MusicPaused = true;
|
|
|
|
}
|
2009-05-23 10:24:33 +00:00
|
|
|
if (!notsfx)
|
|
|
|
{
|
|
|
|
SoundPaused = true;
|
|
|
|
GSnd->SetSfxPaused (true, 0);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_ResumeSound
|
|
|
|
//
|
|
|
|
// Resume music and sound effects, after game PAUSE.
|
|
|
|
//==========================================================================
|
|
|
|
|
2009-05-23 10:24:33 +00:00
|
|
|
void S_ResumeSound (bool notsfx)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (mus_playing.handle && MusicPaused)
|
|
|
|
{
|
2010-09-29 21:10:20 +00:00
|
|
|
mus_playing.handle->Resume();
|
2008-01-27 11:25:03 +00:00
|
|
|
MusicPaused = false;
|
|
|
|
}
|
2009-05-23 10:24:33 +00:00
|
|
|
if (!notsfx)
|
|
|
|
{
|
|
|
|
SoundPaused = false;
|
|
|
|
GSnd->SetSfxPaused (false, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_SetSoundPaused
|
|
|
|
//
|
|
|
|
// Called with state non-zero when the app is active, zero when it isn't.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_SetSoundPaused (int state)
|
|
|
|
{
|
|
|
|
if (state)
|
|
|
|
{
|
|
|
|
if (paused <= 0)
|
|
|
|
{
|
|
|
|
S_ResumeSound(true);
|
|
|
|
if (GSnd != NULL)
|
|
|
|
{
|
2012-08-10 21:16:25 +00:00
|
|
|
GSnd->SetInactive(SoundRenderer::INACTIVE_Active);
|
2009-05-23 10:24:33 +00:00
|
|
|
}
|
|
|
|
if (!netgame
|
|
|
|
#ifdef _DEBUG
|
|
|
|
&& !demoplayback
|
|
|
|
#endif
|
|
|
|
)
|
|
|
|
{
|
|
|
|
paused = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (paused == 0)
|
|
|
|
{
|
|
|
|
S_PauseSound(false, true);
|
|
|
|
if (GSnd != NULL)
|
|
|
|
{
|
2012-08-29 14:23:08 +00:00
|
|
|
GSnd->SetInactive(gamestate == GS_LEVEL || gamestate == GS_TITLELEVEL ?
|
2012-08-10 21:16:25 +00:00
|
|
|
SoundRenderer::INACTIVE_Complete :
|
|
|
|
SoundRenderer::INACTIVE_Mute);
|
2009-05-23 10:24:33 +00:00
|
|
|
}
|
|
|
|
if (!netgame
|
|
|
|
#ifdef _DEBUG
|
|
|
|
&& !demoplayback
|
|
|
|
#endif
|
|
|
|
)
|
|
|
|
{
|
|
|
|
paused = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_EvictAllChannels
|
|
|
|
//
|
|
|
|
// Forcibly evicts all channels so that there are none playing, but all
|
|
|
|
// information needed to restart them is retained.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_EvictAllChannels()
|
|
|
|
{
|
|
|
|
FSoundChan *chan, *next;
|
|
|
|
|
|
|
|
for (chan = Channels; chan != NULL; chan = next)
|
|
|
|
{
|
|
|
|
next = chan->NextChan;
|
|
|
|
|
|
|
|
if (!(chan->ChanFlags & CHAN_EVICTED))
|
|
|
|
{
|
|
|
|
chan->ChanFlags |= CHAN_EVICTED;
|
2008-07-04 16:54:29 +00:00
|
|
|
if (chan->SysChannel != NULL)
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
{
|
2009-10-30 11:18:39 +00:00
|
|
|
if (!(chan->ChanFlags & CHAN_ABSTIME))
|
|
|
|
{
|
|
|
|
chan->StartTime.AsOne = GSnd ? GSnd->GetPosition(chan) : 0;
|
|
|
|
chan->ChanFlags |= CHAN_ABSTIME;
|
|
|
|
}
|
2008-09-15 23:47:00 +00:00
|
|
|
S_StopChannel(chan);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
2009-02-05 00:06:30 +00:00
|
|
|
// assert(chan->NextChan == next);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_RestoreEvictedChannel
|
|
|
|
//
|
|
|
|
// Recursive helper for S_RestoreEvictedChannels().
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_RestoreEvictedChannel(FSoundChan *chan)
|
|
|
|
{
|
|
|
|
if (chan == NULL)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
S_RestoreEvictedChannel(chan->NextChan);
|
|
|
|
if (chan->ChanFlags & CHAN_EVICTED)
|
|
|
|
{
|
|
|
|
S_RestartSound(chan);
|
|
|
|
if (!(chan->ChanFlags & CHAN_LOOP))
|
|
|
|
{
|
|
|
|
if (chan->ChanFlags & CHAN_EVICTED)
|
|
|
|
{ // Still evicted and not looping? Forget about it.
|
|
|
|
S_ReturnChannel(chan);
|
|
|
|
}
|
|
|
|
else if (!(chan->ChanFlags & CHAN_JUSTSTARTED))
|
|
|
|
{ // Should this sound become evicted again, it's okay to forget about it.
|
|
|
|
chan->ChanFlags |= CHAN_FORGETTABLE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-11-15 09:16:06 +00:00
|
|
|
else if (chan->SysChannel == NULL && (chan->ChanFlags & (CHAN_FORGETTABLE | CHAN_LOOP)) == CHAN_FORGETTABLE)
|
|
|
|
{
|
|
|
|
S_ReturnChannel(chan);
|
|
|
|
}
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_RestoreEvictedChannels
|
|
|
|
//
|
|
|
|
// Restarts as many evicted channels as possible. Any channels that could
|
|
|
|
// not be started and are not looping are moved to the free pool.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_RestoreEvictedChannels()
|
|
|
|
{
|
|
|
|
// Restart channels in the same order they were originally played.
|
|
|
|
S_RestoreEvictedChannel(Channels);
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_UpdateSounds
|
|
|
|
//
|
|
|
|
// Updates music & sounds
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-09-06 11:49:09 +00:00
|
|
|
void S_UpdateSounds (AActor *listenactor)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
FVector3 pos, vel;
|
2008-09-06 11:49:09 +00:00
|
|
|
SoundListener listener;
|
2008-03-09 16:01:55 +00:00
|
|
|
|
|
|
|
I_UpdateMusic();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2010-09-29 21:10:20 +00:00
|
|
|
// [RH] Update music and/or playlist. IsPlaying() must be called
|
2008-05-01 21:45:22 +00:00
|
|
|
// to attempt to reconnect to broken net streams and to advance the
|
|
|
|
// playlist when the current song finishes.
|
|
|
|
if (mus_playing.handle != NULL &&
|
2010-09-29 21:10:20 +00:00
|
|
|
!mus_playing.handle->IsPlaying() &&
|
2008-05-01 21:45:22 +00:00
|
|
|
PlayList)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-25 16:19:31 +00:00
|
|
|
PlayList->Advance();
|
|
|
|
S_ActivatePlayList(false);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-09-06 11:49:09 +00:00
|
|
|
// should never happen
|
|
|
|
S_SetListener(listener, listenactor);
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
if ((chan->ChanFlags & (CHAN_EVICTED | CHAN_IS3D)) == CHAN_IS3D)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
CalcPosVel(chan, &pos, &vel);
|
2008-09-15 23:47:00 +00:00
|
|
|
GSnd->UpdateSoundParams3D(&listener, chan, !!(chan->ChanFlags & CHAN_AREA), pos, vel);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
chan->ChanFlags &= ~CHAN_JUSTSTARTED;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-03-25 16:19:31 +00:00
|
|
|
SN_UpdateActiveSequences();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-09-06 11:49:09 +00:00
|
|
|
|
|
|
|
GSnd->UpdateListener(&listener);
|
2008-03-25 16:19:31 +00:00
|
|
|
GSnd->UpdateSounds();
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
2008-07-06 17:32:31 +00:00
|
|
|
if (level.time >= RestartEvictionsAt)
|
|
|
|
{
|
|
|
|
RestartEvictionsAt = 0;
|
|
|
|
S_RestoreEvictedChannels();
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-09-06 11:49:09 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Sets the internal listener structure
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
static void S_SetListener(SoundListener &listener, AActor *listenactor)
|
|
|
|
{
|
|
|
|
if (listenactor != NULL)
|
|
|
|
{
|
|
|
|
listener.angle = (float)(listenactor->angle) * ((float)PI / 2147483648.f);
|
|
|
|
/*
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- 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.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
listener.velocity.X = listenactor->velx * (TICRATE/65536.f);
|
|
|
|
listener.velocity.Y = listenactor->velz * (TICRATE/65536.f);
|
|
|
|
listener.velocity.Z = listenactor->vely * (TICRATE/65536.f);
|
2008-09-06 11:49:09 +00:00
|
|
|
*/
|
|
|
|
listener.velocity.Zero();
|
|
|
|
listener.position.X = FIXED2FLOAT(listenactor->x);
|
2010-03-19 07:33:05 +00:00
|
|
|
listener.position.Y = FIXED2FLOAT(listenactor->z);
|
|
|
|
listener.position.Z = FIXED2FLOAT(listenactor->y);
|
2008-09-06 11:49:09 +00:00
|
|
|
listener.underwater = listenactor->waterlevel == 3;
|
2008-09-06 17:07:27 +00:00
|
|
|
assert(zones != NULL);
|
|
|
|
listener.Environment = zones[listenactor->Sector->ZoneNumber].Environment;
|
2008-09-06 11:49:09 +00:00
|
|
|
listener.valid = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
listener.angle = 0;
|
|
|
|
listener.position.Zero();
|
|
|
|
listener.velocity.Zero();
|
2008-09-06 17:07:27 +00:00
|
|
|
listener.underwater = false;
|
|
|
|
listener.Environment = NULL;
|
2008-09-06 11:49:09 +00:00
|
|
|
listener.valid = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-15 23:47:00 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_GetRolloff
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-09-23 21:41:49 +00:00
|
|
|
float S_GetRolloff(FRolloffInfo *rolloff, float distance, bool logarithmic)
|
2008-09-15 23:47:00 +00:00
|
|
|
{
|
|
|
|
if (rolloff == NULL)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (distance <= rolloff->MinDistance)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (rolloff->RolloffType == ROLLOFF_Log)
|
|
|
|
{ // Logarithmic rolloff has no max distance where it goes silent.
|
|
|
|
return rolloff->MinDistance / (rolloff->MinDistance + rolloff->RolloffFactor * (distance - rolloff->MinDistance));
|
|
|
|
}
|
|
|
|
if (distance >= rolloff->MaxDistance)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float volume = (rolloff->MaxDistance - distance) / (rolloff->MaxDistance - rolloff->MinDistance);
|
|
|
|
if (rolloff->RolloffType == ROLLOFF_Custom && S_SoundCurve != NULL)
|
|
|
|
{
|
|
|
|
volume = S_SoundCurve[int(S_SoundCurveSize * (1 - volume))] / 127.f;
|
|
|
|
}
|
2008-09-23 21:41:49 +00:00
|
|
|
if (logarithmic)
|
2008-09-15 23:47:00 +00:00
|
|
|
{
|
2008-09-23 21:41:49 +00:00
|
|
|
if (rolloff->RolloffType == ROLLOFF_Linear)
|
|
|
|
{
|
|
|
|
return volume;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return float((powf(10.f, volume) - 1.) / 9.);
|
|
|
|
}
|
2008-09-15 23:47:00 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-09-23 21:41:49 +00:00
|
|
|
if (rolloff->RolloffType == ROLLOFF_Linear)
|
|
|
|
{
|
|
|
|
return float(log10(9. * volume + 1.));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return volume;
|
|
|
|
}
|
2008-09-15 23:47:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_ChannelEnded (callback for sound interface code)
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_ChannelEnded(FISoundChannel *ichan)
|
|
|
|
{
|
|
|
|
FSoundChan *schan = static_cast<FSoundChan*>(ichan);
|
|
|
|
bool evicted;
|
|
|
|
|
|
|
|
if (schan != NULL)
|
|
|
|
{
|
|
|
|
// If the sound was stopped with GSnd->StopSound(), then we know
|
|
|
|
// it wasn't evicted. Otherwise, if it's looping, it must have
|
|
|
|
// been evicted. If it's not looping, then it was evicted if it
|
|
|
|
// didn't reach the end of its playback.
|
|
|
|
if (schan->ChanFlags & CHAN_FORGETTABLE)
|
|
|
|
{
|
|
|
|
evicted = false;
|
|
|
|
}
|
|
|
|
else if (schan->ChanFlags & (CHAN_LOOP | CHAN_EVICTED))
|
|
|
|
{
|
|
|
|
evicted = true;
|
|
|
|
}
|
2010-01-16 07:38:12 +00:00
|
|
|
else
|
2008-10-19 22:24:34 +00:00
|
|
|
{
|
2008-09-15 23:47:00 +00:00
|
|
|
unsigned int pos = GSnd->GetPosition(schan);
|
2010-01-16 07:38:12 +00:00
|
|
|
unsigned int len = GSnd->GetSampleLength(S_sfx[schan->SoundID].data);
|
2008-09-15 23:47:00 +00:00
|
|
|
if (pos == 0)
|
|
|
|
{
|
|
|
|
evicted = !!(schan->ChanFlags & CHAN_JUSTSTARTED);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
evicted = (pos < len);
|
|
|
|
}
|
|
|
|
}
|
2010-01-16 07:38:12 +00:00
|
|
|
/*
|
2008-10-19 22:24:34 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
evicted = false;
|
|
|
|
}
|
2010-01-16 07:38:12 +00:00
|
|
|
*/
|
2008-09-15 23:47:00 +00:00
|
|
|
if (!evicted)
|
|
|
|
{
|
|
|
|
S_ReturnChannel(schan);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
schan->ChanFlags |= CHAN_EVICTED;
|
|
|
|
schan->SysChannel = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-11-04 07:29:25 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_ChannelVirtualChanged (callback for sound interface code)
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_ChannelVirtualChanged(FISoundChannel *ichan, bool is_virtual)
|
|
|
|
{
|
|
|
|
FSoundChan *schan = static_cast<FSoundChan*>(ichan);
|
|
|
|
if (is_virtual)
|
|
|
|
{
|
|
|
|
schan->ChanFlags |= CHAN_VIRTUAL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
schan->ChanFlags &= ~CHAN_VIRTUAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-09-15 23:47:00 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_StopChannel
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_StopChannel(FSoundChan *chan)
|
|
|
|
{
|
|
|
|
if (chan == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (chan->SysChannel != NULL)
|
|
|
|
{
|
|
|
|
// S_EvictAllChannels() will set the CHAN_EVICTED flag to indicate
|
|
|
|
// that it wants to keep all the channel information around.
|
|
|
|
if (!(chan->ChanFlags & CHAN_EVICTED))
|
|
|
|
{
|
|
|
|
chan->ChanFlags |= CHAN_FORGETTABLE;
|
2009-10-30 11:18:39 +00:00
|
|
|
if (chan->SourceType == SOURCE_Actor)
|
|
|
|
{
|
|
|
|
chan->Actor = NULL;
|
|
|
|
}
|
2008-09-15 23:47:00 +00:00
|
|
|
}
|
|
|
|
GSnd->StopChannel(chan);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
S_ReturnChannel(chan);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-06-15 17:17:31 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
// (FArchive &) << (FSoundID &)
|
2008-06-15 17:17:31 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
FArchive &operator<<(FArchive &arc, FSoundID &sid)
|
|
|
|
{
|
|
|
|
if (arc.IsStoring())
|
|
|
|
{
|
|
|
|
arc.WriteName((const char *)sid);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sid = arc.ReadName();
|
|
|
|
}
|
|
|
|
return arc;
|
|
|
|
}
|
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// (FArchive &) << (FSoundChan &)
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
static FArchive &operator<<(FArchive &arc, FSoundChan &chan)
|
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
arc << chan.SourceType;
|
|
|
|
switch (chan.SourceType)
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
{
|
2008-07-04 16:54:29 +00:00
|
|
|
case SOURCE_None: break;
|
|
|
|
case SOURCE_Actor: arc << chan.Actor; break;
|
|
|
|
case SOURCE_Sector: arc << chan.Sector; break;
|
|
|
|
case SOURCE_Polyobj: arc << chan.Poly; break;
|
|
|
|
case SOURCE_Unattached: arc << chan.Point[0] << chan.Point[1] << chan.Point[2]; break;
|
|
|
|
default: I_Error("Unknown sound source type %d\n", chan.SourceType); break;
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- 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.
- 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.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
arc << chan.SoundID
|
|
|
|
<< chan.OrgID
|
|
|
|
<< chan.Volume
|
|
|
|
<< chan.DistanceScale
|
|
|
|
<< chan.Pitch
|
|
|
|
<< chan.ChanFlags
|
|
|
|
<< chan.EntChannel
|
|
|
|
<< chan.Priority
|
|
|
|
<< chan.NearLimit
|
|
|
|
<< chan.StartTime
|
|
|
|
<< chan.Rolloff.RolloffType
|
|
|
|
<< chan.Rolloff.MinDistance
|
- version bump to 1.2.0.
- fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct.
- fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright.
Update to ZDoom r1456 (2.3.0 plus one additional fix):
- Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true
floor and ceiling heights. Otherwise the actor will fall right through
3DMidtex textures (and 3D-floors.)
- Fixed: The TeleporterBeacon tried to enter its See state rather than its
Drop state. Also changed it to fade out when it's done rather than
disappearing abruptly.
- Fixed: Strife's quest based line actions also work in Deathmatch.
- Fixed: Gravity application was not correct. For actors with no vertical
momentum the initial pull is supposed to be twice as strong as when
vertical movement already takes place.
- added invquery CCMD like in Strife. Also removed all underscores from the
tag strings so that they can be printed properly.
- Fixed: Skill baby was missing 'autousehealth' for all games.
- Added a new CVAR: sv_disableautohealth
- Autouse of health items is no longer hardwired to the default item classes.
There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small
Raven health item, 2 a large Raven health item and 3 a Strife item.
- Removed an early-out in wallscan_striped() that is invalid when drawing a
skybox.
- fixed: nextmap and nextsecret CCMDs set skill to 0.
- fixed: level.flags2 was not stored in savegames. Also bumped min. savegame
version and removed old compatibility handlings.
- 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.
- Removed the delay for starting all sounds from one tic at exactly the same
DSP position. Without also synchronizing the stopping of sounds, it can
cause problems with things like the chainsaw where the sound is stopped and
immediately restarted, causing occassional gaps between the stopping of the
sound and the starting of the new one. (I added the start synchronization to
combat flanging of paired moving polyobjects when moving around, but I think
just removing velocity from the player for sound calculations takes care of
that well enough.)
- Added GCC headers for intptr_t to tarray.h.
- Added MF5_PAINLESS flag for projectiles that don't make the target go into
the pain state.
- Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space-
efficient.
- Fixed: player->oldbuttons was copied from the current button set at the end
of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput.
- Fixed: The map name display on the automap was incomplete.
- Added FakeInventory.Respawns DECORATe property
- Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the
conversation by pressing Escape.
- added ML_BLOCKPROJECTILE flag to lines.
- Fixed: With opl_onechip set the second OPL chip was never set to anything valid
so it contained an invalid pointer. There were also a few other places that
simply assumed that the second chip is set to something valid.
- Fixed: NPCs which are engaged in a conversation should not move.
- Fixed: Player movement animation was not stopped when starting a conversation.
- Added selective compression of network packets. Interestingly, most packets
don't actually compress all that well, even the ones that aren't too short
to possibly compress. (Maybe make the whole thing one long, never-ending
zlib data stream with Z_SYNC_FLUSH used to chunk things at packet
boundaries? That would probably help the compression ratio, but it would
require changing the way the netcode determines sequence, which would be
a much more invasive change.)
- Fixed: Heretic's fullscreen HUD crashed when the player had armor without
a valid icon.
- Fixed: The StrifePlayer was missing a RunHealth setting.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
|
|
|
<< chan.Rolloff.MaxDistance
|
|
|
|
<< chan.LimitRange;
|
2009-02-08 23:01:13 +00:00
|
|
|
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
return arc;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_SerializeSounds
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_SerializeSounds(FArchive &arc)
|
|
|
|
{
|
|
|
|
FSoundChan *chan;
|
|
|
|
|
2008-07-04 16:54:29 +00:00
|
|
|
GSnd->Sync(true);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
|
|
|
|
if (arc.IsStoring())
|
|
|
|
{
|
|
|
|
TArray<FSoundChan *> chans;
|
|
|
|
|
|
|
|
// Count channels and accumulate them so we can store them in
|
|
|
|
// reverse order. That way, they will be in the same order when
|
|
|
|
// reloaded later as they are now.
|
|
|
|
for (chan = Channels; chan != NULL; chan = chan->NextChan)
|
|
|
|
{
|
|
|
|
// If the sound is forgettable, this is as good a time as
|
2008-07-06 17:32:31 +00:00
|
|
|
// any to forget about it. And if it's a UI sound, it shouldn't
|
|
|
|
// be stored in the savegame.
|
|
|
|
if (!(chan->ChanFlags & (CHAN_FORGETTABLE | CHAN_UI)))
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
{
|
|
|
|
chans.Push(chan);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
arc.WriteCount(chans.Size());
|
|
|
|
|
|
|
|
for (unsigned int i = chans.Size(); i-- != 0; )
|
|
|
|
{
|
|
|
|
// Replace start time with sample position.
|
|
|
|
QWORD start = chans[i]->StartTime.AsOne;
|
|
|
|
chans[i]->StartTime.AsOne = GSnd ? GSnd->GetPosition(chans[i]) : 0;
|
|
|
|
arc << *chans[i];
|
|
|
|
chans[i]->StartTime.AsOne = start;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
unsigned int count;
|
|
|
|
|
|
|
|
S_StopAllChannels();
|
|
|
|
count = arc.ReadCount();
|
|
|
|
for (unsigned int i = 0; i < count; ++i)
|
|
|
|
{
|
2008-09-15 23:47:00 +00:00
|
|
|
chan = (FSoundChan*)S_GetChannel(NULL);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
arc << *chan;
|
|
|
|
// Sounds always start out evicted when restored from a save.
|
2008-07-06 17:32:31 +00:00
|
|
|
chan->ChanFlags |= CHAN_EVICTED | CHAN_ABSTIME;
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
2008-07-06 17:32:31 +00:00
|
|
|
// The two tic delay is to make sure any screenwipes have finished.
|
|
|
|
// This needs to be two because the game is run for one tic before
|
|
|
|
// the wipe so that it can produce a screen to wipe to. So if we
|
|
|
|
// only waited one tic to restart the sounds, they would start
|
|
|
|
// playing before the wipe, and depending on the synchronization
|
|
|
|
// between the main thread and the mixer thread at the time, the
|
|
|
|
// sounds might be heard briefly before pausing for the wipe.
|
|
|
|
RestartEvictionsAt = level.time + 2;
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
|
|
|
DSeqNode::SerializeSequences(arc);
|
2008-07-04 16:54:29 +00:00
|
|
|
GSnd->Sync(false);
|
|
|
|
GSnd->UpdateSounds();
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
}
|
2008-06-15 17:17:31 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_ActivatePlayList
|
|
|
|
//
|
|
|
|
// Plays the next song in the playlist. If no songs in the playlist can be
|
|
|
|
// played, then it is deleted.
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_ActivatePlayList (bool goBack)
|
|
|
|
{
|
|
|
|
int startpos, pos;
|
|
|
|
|
|
|
|
startpos = pos = PlayList->GetPosition ();
|
|
|
|
S_StopMusic (true);
|
|
|
|
while (!S_ChangeMusic (PlayList->GetSong (pos), 0, false, true))
|
|
|
|
{
|
|
|
|
pos = goBack ? PlayList->Backup () : PlayList->Advance ();
|
|
|
|
if (pos == startpos)
|
|
|
|
{
|
|
|
|
delete PlayList;
|
|
|
|
PlayList = NULL;
|
|
|
|
Printf ("Cannot play anything in the playlist.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_ChangeCDMusic
|
|
|
|
//
|
|
|
|
// Starts a CD track as music.
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
bool S_ChangeCDMusic (int track, unsigned int id, bool looping)
|
|
|
|
{
|
|
|
|
char temp[32];
|
|
|
|
|
Update to ZDoom r1083. Not fully tested yet!
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code.
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@138 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-23 18:35:55 +00:00
|
|
|
if (id != 0)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
Update to ZDoom r1083. Not fully tested yet!
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code.
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@138 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-23 18:35:55 +00:00
|
|
|
mysnprintf (temp, countof(temp), ",CD,%d,%x", track, id);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Update to ZDoom r1083. Not fully tested yet!
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code.
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@138 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-23 18:35:55 +00:00
|
|
|
mysnprintf (temp, countof(temp), ",CD,%d", track);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
return S_ChangeMusic (temp, 0, looping);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_StartMusic
|
|
|
|
//
|
|
|
|
// Starts some music with the given name.
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
bool S_StartMusic (const char *m_id)
|
|
|
|
{
|
|
|
|
return S_ChangeMusic (m_id, 0, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_ChangeMusic
|
|
|
|
//
|
|
|
|
// Starts playing a music, possibly looping.
|
|
|
|
//
|
|
|
|
// [RH] If music is a MOD, starts it at position order. If name is of the
|
|
|
|
// format ",CD,<track>,[cd id]" song is a CD track, and if [cd id] is
|
|
|
|
// specified, it will only be played if the specified CD is in a drive.
|
|
|
|
//==========================================================================
|
|
|
|
|
2009-06-04 13:59:08 +00:00
|
|
|
TArray<BYTE> musiccache;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
|
|
|
{
|
|
|
|
if (!force && PlayList)
|
|
|
|
{ // Don't change if a playlist is active
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// allow specifying "*" as a placeholder to play the level's default music.
|
|
|
|
if (musicname != NULL && !strcmp(musicname, "*"))
|
|
|
|
{
|
|
|
|
if (gamestate == GS_LEVEL || gamestate == GS_TITLELEVEL)
|
|
|
|
{
|
2009-02-05 00:06:30 +00:00
|
|
|
musicname = level.Music;
|
2008-01-27 11:25:03 +00:00
|
|
|
order = level.musicorder;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
musicname = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (musicname == NULL || musicname[0] == 0)
|
|
|
|
{
|
|
|
|
// Don't choke if the map doesn't have a song attached
|
|
|
|
S_StopMusic (true);
|
Update to ZDoom r1585:
- Added ACS GetChar function.
- Added Gez's submission for polyobjects being able to crush corpses but made
it an explicit MAPINFO option only.
- Changed APlayerPawn::DamageFade to a PalEntry from 3 floats.
- Removed #pragma warnings from cmdlib.h and fixed the places where they were
still triggered.
These #pragmas were responsible for >90% of the GCC warnings that were not
listed in VC++.
- Fixed one bug in the process: DSeqNode::m_Atten was never adjusted when the
parameter handling of the sound functions for attenuation was changed.
Changed m_Atten to a float and fixed the SNDSEQ parser to set proper values.
Also added the option to specify attenuation with direct values in addition
to the predefined names.
- fixed a few Heretic actors:
* The pod generator's attacksound was wrong
* The teleglitter generators need different flags if they are supposed to work
with z-aware spawning of the glitter.
* The knight's axes need the THRUGHOST flag.
- Fixed non-POD passing in G_BuildSaveName() and other things GCC warned
about.
- Added support for imploded zips.
- Fixed: Some missile spawning functions ignored the FastSpeed setting.
- Fixed: P_CheckSwitchRange tried to access a line's backsector without
checking if it is valid.
- Fixed: Fast projectile could not be frozen by the Time freezer.
- Added several new ACS functions: GetActorMomX/Y/Z, GetActorViewHeight,
SetActivator, SetActivatorToTarget.
- Added Species property for actors and separated Hexen's Demon1 and Demon2
into different species.
- Added handling for UDMF user keys.
- Added support for ACS functions that can be defined without recompiling ACC.
- Fixed: The short lump name for embedded files must be cleared so that they
are not found by a normal lump search.
- Added AProp_Notarget actor property.
- Fixed: TraceBleed was missing a NULL pointer check,
- Fixed: P_RandomChaseDir could crash for friendly monsters that belong to
a player which left the game.
- Changed A_PodGrow so that it plays the generator's attack sound instead of
"misc/podgrow".
- Added transference of a select few flags from PowerProtection to its owner.
- Added actor type parameters to A_PodPain() and A_MakePod().
- The savegame path is now passed through NicePath(), since it's user-
specifiable.
- Added save_dir cvar. When non-empty, it controls where savegames go.
- SBARINFO update:
* Added the ability to center things with fullscreenoffsets enabled. Due
to some limitations the syntax is [-]<integer> [+ center].
* Fixed: the translucent flag on drawinventorybar didn't work quite right.
* Fixed: Extremely minor inaccuracy in the Doom SBarInfo code. The
fullscreen inventory bar wasn't scaled correctly.
- fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines.
- Added more compatibility settings, submitted by Gez.
- 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.
- Fixed: Completely empty patches (8 0-bytes) could not be handled by the
texture manager. They now get assigned a new FEmptyTexture object
that is just a 1x1 pixel transparent texture.
- Fixed: Multiple namespace markers of the same type were no longer detected.
- Fixed sprite renaming.
- Maps defined with Hexen-style MAPINFOs now run their scripts in the proper
order.
- Fixed: FWadCollection::CheckNumForName() read the lump each iteration before
checking for the end marker. On 32-bit systems, this is -1, but on 64-bit
systems, it is a very large integer that is highly unlikely to be in mapped
memory.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@325 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-15 18:02:01 +00:00
|
|
|
mus_playing.name = "";
|
2010-06-13 13:33:27 +00:00
|
|
|
LastSong = "";
|
2010-04-05 09:24:43 +00:00
|
|
|
return true;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2009-02-08 23:01:13 +00:00
|
|
|
|
|
|
|
FString DEH_Music;
|
|
|
|
if (musicname[0] == '$')
|
|
|
|
{
|
|
|
|
// handle dehacked replacement.
|
|
|
|
// Any music name defined this way needs to be prefixed with 'D_' because
|
|
|
|
// Doom.exe does not contain the prefix so these strings don't either.
|
|
|
|
const char * mus_string = GStrings[musicname+1];
|
|
|
|
if (mus_string != NULL)
|
|
|
|
{
|
|
|
|
DEH_Music << "D_" << mus_string;
|
|
|
|
musicname = DEH_Music;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-25 12:10:12 +00:00
|
|
|
if (!mus_playing.name.IsEmpty() &&
|
|
|
|
mus_playing.handle != NULL &&
|
|
|
|
stricmp (mus_playing.name, musicname) == 0 &&
|
|
|
|
mus_playing.handle->m_Looping == looping)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (order != mus_playing.baseorder)
|
|
|
|
{
|
2008-08-04 19:46:35 +00:00
|
|
|
if (mus_playing.handle->SetSubsong(order))
|
|
|
|
{
|
|
|
|
mus_playing.baseorder = order;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2012-03-22 23:28:47 +00:00
|
|
|
else if (!mus_playing.handle->IsPlaying())
|
|
|
|
{
|
|
|
|
mus_playing.handle->Play(looping, order);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strnicmp (musicname, ",CD,", 4) == 0)
|
|
|
|
{
|
|
|
|
int track = strtoul (musicname+4, NULL, 0);
|
|
|
|
const char *more = strchr (musicname+4, ',');
|
|
|
|
unsigned int id = 0;
|
|
|
|
|
|
|
|
if (more != NULL)
|
|
|
|
{
|
|
|
|
id = strtoul (more+1, NULL, 16);
|
|
|
|
}
|
|
|
|
S_StopMusic (true);
|
|
|
|
mus_playing.handle = I_RegisterCDSong (track, id);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int lumpnum = -1;
|
- Fixed: The hitscan tracer had the current sector point to a temporary variable
when 3D floors were involved.
Update to ZDoom r965:
- Fixed: SPAC_AnyCross didn't work.
- Fixed: Pushable doors must also check for SPAC_MPush.
- Fixed: P_LoadThings2 did not adjust the byte order for the thingid field.
- Changed: HIRESTEX 'define' textures now replace existing textures
of type MiscPatch with the same name.
- Added UDMF line trigger types MonsterUse and MonsterPush.
- Separated skill and class filter bits from FMapThing::flags so that
UDMF can define up to 16 of each. Also separated easy/baby and
hard/nightmare and changed default MAPINFO definitions.
- Fixed: FWadCollection::MergeLumps() did not initialize the flags for any
marker lumps it inserted.
- Fixed: Need write barriers when modifying SequenceListHead.
- Added a new cvar: midi_timiditylike. This re-enables TiMidity handling of
GUS patch flags, envelopes, and volume levels, while trying to be closer
to TiMidity++ than original TiMidity.
- Renamed timidity_config and timidity_voices to midi_config and midi_voices
respectively.
- Changed: Crosshair drawing uses the current player class's default health instead
of 100 to calculate the color for the crosshair.
- Added SECF_NOFALLINGDAMAGE flag plus Sector_ChangeFlags to set it. Also separated
all user settable flags from MoreFlags into their own Flags variable.
- Reduced volume, expression, and panning controllers back to 7 bits.
- Added very basic Soundfont support to the internal TiMidity. Things missing:
filter, LFOs, modulation envelope, chorus, reverb, and modulators. May or
may not be compatible with TiMidity++'s soundfont extensions.
- Changed all thing coordinates that were stored as shorts into fixed_t.
- Separated mapthing2_t into mapthinghexen_t and the internal FMapThing so
that it is easier to add new features in the UDMF map format.
- Added some initial code to read UDMF maps.
- Added support for quoted strings to the TiMidity config parser.
- Split off the slope creation code from p_Setup.cpp into its own file.
- Separated the linedef activation types into a bit mask that allows combination
of all types on the same linedef. Also added a 'first side only' flag. This
is not usable from Hexen or Doom format maps though but in preparation of
the UDMF format discussed here:
http://www.doomworld.com/vb/source-ports/43145-udmf-v0-99-specification-draft-aka-textmap/
- Changed linedef's alpha property from a byte to fixed point after seeing that
255 wasn't handled to be fully opaque.
- fixed a GCC warning in fmodsound.cpp
- Fixed: Warped textures didn't work anymore because the default speed was 0.
- Fixed: I had instrument vibrato setting the tremolo_sweep_increment value
in the instrument loader, effectively disabling vibrato.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@103 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-12 09:58:47 +00:00
|
|
|
int offset = 0, length = 0;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
int device = MDEV_DEFAULT;
|
2008-08-04 19:46:35 +00:00
|
|
|
MusInfo *handle = NULL;
|
2010-11-08 23:45:55 +00:00
|
|
|
FName musicasname = musicname;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2010-11-08 23:45:55 +00:00
|
|
|
FName *aliasp = MusicAliases.CheckKey(musicasname);
|
|
|
|
if (aliasp != NULL)
|
|
|
|
{
|
|
|
|
musicname = (musicasname = *aliasp).GetChars();
|
|
|
|
if (musicasname == NAME_None) return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
int *devp = MidiDevices.CheckKey(musicasname);
|
2008-01-27 11:25:03 +00:00
|
|
|
if (devp != NULL) device = *devp;
|
|
|
|
|
2008-05-01 21:45:22 +00:00
|
|
|
// Strip off any leading file:// component.
|
|
|
|
if (strncmp(musicname, "file://", 7) == 0)
|
|
|
|
{
|
|
|
|
musicname += 7;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
if (!FileExists (musicname))
|
|
|
|
{
|
2008-03-30 08:34:44 +00:00
|
|
|
if ((lumpnum = Wads.CheckNumForFullName (musicname, true, ns_music)) == -1)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-05-01 21:45:22 +00:00
|
|
|
if (strstr(musicname, "://") > musicname)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-05-01 21:45:22 +00:00
|
|
|
// Looks like a URL; try it as such.
|
|
|
|
handle = I_RegisterURLSong(musicname);
|
|
|
|
if (handle == NULL)
|
|
|
|
{
|
|
|
|
Printf ("Could not open \"%s\"\n", musicname);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Printf ("Music \"%s\" not found\n", musicname);
|
2008-01-27 11:25:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2008-05-01 21:45:22 +00:00
|
|
|
if (handle == NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-05-01 21:45:22 +00:00
|
|
|
if (!Wads.IsUncompressedFile(lumpnum))
|
2008-03-25 16:19:31 +00:00
|
|
|
{
|
2008-05-01 21:45:22 +00:00
|
|
|
// We must cache the music data and use it from memory.
|
|
|
|
|
|
|
|
// shut down old music before reallocating and overwriting the cache!
|
|
|
|
S_StopMusic (true);
|
|
|
|
|
|
|
|
offset = -1; // this tells the low level code that the music
|
|
|
|
// is being used from memory
|
|
|
|
length = Wads.LumpLength (lumpnum);
|
|
|
|
if (length == 0)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
musiccache.Resize(length);
|
|
|
|
Wads.ReadLump(lumpnum, &musiccache[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
offset = Wads.GetLumpOffset (lumpnum);
|
|
|
|
length = Wads.LumpLength (lumpnum);
|
|
|
|
if (length == 0)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2008-03-25 16:19:31 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// shutdown old music
|
|
|
|
S_StopMusic (true);
|
|
|
|
|
2008-03-28 09:56:50 +00:00
|
|
|
// Just record it if volume is 0
|
|
|
|
if (snd_musicvolume <= 0)
|
|
|
|
{
|
|
|
|
mus_playing.loop = looping;
|
2012-06-09 18:04:07 +00:00
|
|
|
mus_playing.name = musicname;
|
2008-08-04 19:46:35 +00:00
|
|
|
mus_playing.baseorder = order;
|
2008-03-28 09:56:50 +00:00
|
|
|
LastSong = musicname;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// load & register it
|
2008-05-01 21:45:22 +00:00
|
|
|
if (handle != NULL)
|
|
|
|
{
|
|
|
|
mus_playing.handle = handle;
|
|
|
|
}
|
|
|
|
else if (offset != -1)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
mus_playing.handle = I_RegisterSong (lumpnum != -1 ?
|
|
|
|
Wads.GetWadFullName (Wads.GetLumpFile (lumpnum)) :
|
|
|
|
musicname, NULL, offset, length, device);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mus_playing.handle = I_RegisterSong (NULL, &musiccache[0], -1, length, device);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mus_playing.loop = looping;
|
2008-03-28 09:56:50 +00:00
|
|
|
mus_playing.name = musicname;
|
2008-08-04 19:46:35 +00:00
|
|
|
mus_playing.baseorder = 0;
|
2008-03-28 09:56:50 +00:00
|
|
|
LastSong = "";
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (mus_playing.handle != 0)
|
|
|
|
{ // play it
|
2010-09-29 21:10:20 +00:00
|
|
|
mus_playing.handle->Start(looping, S_GetMusicVolume (musicname), order);
|
2008-08-04 19:46:35 +00:00
|
|
|
mus_playing.baseorder = order;
|
2008-01-27 11:25:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_RestartMusic
|
|
|
|
//
|
|
|
|
// Must only be called from snd_reset in i_sound.cpp!
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_RestartMusic ()
|
|
|
|
{
|
|
|
|
if (!LastSong.IsEmpty())
|
|
|
|
{
|
2008-03-28 09:56:50 +00:00
|
|
|
FString song = LastSong;
|
2008-01-27 11:25:03 +00:00
|
|
|
LastSong = "";
|
2008-03-28 09:56:50 +00:00
|
|
|
S_ChangeMusic (song, mus_playing.baseorder, mus_playing.loop, true);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-12 09:08:10 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_MIDIDeviceChanged
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_MIDIDeviceChanged()
|
|
|
|
{
|
|
|
|
if (mus_playing.handle != NULL && mus_playing.handle->IsMIDI())
|
|
|
|
{
|
|
|
|
mus_playing.handle->Stop();
|
|
|
|
mus_playing.handle->Start(mus_playing.loop, -1, mus_playing.baseorder);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_GetMusic
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
int S_GetMusic (char **name)
|
|
|
|
{
|
|
|
|
int order;
|
|
|
|
|
|
|
|
if (mus_playing.name)
|
|
|
|
{
|
|
|
|
*name = copystring (mus_playing.name);
|
|
|
|
order = mus_playing.baseorder;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*name = NULL;
|
|
|
|
order = 0;
|
|
|
|
}
|
|
|
|
return order;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// S_StopMusic
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void S_StopMusic (bool force)
|
|
|
|
{
|
|
|
|
// [RH] Don't stop if a playlist is active.
|
|
|
|
if ((force || PlayList == NULL) && !mus_playing.name.IsEmpty())
|
|
|
|
{
|
2010-09-29 21:10:20 +00:00
|
|
|
if (mus_playing.handle != NULL)
|
|
|
|
{
|
|
|
|
if (MusicPaused)
|
|
|
|
mus_playing.handle->Resume();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2010-09-29 21:10:20 +00:00
|
|
|
mus_playing.handle->Stop();
|
|
|
|
delete mus_playing.handle;
|
|
|
|
mus_playing.handle = NULL;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
LastSong = mus_playing.name;
|
|
|
|
mus_playing.name = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD playsound
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (playsound)
|
|
|
|
{
|
|
|
|
if (argv.argc() > 1)
|
|
|
|
{
|
* Updated to ZDoom r3350:
- 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 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.
- Fixed: Line type 49 was wrong for all games. Fixed by adding a new Ceiling_CrushAndRaiseDist special.
- Fixed: If an episode skips the skill menu, it should also skip the confirm skill menu if the default skill requests confirmation.
- Fixed: Episodes with NoSkillMenu defined had their own idea of default skill that differed from episodes with skill menus (and completely ignored whichever skill is explicitly defined as the default skill).
- Remove all restrictions on what you can do with tags as line special arguments in xlat. Something like 「(tag & 5) + (tag & 2) / 2」 is now a valid argument for a standard line translation.
- Added modulus to FParseContext/xlat.
- Fixed: Division of tag arguments for xlat was in the wrong order.
- Added more tag operators for xlat: * / & | ^
- Improve tag support for xlat: Any combination of arguments can now be tags, and you can add (or subtract) a constant to them. If you do wish to add a constant, tag must come first. e.g. tag+3 is good, but 3+tag will not work. (As a bonus, the parser is simpler, too.)
- Fixed: Totally freezing a player did not ignore crouch toggling.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1283 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:02:36 +00:00
|
|
|
FSoundID id = argv[1];
|
|
|
|
if (id == 0)
|
|
|
|
{
|
|
|
|
Printf("'%s' is not a sound\n", argv[1]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
S_Sound (CHAN_AUTO | CHAN_UI, id, 1.f, ATTN_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD loopsound
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (loopsound)
|
|
|
|
{
|
|
|
|
if (players[consoleplayer].mo != NULL && !netgame && argv.argc() > 1)
|
|
|
|
{
|
|
|
|
FSoundID id = argv[1];
|
|
|
|
if (id == 0)
|
|
|
|
{
|
|
|
|
Printf("'%s' is not a sound\n", argv[1]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
AActor *icon = Spawn("SpeakerIcon", players[consoleplayer].mo->x,
|
|
|
|
players[consoleplayer].mo->y,
|
|
|
|
players[consoleplayer].mo->z + 32*FRACUNIT,
|
|
|
|
ALLOW_REPLACE);
|
|
|
|
if (icon != NULL)
|
|
|
|
{
|
|
|
|
S_Sound(icon, CHAN_BODY | CHAN_LOOP, id, 1.f, ATTN_IDLE);
|
|
|
|
}
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD idmus
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (idmus)
|
|
|
|
{
|
|
|
|
level_info_t *info;
|
Update to ZDoom r1083. Not fully tested yet!
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code.
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@138 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-23 18:35:55 +00:00
|
|
|
FString map;
|
2008-01-27 11:25:03 +00:00
|
|
|
int l;
|
|
|
|
|
2010-10-06 08:03:11 +00:00
|
|
|
if (!nomusic)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-10-06 08:03:11 +00:00
|
|
|
if (argv.argc() > 1)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-10-06 08:03:11 +00:00
|
|
|
if (gameinfo.flags & GI_MAPxx)
|
Update to ZDoom r1083. Not fully tested yet!
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code.
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@138 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-23 18:35:55 +00:00
|
|
|
{
|
2010-10-06 08:03:11 +00:00
|
|
|
l = atoi (argv[1]);
|
|
|
|
if (l <= 99)
|
|
|
|
{
|
|
|
|
map = CalcMapName (0, l);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Printf ("%s\n", GStrings("STSTR_NOMUS"));
|
|
|
|
return;
|
|
|
|
}
|
Update to ZDoom r1083. Not fully tested yet!
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code.
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@138 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-23 18:35:55 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
else
|
|
|
|
{
|
2010-10-06 08:03:11 +00:00
|
|
|
map = CalcMapName (argv[1][0] - '0', argv[1][1] - '0');
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2010-10-06 08:03:11 +00:00
|
|
|
if ( (info = FindLevelInfo (map)) )
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-10-06 08:03:11 +00:00
|
|
|
if (info->Music.IsNotEmpty())
|
|
|
|
{
|
|
|
|
S_ChangeMusic (info->Music, info->musicorder);
|
|
|
|
Printf ("%s\n", GStrings("STSTR_MUS"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Printf ("%s\n", GStrings("STSTR_NOMUS"));
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD changemus
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (changemus)
|
|
|
|
{
|
2010-10-06 08:03:11 +00:00
|
|
|
if (!nomusic)
|
|
|
|
{
|
|
|
|
if (argv.argc() > 1)
|
|
|
|
{
|
|
|
|
if (PlayList)
|
|
|
|
{
|
|
|
|
delete PlayList;
|
|
|
|
PlayList = NULL;
|
|
|
|
}
|
|
|
|
S_ChangeMusic (argv[1], argv.argc() > 2 ? atoi (argv[2]) : 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const char *currentmus = mus_playing.name.GetChars();
|
|
|
|
if(currentmus != NULL && *currentmus != 0)
|
|
|
|
{
|
|
|
|
Printf ("currently playing %s\n", currentmus);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Printf ("no music playing\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD stopmus
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (stopmus)
|
|
|
|
{
|
|
|
|
if (PlayList)
|
|
|
|
{
|
|
|
|
delete PlayList;
|
|
|
|
PlayList = NULL;
|
|
|
|
}
|
|
|
|
S_StopMusic (false);
|
2012-06-24 20:36:55 +00:00
|
|
|
LastSong = ""; // forget the last played song so that it won't get restarted if some volume changes occur
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD cd_play
|
|
|
|
//
|
|
|
|
// Plays a specified track, or the entire CD if no track is specified.
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (cd_play)
|
|
|
|
{
|
|
|
|
char musname[16];
|
|
|
|
|
|
|
|
if (argv.argc() == 1)
|
Update to ZDoom r1083. Not fully tested yet!
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code.
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@138 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-23 18:35:55 +00:00
|
|
|
{
|
2008-01-27 11:25:03 +00:00
|
|
|
strcpy (musname, ",CD,");
|
Update to ZDoom r1083. Not fully tested yet!
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code.
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@138 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-23 18:35:55 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
else
|
Update to ZDoom r1083. Not fully tested yet!
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code.
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@138 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-23 18:35:55 +00:00
|
|
|
{
|
|
|
|
mysnprintf (musname, countof(musname), ",CD,%d", atoi(argv[1]));
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
S_ChangeMusic (musname, 0, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD cd_stop
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (cd_stop)
|
|
|
|
{
|
|
|
|
CD_Stop ();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD cd_eject
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (cd_eject)
|
|
|
|
{
|
|
|
|
CD_Eject ();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD cd_close
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (cd_close)
|
|
|
|
{
|
|
|
|
CD_UnEject ();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD cd_pause
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (cd_pause)
|
|
|
|
{
|
|
|
|
CD_Pause ();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD cd_resume
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (cd_resume)
|
|
|
|
{
|
|
|
|
CD_Resume ();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD playlist
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (playlist)
|
|
|
|
{
|
|
|
|
int argc = argv.argc();
|
|
|
|
|
|
|
|
if (argc < 2 || argc > 3)
|
|
|
|
{
|
|
|
|
Printf ("playlist <playlist.m3u> [<position>|shuffle]\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (PlayList != NULL)
|
|
|
|
{
|
|
|
|
PlayList->ChangeList (argv[1]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PlayList = new FPlayList (argv[1]);
|
|
|
|
}
|
|
|
|
if (PlayList->GetNumSongs () == 0)
|
|
|
|
{
|
|
|
|
delete PlayList;
|
|
|
|
PlayList = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (argc == 3)
|
|
|
|
{
|
|
|
|
if (stricmp (argv[2], "shuffle") == 0)
|
|
|
|
{
|
|
|
|
PlayList->Shuffle ();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PlayList->SetPosition (atoi (argv[2]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
S_ActivatePlayList (false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD playlistpos
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
static bool CheckForPlaylist ()
|
|
|
|
{
|
|
|
|
if (PlayList == NULL)
|
|
|
|
{
|
|
|
|
Printf ("No playlist is playing.\n");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
CCMD (playlistpos)
|
|
|
|
{
|
|
|
|
if (CheckForPlaylist() && argv.argc() > 1)
|
|
|
|
{
|
|
|
|
PlayList->SetPosition (atoi (argv[1]) - 1);
|
|
|
|
S_ActivatePlayList (false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD playlistnext
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (playlistnext)
|
|
|
|
{
|
|
|
|
if (CheckForPlaylist())
|
|
|
|
{
|
|
|
|
PlayList->Advance ();
|
|
|
|
S_ActivatePlayList (false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD playlistprev
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (playlistprev)
|
|
|
|
{
|
|
|
|
if (CheckForPlaylist())
|
|
|
|
{
|
|
|
|
PlayList->Backup ();
|
|
|
|
S_ActivatePlayList (true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD playliststatus
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (playliststatus)
|
|
|
|
{
|
|
|
|
if (CheckForPlaylist ())
|
|
|
|
{
|
|
|
|
Printf ("Song %d of %d:\n%s\n",
|
|
|
|
PlayList->GetPosition () + 1,
|
|
|
|
PlayList->GetNumSongs (),
|
|
|
|
PlayList->GetSong (PlayList->GetPosition ()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CCMD cachesound <sound name>
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CCMD (cachesound)
|
|
|
|
{
|
|
|
|
if (argv.argc() < 2)
|
|
|
|
{
|
|
|
|
Printf ("Usage: cachesound <sound> ...\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
for (int i = 1; i < argv.argc(); ++i)
|
|
|
|
{
|
2008-06-15 17:17:31 +00:00
|
|
|
FSoundID sfxnum = argv[i];
|
|
|
|
if (sfxnum != 0)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
S_CacheSound (&S_sfx[sfxnum]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|