From 365502d81957a0adda332a4913385c14837c5636 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 26 Jan 2024 12:58:31 -0500 Subject: [PATCH] more linux build errors --- .../T6/AssetLoaders/AssetLoaderSoundBank.cpp | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp index f8391925..90fad2bd 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp @@ -1,26 +1,25 @@ #include "AssetLoaderSoundBank.h" #include "Csv/ParsedCsv.h" -#include "ObjContainer/SoundBank/SoundBankWriter.h" -#include "nlohmann/json.hpp" - #include "Game/T6/CommonT6.h" #include "Game/T6/ObjConstantsT6.h" #include "Game/T6/T6.h" +#include "ObjContainer/SoundBank/SoundBankWriter.h" #include "Pool/GlobalAssetPool.h" +#include "nlohmann/json.hpp" #include -#include -#include -#include #include +#include +#include +#include using namespace T6; namespace fs = std::filesystem; namespace { - const std::string PREFIXES_TO_DROP[] { + const std::string PREFIXES_TO_DROP[]{ "raw/", "devraw/", }; @@ -60,7 +59,7 @@ namespace return nullptr; } -} +} // namespace void* AssetLoaderSoundBank::CreateEmptyAsset(const std::string& assetName, MemoryManager* memory) { @@ -355,13 +354,13 @@ bool LoadSoundRadverbs(MemoryManager* memory, SndBank* sndBank, const SearchPath for (auto i = 0u; i < sndBank->radverbCount; i++) { - auto& row = radverbCsv[i]; + auto row = radverbCsv[i]; auto& name = row.GetValue("name", true); if (name.empty()) return false; - strncpy_s(sndBank->radverbs[i].name, name.data(), 32); + strncpy(sndBank->radverbs[i].name, name.data(), 32); sndBank->radverbs[i].id = Common::SND_HashName(name.data()); sndBank->radverbs[i].smoothing = row.GetValueFloat("smoothing"); sndBank->radverbs[i].earlyTime = row.GetValueFloat("earlyTime"); @@ -398,9 +397,8 @@ bool LoadSoundDuckList(ISearchPath* searchPath, MemoryManager* memory, SndBank* for (auto i = 0u; i < sndBank->duckCount; i++) { - auto* duck = &sndBank->ducks[i]; - auto& row = duckListCsv[i]; - + auto row = duckListCsv[i]; + const auto name = row.GetValue("name", true); if (name.empty()) return false; @@ -412,7 +410,8 @@ bool LoadSoundDuckList(ISearchPath* searchPath, MemoryManager* memory, SndBank* return false; } - strncpy_s(duck->name, name.data(), 32); + auto* duck = &sndBank->ducks[i]; + strncpy(duck->name, name.data(), 32); duck->id = Common::SND_HashName(name.data()); auto duckJson = nlohmann::json::parse(*duckFile.m_stream); @@ -545,7 +544,7 @@ bool AssetLoaderSoundBank::LoadFromRaw( sablWriter->AddSound(GetSoundFilePath(alias), alias->assetId); } } - + // write the output linked sound bank if (sablWriter) {