Load bounce sounds, better soundalias structure

This commit is contained in:
rackover 2021-04-13 19:54:09 +02:00
parent 1fe241c7e5
commit 3e9b05d8ce
2 changed files with 16 additions and 5 deletions

View File

@ -170,8 +170,13 @@ namespace Assets
LoadWeapSound(putawaySoundPlayer);
LoadWeapSound(scanSound);
// No idea how to handle this!
//if (asset->weapDef->bounceSound && *asset->weapDef->bounceSound) builder->loadAsset(Game::XAssetType::ASSET_TYPE_SOUND, *asset->weapDef->bounceSound);
if (asset->weapDef->bounceSound)
{
for (size_t i = 0; i < 31; i++)
{
LoadWeapSound(bounceSound[i]);
}
}
LoadWeapSound(projExplosionSound);
LoadWeapSound(projDudSound);

View File

@ -34,7 +34,7 @@ namespace Assets
return;
}
aliasList->aliasName = builder->getAllocator()->duplicateString(infoData["aliasName"].string_value().c_str());
aliasList->aliasName = builder->getAllocator()->duplicateString(name.c_str());
for (size_t i = 0; i < aliasList->count; i++)
{
@ -79,6 +79,7 @@ namespace Assets
auto envelopMax = head["envelopMax"];
auto envelopPercentage = head["envelopPercentage"];
auto speakerMap = head["speakerMap"];
auto aliasName = head["aliasName"];
// Fix casing
if (soundFile.is_null())
@ -109,6 +110,11 @@ namespace Assets
Components::Logger::Print("%s is not string but %d (%s)\n", "subtitle", subtitle.type(), subtitle.dump().c_str());
}
if (!CHECK(aliasName, string))
{
Components::Logger::Print("%s is not string but %d (%s)\n", "aliasName", aliasName.type(), aliasName.dump().c_str());
}
if (!CHECK(secondaryAliasName, string))
{
Components::Logger::Print("%s is not string but %d (%s)\n", "secondaryAliasName", secondaryAliasName.type(), secondaryAliasName.dump().c_str());
@ -195,7 +201,7 @@ namespace Assets
}
if (CHECK(type, number) && CHECK(subtitle, string) && CHECK(secondaryAliasName, string) && CHECK(chainAliasName, string) &&
if (CHECK(type, number) && CHECK(aliasName, string) && CHECK(subtitle, string) && CHECK(secondaryAliasName, string) && CHECK(chainAliasName, string) &&
CHECK(soundFile, string) && CHECK(sequence, number) && CHECK(volMin, number) && CHECK(volMax, number) && CHECK(pitchMin, number) &&
CHECK(pitchMax, number) && CHECK(distMin, number) && CHECK(distMax, number) && CHECK(flags, number) && CHECK(slavePercentage, number) &&
CHECK(probability, number) && CHECK(lfePercentage, number) && CHECK(centerPercentage, number) && CHECK(startDelay, number) &&
@ -204,7 +210,7 @@ namespace Assets
{
alias->soundFile->exists = true;
alias->aliasName = aliasList->aliasName;
alias->aliasName = builder->getAllocator()->duplicateString(aliasName.string_value().c_str());
if (subtitle.is_string())
{