Ignore:
Timestamp:
Nov 12, 2003, 10:18:50 PM (19 years ago)
Author:
Sam Hocevar
Message:
  • libee/ee.h: + Added ee_color_names[] containing our 16 color names.
  • libee/ee.c: + Extended our color set to the full 16 instead of 10. + Precalculate ncurses attributes.
  • libee/graphics.c: + Clip color value in ee_set_color(). + Clip characters in ee_putchar(). + Partially clip characters in ee_putstr(), overflows aren't checked yet.
  • libee/ee_internals.h: + New file to share extern variables within libee.
  • test/demo.c: + Added a simple demo_color() to output all colors. + Replaced four ee_draw_line() with ee_draw_thin_box(). + Replaced x1, y1, x2 etc. with xa, ya, xb etc. because <math.h> already

defines y1.

+ Randomized colours from 0 to 15 instead of 1 to 10.

  • src/Makefiles.am: + Added -lm to the ttyvaders linking flags because of the intro.
  • README BUGS TODO: + Updated.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/libee/io.c

    r155 r159  
    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
     
    3434
    3535#include "ee.h"
     36#include "ee_internals.h"
    3637
    3738char ee_get_key(void)
    3839{
    39 #ifdef USE_SLANG
    40     if(SLang_input_pending(0))
    41     {
    42         return SLang_getkey();
    43     }
    44 #elif USE_NCURSES
     40#if defined(USE_SLANG)
     41    return SLang_input_pending(0) ? SLang_getkey() : 0;
     42
     43#elif defined(USE_NCURSES)
    4544    char key = getch();
     45    return key != ERR ? key : 0;
    4646
    47     if(key != ERR)
    48     {
    49         return key;
    50     }
    51 #elif USE_CONIO
     47#elif defined(USE_CONIO)
    5248    return _conio_kbhit() ? getch() : 0;
    5349
    5450#endif
    55 
    56     return 0;
    5751}
    5852
Note: See TracChangeset for help on using the changeset viewer.