diff options
author | nathansmith117 <nathansmith117@sdf.org> | 2025-02-04 11:29:07 +0000 |
---|---|---|
committer | nathansmith117 <nathansmith117@sdf.org> | 2025-02-04 11:29:07 +0000 |
commit | fe9b718f8978cfd792f7303214b2dd45172b8d4b (patch) | |
tree | 8efd867eae12ad5d55d29e964272974ee3d71b18 /include | |
parent | fb7ccc0c046ed80fdac2e829b8c367841600e211 (diff) | |
download | sldj-fe9b718f8978cfd792f7303214b2dd45172b8d4b.tar.gz sldj-fe9b718f8978cfd792f7303214b2dd45172b8d4b.tar.bz2 sldj-fe9b718f8978cfd792f7303214b2dd45172b8d4b.zip |
Working on script context
Diffstat (limited to 'include')
-rw-r--r-- | include/libsldj/util.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/libsldj/util.h b/include/libsldj/util.h new file mode 100644 index 0000000..fd89d1c --- /dev/null +++ b/include/libsldj/util.h @@ -0,0 +1,35 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> + +#ifndef UTIL_H +#define UTIL_H + +#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) + +// Just the same color structure as the raylib name. +#ifndef RL_COLOR_TYPE +#define RL_COLOR_TYPE +typedef struct Color { + unsigned char r; + unsigned char g; + unsigned char b; + unsigned char a; +} Color; +#endif + +// Used for sending information to a scanner. +typedef struct SldjContext { + uint16_t viewportWidth; + uint16_t viewportHeight; + uint8_t targetFps; + uint16_t xCount; + uint16_t yCount; +} SldjContext; + +#endif + |