mirror of
https://github.com/AxioDL/amuse.git
synced 2025-12-09 05:27:57 +00:00
Refactors, bug fixes, lotsa things
This commit is contained in:
@@ -6,7 +6,6 @@ namespace amuse
|
||||
|
||||
void AudioGroupSampleDirectory::Entry::swapBig()
|
||||
{
|
||||
m_sfxId = SBig(m_sfxId);
|
||||
m_sampleOff = SBig(m_sampleOff);
|
||||
m_unk = SBig(m_unk);
|
||||
m_sampleRate = SBig(m_sampleRate);
|
||||
@@ -30,6 +29,27 @@ void AudioGroupSampleDirectory::ADPCMParms::swapBig()
|
||||
|
||||
AudioGroupSampleDirectory::AudioGroupSampleDirectory(const unsigned char* data)
|
||||
{
|
||||
const unsigned char* cur = data;
|
||||
while (*reinterpret_cast<const uint32_t*>(cur) != 0xffffffff)
|
||||
{
|
||||
const AudioGroupSampleDirectory::Entry* ent =
|
||||
reinterpret_cast<const AudioGroupSampleDirectory::Entry*>(cur);
|
||||
|
||||
std::pair<Entry, ADPCMParms>& store = m_entries[ent->m_sfxId];
|
||||
store.first = *ent;
|
||||
store.first.swapBig();
|
||||
|
||||
if (store.first.m_adpcmParmOffset)
|
||||
{
|
||||
const AudioGroupSampleDirectory::ADPCMParms* adpcm =
|
||||
reinterpret_cast<const AudioGroupSampleDirectory::ADPCMParms*>(data +
|
||||
store.first.m_adpcmParmOffset);
|
||||
store.second = *adpcm;
|
||||
store.second.swapBig();
|
||||
}
|
||||
|
||||
cur += 32;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user