|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Single source of truth for index+generation bit-packing. More...
#include <cstdint>

Go to the source code of this file.
Classes | |
| struct | esengine::PackedId< IndexBits, GenBits > |
| Index+generation packing into a u32, parameterized by the bit split. More... | |
Namespaces | |
| namespace | esengine |
Single source of truth for index+generation bit-packing.
Both the ECS esengine::Entity and the resource esengine::resource::Handle pack a slot index plus a reuse generation into one integer. They used to each copy-paste the masks/shifts (three independent packings drifted apart — see the RC re-architecture's "multiple sources of truth" root cause). This template is the one definition both delegate to; the bit split is a parameter.
The u32 storage is deliberate and structurally enforced by the static_assert below: a packed id must fit in 32 bits so that
Definition in file PackedId.hpp.