Utils.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: Beerware
8 #pragma once
9 
10 #include <SDL.h>
11 
16 #define RETURN_ON_ERROR(value) if (-1 == value) { return value; }
17 
18 void Utils_ClearFlag(const Uint8 u8Bit, Uint16* pu16Flags);
19 SDL_bool Utils_IsFlagSet(const Uint8 u8Bit, Uint16 u16Flags);
20 void Utils_SetFlag(const Uint8 u8Bit, Uint16* pu16Flags);
21 void Utils_ToggleFlag(const Uint8 u8Bit, Uint16* pu16Flags);
22 double Utils_Round(double dValue);
23 Uint32 Utils_Xorshift(Uint32* pu32State);
double Utils_Round(double dValue)
Round to integral value.
Definition: Utils.c:82
Uint32 Utils_Xorshift(Uint32 *pu32State)
Pseudo-random number generator.
Definition: Utils.c:104
void Utils_ClearFlag(const Uint8 u8Bit, Uint16 *pu16Flags)
Clear flag.
Definition: Utils.c:21
SDL_bool Utils_IsFlagSet(const Uint8 u8Bit, Uint16 u16Flags)
Check if flag is set.
Definition: Utils.c:37
void Utils_SetFlag(const Uint8 u8Bit, Uint16 *pu16Flags)
Set flag.
Definition: Utils.c:57
void Utils_ClearFlag(const Uint8 u8Bit, Uint16 *pu16Flags)
Clear flag.
Definition: Utils.c:21
void Utils_ToggleFlag(const Uint8 u8Bit, Uint16 *pu16Flags)
Toggle flag.
Definition: Utils.c:70
double Utils_Round(double dValue)
Round to integral value.
Definition: Utils.c:82
Uint32 Utils_Xorshift(Uint32 *pu32State)
Pseudo-random number generator.
Definition: Utils.c:104
void Utils_SetFlag(const Uint8 u8Bit, Uint16 *pu16Flags)
Set flag.
Definition: Utils.c:57
void Utils_ToggleFlag(const Uint8 u8Bit, Uint16 *pu16Flags)
Toggle flag.
Definition: Utils.c:70
SDL_bool Utils_IsFlagSet(const Uint8 u8Bit, Uint16 u16Flags)
Check if flag is set.
Definition: Utils.c:37