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/ee.c

    r148 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
     
    3842
    3943static int _ee_delay;
     44#ifdef USE_CONIO
     45static struct text_info ti;
     46#endif
    4047
    4148int ee_init(void)
     
    98105    init_pair(EE_MAGENTA, COLOR_MAGENTA, COLOR_BLACK);
    99106
    100 #else
    101     /* Dummy driver */
     107#elif USE_CONIO
     108    _wscroll = 0;
     109    _setcursortype(_NOCURSOR);
     110    clrscr();
     111    gettextinfo(&ti);
     112//window(2, 2, 20, 20);
    102113
    103114#endif
     
    118129#elif USE_NCURSES
    119130    return COLS;
    120 #else
    121     return 80;
     131#elif USE_CONIO
     132    return ti.screenwidth;
    122133#endif
    123134}
     
    130141    return LINES;
    131142#else
    132     return 25;
    133 #endif
    134 }
    135 
     143    return ti.screenheight;
     144#endif
     145}
     146
     147#ifndef USE_CONIO
    136148static int64_t local_time(void)
    137149{
     
    145157    return now;
    146158}
     159#endif
    147160
    148161void ee_refresh(void)
    149162{
     163#ifndef USE_CONIO
    150164    static int64_t local_clock = 0;
    151165    int64_t now;
     
    161175        /* If we are late, we shouldn't display anything */
    162176    }
     177#endif
    163178
    164179#ifdef USE_SLANG
     
    166181#elif USE_NCURSES
    167182    refresh();
    168 #else
    169     /* Use dummy driver */
    170 #endif
    171 
     183#elif USE_CONIO
     184    /* Do nothing? */
     185#endif
     186
     187#ifndef USE_CONIO
    172188    now = local_time();
    173189
     
    178194
    179195    local_clock += _ee_delay;
     196#endif
    180197}
    181198
     
    189206    curs_set(1);
    190207    endwin();
    191 #else
    192     /* Use dummy driver */
    193 #endif
    194 }
    195 
     208#elif USE_CONIO
     209    _wscroll = 1;
     210    ee_set_color(EE_WHITE);
     211    ee_putstr(ee_get_width(), ee_get_height()-1, "\r\n");
     212    _setcursortype(_NORMALCURSOR);
     213#endif
     214}
     215
Note: See TracChangeset for help on using the changeset viewer.