Ignore:
Timestamp:
Nov 12, 2003, 5:23:18 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • MS-DOS port of libee, using <conio.h>.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ttyvaders/trunk/libee/graphics.c

    r154 r156  
    2727#elif USE_NCURSES
    2828#   include <curses.h>
     29#elif USE_CONIO
     30#   include <conio.h>
     31#else
     32#   error "no graphics library detected"
    2933#endif
    3034
     
    3539
    3640static int ee_color = 0;
     41#ifdef USE_CONIO
     42static 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
    3756
    3857void ee_set_color(int color)
     
    4362#elif USE_NCURSES
    4463    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]);
    4767#endif
    4868}
     
    6181    move(y,x);
    6282    addch(c);
    63 #else
    64     /* Use dummy driver */
     83#elif USE_CONIO
     84    gotoxy(x+1,y+1);
     85    putch(c);
    6586#endif
    6687}
     
    7495    move(y,x);
    7596    addstr(s);
    76 #else
    77     /* Use dummy driver */
     97#elif USE_CONIO
     98    gotoxy(x+1,y+1);
     99    cputs(s);
    78100#endif
    79101}
     
    81103void ee_clear(void)
    82104{
    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 */
    85106    int x = ee_get_width(), y = ee_get_height();
    86107    char *empty_line = malloc((x + 1) * sizeof(char));
     
    95116
    96117    free(empty_line);
    97 #else
    98     /* Use dummy driver */
    99 #endif
    100118}
    101119
Note: See TracChangeset for help on using the changeset viewer.