2006-02-24 04:48:15 +00:00
|
|
|
// Emacs style mode select -*- C++ -*-
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// 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:
|
|
|
|
// The not so system specific sound interface.
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __S_SOUND__
|
|
|
|
#define __S_SOUND__
|
|
|
|
|
2008-09-14 23:54:38 +00:00
|
|
|
#include "doomtype.h"
|
2008-09-15 18:18:04 +00:00
|
|
|
#include "i_soundinternal.h"
|
2008-10-26 17:06:47 +00:00
|
|
|
#include "dobject.h"
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
class AActor;
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
class FScanner;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// SoundFX struct.
|
|
|
|
//
|
|
|
|
struct sfxinfo_t
|
|
|
|
{
|
2008-03-21 05:13:59 +00:00
|
|
|
// Next field is for use by the system sound interface.
|
|
|
|
// A non-null data means the sound has been loaded.
|
2008-09-09 20:49:53 +00:00
|
|
|
SoundHandle data;
|
2008-03-21 05:13:59 +00:00
|
|
|
|
2007-02-04 00:33:17 +00:00
|
|
|
FString name; // [RH] Sound name defined in SNDINFO
|
2008-03-21 05:13:59 +00:00
|
|
|
int lumpnum; // lump number of sfx
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-03-21 05:13:59 +00:00
|
|
|
unsigned int next, index; // [RH] For hashing
|
2008-03-25 04:42:26 +00:00
|
|
|
float Volume;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-03-21 05:13:59 +00:00
|
|
|
BYTE PitchMask;
|
2008-03-30 08:32:44 +00:00
|
|
|
SWORD NearLimit; // 0 means unlimited
|
2009-02-08 11:28:30 +00:00
|
|
|
float LimitRange; // Range for sound limiting (squared for faster computations)
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
WORD bRandomHeader:1;
|
|
|
|
WORD bPlayerReserve:1;
|
|
|
|
WORD bLoadRAW:1;
|
|
|
|
WORD bPlayerCompat:1;
|
|
|
|
WORD b16bit:1;
|
|
|
|
WORD bUsed:1;
|
|
|
|
WORD bSingular:1;
|
2007-02-04 00:22:56 +00:00
|
|
|
WORD bTentative:1;
|
2012-11-03 03:43:05 +00:00
|
|
|
WORD bPlayerSilent:1; // This player sound is intentionally silent.
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2014-07-30 02:09:29 +00:00
|
|
|
WORD RawRate; // Sample rate to use when bLoadRAW is true
|
|
|
|
|
2010-03-18 04:26:22 +00:00
|
|
|
int LoopStart; // -1 means no specific loop defined
|
|
|
|
|
2008-03-30 08:32:44 +00:00
|
|
|
unsigned int link;
|
|
|
|
enum { NO_LINK = 0xffffffff };
|
2008-03-22 03:33:41 +00:00
|
|
|
|
2008-09-09 09:22:47 +00:00
|
|
|
FRolloffInfo Rolloff;
|
2012-05-07 01:16:56 +00:00
|
|
|
float Attenuation; // Multiplies the attenuation passed to S_Sound.
|
2012-08-22 23:17:49 +00:00
|
|
|
|
|
|
|
void MarkUsed(); // Marks this sound as used.
|
2008-03-22 03:33:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Rolloff types
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ROLLOFF_Doom, // Linear rolloff with a logarithmic volume scale
|
|
|
|
ROLLOFF_Linear, // Linear rolloff with a linear volume scale
|
|
|
|
ROLLOFF_Log, // Logarithmic rolloff (standard hardware type)
|
|
|
|
ROLLOFF_Custom // Lookup volume from SNDCURVE
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
2008-06-15 02:25:09 +00:00
|
|
|
int S_FindSound (const char *logicalname);
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// the complete set of sound effects
|
|
|
|
extern TArray<sfxinfo_t> S_sfx;
|
|
|
|
|
2008-06-15 02:25:09 +00:00
|
|
|
// An index into the S_sfx[] array.
|
|
|
|
class FSoundID
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FSoundID()
|
|
|
|
{
|
|
|
|
ID = 0;
|
|
|
|
}
|
|
|
|
FSoundID(int id)
|
|
|
|
{
|
|
|
|
ID = id;
|
|
|
|
}
|
|
|
|
FSoundID(const char *name)
|
|
|
|
{
|
|
|
|
ID = S_FindSound(name);
|
|
|
|
}
|
|
|
|
FSoundID(const FString &name)
|
|
|
|
{
|
|
|
|
ID = S_FindSound(name);
|
|
|
|
}
|
|
|
|
FSoundID(const FSoundID &other)
|
|
|
|
{
|
|
|
|
ID = other.ID;
|
|
|
|
}
|
|
|
|
FSoundID &operator=(const FSoundID &other)
|
|
|
|
{
|
|
|
|
ID = other.ID;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
FSoundID &operator=(const char *name)
|
|
|
|
{
|
|
|
|
ID = S_FindSound(name);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
FSoundID &operator=(const FString &name)
|
|
|
|
{
|
|
|
|
ID = S_FindSound(name);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
operator int() const
|
|
|
|
{
|
|
|
|
return ID;
|
|
|
|
}
|
|
|
|
operator FString() const
|
|
|
|
{
|
|
|
|
return ID ? S_sfx[ID].name : "";
|
|
|
|
}
|
|
|
|
operator const char *() const
|
|
|
|
{
|
|
|
|
return ID ? S_sfx[ID].name.GetChars() : NULL;
|
|
|
|
}
|
2012-08-22 23:17:49 +00:00
|
|
|
void MarkUsed() const
|
|
|
|
{
|
|
|
|
S_sfx[ID].MarkUsed();
|
|
|
|
}
|
2008-06-15 02:25:09 +00:00
|
|
|
private:
|
|
|
|
int ID;
|
|
|
|
protected:
|
|
|
|
enum EDummy { NoInit };
|
|
|
|
FSoundID(EDummy) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
class FSoundIDNoInit : public FSoundID
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FSoundIDNoInit() : FSoundID(NoInit) {}
|
|
|
|
|
|
|
|
FSoundID &operator=(const FSoundID &other)
|
|
|
|
{
|
|
|
|
return FSoundID::operator=(other);
|
|
|
|
}
|
|
|
|
FSoundID &operator=(const char *name)
|
|
|
|
{
|
|
|
|
return FSoundID::operator=(name);
|
|
|
|
}
|
|
|
|
FSoundID &operator=(const FString &name)
|
|
|
|
{
|
|
|
|
return FSoundID::operator=(name);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
FArchive &operator<<(FArchive &arc, FSoundID &sid);
|
|
|
|
|
2008-09-09 09:22:47 +00:00
|
|
|
extern FRolloffInfo S_Rolloff;
|
2008-03-22 03:33:41 +00:00
|
|
|
extern BYTE *S_SoundCurve;
|
|
|
|
extern int S_SoundCurveSize;
|
|
|
|
|
2008-03-21 05:13:59 +00:00
|
|
|
// Information about one playing sound.
|
2008-06-15 02:25:09 +00:00
|
|
|
struct sector_t;
|
2008-07-01 04:06:56 +00:00
|
|
|
struct FPolyObj;
|
2008-09-15 18:18:04 +00:00
|
|
|
struct FSoundChan : public FISoundChannel
|
2008-03-21 05:13:59 +00:00
|
|
|
{
|
|
|
|
FSoundChan *NextChan; // Next channel in this list.
|
|
|
|
FSoundChan **PrevChan; // Previous channel in this list.
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
FSoundID SoundID; // Sound ID of playing sound.
|
|
|
|
FSoundID OrgID; // Sound ID of sound used to start this channel.
|
2008-03-21 05:13:59 +00:00
|
|
|
float Volume;
|
2008-03-25 04:42:26 +00:00
|
|
|
int ChanFlags;
|
2008-07-01 04:06:56 +00:00
|
|
|
SWORD Pitch; // Pitch variation.
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
BYTE EntChannel; // Actor's sound channel.
|
|
|
|
SBYTE Priority;
|
|
|
|
SWORD NearLimit;
|
2008-07-01 04:06:56 +00:00
|
|
|
BYTE SourceType;
|
2009-02-08 11:28:30 +00:00
|
|
|
float LimitRange;
|
2008-07-01 04:06:56 +00:00
|
|
|
union
|
|
|
|
{
|
2008-11-15 01:01:04 +00:00
|
|
|
AActor *Actor; // Used for position and velocity.
|
2008-07-01 04:06:56 +00:00
|
|
|
const sector_t *Sector; // Sector for area sounds.
|
|
|
|
const FPolyObj *Poly; // Polyobject sound source.
|
|
|
|
float Point[3]; // Sound is not attached to any source.
|
|
|
|
};
|
2008-03-21 05:13:59 +00:00
|
|
|
};
|
2008-04-19 22:47:54 +00:00
|
|
|
extern FSoundChan *Channels;
|
2008-03-21 05:13:59 +00:00
|
|
|
|
|
|
|
void S_ReturnChannel(FSoundChan *chan);
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
void S_EvictAllChannels();
|
2008-03-21 05:13:59 +00:00
|
|
|
|
2008-09-15 16:02:05 +00:00
|
|
|
void S_StopChannel(FSoundChan *chan);
|
2008-03-21 05:13:59 +00:00
|
|
|
void S_LinkChannel(FSoundChan *chan, FSoundChan **head);
|
|
|
|
void S_UnlinkChannel(FSoundChan *chan);
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// Initializes sound stuff, including volume
|
|
|
|
// Sets channels, SFX and music volume,
|
|
|
|
// allocates channel buffer, sets S_sfx lookup.
|
|
|
|
//
|
|
|
|
void S_Init ();
|
2006-12-24 23:08:49 +00:00
|
|
|
void S_InitData ();
|
2006-05-12 03:14:40 +00:00
|
|
|
void S_Shutdown ();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Per level startup code.
|
|
|
|
// Kills playing sounds at start of level and starts new music.
|
|
|
|
//
|
|
|
|
void S_Start ();
|
|
|
|
|
|
|
|
// Called after a level is loaded. Ensures that most sounds are loaded.
|
|
|
|
void S_PrecacheLevel ();
|
|
|
|
|
|
|
|
// Loads a sound, including any random sounds it might reference.
|
|
|
|
void S_CacheSound (sfxinfo_t *sfx);
|
|
|
|
|
|
|
|
// Start sound for thing at <ent>
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
void S_Sound (int channel, FSoundID sfxid, float volume, float attenuation);
|
|
|
|
void S_Sound (AActor *ent, int channel, FSoundID sfxid, float volume, float attenuation);
|
2010-03-18 00:32:35 +00:00
|
|
|
void S_SoundMinMaxDist (AActor *ent, int channel, FSoundID sfxid, float volume, float mindist, float maxdist);
|
2008-07-01 04:06:56 +00:00
|
|
|
void S_Sound (const FPolyObj *poly, int channel, FSoundID sfxid, float volume, float attenuation);
|
|
|
|
void S_Sound (const sector_t *sec, int channel, FSoundID sfxid, float volume, float attenuation);
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
void S_Sound (fixed_t x, fixed_t y, fixed_t z, int channel, FSoundID sfxid, float volume, float attenuation);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// sound channels
|
|
|
|
// channel 0 never willingly overrides
|
|
|
|
// other channels (1-7) always override a playing sound on that channel
|
|
|
|
//
|
|
|
|
// CHAN_AUTO searches down from channel 7 until it finds a channel not in use
|
|
|
|
// CHAN_WEAPON is for weapons
|
|
|
|
// CHAN_VOICE is for oof, sight, or other voice sounds
|
|
|
|
// CHAN_ITEM is for small things and item pickup
|
|
|
|
// CHAN_BODY is for generic body sounds
|
2008-03-21 05:13:59 +00:00
|
|
|
// CHAN_PICKUP can optionally be set as a local sound only for "compatibility"
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
#define CHAN_AUTO 0
|
|
|
|
#define CHAN_WEAPON 1
|
|
|
|
#define CHAN_VOICE 2
|
|
|
|
#define CHAN_ITEM 3
|
|
|
|
#define CHAN_BODY 4
|
2008-06-15 02:25:09 +00:00
|
|
|
|
|
|
|
// Channel alias for sector sounds. These define how listener height is
|
|
|
|
// used when calculating 3D sound volume.
|
|
|
|
#define CHAN_FLOOR 1 // Sound comes from the floor.
|
|
|
|
#define CHAN_CEILING 2 // Sound comes from the ceiling.
|
|
|
|
#define CHAN_FULLHEIGHT 3 // Sound comes entire height of the sector.
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
#define CHAN_INTERIOR 4 // Sound comes height between floor and ceiling.
|
2008-06-15 02:25:09 +00:00
|
|
|
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
// modifier flags
|
|
|
|
#define CHAN_LISTENERZ 8
|
2008-07-01 04:06:56 +00:00
|
|
|
#define CHAN_MAYBE_LOCAL 16
|
|
|
|
#define CHAN_UI 32 // Do not record sound in savegames.
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
#define CHAN_NOPAUSE 64 // Do not pause this sound in menus.
|
|
|
|
#define CHAN_AREA 128 // Sound plays from all around. Only valid with sector sounds.
|
|
|
|
#define CHAN_LOOP 256
|
2008-03-25 04:42:26 +00:00
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
#define CHAN_PICKUP (CHAN_ITEM|CHAN_MAYBE_LOCAL)
|
|
|
|
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
#define CHAN_IS3D 1 // internal: Sound is 3D.
|
2008-07-05 03:32:44 +00:00
|
|
|
#define CHAN_EVICTED 2 // internal: Sound was evicted.
|
|
|
|
#define CHAN_FORGETTABLE 4 // internal: Forget channel data when sound stops.
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
#define CHAN_JUSTSTARTED 512 // internal: Sound has not been updated yet.
|
2008-07-05 03:32:44 +00:00
|
|
|
#define CHAN_ABSTIME 1024// internal: Start time is absolute and does not depend on current time.
|
2009-11-04 02:07:39 +00:00
|
|
|
#define CHAN_VIRTUAL 2048// internal: Channel is currently virtual
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// sound attenuation values
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
#define ATTN_NONE 0.f // full volume the entire level
|
|
|
|
#define ATTN_NORM 1.f
|
|
|
|
#define ATTN_IDLE 1.001f
|
|
|
|
#define ATTN_STATIC 3.f // diminish very rapidly with distance
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
int S_PickReplacement (int refid);
|
|
|
|
void S_CacheRandomSound (sfxinfo_t *sfx);
|
|
|
|
|
2008-03-21 05:13:59 +00:00
|
|
|
// Checks if a copy of this sound is already playing.
|
|
|
|
bool S_CheckSingular (int sound_id);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-07-01 04:06:56 +00:00
|
|
|
// Stops a sound emanating from one of an emitter's channels.
|
2006-02-24 04:48:15 +00:00
|
|
|
void S_StopSound (AActor *ent, int channel);
|
2008-07-01 04:06:56 +00:00
|
|
|
void S_StopSound (const sector_t *sec, int channel);
|
|
|
|
void S_StopSound (const FPolyObj *poly, int channel);
|
|
|
|
|
|
|
|
// Stops an origin-less sound from playing from this channel.
|
|
|
|
void S_StopSound (int channel);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Stop sound for all channels
|
|
|
|
void S_StopAllChannels (void);
|
|
|
|
|
2008-07-01 04:06:56 +00:00
|
|
|
// Is the sound playing on one of the emitter's channels?
|
|
|
|
bool S_GetSoundPlayingInfo (const AActor *actor, int sound_id);
|
|
|
|
bool S_GetSoundPlayingInfo (const sector_t *sector, int sound_id);
|
|
|
|
bool S_GetSoundPlayingInfo (const FPolyObj *poly, int sound_id);
|
|
|
|
|
2006-08-31 00:16:12 +00:00
|
|
|
bool S_IsActorPlayingSomething (AActor *actor, int channel, int sound_id);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2013-06-01 17:46:50 +00:00
|
|
|
// Change a playing sound's volume
|
|
|
|
bool S_ChangeSoundVolume(AActor *actor, int channel, float volume);
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// Moves all sounds from one mobj to another
|
|
|
|
void S_RelinkSound (AActor *from, AActor *to);
|
|
|
|
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
// Stores/retrieves playing channel information in an archive.
|
|
|
|
void S_SerializeSounds(FArchive &arc);
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// Start music using <music_name>
|
|
|
|
bool S_StartMusic (const char *music_name);
|
|
|
|
|
|
|
|
// Start music using <music_name>, and set whether looping
|
|
|
|
bool S_ChangeMusic (const char *music_name, int order=0, bool looping=true, bool force=false);
|
|
|
|
|
|
|
|
// Start playing a cd track as music
|
|
|
|
bool S_ChangeCDMusic (int track, unsigned int id=0, bool looping=true);
|
|
|
|
|
|
|
|
void S_RestartMusic ();
|
|
|
|
|
2011-05-20 00:26:22 +00:00
|
|
|
void S_MIDIDeviceChanged();
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
int S_GetMusic (char **name);
|
|
|
|
|
|
|
|
// Stops the music for sure.
|
|
|
|
void S_StopMusic (bool force);
|
2015-04-25 08:26:14 +00:00
|
|
|
void S_UpdateMusic();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Stop and resume music, during game PAUSE.
|
2009-05-20 02:52:07 +00:00
|
|
|
void S_PauseSound (bool notmusic, bool notsfx);
|
|
|
|
void S_ResumeSound (bool notsfx);
|
2009-05-23 03:09:50 +00:00
|
|
|
void S_SetSoundPaused (int state);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Updates music & sounds
|
|
|
|
//
|
2008-09-06 11:07:27 +00:00
|
|
|
void S_UpdateSounds (AActor *listener);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
- 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.
June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public
S_Sound() interface.
- Fixed: S_RelinkSound() compared the points of the channels against the
from actor's point, rather than checking the channels' mover.
- Changed Strife's animated doors so that their sounds originate from the
interior of the sector making them and not from the entire vertical height
of the map.
SVN r1055 (trunk)
2008-06-29 04:19:38 +00:00
|
|
|
void S_RestoreEvictedChannels();
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// [RH] S_sfx "maintenance" routines
|
2010-12-14 00:50:02 +00:00
|
|
|
void S_ParseSndInfo (bool redefine);
|
2008-05-20 04:02:49 +00:00
|
|
|
void S_ParseReverbDef ();
|
|
|
|
void S_UnloadReverbDef ();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
void S_HashSounds ();
|
|
|
|
int S_FindSoundNoHash (const char *logicalname);
|
|
|
|
bool S_AreSoundsEquivalent (AActor *actor, int id1, int id2);
|
|
|
|
bool S_AreSoundsEquivalent (AActor *actor, const char *name1, const char *name2);
|
|
|
|
int S_LookupPlayerSound (const char *playerclass, int gender, const char *logicalname);
|
2008-06-15 02:25:09 +00:00
|
|
|
int S_LookupPlayerSound (const char *playerclass, int gender, FSoundID refid);
|
|
|
|
int S_FindSkinnedSound (AActor *actor, FSoundID refid);
|
2007-02-04 00:22:56 +00:00
|
|
|
int S_FindSkinnedSoundEx (AActor *actor, const char *logicalname, const char *extendedname);
|
2006-02-24 04:48:15 +00:00
|
|
|
int S_FindSoundByLump (int lump);
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
int S_AddSound (const char *logicalname, const char *lumpname, FScanner *sc=NULL); // Add sound by lumpname
|
2006-02-24 04:48:15 +00:00
|
|
|
int S_AddSoundLump (const char *logicalname, int lump); // Add sound by lump index
|
|
|
|
int S_AddPlayerSound (const char *playerclass, const int gender, int refid, const char *lumpname);
|
2006-06-11 11:28:48 +00:00
|
|
|
int S_AddPlayerSound (const char *playerclass, const int gender, int refid, int lumpnum, bool fromskin=false);
|
|
|
|
int S_AddPlayerSoundExisting (const char *playerclass, const int gender, int refid, int aliasto, bool fromskin=false);
|
2012-08-22 23:46:47 +00:00
|
|
|
void S_MarkPlayerSounds (const char *playerclass);
|
2006-02-24 04:48:15 +00:00
|
|
|
void S_ShrinkPlayerSoundLists ();
|
2008-09-07 14:45:50 +00:00
|
|
|
void S_UnloadSound (sfxinfo_t *sfx);
|
|
|
|
sfxinfo_t *S_LoadSound(sfxinfo_t *sfx);
|
|
|
|
unsigned int S_GetMSLength(FSoundID sound);
|
2010-06-13 08:47:38 +00:00
|
|
|
void S_ParseMusInfo();
|
- Added support for custom loop points for songs. This does not work with MP3 because of the
way MP3 obfuscates custom tags. Vorbis and FLAC are fine. (I could make it work with MP3,
but you should be using Vorbis instead.) They are:
* LOOP_START: Start time for the loop. If omitted, the song repeats from the beginning.
* LOOP_END: End time for the loop. If omitted, the song loops at the end. (If you need to specify this, why aren't you using a shorter song.)
You only need to specify one of these tags to set the custom loop. Naturally, you can set
them both, as well. The format for each tag is the same:
* If it contains a colon (:), it specifies by time. This may be of the form 00:00:00.00
(HH:MM:SS.ss) to specify by play. Various parts may be left off. e.g. To start the loop
at 20 seconds in, you can use ":20", 0:20", "00:00:20", ":20.0", etc. Values after the
decimal are fractions of a second and accurate to one millisecond.
* If you don't include a colon but just have a raw number, then it's the number of PCM
samples at which to loop.
* Any characters other than digits (0-9), colons (:), or a single decimal point for the
seconds portion will result in the tag being ignored.
SVN r2424 (trunk)
2010-07-10 02:59:34 +00:00
|
|
|
bool S_ParseTimeTag(const char *tag, bool *as_samples, unsigned int *time);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// [RH] Prints sound debug info to the screen.
|
|
|
|
// Modelled after Hexen's noise cheat.
|
|
|
|
void S_NoiseDebug ();
|
|
|
|
|
|
|
|
extern ReverbContainer *Environments;
|
|
|
|
extern ReverbContainer *DefaultEnvironments[26];
|
|
|
|
|
|
|
|
class FArchive;
|
|
|
|
FArchive &operator<< (FArchive &arc, ReverbContainer *&env);
|
|
|
|
|
|
|
|
void S_SetEnvironment (const ReverbContainer *settings);
|
|
|
|
ReverbContainer *S_FindEnvironment (const char *name);
|
|
|
|
ReverbContainer *S_FindEnvironment (int id);
|
|
|
|
void S_AddEnvironment (ReverbContainer *settings);
|
|
|
|
|
2008-03-27 00:05:32 +00:00
|
|
|
enum EMidiDevice
|
|
|
|
{
|
|
|
|
MDEV_DEFAULT = -1,
|
|
|
|
MDEV_MMAPI = 0,
|
2010-06-13 08:47:38 +00:00
|
|
|
MDEV_OPL = 1,
|
2014-06-26 23:58:18 +00:00
|
|
|
MDEV_SNDSYS = 2,
|
2010-06-13 08:47:38 +00:00
|
|
|
MDEV_TIMIDITY = 3,
|
2010-08-26 16:46:01 +00:00
|
|
|
MDEV_FLUIDSYNTH = 4,
|
2010-09-29 00:35:47 +00:00
|
|
|
MDEV_GUS = 5,
|
2015-11-28 19:58:14 +00:00
|
|
|
MDEV_WILDMIDI = 6,
|
2008-03-27 00:05:32 +00:00
|
|
|
};
|
|
|
|
|
2015-12-31 22:03:53 +00:00
|
|
|
struct MidiDeviceSetting
|
|
|
|
{
|
|
|
|
int device;
|
|
|
|
FString args;
|
|
|
|
|
|
|
|
MidiDeviceSetting()
|
|
|
|
{
|
|
|
|
device = MDEV_DEFAULT;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-11-08 17:24:27 +00:00
|
|
|
typedef TMap<FName, FName> MusicAliasMap;
|
2015-12-31 22:03:53 +00:00
|
|
|
typedef TMap<FName, MidiDeviceSetting> MidiDeviceMap;
|
2007-09-12 00:20:11 +00:00
|
|
|
|
2010-11-08 17:24:27 +00:00
|
|
|
extern MusicAliasMap MusicAliases;
|
2007-09-12 00:20:11 +00:00
|
|
|
extern MidiDeviceMap MidiDevices;
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
#endif
|