From fe766a734ff03594e7ee495e8d8bcf213e186b2f Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Sun, 15 Sep 2024 21:21:05 -0700 Subject: [PATCH] Use decltype of variable being set --- .../T6/AssetLoaders/AssetLoaderSoundBank.cpp | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp index 8269dc81..c269a450 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp @@ -75,7 +75,7 @@ bool AssetLoaderSoundBank::CanLoadFromRaw() const size_t GetValueIndex(const std::string& value, const std::string* lookupTable, size_t len) { if (value.empty()) - return 0; + return 0; for (auto i = 0u; i < len; i++) { @@ -140,34 +140,34 @@ bool LoadSoundAlias(MemoryManager* memory, SndAlias* alias, const ParsedCsvRow& alias->subtitle = memory->Dup(subtitle.data()); alias->duck = Common::SND_HashName(row.GetValue("duck").data()); - - alias->volMin = row.GetValueInt("vol_min"); - alias->volMax = row.GetValueInt("vol_max"); - alias->distMin = row.GetValueInt("dist_min"); - alias->distMax = row.GetValueInt("dist_max"); - alias->distReverbMax = row.GetValueInt("dist_reverb_max"); - alias->limitCount = row.GetValueInt("limit_count"); - alias->entityLimitCount = row.GetValueInt("entity_limit_count"); - alias->pitchMin = row.GetValueInt("pitch_min"); - alias->pitchMax = row.GetValueInt("pitch_max"); - alias->minPriority = row.GetValueInt("min_priority"); - alias->maxPriority = row.GetValueInt("max_priority"); - alias->minPriorityThreshold = row.GetValueInt("min_priority_threshold"); - alias->maxPriorityThreshold = row.GetValueInt("max_priority_threshold"); - alias->probability = row.GetValueInt("probability"); - alias->startDelay = row.GetValueInt("start_delay"); - alias->reverbSend = row.GetValueInt("reverb_send"); - alias->centerSend = row.GetValueInt("center_send"); - alias->envelopMin = row.GetValueInt("envelop_min"); - alias->envelopMax = row.GetValueInt("envelop_max"); - alias->envelopPercentage = row.GetValueInt("envelop_percentage"); - alias->occlusionLevel = row.GetValueInt("occlusion_level"); - alias->fluxTime = row.GetValueInt("move_time"); - alias->futzPatch = row.GetValueInt("futz"); - alias->contextType = row.GetValueInt("context_type"); - alias->contextValue = row.GetValueInt("context_value"); - alias->fadeIn = row.GetValueInt("fade_in"); - alias->fadeOut = row.GetValueInt("fade_out"); + + alias->volMin = row.GetValueIntvolMin)>("vol_min"); + alias->volMax = row.GetValueIntvolMax)>("vol_max"); + alias->distMin = row.GetValueIntdistMin)>("dist_min"); + alias->distMax = row.GetValueIntdistMax)>("dist_max"); + alias->distReverbMax = row.GetValueIntdistReverbMax)>("dist_reverb_max"); + alias->limitCount = row.GetValueIntlimitCount)>("limit_count"); + alias->entityLimitCount = row.GetValueIntentityLimitCount)>("entity_limit_count"); + alias->pitchMin = row.GetValueIntpitchMin)>("pitch_min"); + alias->pitchMax = row.GetValueIntpitchMax)>("pitch_max"); + alias->minPriority = row.GetValueIntminPriority)>("min_priority"); + alias->maxPriority = row.GetValueIntmaxPriority)>("max_priority"); + alias->minPriorityThreshold = row.GetValueIntminPriorityThreshold)>("min_priority_threshold"); + alias->maxPriorityThreshold = row.GetValueIntmaxPriorityThreshold)>("max_priority_threshold"); + alias->probability = row.GetValueIntprobability)>("probability"); + alias->startDelay = row.GetValueIntstartDelay)>("start_delay"); + alias->reverbSend = row.GetValueIntreverbSend)>("reverb_send"); + alias->centerSend = row.GetValueIntcenterSend)>("center_send"); + alias->envelopMin = row.GetValueIntenvelopMin)>("envelop_min"); + alias->envelopMax = row.GetValueIntenvelopMax)>("envelop_max"); + alias->envelopPercentage = row.GetValueIntenvelopPercentage)>("envelop_percentage"); + alias->occlusionLevel = row.GetValueIntocclusionLevel)>("occlusion_level"); + alias->fluxTime = row.GetValueIntfluxTime)>("move_time"); + alias->futzPatch = row.GetValueIntfutzPatch)>("futz"); + alias->contextType = row.GetValueIntcontextType)>("context_type"); + alias->contextValue = row.GetValueIntcontextValue)>("context_value"); + alias->fadeIn = row.GetValueIntfadeIn)>("fade_in"); + alias->fadeOut = row.GetValueIntfadeOut)>("fade_out"); alias->flags.looping = row.GetValue("loop") == "looping"; alias->flags.panType = row.GetValue("pan") == "3d"; @@ -179,7 +179,7 @@ bool LoadSoundAlias(MemoryManager* memory, SndAlias* alias, const ParsedCsvRow& alias->flags.pauseable = row.GetValue("pause") == "yes"; alias->flags.stopOnDeath = row.GetValue("stop_on_death") == "yes"; - alias->duckGroup = static_cast(GetValueIndex(row.GetValue("duck_group"), SOUND_DUCK_GROUPS, std::extent_v)); + alias->duckGroup = static_castduckGroup)>(GetValueIndex(row.GetValue("duck_group"), SOUND_DUCK_GROUPS, std::extent_v)); alias->flags.volumeGroup = GetValueIndex(row.GetValue("group"), SOUND_GROUPS, std::extent_v); alias->flags.fluxType = GetValueIndex(row.GetValue("move_type"), SOUND_MOVE_TYPES, std::extent_v); alias->flags.loadType = GetValueIndex(row.GetValue("type"), SOUND_LOAD_TYPES, std::extent_v);