Ignore:
Timestamp:
Nov 12, 2003, 7:41:02 PM (18 years ago)
Author:
Sam Hocevar
Message:
  • README: + Added a note about dos cross-compilation.
  • configure.ac: + Added a check for ScreenUpdate? in <pc.h>.
  • libee/graphics.c libee/ee.c: + Improved the conio port thanks to ScreenUpdate?().
File:
1 edited

Legend:

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

    r156 r158  
    2323#include "config.h"
    2424
    25 #ifdef USE_SLANG
     25#if defined(USE_SLANG)
    2626#   include <slang.h>
    27 #elif USE_NCURSES
     27#elif defined(USE_NCURSES)
    2828#   include <curses.h>
    29 #elif USE_CONIO
     29#elif defined(USE_CONIO)
    3030#   include <conio.h>
    3131#else
     
    3939
    4040static int ee_color = 0;
    41 #ifdef USE_CONIO
     41#if defined(USE_CONIO)
    4242static enum COLORS dos_colors[] = {
    4343    0,
     
    5858{
    5959    ee_color = color;
    60 #ifdef USE_SLANG
     60#if defined(USE_SLANG)
    6161    SLsmg_set_color(color);
    62 #elif USE_NCURSES
     62#elif defined(USE_NCURSES)
    6363    attrset(COLOR_PAIR(color));
    64 #elif USE_CONIO
     64#elif defined(USE_CONIO)
    6565    if(color >= 1 && color <= 10)
    6666        textcolor(dos_colors[color]);
     
    7373}
    7474
     75extern char *_screen_buffer;
     76
    7577void ee_putchar(int x, int y, char c)
    7678{
    77 #ifdef USE_SLANG
     79#if defined(USE_SLANG)
    7880    SLsmg_gotorc(y,x);
    7981    SLsmg_write_char(c);
    80 #elif USE_NCURSES
     82#elif defined(USE_NCURSES)
    8183    move(y,x);
    8284    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);
    8692#endif
    8793}
     
    8995void ee_putstr(int x, int y, char *s)
    9096{
    91 #ifdef USE_SLANG
     97    if(y<0 || y>=ee_get_height())
     98        return;
     99#if defined(USE_SLANG)
    92100    SLsmg_gotorc(y,x);
    93101    SLsmg_write_string(s);
    94 #elif USE_NCURSES
     102#elif defined(USE_NCURSES)
    95103    move(y,x);
    96104    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);
    100114#endif
    101115}
Note: See TracChangeset for help on using the changeset viewer.