aboutsummaryrefslogtreecommitdiff
path: root/src/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/types.h')
-rw-r--r--src/types.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/types.h b/src/types.h
new file mode 100644
index 0000000..dc6789e
--- /dev/null
+++ b/src/types.h
@@ -0,0 +1,11 @@
+#define uint unsigned int
+#define uint8 unsigned char
+#define uint16 uint16_t
+#define uint32 unsigned int
+
+#define COLTOINT(R,G,B) (((unsigned int)R)<<16)|(((unsigned int)G)<<8)|(unsigned int)B
+#define INTTOCOL(C) (C>>16), ((C>>8)%256), (C%256)
+#define COLTOINTA(R,G,B,A) (((COLTOINT(R,G,B)) << 8)|(unsigned int)A)
+#define INTTOCOLA(C) (C>>24), ((C>>16)&0xFF), ((C>>8)&0xFF), (C&0xFF)
+
+#define LENGTH(S) ((sizeof S)/(sizeof S[0]))