mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-15 08:41:59 +00:00
- since Wads.ReopenLumpNum already performs caching on the lump data it is not really necessary anymore to maintain a separate musiccache, so this code can be removed.
This commit is contained in:
parent
aecff68a4d
commit
4294b94728
1 changed files with 3 additions and 25 deletions
|
@ -2331,8 +2331,6 @@ bool S_StartMusic (const char *m_id)
|
|||
// specified, it will only be played if the specified CD is in a drive.
|
||||
//==========================================================================
|
||||
|
||||
TArray<BYTE> musiccache;
|
||||
|
||||
bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
||||
{
|
||||
if (!force && PlayList)
|
||||
|
@ -2456,31 +2454,11 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
|||
}
|
||||
if (handle == NULL)
|
||||
{
|
||||
if (!Wads.IsUncompressedFile(lumpnum))
|
||||
if (Wads.LumpLength (lumpnum) == 0)
|
||||
{
|
||||
// We must cache the music data and use it from memory.
|
||||
|
||||
// shut down old music before reallocating and overwriting the cache!
|
||||
S_StopMusic (true);
|
||||
|
||||
length = Wads.LumpLength (lumpnum);
|
||||
if (length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
musiccache.Resize(length);
|
||||
Wads.ReadLump(lumpnum, &musiccache[0]);
|
||||
|
||||
reader = new MemoryReader((const char*)&musiccache[0], musiccache.Size());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Wads.LumpLength (lumpnum) == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
reader = Wads.ReopenLumpNum(lumpnum);
|
||||
return false;
|
||||
}
|
||||
reader = Wads.ReopenLumpNum(lumpnum);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue