Refactor Jolt-related project settings to only be loaded as needed

This commit is contained in:
Mikael Hermansson 2025-01-08 00:51:14 +01:00
parent b15b24b087
commit 3b78ff564a
18 changed files with 137 additions and 247 deletions

View file

@ -64,7 +64,7 @@ constexpr TValue align_up(TValue p_value, TAlignment p_alignment) {
} //namespace
JoltTempAllocator::JoltTempAllocator() :
capacity((uint64_t)JoltProjectSettings::get_temp_memory_b()),
capacity((uint64_t)JoltProjectSettings::temp_memory_b),
base(static_cast<uint8_t *>(JPH::Allocate((size_t)capacity))) {
}
@ -89,7 +89,7 @@ void *JoltTempAllocator::Allocate(uint32_t p_size) {
WARN_PRINT_ONCE(vformat("Jolt Physics temporary memory allocator exceeded capacity of %d MiB. "
"Falling back to slower general-purpose allocator. "
"Consider increasing maximum temporary memory in project settings.",
JoltProjectSettings::get_temp_memory_mib()));
JoltProjectSettings::temp_memory_mib));
ptr = JPH::Allocate(p_size);
}