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:
avolkov
2005-03-16 05:48:32 +00:00
parent 0b0f74b97d
commit d77c74596c
3 changed files with 13 additions and 14 deletions
+6
View File
@@ -60,6 +60,12 @@ extern BOOLEAN DestroyMusic (MUSIC_REF MusicRef);
#define MAX_CHANNELS 8
#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
Priority);
extern void PLRStop (MUSIC_REF MusicRef);
+1 -1
View File
@@ -26,7 +26,7 @@
#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 SPEECH_SOURCE (MUSIC_SOURCE + 1)
#define NUM_SOUNDSOURCES (SPEECH_SOURCE + 1)
+6 -13
View File
@@ -23,7 +23,7 @@ SOUND MenuSounds;
SOUND GameSounds;
#define MAX_SOUNDS 8
static BYTE num_sounds;
static BYTE num_sounds = 0;
static SOUND sound_buf[MAX_SOUNDS];
static ELEMENTPTR sound_posobj[MAX_SOUNDS];
@@ -32,12 +32,10 @@ void
PlaySound (SOUND S, SoundPosition Pos, ELEMENTPTR PositionalObject,
BYTE Priority)
{
#define MIN_FX_CHANNEL 1
#define NUM_FX_CHANNELS 4
/* obviously number of channels is assumed to be at least 5 */
BYTE chan, c;
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)
return;
@@ -134,14 +132,12 @@ NotPositional (void)
/* Updates positional sound effects */
void
UpdateSoundPositions (void) {
UpdateSoundPositions (void)
{
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;
if (!ChannelPlaying(i))
continue;
@@ -181,11 +177,8 @@ RemoveSoundsForObject (ELEMENTPTR PosObj)
{
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)
SetPositionalObject (i, NULL);
}