From 9e660e594f6d3a43ea1427fb872801a2fcedad93 Mon Sep 17 00:00:00 2001 From: Krow Savcik Date: Tue, 26 Sep 2023 22:32:35 +0300 Subject: initial commit --- src/types.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/types.h (limited to 'src/types.h') 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])) -- cgit v1.2.3