mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 14:58:10 -05:00
Increase rounded sound alias float value precision until it is equal to initial value
This commit is contained in:
@ -76,16 +76,6 @@ namespace
|
||||
return 0;
|
||||
}
|
||||
|
||||
float DbsplToLinear(const float dbsplValue)
|
||||
{
|
||||
return std::pow(10.0f, (dbsplValue - 100.0f) / 20.0f);
|
||||
}
|
||||
|
||||
float CentsToHertz(const float cents)
|
||||
{
|
||||
return std::pow(2.0f, cents / 1200.0f);
|
||||
}
|
||||
|
||||
bool ReadColumnString(const std::vector<CsvCell>& row, const unsigned columnIndex, const char*& value, MemoryManager& memory)
|
||||
{
|
||||
const auto& cell = row[columnIndex];
|
||||
@ -117,7 +107,7 @@ namespace
|
||||
return false;
|
||||
}
|
||||
|
||||
value = static_cast<uint16_t>(DbsplToLinear(dbsplValue) * static_cast<float>(std::numeric_limits<uint16_t>::max()));
|
||||
value = static_cast<uint16_t>(T6::Common::DbsplToLinear(dbsplValue) * static_cast<float>(std::numeric_limits<uint16_t>::max()));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -142,7 +132,7 @@ namespace
|
||||
return false;
|
||||
}
|
||||
|
||||
value = static_cast<uint16_t>(CentsToHertz(centValue) * static_cast<float>(std::numeric_limits<int16_t>::max()));
|
||||
value = static_cast<uint16_t>(T6::Common::CentsToHertz(centValue) * static_cast<float>(std::numeric_limits<int16_t>::max()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user