fix SND_HashName

This commit is contained in:
Alex 2024-01-01 10:29:26 -05:00
parent 85539b24be
commit c8f1c16130
3 changed files with 16 additions and 26 deletions

View File

@ -23,7 +23,7 @@ namespace T6
while (str[offset]) while (str[offset])
{ {
const auto c = tolower(str[offset++]); const auto c = tolower(str[offset++]);
result = c + 33 * result; result = c + 0x1003F * result;
} }
if (!result) if (!result)

View File

@ -5602,8 +5602,8 @@ namespace T6
struct SndAliasFlags struct SndAliasFlags
{ {
// flags0 // flags0
SndAliasLoopType looping : 1; // 0 unsigned int looping : 1; // 0
SndAliasPanType panType : 1; // 1 unsigned int panType : 1; // 1
unsigned int distanceLpf : 1; // 2 unsigned int distanceLpf : 1; // 2
unsigned int doppler : 1; // 3 unsigned int doppler : 1; // 3
unsigned int isBig : 1; // 4 unsigned int isBig : 1; // 4
@ -5614,7 +5614,7 @@ namespace T6
unsigned int voiceLimit : 1; // 9 unsigned int voiceLimit : 1; // 9
unsigned int ignoreMaxDist : 1; // 10 unsigned int ignoreMaxDist : 1; // 10
unsigned int busType : 4; // 11-14 unsigned int busType : 4; // 11-14
SndAliasLoadType loadType : 2; // 15-16 unsigned int loadType : 2; // 15-16
unsigned int volumeGroup : 5; // 17-21 unsigned int volumeGroup : 5; // 17-21
unsigned int fluxType : 3; // 22-24 unsigned int fluxType : 3; // 22-24
unsigned int limitType : 2; // 25-26 unsigned int limitType : 2; // 25-26
@ -5674,9 +5674,9 @@ namespace T6
char duckGroup; char duckGroup;
}; };
#ifndef __zonecodegenerator #ifndef __zonecodegenerator
static_assert(sizeof(SndAliasFlags) == 8); static_assert(sizeof(SndAliasFlags) == 8);
#endif #endif
struct type_align(4) pathlink_s struct type_align(4) pathlink_s
{ {

View File

@ -1,7 +1,7 @@
#include "AssetDumperSndBank.h" #include "AssetDumperSndBank.h"
#include "Game/T6/CommonT6.h"
#include "Csv/CsvStream.h" #include "Csv/CsvStream.h"
#include "Game/T6/CommonT6.h"
#include "ObjContainer/SoundBank/SoundBank.h" #include "ObjContainer/SoundBank/SoundBank.h"
#include "Sound/WavWriter.h" #include "Sound/WavWriter.h"
#include "nlohmann/json.hpp" #include "nlohmann/json.hpp"
@ -169,25 +169,15 @@ namespace
"", "",
}; };
const std::unordered_map<unsigned int, std::string> CURVES_MAP{ std::unordered_map<unsigned int, std::string> CreateCurvesMap()
{T6::Common::SND_HashName(CURVES_ENUM[0].data()), CURVES_ENUM[0]}, {
{T6::Common::SND_HashName(CURVES_ENUM[1].data()), CURVES_ENUM[1]}, std::unordered_map<unsigned int, std::string> result;
{T6::Common::SND_HashName(CURVES_ENUM[2].data()), CURVES_ENUM[2]}, for (auto i = 0u; i < std::extent_v<decltype(CURVES_ENUM)>; i++)
{T6::Common::SND_HashName(CURVES_ENUM[3].data()), CURVES_ENUM[3]}, result.emplace(T6::Common::SND_HashName(CURVES_ENUM[i].data()), CURVES_ENUM[i]);
{T6::Common::SND_HashName(CURVES_ENUM[4].data()), CURVES_ENUM[4]}, return result;
{T6::Common::SND_HashName(CURVES_ENUM[5].data()), CURVES_ENUM[5]}, }
{T6::Common::SND_HashName(CURVES_ENUM[6].data()), CURVES_ENUM[6]},
{T6::Common::SND_HashName(CURVES_ENUM[7].data()), CURVES_ENUM[7]}, const std::unordered_map<unsigned int, std::string> CURVES_MAP = CreateCurvesMap();
{T6::Common::SND_HashName(CURVES_ENUM[8].data()), CURVES_ENUM[8]},
{T6::Common::SND_HashName(CURVES_ENUM[9].data()), CURVES_ENUM[9]},
{T6::Common::SND_HashName(CURVES_ENUM[10].data()), CURVES_ENUM[10]},
{T6::Common::SND_HashName(CURVES_ENUM[11].data()), CURVES_ENUM[11]},
{T6::Common::SND_HashName(CURVES_ENUM[12].data()), CURVES_ENUM[12]},
{T6::Common::SND_HashName(CURVES_ENUM[13].data()), CURVES_ENUM[13]},
{T6::Common::SND_HashName(CURVES_ENUM[14].data()), CURVES_ENUM[14]},
{T6::Common::SND_HashName(CURVES_ENUM[15].data()), CURVES_ENUM[15]},
{T6::Common::SND_HashName(CURVES_ENUM[16].data()), CURVES_ENUM[16]},
};
const std::string DUCK_GROUPS_ENUM[]{ const std::string DUCK_GROUPS_ENUM[]{
"snp_alerts_gameplay", "snp_alerts_gameplay",