mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- adjusted bit array helpers for the change of type for gotpic from (undefined) char to (defined) uint8_t.
This commit is contained in:
parent
a6ba81939a
commit
17a4ddd51e
1 changed files with 11 additions and 5 deletions
|
@ -511,18 +511,24 @@ inline int QRandom2(int a1)
|
|||
return mulscale(qrand(), a1, 14)-a1;
|
||||
}
|
||||
|
||||
inline void SetBitString(char *pArray, int nIndex)
|
||||
template<class T>
|
||||
inline void SetBitString(T *pArray, int nIndex)
|
||||
{
|
||||
pArray[nIndex>>3] |= 1<<(nIndex&7);
|
||||
static_assert(sizeof(T) == 1);
|
||||
pArray[nIndex>>3] |= 1<<(nIndex&7);
|
||||
}
|
||||
|
||||
inline void ClearBitString(char *pArray, int nIndex)
|
||||
template<class T>
|
||||
inline void ClearBitString(T *pArray, int nIndex)
|
||||
{
|
||||
pArray[nIndex >> 3] &= ~(1 << (nIndex & 7));
|
||||
static_assert(sizeof(T) == 1);
|
||||
pArray[nIndex >> 3] &= ~(1 << (nIndex & 7));
|
||||
}
|
||||
|
||||
inline char TestBitString(char *pArray, int nIndex)
|
||||
template<class T>
|
||||
inline char TestBitString(T *pArray, int nIndex)
|
||||
{
|
||||
static_assert(sizeof(T) == 1);
|
||||
return pArray[nIndex>>3] & (1<<(nIndex&7));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue