From 177400159883b19fc5d6b07647af30fcd5d51fc7 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Sun, 6 Oct 2024 12:13:22 -0700 Subject: [PATCH] Use int16_t max for pitch dumping and loading --- src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp | 2 +- src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp index 76ddc2ce..5834efc6 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp @@ -142,7 +142,7 @@ namespace return false; } - value = static_cast(CentToHertz(centValue) * static_cast(std::numeric_limits::max())); + value = static_cast(CentToHertz(centValue) * static_cast(std::numeric_limits::max())); return true; } diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp index b7cea999..ec79fe34 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp @@ -404,7 +404,7 @@ namespace void WriteColumnPitchHertz(CsvOutputStream& stream, const uint16_t value) { - const auto hertz = static_cast(value) / static_cast(std::numeric_limits::max()); + const auto hertz = static_cast(value) / static_cast(std::numeric_limits::max()); const auto cents = std::clamp(HertzToCents(hertz), -2400.0f, 1200.0f); stream.WriteColumn(std::format("{:.4g}", cents)); }