diff options
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/utils.h b/src/utils.h index e3b52ed..e289189 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,13 +1,17 @@ #include <stdio.h> #include <stdlib.h> -#include <stdlib.h> +#include <stdint.h> +#include <math.h> #include <raylib.h> -#include "raylib.h" +#include <raymath.h> +#include "raygui.h" #ifndef UTIL_H #define UTIL_H +typedef struct Game Game; + #define FT_NAMEMAX 256 // Memory management. @@ -27,4 +31,11 @@ typedef enum FTError { FTSUCCESS = 0 } FTError; +// Bit shit. +#define SET_BIT(b, n) (b | (0x1 << n)) +#define CLEAR_BIT(b, n) (b & ~(0x1 << n)) +#define IS_BIT_SET(b, n) ((b >> n) & 0x1) +#define TOGGLE_BIT(b, n) (b ^ (0x1 << n)) +#define HAS_FLAG(v, f) ((v & f) == f) + #endif |