Skip to main content

Crate oot_bitset

Crate oot_bitset 

Source
Expand description

oot_bitset – “Ocarina-style” compact bit-flags, ported from C

Each flag is a 16-bit ID where • upper 12 bits → word index • lower 4 bits → bit index inside that word

The slice you pass in must be an array of u16 words large enough to hold the highest word index you will touch.

Functions§

bitset_clear
Clear (disable) a flag.
bitset_get
Test whether a given flag is set.
bitset_index
Extract the word part of an encoded flag (upper 12 bits).
bitset_mask
Convert an encoded flag to a one-bit mask (lower 4 bits → 0–15).
bitset_set
Set (enable) a flag.
bitset_word_mut
Borrow the underlying 16-bit word for direct fiddling, mirroring the C macro.