Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Include/Pipe/Core/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ namespace p::core
i32 RemoveMany(const Container& items, const bool shouldShrink = true)
{
const i32 lastSize = Size();
for (i32 i = 0; i < lastSize; ++i)
for (i32 i = 0; i < Size(); ++i)
{
if (items.Contains(Data()[i]))
{
Expand Down
2 changes: 1 addition & 1 deletion Include/Pipe/Core/Tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace p::core

public:
constexpr Tag() = default;
explicit Tag(StringView value);
Tag(StringView value);
Tag(const TChar* value) : Tag(StringView{value}) {}
explicit Tag(const String& value) : Tag(StringView(value)) {}

Expand Down
2 changes: 1 addition & 1 deletion Include/Pipe/ECS/Pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ namespace p::ecs
{
for (i32 i = 0; i < Size(); ++i)
{
if (idList[i] != ecs::NoId)
if (ecs::GetVersion(idList[i]) != ecs::NoVersion)
{
data.RemoveAt(i);
}
Expand Down
74 changes: 0 additions & 74 deletions Include/Pipe/Memory/InlineAllocator.h

This file was deleted.

13 changes: 7 additions & 6 deletions Src/ECS/BasePool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "Pipe/ECS/BasePool.h"

#include "Pipe/Core/Limits.h"
#include "Pipe/ECS/Id.h"


namespace p::ecs
Expand Down Expand Up @@ -69,7 +70,7 @@ namespace p::ecs
const Index index = ecs::GetIndex(id);
i32& idIndex = idIndices[index];

idList[idIndex] = ecs::NoId;
idList[idIndex] = ecs::MakeId(index, ecs::NoVersion); // Mark invalid but keep index
lastRemovedIndex = idIndex;
idIndex = NO_INDEX;
}
Expand All @@ -91,18 +92,18 @@ namespace p::ecs
if (lastRemovedIndex == NO_INDEX)
{
const auto last = end();
for (auto it = begin(); it < last; ++it)
for (Id id : idList)
{
idIndices[ecs::GetIndex(*it)] = NO_INDEX;
idIndices[ecs::GetIndex(id)] = NO_INDEX;
}
}
else
{
for (Id entity : *this)
for (Id id : idList)
{
if (ecs::GetVersion(entity) != ecs::GetVersion(ecs::NoId))
if (ecs::GetVersion(id) != ecs::NoVersion)
{
idIndices[ecs::GetIndex(entity)] = NO_INDEX;
idIndices[ecs::GetIndex(id)] = NO_INDEX;
}
}
}
Expand Down