fixup id generation
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
9f943cc6a2
commit
42cb7897c2
1 changed files with 1 additions and 1 deletions
|
|
@ -3,7 +3,7 @@
|
|||
#include <ikarus/objects/object_type.h>
|
||||
|
||||
constexpr uint64_t IKARUS_ID_OBJECT_TYPE_BITS = 8;
|
||||
constexpr uint64_t IKARUS_ID_OBJECT_RANDOM_BITS = sizeof(IkarusId) - IKARUS_ID_OBJECT_TYPE_BITS;
|
||||
constexpr uint64_t IKARUS_ID_OBJECT_RANDOM_BITS = sizeof(IkarusId) * 8 - IKARUS_ID_OBJECT_TYPE_BITS;
|
||||
|
||||
auto ikarus_id_from_data_and_type(int64_t data, IkarusObjectType type) -> IkarusId {
|
||||
return data | (static_cast<IkarusId>(type) << IKARUS_ID_OBJECT_RANDOM_BITS);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue