mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
allow sound aliases without explicit files
This commit is contained in:
parent
f6ee4790fa
commit
e61c58c4c5
@ -122,14 +122,15 @@ bool LoadSoundAlias(MemoryManager* memory, SndAlias* alias, const ParsedCsvRow&
|
|||||||
if (name.empty())
|
if (name.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const auto& aliasFileName = row.GetValue("file", true);
|
|
||||||
if (aliasFileName.empty())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
alias->name = memory->Dup(name.data());
|
alias->name = memory->Dup(name.data());
|
||||||
alias->id = Common::SND_HashName(name.data());
|
alias->id = Common::SND_HashName(name.data());
|
||||||
|
|
||||||
|
const auto aliasFileName = row.GetValue("file");
|
||||||
|
if (!aliasFileName.empty())
|
||||||
|
{
|
||||||
alias->assetFileName = memory->Dup(aliasFileName.data());
|
alias->assetFileName = memory->Dup(aliasFileName.data());
|
||||||
alias->assetId = Common::SND_HashName(aliasFileName.data());
|
alias->assetId = Common::SND_HashName(aliasFileName.data());
|
||||||
|
}
|
||||||
|
|
||||||
const auto secondaryName = row.GetValue("secondary");
|
const auto secondaryName = row.GetValue("secondary");
|
||||||
if (!secondaryName.empty())
|
if (!secondaryName.empty())
|
||||||
@ -529,12 +530,15 @@ bool AssetLoaderSoundBank::LoadFromRaw(
|
|||||||
{
|
{
|
||||||
const auto* alias = &aliasList->head[j];
|
const auto* alias = &aliasList->head[j];
|
||||||
|
|
||||||
|
if (alias->assetFileName && alias->assetId)
|
||||||
|
{
|
||||||
if (sabsWriter && alias->flags.loadType == SA_STREAMED)
|
if (sabsWriter && alias->flags.loadType == SA_STREAMED)
|
||||||
sabsWriter->AddSound(GetSoundFilePath(alias), alias->assetId, alias->flags.looping, true);
|
sabsWriter->AddSound(GetSoundFilePath(alias), alias->assetId, alias->flags.looping, true);
|
||||||
else if (sablWriter)
|
else if (sablWriter)
|
||||||
sablWriter->AddSound(GetSoundFilePath(alias), alias->assetId, alias->flags.looping);
|
sablWriter->AddSound(GetSoundFilePath(alias), alias->assetId, alias->flags.looping);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// write the output linked sound bank
|
// write the output linked sound bank
|
||||||
if (sablWriter)
|
if (sablWriter)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user