Merge remote-tracking branch 'origin/master' into 1.11

# Conflicts:
#	Source/Engine/Level/Scene/SceneRendering.cpp
#	Source/Engine/Physics/Colliders/Collider.cpp
#	Source/Engine/Physics/Colliders/Collider.h
This commit is contained in:
Wojtek Figat
2025-09-02 22:23:45 +02:00
53 changed files with 899 additions and 287 deletions

View File

@@ -417,7 +417,7 @@ public:
template<typename ItemType>
bool Add(const ItemType& item)
{
Bucket* bucket = Base::OnAdd(item, false);
Bucket* bucket = Base::OnAdd(item, false, true);
if (bucket)
bucket->Occupy(item);
return bucket != nullptr;
@@ -430,7 +430,7 @@ public:
/// <returns>True if element has been added to the collection, otherwise false if the element is already present.</returns>
bool Add(T&& item)
{
Bucket* bucket = Base::OnAdd(item, false);
Bucket* bucket = Base::OnAdd(item, false, true);
if (bucket)
bucket->Occupy(MoveTemp(item));
return bucket != nullptr;

View File

@@ -365,7 +365,7 @@ protected:
}
template<typename KeyComparableType>
BucketType* OnAdd(const KeyComparableType& key, bool checkUnique = true)
BucketType* OnAdd(const KeyComparableType& key, bool checkUnique = true, bool nullIfNonUnique = false)
{
// Check if need to rehash elements (prevent many deleted elements that use too much of capacity)
if (_deletedCount * HASH_SET_DEFAULT_SLACK_SCALE > _size)
@@ -386,6 +386,8 @@ protected:
Platform::CheckFailed("That key has been already added to the collection.", __FILE__, __LINE__);
return nullptr;
}
if (nullIfNonUnique)
return nullptr;
return &_allocation.Get()[pos.ObjectIndex];
}