Changeset 1311 for cacatris/trunk


Ignore:
Timestamp:
Nov 9, 2006, 11:52:31 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Update code to make use of libcaca 0.99.beta9.
Location:
cacatris/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cacatris/trunk/configure.ac

    r1083 r1311  
    2727
    2828CACA="no"
    29 PKG_CHECK_MODULES(caca, caca,
     29PKG_CHECK_MODULES(caca, caca >= 0.99.beta9,
    3030 [CACA="yes"],
    3131 [AC_MSG_RESULT(no)
    32   AC_MSG_ERROR([you need libcaca version 0.99 or later])])
     32  AC_MSG_ERROR([you need libcaca version 0.99.beta9 or later])])
    3333
    3434# Optimizations
  • cacatris/trunk/src/cacatris.h

    r1126 r1311  
    4444
    4545unsigned int blocks_palette[] = {
    46     CUCUL_COLOR_BLUE,
    47     CUCUL_COLOR_GREEN,
    48     CUCUL_COLOR_CYAN,
    49     CUCUL_COLOR_RED,
    50     CUCUL_COLOR_MAGENTA,
    51     CUCUL_COLOR_BROWN,
    52     CUCUL_COLOR_LIGHTGRAY
     46    CUCUL_BLUE,
     47    CUCUL_GREEN,
     48    CUCUL_CYAN,
     49    CUCUL_RED,
     50    CUCUL_MAGENTA,
     51    CUCUL_BROWN,
     52    CUCUL_LIGHTGRAY
    5353};
    5454
  • cacatris/trunk/src/main.c

    r1213 r1311  
    200200    sprintf(totalline, " Lines    :   %02d    ", total);
    201201
    202     cucul_set_color(inf, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     202    cucul_set_color_ansi(inf, CUCUL_WHITE, CUCUL_BLUE);
    203203    cucul_putstr(inf, 0, 0, "      =Cacatris=    ");
    204204    cucul_putstr(inf, 0, 1, "  Arrows  :    move ");
     
    232232            unsigned int oyi = (unsigned int) oy;
    233233            unsigned int c = playfield[oxi+oyi*FIELD_WIDTH];
    234             if(c) {
    235                 cucul_set_color(canvas, CUCUL_COLOR_BLACK, blocks_palette[c-1]);
    236                 cucul_putchar(canvas, x, y, ' ');
    237             } else {
    238                 cucul_set_color(canvas, CUCUL_COLOR_BLACK, CUCUL_COLOR_DARKGRAY);
    239                 cucul_putchar(canvas, x, y, ' ');
    240 
    241             }
     234            cucul_set_color_ansi(canvas, CUCUL_BLACK,
     235                                 c ? blocks_palette[c-1] : CUCUL_DARKGRAY);
     236            cucul_putchar(canvas, x, y, ' ');
    242237            ox+=incx;
    243238        }
Note: See TracChangeset for help on using the changeset viewer.