Changeset 158 for ttyvaders/trunk/libee/graphics.c
- Timestamp:
- Nov 12, 2003, 7:41:02 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ttyvaders/trunk/libee/graphics.c
r156 r158 23 23 #include "config.h" 24 24 25 #if def USE_SLANG25 #if defined(USE_SLANG) 26 26 # include <slang.h> 27 #elif USE_NCURSES27 #elif defined(USE_NCURSES) 28 28 # include <curses.h> 29 #elif USE_CONIO29 #elif defined(USE_CONIO) 30 30 # include <conio.h> 31 31 #else … … 39 39 40 40 static int ee_color = 0; 41 #if def USE_CONIO41 #if defined(USE_CONIO) 42 42 static enum COLORS dos_colors[] = { 43 43 0, … … 58 58 { 59 59 ee_color = color; 60 #if def USE_SLANG60 #if defined(USE_SLANG) 61 61 SLsmg_set_color(color); 62 #elif USE_NCURSES62 #elif defined(USE_NCURSES) 63 63 attrset(COLOR_PAIR(color)); 64 #elif USE_CONIO64 #elif defined(USE_CONIO) 65 65 if(color >= 1 && color <= 10) 66 66 textcolor(dos_colors[color]); … … 73 73 } 74 74 75 extern char *_screen_buffer; 76 75 77 void ee_putchar(int x, int y, char c) 76 78 { 77 #if def USE_SLANG79 #if defined(USE_SLANG) 78 80 SLsmg_gotorc(y,x); 79 81 SLsmg_write_char(c); 80 #elif USE_NCURSES82 #elif defined(USE_NCURSES) 81 83 move(y,x); 82 84 addch(c); 83 #elif USE_CONIO 84 gotoxy(x+1,y+1); 85 putch(c); 85 #elif defined(USE_CONIO) 86 if(x<0 || x>=ee_get_width() || y<0 || y>=ee_get_height()) 87 return; 88 _screen_buffer[2 * (x + y * ee_get_width())] = c; 89 _screen_buffer[2 * (x + y * ee_get_width()) + 1] = dos_colors[ee_color]; 90 // gotoxy(x+1,y+1); 91 // putch(c); 86 92 #endif 87 93 } … … 89 95 void ee_putstr(int x, int y, char *s) 90 96 { 91 #ifdef USE_SLANG 97 if(y<0 || y>=ee_get_height()) 98 return; 99 #if defined(USE_SLANG) 92 100 SLsmg_gotorc(y,x); 93 101 SLsmg_write_string(s); 94 #elif USE_NCURSES102 #elif defined(USE_NCURSES) 95 103 move(y,x); 96 104 addstr(s); 97 #elif USE_CONIO 98 gotoxy(x+1,y+1); 99 cputs(s); 105 #elif defined(USE_CONIO) 106 char *buf = _screen_buffer + 2 * (x + y * ee_get_width()); 107 while(*s) 108 { 109 *buf++ = *s++; 110 *buf++ = dos_colors[ee_color]; 111 } 112 // gotoxy(x+1,y+1); 113 // cputs(s); 100 114 #endif 101 115 }
Note: See TracChangeset
for help on using the changeset viewer.