#ifndef _CC_COMMON_H_ #define _CC_COMMON_H_ #include typedef uint8_t GlyphBitmap[11]; struct rgba { uint8_t r, g, b, a; }; union color { struct rgba rgba; uint32_t v; }; struct palette { const uint8_t count; union color colors[] __attribute__((counted_by(count))); }; #define LENGTHOF(...) (sizeof(__VA_ARGS__) / sizeof(*(__VA_ARGS__))) #define PALETTE(...) { .count = LENGTHOF((union color[]){__VA_ARGS__}), .colors = {__VA_ARGS__} } const extern GlyphBitmap cc_font_atlas[256]; const extern struct palette cc_default_palette, cc_default_gray_palette; #endif