Misc sfx bug and semantical fixes
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1578 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -60,6 +60,12 @@ extern BOOLEAN DestroyMusic (MUSIC_REF MusicRef);
|
|||||||
#define MAX_CHANNELS 8
|
#define MAX_CHANNELS 8
|
||||||
#define MAX_VOLUME 255
|
#define MAX_VOLUME 255
|
||||||
|
|
||||||
|
#define FIRST_SFX_CHANNEL 0
|
||||||
|
#define MIN_FX_CHANNEL 1
|
||||||
|
#define NUM_FX_CHANNELS 4
|
||||||
|
#define LAST_SFX_CHANNEL (MIN_FX_CHANNEL + NUM_FX_CHANNELS - 1)
|
||||||
|
#define NUM_SFX_CHANNELS (MIN_FX_CHANNEL + NUM_FX_CHANNELS)
|
||||||
|
|
||||||
extern void PLRPlaySong (MUSIC_REF MusicRef, BOOLEAN Continuous, BYTE
|
extern void PLRPlaySong (MUSIC_REF MusicRef, BOOLEAN Continuous, BYTE
|
||||||
Priority);
|
Priority);
|
||||||
extern void PLRStop (MUSIC_REF MusicRef);
|
extern void PLRStop (MUSIC_REF MusicRef);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define FIRST_SFX_SOURCE 0
|
#define FIRST_SFX_SOURCE 0
|
||||||
#define LAST_SFX_SOURCE 4
|
#define LAST_SFX_SOURCE (FIRST_SFX_SOURCE + NUM_SFX_CHANNELS - 1)
|
||||||
#define MUSIC_SOURCE (LAST_SFX_SOURCE + 1)
|
#define MUSIC_SOURCE (LAST_SFX_SOURCE + 1)
|
||||||
#define SPEECH_SOURCE (MUSIC_SOURCE + 1)
|
#define SPEECH_SOURCE (MUSIC_SOURCE + 1)
|
||||||
#define NUM_SOUNDSOURCES (SPEECH_SOURCE + 1)
|
#define NUM_SOUNDSOURCES (SPEECH_SOURCE + 1)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ SOUND MenuSounds;
|
|||||||
SOUND GameSounds;
|
SOUND GameSounds;
|
||||||
|
|
||||||
#define MAX_SOUNDS 8
|
#define MAX_SOUNDS 8
|
||||||
static BYTE num_sounds;
|
static BYTE num_sounds = 0;
|
||||||
static SOUND sound_buf[MAX_SOUNDS];
|
static SOUND sound_buf[MAX_SOUNDS];
|
||||||
static ELEMENTPTR sound_posobj[MAX_SOUNDS];
|
static ELEMENTPTR sound_posobj[MAX_SOUNDS];
|
||||||
|
|
||||||
@@ -32,12 +32,10 @@ void
|
|||||||
PlaySound (SOUND S, SoundPosition Pos, ELEMENTPTR PositionalObject,
|
PlaySound (SOUND S, SoundPosition Pos, ELEMENTPTR PositionalObject,
|
||||||
BYTE Priority)
|
BYTE Priority)
|
||||||
{
|
{
|
||||||
#define MIN_FX_CHANNEL 1
|
|
||||||
#define NUM_FX_CHANNELS 4
|
|
||||||
/* obviously number of channels is assumed to be at least 5 */
|
/* obviously number of channels is assumed to be at least 5 */
|
||||||
BYTE chan, c;
|
BYTE chan, c;
|
||||||
static BYTE lru_channel[NUM_FX_CHANNELS] = {0, 1, 2, 3};
|
static BYTE lru_channel[NUM_FX_CHANNELS] = {0, 1, 2, 3};
|
||||||
static SOUND channel[NUM_FX_CHANNELS];
|
static SOUND channel[NUM_FX_CHANNELS] = {0, 0, 0, 0};
|
||||||
|
|
||||||
if (S == 0)
|
if (S == 0)
|
||||||
return;
|
return;
|
||||||
@@ -134,14 +132,12 @@ NotPositional (void)
|
|||||||
|
|
||||||
/* Updates positional sound effects */
|
/* Updates positional sound effects */
|
||||||
void
|
void
|
||||||
UpdateSoundPositions (void) {
|
UpdateSoundPositions (void)
|
||||||
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
|
|
||||||
for (i = 0; i <= NUM_FX_CHANNELS; ++i)
|
for (i = FIRST_SFX_CHANNEL; i <= LAST_SFX_CHANNEL; ++i)
|
||||||
{
|
{
|
||||||
// XXX: (possible BUG): shouldn't the "<=" be "<"
|
|
||||||
// TODO: investigate - SvdB
|
|
||||||
|
|
||||||
ELEMENTPTR posobj;
|
ELEMENTPTR posobj;
|
||||||
if (!ChannelPlaying(i))
|
if (!ChannelPlaying(i))
|
||||||
continue;
|
continue;
|
||||||
@@ -181,11 +177,8 @@ RemoveSoundsForObject (ELEMENTPTR PosObj)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i <= NUM_FX_CHANNELS; ++i)
|
for (i = FIRST_SFX_CHANNEL; i <= LAST_SFX_CHANNEL; ++i)
|
||||||
{
|
{
|
||||||
// XXX: (possible BUG): shouldn't the "<=" be "<"
|
|
||||||
// TODO: investigate - SvdB
|
|
||||||
|
|
||||||
if (GetPositionalObject (i) == PosObj)
|
if (GetPositionalObject (i) == PosObj)
|
||||||
SetPositionalObject (i, NULL);
|
SetPositionalObject (i, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user