Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*----------------------------------------------------------------------------*-
- *
- * DBit - 16-bit and 8-bit arrays support.
- *
- * created by Maximiliano Vega (MrDeath537)
- *
- -*----------------------------------------------------------------------------*/
- #if !defined DBIT_INCLUDED
- #define DBIT_INCLUDED
- #else
- #endinput
- #endif
- /*----------------------------------------------------------------------------*/
- stock
- DBITS_VAR;
- /*----------------------------------------------------------------------------*/
- #define Bit16:%0<%1> \
- %0[(%1)/2]
- #define Bit8:%0<%1> \
- %0[(%1) char]
- /*----------------------------------------------------------------------------*/
- #define Bit8_Get(%0,%1) \
- (%0{(%1)})
- #define Bit8_Set(%0,%1,%2) \
- (%0{(%1)}=(%2))
- /*----------------------------------------------------------------------------*/
- #define Bit16_Get(%0,%1) \
- (((DBITS_VAR=(%1)),DBITS_VAR&1)?(%0[(%1)/2]&0x0000FFFF):((%0[(%1)/2]>>>16)&0x0000FFFF))
- stock Bit16_Set(bVar[], iSlot, bNum)
- {
- if (iSlot & 1)
- bVar[iSlot / 2] = (bVar[iSlot / 2] & 0xFFFF0000) | bNum;
- else
- bVar[iSlot / 2] = (bVar[iSlot / 2] & 0x0000FFFF) | (bNum << 16);
- }
- /*----------------------------------------------------------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement