#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]))