mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-14 02:27:21 -07:00
Added names for the soundfonts.
This commit is contained in:
parent
c5df54ae27
commit
bff206e30b
11 changed files with 89 additions and 40 deletions
|
@ -68,6 +68,13 @@ void ZAudio::ParseXML(tinyxml2::XMLElement* reader)
|
|||
}
|
||||
}
|
||||
|
||||
if (std::string(child->Value()) == "Soundfont")
|
||||
{
|
||||
auto name = child->Attribute("Name");
|
||||
auto index = child->IntAttribute("Index", 0);
|
||||
soundFontNames[index] = name;
|
||||
}
|
||||
|
||||
child = child->NextSiblingElement();
|
||||
}
|
||||
}
|
||||
|
@ -154,14 +161,10 @@ SampleEntry* ZAudio::ParseSampleEntry(std::vector<uint8_t> audioBank,
|
|||
int bp = 0;
|
||||
}
|
||||
|
||||
if (/* sample->loop.count != 0xFFFFFFFF && */ sample->loop.count != 0)
|
||||
if (sample->loop.count != 0)
|
||||
{
|
||||
//for (int i = 0; i < sample->loop.count; i++)
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
//if ((loopOffset + 16 + (i * 2)) >= audioBank.size())
|
||||
//break;
|
||||
|
||||
int16_t state = BitConverter::ToInt16BE(audioBank, loopOffset + 16 + (i * 2));
|
||||
sample->loop.states.push_back(state);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue