Quellcode durchsuchen

* Update code to make use of libcaca 0.99.beta9.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/cacatris/trunk@1311 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam vor 18 Jahren
Ursprung
Commit
a31333de42
3 geänderte Dateien mit 13 neuen und 18 gelöschten Zeilen
  1. +2
    -2
      configure.ac
  2. +7
    -7
      src/cacatris.h
  3. +4
    -9
      src/main.c

+ 2
- 2
configure.ac Datei anzeigen

@@ -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"


+ 7
- 7
src/cacatris.h Datei anzeigen

@@ -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_ {


+ 4
- 9
src/main.c Datei anzeigen

@@ -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;


Laden…
Abbrechen
Speichern