#include <SDL.h>
#include "Utils.h"
Include dependency graph for Utils.c:

Functions

void Utils_ClearFlag (const Uint8 u8Bit, Uint16 *pu16Flags)
 Clear flag. More...
 
SDL_bool Utils_IsFlagSet (const Uint8 u8Bit, Uint16 u16Flags)
 Check if flag is set. More...
 
void Utils_SetFlag (const Uint8 u8Bit, Uint16 *pu16Flags)
 Set flag. More...
 
void Utils_ToggleFlag (const Uint8 u8Bit, Uint16 *pu16Flags)
 Toggle flag. More...
 
double Utils_Round (double dValue)
 Round to integral value. More...
 
Uint32 Utils_Xorshift (Uint32 *pu32State)
 Pseudo-random number generator. More...
 

Function Documentation

◆ Utils_ClearFlag()

void Utils_ClearFlag ( const Uint8  u8Bit,
Uint16 *  pu16Flags 
)

Clear flag.

Clears specific flag in bit/flag field

Parameters
u8BitFlag/bit to clear
pu16FlagsPointer to flag/bit field
Here is the caller graph for this function:

◆ Utils_IsFlagSet()

SDL_bool Utils_IsFlagSet ( const Uint8  u8Bit,
Uint16  u16Flags 
)

Check if flag is set.

Checks whether a specific flag is set or not

Parameters
u8BitFlag/bit to check
u16FlagsFlag/bit field
Returns
Current state of the flag
Return values
SDL_TRUEFlag is set
SDL_FALSEFlag is not set
Here is the caller graph for this function:

◆ Utils_Round()

double Utils_Round ( double  dValue)

Round to integral value.

Round to integral value, regardless of rounding direction

Parameters
dValueThe value to round
Returns
Rounded integral value
Here is the caller graph for this function:

◆ Utils_SetFlag()

void Utils_SetFlag ( const Uint8  u8Bit,
Uint16 *  pu16Flags 
)

Set flag.

Sets specific flag in bit/flag field

Parameters
u8BitFlag/bit to set
pu16FlagsPointer to flag/bit field
Here is the caller graph for this function:

◆ Utils_ToggleFlag()

void Utils_ToggleFlag ( const Uint8  u8Bit,
Uint16 *  pu16Flags 
)

Toggle flag.

Toggles specific flag in bit/flag field

Parameters
u8BitFlag/bit to toggle
pu16FlagsPointer to flag/bit field

◆ Utils_Xorshift()

Uint32 Utils_Xorshift ( Uint32 *  pu32State)

Pseudo-random number generator.

Pseudo-random number generator based on linear-feedback shift registers

Parameters
pu32StateCurrent state/seed
Returns
32-bit pseudo-random number
Remarks
The state word must be initialized to non-zero.