mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-14 16:41:07 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom
This commit is contained in:
commit
addd059410
1 changed files with 6 additions and 6 deletions
|
@ -211,11 +211,11 @@ bool MUSSong2::CheckDone()
|
||||||
|
|
||||||
void MUSSong2::Precache()
|
void MUSSong2::Precache()
|
||||||
{
|
{
|
||||||
WORD *work = (WORD *)alloca(MusHeader->NumInstruments * sizeof(WORD));
|
TArray<WORD> work(MusHeader->NumInstruments);
|
||||||
const BYTE *used = (BYTE *)MusHeader + sizeof(MUSHeader) / sizeof(BYTE);
|
const BYTE *used = (BYTE *)MusHeader + sizeof(MUSHeader) / sizeof(BYTE);
|
||||||
int i, j, k;
|
int i, k;
|
||||||
|
|
||||||
for (i = j = k = 0; i < MusHeader->NumInstruments; ++i)
|
for (i = k = 0; i < MusHeader->NumInstruments; ++i)
|
||||||
{
|
{
|
||||||
BYTE instr = used[k++];
|
BYTE instr = used[k++];
|
||||||
WORD val;
|
WORD val;
|
||||||
|
@ -240,15 +240,15 @@ void MUSSong2::Precache()
|
||||||
{
|
{
|
||||||
for (int b = 0; b < numbanks; b++)
|
for (int b = 0; b < numbanks; b++)
|
||||||
{
|
{
|
||||||
work[j++] = val | (used[k++] << 7);
|
work.Push(val | (used[k++] << 7));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
work[j++] = val;
|
work.Push(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MIDI->PrecacheInstruments(&work[0], j);
|
MIDI->PrecacheInstruments(&work[0], work.Size());
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
Loading…
Reference in a new issue