This commit is contained in:
Till Wübbers
2025-04-27 12:00:22 +02:00
parent d75e5627f9
commit 4cdd80977c
8 changed files with 148 additions and 34 deletions

View File

@@ -72,7 +72,7 @@ namespace Game
class IEntityManager
{
public:
virtual bool Setup(void*& ptr, bool forceReset) = 0;
virtual bool Setup(uint8_t*& ptr, bool forceReset) = 0;
};
template <typename T, typename HandleT, uint32_t C> class EntityManager : public IEntityManager
@@ -86,7 +86,7 @@ namespace Game
public:
// Returns true if size changed
bool Setup(void*& ptr, bool forceReset)
bool Setup(uint8_t*& ptr, bool forceReset)
{
bool changed = false;
if (EntitySize != sizeof(T) || forceReset)
@@ -96,7 +96,7 @@ namespace Game
}
EntitySize = sizeof(T);
Data = reinterpret_cast<T*>(ptr);
ptr = (uint8_t*)ptr + (C * EntitySize);
ptr += C * EntitySize;
return changed;
}