Changeset 156 for ttyvaders/trunk/libee/graphics.c
- Timestamp:
- Nov 12, 2003, 5:23:18 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ttyvaders/trunk/libee/graphics.c
r154 r156 27 27 #elif USE_NCURSES 28 28 # include <curses.h> 29 #elif USE_CONIO 30 # include <conio.h> 31 #else 32 # error "no graphics library detected" 29 33 #endif 30 34 … … 35 39 36 40 static int ee_color = 0; 41 #ifdef USE_CONIO 42 static enum COLORS dos_colors[] = { 43 0, 44 BLACK, 45 GREEN, 46 YELLOW, 47 WHITE, 48 RED, 49 DARKGRAY, 50 LIGHTGRAY, 51 BLUE, 52 CYAN, 53 MAGENTA 54 }; 55 #endif 37 56 38 57 void ee_set_color(int color) … … 43 62 #elif USE_NCURSES 44 63 attrset(COLOR_PAIR(color)); 45 #else 46 /* Use dummy driver */ 64 #elif USE_CONIO 65 if(color >= 1 && color <= 10) 66 textcolor(dos_colors[color]); 47 67 #endif 48 68 } … … 61 81 move(y,x); 62 82 addch(c); 63 #else 64 /* Use dummy driver */ 83 #elif USE_CONIO 84 gotoxy(x+1,y+1); 85 putch(c); 65 86 #endif 66 87 } … … 74 95 move(y,x); 75 96 addstr(s); 76 #else 77 /* Use dummy driver */ 97 #elif USE_CONIO 98 gotoxy(x+1,y+1); 99 cputs(s); 78 100 #endif 79 101 } … … 81 103 void ee_clear(void) 82 104 { 83 #if defined(USE_SLANG) || defined(USE_NCURSES) 84 /* We could use SLsmg_cls(), but drawing empty lines is much faster */ 105 /* We could use SLsmg_cls() etc., but drawing empty lines is much faster */ 85 106 int x = ee_get_width(), y = ee_get_height(); 86 107 char *empty_line = malloc((x + 1) * sizeof(char)); … … 95 116 96 117 free(empty_line); 97 #else98 /* Use dummy driver */99 #endif100 118 } 101 119
Note: See TracChangeset
for help on using the changeset viewer.