multivoc.c: use a local variable instead of a file-scope one used locally.

git-svn-id: https://svn.eduke32.com/eduke32@4183 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-11-28 21:18:09 +00:00
parent a68ef20182
commit 9688dccfff

View file

@ -101,7 +101,6 @@ static volatile VoiceNode VoiceList;
static volatile VoiceNode VoicePool; static volatile VoiceNode VoicePool;
static int32_t MV_MixPage = 0; static int32_t MV_MixPage = 0;
static int32_t MV_VoiceHandle = MV_MINVOICEHANDLE;
void (*MV_Printf)(const char *fmt, ...) = NULL; void (*MV_Printf)(const char *fmt, ...) = NULL;
static void (*MV_CallBackFunc)(uint32_t) = NULL; static void (*MV_CallBackFunc)(uint32_t) = NULL;
@ -648,17 +647,19 @@ VoiceNode *MV_AllocVoice(int32_t priority)
LL_Remove(voice, next, prev); LL_Remove(voice, next, prev);
RestoreInterrupts(); RestoreInterrupts();
MV_VoiceHandle = MV_MINVOICEHANDLE;
// Find a free voice handle
do
{ {
if (++MV_VoiceHandle < MV_MINVOICEHANDLE || MV_VoiceHandle > MV_MaxVoices) int32_t vhan = MV_MINVOICEHANDLE;
MV_VoiceHandle = MV_MINVOICEHANDLE;
}
while (MV_VoicePlaying(MV_VoiceHandle));
voice->handle = MV_VoiceHandle; // Find a free voice handle
do
{
if (++vhan < MV_MINVOICEHANDLE || vhan > MV_MaxVoices)
vhan = MV_MINVOICEHANDLE;
}
while (MV_VoicePlaying(vhan));
voice->handle = vhan;
}
return voice; return voice;
} }