|
| static u8 | getNybble1 (Actor *target) |
| static u8 | getNybble2 (Actor *target) |
| static u8 | getNybble3 (Actor *target) |
| static u8 | getNybble4 (Actor *target) |
| static u8 | getNybble5 (Actor *target) |
| static u8 | getNybble6 (Actor *target) |
| static u8 | getNybble7 (Actor *target) |
| static u8 | getNybble8 (Actor *target) |
| static u8 | getNybble9 (Actor *target) |
| static u8 | getNybble10 (Actor *target) |
| static u8 | getNybble11 (Actor *target) |
| static u8 | getNybble12 (Actor *target) |
| static u8 | getNybble13 (Actor *target) |
| static u8 | getNybble14 (Actor *target) |
| static u8 | getNybble15 (Actor *target) |
| static u8 | getNybble16 (Actor *target) |
| static u8 | getNybble17 (Actor *target) |
| static u8 | getNybble18 (Actor *target) |
| static u8 | getNybble19 (Actor *target) |
| static u8 | getNybble20 (Actor *target) |
| static u8 | getNybble21 (Actor *target) |
| static u8 | getNybble22 (Actor *target) |
| static u8 | getNybble23 (Actor *target) |
| static u8 | getNybble24 (Actor *target) |
| static u32 | getNybbleRange (Actor *target, u8 from, u8 end) |
| | Extract the combined value of a range of up to 8 sequential nybbles from the given actor's full 24 nybbles of spritedata.
|
| static u32 | getBitRange (const Actor *target, u8 from, u8 end) |
| | Extract the value of an arbitrary 32-bit range of bits from the given actor's full 96 bits of spritedata which make up all nybbles 1-24. Bit layout cheatsheet: nybbles 1-4 (bits 0-15), nybbles 5-12 (bits 16-47), nybbles 13-20 (bits 48-79), nybbles 21-24 (bits 80-96)
|
| template<u8 TFrom, u8 TEnd, s32 TOutBytes> |
| static void | getBitRange (const Actor *target, u8(&out)[TOutBytes]) |
| | Extract a compile-time defined range of bits (up to 96) from the given actor's spritedata. Bit layout cheatsheet: nybbles 1-4 (bits 0-15), nybbles 5-12 (bits 16-47), nybbles 13-20 (bits 48-79), nybbles 21-24 (bits 80-96)
|
| u32 red::SpriteUtil::getBitRange |
( |
const Actor * | target, |
|
|
u8 | from, |
|
|
u8 | end ) |
|
inlinestaticnodiscard |
Extract the value of an arbitrary 32-bit range of bits from the given actor's full 96 bits of spritedata which make up all nybbles 1-24. Bit layout cheatsheet: nybbles 1-4 (bits 0-15), nybbles 5-12 (bits 16-47), nybbles 13-20 (bits 48-79), nybbles 21-24 (bits 80-96)
Max. output is limited to a 32-bit value for performance, if the requested range exceeds 32 bits in size or is invalid, OSFatal is called. Use the other overload if you need to extract more than 32 bits.
- Parameters
-
| from | 0-indexed Big Endian (left-to-right) inclusive bit index to start the range at. (0-96) |
| end | 0-indexed Big Endian (left-to-right) exclusive bit index to end the range at. (0-96) |
template<u8 TFrom, u8 TEnd, s32 TOutBytes>
| void red::SpriteUtil::getBitRange |
( |
const Actor * | target, |
|
|
u8(&) | out[TOutBytes] ) |
|
inlinestatic |
Extract a compile-time defined range of bits (up to 96) from the given actor's spritedata. Bit layout cheatsheet: nybbles 1-4 (bits 0-15), nybbles 5-12 (bits 16-47), nybbles 13-20 (bits 48-79), nybbles 21-24 (bits 80-96)
The output is right-aligned in the provided buffer. All memory safety checks and bounds validations are resolved at compile-time. Fast/Slow paths are optimized statically.
- Parameters
-
| target | The actor whose spritedata will be extracted. |
| out | Reference to a buffer where the extracted bits will be written (size deduced automatically). |
- Template Parameters
-
| TFrom | 0-indexed Big Endian inclusive start bit index. |
| TEnd | 0-indexed Big Endian exclusive end bit index. |
| TOutBytes | Deduced byte size of the provided output array. |