mirror of
https://github.com/BluTac10/Xbox-Neo.git
synced 2026-06-28 04:47:10 +00:00
fix: handled all audio and parameter types correctly to prevent crashes
Original commit: 8658049e71
This commit is contained in:
@@ -473,18 +473,63 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen
|
||||
DLCAudioFile *dlcFile = static_cast<DLCAudioFile *>(pack->getFile(DLCManager::e_DLCType_Audio, 0));
|
||||
texturePack->setHasAudio(true);
|
||||
// init the streaming sound ids for this texture pack
|
||||
int iOverworldStart, iNetherStart, iEndStart;
|
||||
int iOverworldC, iNetherC, iEndC;
|
||||
int iOverworldC=dlcFile->GetCountofType(DLCAudioFile::e_AudioType_Overworld);
|
||||
int iNetherC=dlcFile->GetCountofType(DLCAudioFile::e_AudioType_Nether);
|
||||
int iEndStart=iOverworldC+iNetherC;
|
||||
int iEndC=dlcFile->GetCountofType(DLCAudioFile::e_AudioType_End);
|
||||
int iAfterEnd=iOverworldC+iNetherC+iEndC;
|
||||
int iCreativeC=dlcFile->GetCountofType(DLCAudioFile::e_AudioType_Creative);
|
||||
|
||||
iOverworldStart=0;
|
||||
iOverworldC=dlcFile->GetCountofType(DLCAudioFile::e_AudioType_Overworld);
|
||||
iNetherStart=iOverworldC;
|
||||
iNetherC=dlcFile->GetCountofType(DLCAudioFile::e_AudioType_Nether);
|
||||
iEndStart=iOverworldC+iNetherC;
|
||||
iEndC=dlcFile->GetCountofType(DLCAudioFile::e_AudioType_End);
|
||||
int iCreativeStart, iCreativeRange;
|
||||
if(iCreativeC)
|
||||
{
|
||||
iCreativeStart=iAfterEnd;
|
||||
iCreativeRange=iCreativeC;
|
||||
iAfterEnd+=iCreativeC;
|
||||
}
|
||||
else
|
||||
{
|
||||
iCreativeStart=0;
|
||||
iCreativeRange=iOverworldC;
|
||||
}
|
||||
|
||||
Minecraft::GetInstance()->soundEngine->SetStreamingSounds(iOverworldStart,iOverworldStart+iOverworldC-1,
|
||||
iNetherStart,iNetherStart+iNetherC-1,iEndStart,iEndStart+iEndC-1,iEndStart+iEndC); // push the CD start to after
|
||||
int iMenuC=dlcFile->GetCountofType(DLCAudioFile::e_AudioType_Menu);
|
||||
int iMenuStart, iMenuRange;
|
||||
if(iMenuC)
|
||||
{
|
||||
iMenuStart=iAfterEnd;
|
||||
iMenuRange=iMenuC;
|
||||
iAfterEnd+=iMenuC;
|
||||
}
|
||||
else
|
||||
{
|
||||
iMenuStart=0;
|
||||
iMenuRange=iOverworldC;
|
||||
}
|
||||
|
||||
int iBattleC=dlcFile->GetCountofType(DLCAudioFile::e_AudioType_Battle);
|
||||
if(iBattleC)
|
||||
{
|
||||
Minecraft::GetInstance()->soundEngine->SetStreamingSounds(
|
||||
0,iOverworldC-1,
|
||||
iOverworldC,iOverworldC+iNetherC-1,
|
||||
iEndStart,iEndStart+iEndC-1,
|
||||
iCreativeStart,iCreativeStart+iCreativeRange-1,
|
||||
iMenuStart,iMenuStart+iMenuRange-1,
|
||||
iAfterEnd,iAfterEnd+iBattleC-1,
|
||||
iAfterEnd+iBattleC);
|
||||
}
|
||||
else
|
||||
{
|
||||
Minecraft::GetInstance()->soundEngine->SetStreamingSounds(
|
||||
0,iOverworldC-1,
|
||||
iOverworldC,iOverworldC+iNetherC-1,
|
||||
iEndStart,iEndStart+iEndC-1,
|
||||
iCreativeStart,iCreativeStart+iCreativeRange-1,
|
||||
iMenuStart,iMenuStart+iMenuRange-1,
|
||||
0,iOverworldC-1,
|
||||
iAfterEnd);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user