mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r16805) -Codechange: Remove 'unused' mixer channel flags, which always had the same value.
This commit is contained in:
parent
2547ba9517
commit
a67f861d55
@ -21,8 +21,6 @@ struct MixerChannel {
|
|||||||
/* Mixing volume */
|
/* Mixing volume */
|
||||||
int volume_left;
|
int volume_left;
|
||||||
int volume_right;
|
int volume_right;
|
||||||
|
|
||||||
uint flags;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static MixerChannel _channels[8];
|
static MixerChannel _channels[8];
|
||||||
@ -80,7 +78,7 @@ static void mix_int8_to_int16(MixerChannel *sc, int16 *buffer, uint samples)
|
|||||||
|
|
||||||
static void MxCloseChannel(MixerChannel *mc)
|
static void MxCloseChannel(MixerChannel *mc)
|
||||||
{
|
{
|
||||||
if (mc->flags & MX_AUTOFREE) free(mc->memory);
|
free(mc->memory);
|
||||||
mc->active = false;
|
mc->active = false;
|
||||||
mc->memory = NULL;
|
mc->memory = NULL;
|
||||||
}
|
}
|
||||||
@ -112,10 +110,9 @@ MixerChannel *MxAllocateChannel()
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, size_t size, uint rate, uint flags)
|
void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, size_t size, uint rate)
|
||||||
{
|
{
|
||||||
mc->memory = mem;
|
mc->memory = mem;
|
||||||
mc->flags = flags;
|
|
||||||
mc->frac_pos = 0;
|
mc->frac_pos = 0;
|
||||||
mc->pos = 0;
|
mc->pos = 0;
|
||||||
|
|
||||||
|
@ -7,18 +7,11 @@
|
|||||||
|
|
||||||
struct MixerChannel;
|
struct MixerChannel;
|
||||||
|
|
||||||
enum {
|
|
||||||
MX_AUTOFREE = 1,
|
|
||||||
// MX_8BIT = 2,
|
|
||||||
// MX_STEREO = 4,
|
|
||||||
// MX_UNSIGNED = 8,
|
|
||||||
};
|
|
||||||
|
|
||||||
bool MxInitialize(uint rate);
|
bool MxInitialize(uint rate);
|
||||||
void MxMixSamples(void *buffer, uint samples);
|
void MxMixSamples(void *buffer, uint samples);
|
||||||
|
|
||||||
MixerChannel *MxAllocateChannel();
|
MixerChannel *MxAllocateChannel();
|
||||||
void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, size_t size, uint rate, uint flags);
|
void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, size_t size, uint rate);
|
||||||
void MxSetChannelVolume(MixerChannel *mc, uint left, uint right);
|
void MxSetChannelVolume(MixerChannel *mc, uint left, uint right);
|
||||||
void MxActivateChannel(MixerChannel*);
|
void MxActivateChannel(MixerChannel*);
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ static bool SetBankSource(MixerChannel *mc, const SoundEntry *sound)
|
|||||||
|
|
||||||
assert(sound->bits_per_sample == 8 && sound->channels == 1 && sound->file_size != 0 && sound->rate != 0);
|
assert(sound->bits_per_sample == 8 && sound->channels == 1 && sound->file_size != 0 && sound->rate != 0);
|
||||||
|
|
||||||
MxSetChannelRawSrc(mc, mem, sound->file_size, sound->rate, MX_AUTOFREE);
|
MxSetChannelRawSrc(mc, mem, sound->file_size, sound->rate);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user