| 1 | #ifndef GUI_DRAW_H |
|---|
| 2 | #define GUI_DRAW_H |
|---|
| 3 | //------------------------------------------------------------------- |
|---|
| 4 | |
|---|
| 5 | #if CAM_BITMAP_PALETTE==1 |
|---|
| 6 | #define COLOR_TRANSPARENT 0x00 |
|---|
| 7 | #define COLOR_WHITE 0x11 |
|---|
| 8 | #define COLOR_RED 0x22 |
|---|
| 9 | #define COLOR_GREY 0x3F |
|---|
| 10 | #define COLOR_GREEN 0x55 |
|---|
| 11 | #define COLOR_BLUE_LT 0xDD |
|---|
| 12 | #define COLOR_BLUE 0xDF |
|---|
| 13 | #define COLOR_YELLOW 0xEE |
|---|
| 14 | #define COLOR_BLACK 0xFF |
|---|
| 15 | //#define COLOR_BG 0x0F |
|---|
| 16 | #define COLOR_BG 0x44 |
|---|
| 17 | #define COLOR_FG COLOR_WHITE |
|---|
| 18 | #define COLOR_SELECTED_BG COLOR_RED |
|---|
| 19 | #define COLOR_SELECTED_FG COLOR_WHITE |
|---|
| 20 | #define COLOR_ALT_BG 0xD4 |
|---|
| 21 | #define COLOR_SPLASH_RED 0x2E |
|---|
| 22 | #define COLOR_SPLASH_PINK 0x21 |
|---|
| 23 | #define COLOR_SPLASH_GREY 0x1F |
|---|
| 24 | #elif CAM_BITMAP_PALETTE==2 |
|---|
| 25 | #define COLOR_TRANSPARENT 0x00 |
|---|
| 26 | #define COLOR_WHITE 0xD3 |
|---|
| 27 | #define COLOR_RED 0x64 |
|---|
| 28 | #define COLOR_GREY 0x12 |
|---|
| 29 | #define COLOR_GREEN 0xC4 |
|---|
| 30 | #define COLOR_BLUE_LT 0x6A |
|---|
| 31 | #define COLOR_BLUE 0x87 |
|---|
| 32 | #define COLOR_YELLOW 0x44 |
|---|
| 33 | #define COLOR_BLACK 0xFF |
|---|
| 34 | //#define COLOR_BG 0x0F |
|---|
| 35 | #define COLOR_BG 0x22 |
|---|
| 36 | #define COLOR_FG COLOR_WHITE |
|---|
| 37 | #define COLOR_SELECTED_BG COLOR_RED |
|---|
| 38 | #define COLOR_SELECTED_FG COLOR_WHITE |
|---|
| 39 | #define COLOR_ALT_BG 0x22 |
|---|
| 40 | #define COLOR_SPLASH_RED 0x58 |
|---|
| 41 | #define COLOR_SPLASH_PINK 0x4C |
|---|
| 42 | #define COLOR_SPLASH_GREY 0x16 |
|---|
| 43 | #else |
|---|
| 44 | #error CAM_BITMAP_PALETTE not defined |
|---|
| 45 | #endif |
|---|
| 46 | |
|---|
| 47 | #define FONT_WIDTH 8 |
|---|
| 48 | #define FONT_HEIGHT 16 |
|---|
| 49 | |
|---|
| 50 | //------------------------------------------------------------------- |
|---|
| 51 | extern unsigned int screen_width, screen_height, screen_size; |
|---|
| 52 | extern unsigned int screen_buffer_width, screen_buffer_height, screen_buffer_size; |
|---|
| 53 | |
|---|
| 54 | //------------------------------------------------------------------- |
|---|
| 55 | void draw_init(); |
|---|
| 56 | void draw_set_draw_proc(void (*pixel_proc)(unsigned int offset, color cl)); |
|---|
| 57 | |
|---|
| 58 | extern color draw_get_pixel(coord x, coord y); |
|---|
| 59 | |
|---|
| 60 | extern void draw_line(coord x1, coord y1, coord x2, coord y2, color cl); |
|---|
| 61 | |
|---|
| 62 | // draw frame |
|---|
| 63 | extern void draw_rect(coord x1, coord y1, coord x2, coord y2, color cl); |
|---|
| 64 | extern void draw_round_rect(coord x1, coord y1, coord x2, coord y2, color cl); |
|---|
| 65 | // color: hi_byte - BG; lo_byte - FG |
|---|
| 66 | extern void draw_filled_rect(coord x1, coord y1, coord x2, coord y2, color cl); |
|---|
| 67 | extern void draw_filled_round_rect(coord x1, coord y1, coord x2, coord y2, color cl); |
|---|
| 68 | |
|---|
| 69 | extern void draw_char(coord x, coord y, const char ch, color cl); |
|---|
| 70 | extern void draw_string(coord x, coord y, const char *s, color cl); |
|---|
| 71 | |
|---|
| 72 | extern void draw_txt_rect(coord col, coord row, unsigned int length, unsigned int height, color cl); |
|---|
| 73 | extern void draw_txt_rect_exp(coord col, coord row, unsigned int length, unsigned int height, unsigned int exp, color cl); |
|---|
| 74 | extern void draw_txt_filled_rect(coord col, coord row, unsigned int length, unsigned int height, color cl); |
|---|
| 75 | extern void draw_txt_filled_rect_exp(coord col, coord row, unsigned int length, unsigned int height, unsigned int exp, color cl); |
|---|
| 76 | extern void draw_txt_string(coord col, coord row, const char *str, color cl); |
|---|
| 77 | extern void draw_txt_char(coord col, coord row, const char ch, color cl); |
|---|
| 78 | |
|---|
| 79 | extern void draw_clear(); |
|---|
| 80 | extern void draw_restore(); |
|---|
| 81 | |
|---|
| 82 | extern void draw_fill(coord x, coord y, color cl_fill, color cl_bound); |
|---|
| 83 | extern void draw_circle(coord x, coord y, const unsigned int r, color cl); |
|---|
| 84 | extern void draw_ellipse(coord xc, coord yc, unsigned int a, unsigned int b, color cl); |
|---|
| 85 | extern void draw_filled_ellipse(coord xc, coord yc, unsigned int a, unsigned int b, color cl); |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | //------------------------------------------------------------------- |
|---|
| 89 | #endif |
|---|