diff --git a/configure.ac b/configure.ac index 44f5b94..b00f0a3 100644 --- a/configure.ac +++ b/configure.ac @@ -26,10 +26,10 @@ if test "$build" != "$host" -a "${PKG_CONFIG_LIBDIR}" = ""; then fi CACA="no" -PKG_CHECK_MODULES(caca, caca, +PKG_CHECK_MODULES(caca, caca >= 0.99.beta9, [CACA="yes"], [AC_MSG_RESULT(no) - AC_MSG_ERROR([you need libcaca version 0.99 or later])]) + AC_MSG_ERROR([you need libcaca version 0.99.beta9 or later])]) # Optimizations CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" diff --git a/src/cacatris.h b/src/cacatris.h index 960eada..3c26640 100644 --- a/src/cacatris.h +++ b/src/cacatris.h @@ -43,13 +43,13 @@ unsigned char playfield[FIELD_WIDTH*FIELD_HEIGHT]; static cucul_canvas_t *field, *infos, *screen; unsigned int blocks_palette[] = { - CUCUL_COLOR_BLUE, - CUCUL_COLOR_GREEN, - CUCUL_COLOR_CYAN, - CUCUL_COLOR_RED, - CUCUL_COLOR_MAGENTA, - CUCUL_COLOR_BROWN, - CUCUL_COLOR_LIGHTGRAY + CUCUL_BLUE, + CUCUL_GREEN, + CUCUL_CYAN, + CUCUL_RED, + CUCUL_MAGENTA, + CUCUL_BROWN, + CUCUL_LIGHTGRAY }; typedef struct piece_t_ { diff --git a/src/main.c b/src/main.c index c5ac5e3..44a5812 100644 --- a/src/main.c +++ b/src/main.c @@ -199,7 +199,7 @@ void infos_populate(cucul_canvas_t *inf, unsigned int score, sprintf(levelline, " Level : %02d ", level); sprintf(totalline, " Lines : %02d ", total); - cucul_set_color(inf, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE); + cucul_set_color_ansi(inf, CUCUL_WHITE, CUCUL_BLUE); cucul_putstr(inf, 0, 0, " =Cacatris= "); cucul_putstr(inf, 0, 1, " Arrows : move "); cucul_putstr(inf, 0, 2, " Space : pouf "); @@ -231,14 +231,9 @@ void playfield_draw(cucul_canvas_t *canvas) unsigned int oxi = (unsigned int) ox; unsigned int oyi = (unsigned int) oy; unsigned int c = playfield[oxi+oyi*FIELD_WIDTH]; - if(c) { - cucul_set_color(canvas, CUCUL_COLOR_BLACK, blocks_palette[c-1]); - cucul_putchar(canvas, x, y, ' '); - } else { - cucul_set_color(canvas, CUCUL_COLOR_BLACK, CUCUL_COLOR_DARKGRAY); - cucul_putchar(canvas, x, y, ' '); - - } + cucul_set_color_ansi(canvas, CUCUL_BLACK, + c ? blocks_palette[c-1] : CUCUL_DARKGRAY); + cucul_putchar(canvas, x, y, ' '); ox+=incx; } ox = 0;