mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-25 01:34:18 +00:00
Add a PARAMS_PACK macro for building actor params setters (#2304)
This commit is contained in:
parent
6239f8e0b3
commit
e10c64a0b4
1 changed files with 4 additions and 0 deletions
|
@ -748,6 +748,10 @@ typedef struct NpcInteractInfo {
|
|||
#define PARAMS_GET_NOSHIFT(p, s, n) \
|
||||
((p) & (NBITS_TO_MASK(n) << (s)))
|
||||
|
||||
// Moves the `n`-bit value `p` to bit position `s` for building actor parameters by OR-ing these together
|
||||
#define PARAMS_PACK(p, s, n) \
|
||||
(((p) & NBITS_TO_MASK(n)) << (s))
|
||||
|
||||
// Generates a bitmask for bit position `s` of length `n`
|
||||
#define PARAMS_MAKE_MASK(s, n) PARAMS_GET_NOSHIFT(~0, s, n)
|
||||
|
||||
|
|
Loading…
Reference in a new issue