Ignore:
Timestamp:
Oct 18, 2008, 11:42:24 PM (11 years ago)
Author:
Sam Hocevar
Message:

Port ttyvaders to the unified libcaca 0.99.beta15 API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ttyvaders/trunk/src/intro.c

    r1460 r2990  
    2424{
    2525    caca_event_t ev;
    26     cucul_canvas_t *foo_sprite;
    27     cucul_canvas_t *bar_sprite;
    28     cucul_canvas_t *baz_sprite;
    29     cucul_buffer_t *b;
     26    caca_canvas_t *foo_sprite;
     27    caca_canvas_t *bar_sprite;
     28    caca_canvas_t *baz_sprite;
     29    caca_buffer_t *b;
    3030    int frame = 0;
    3131
    32     b = cucul_load_file("data/foofight.caca");
    33     foo_sprite = cucul_import_canvas(b, "");
    34     cucul_free_buffer(b);
     32    b = caca_load_file("data/foofight.caca");
     33    foo_sprite = caca_import_canvas(b, "");
     34    caca_free_buffer(b);
    3535
    36     b = cucul_load_file("data/barfight.caca");
    37     bar_sprite = cucul_import_canvas(b, "");
    38     cucul_free_buffer(b);
     36    b = caca_load_file("data/barfight.caca");
     37    bar_sprite = caca_import_canvas(b, "");
     38    caca_free_buffer(b);
    3939
    40     b = cucul_load_file("data/bazfight.caca");
    41     baz_sprite = cucul_import_canvas(b, "");
    42     cucul_free_buffer(b);
     40    b = caca_load_file("data/bazfight.caca");
     41    baz_sprite = caca_import_canvas(b, "");
     42    caca_free_buffer(b);
    4343
    4444    while(caca_get_event(g->dp, CACA_EVENT_KEY_PRESS, &ev, 0) == 0)
     
    4848        frame++;
    4949
    50         cucul_clear_canvas(g->cv);
     50        caca_clear_canvas(g->cv);
    5151
    52         xo = cucul_get_canvas_width(g->cv) / 2;
    53         yo = cucul_get_canvas_height(g->cv) / 2;
     52        xo = caca_get_canvas_width(g->cv) / 2;
     53        yo = caca_get_canvas_height(g->cv) / 2;
    5454
    55         cucul_set_color(g->cv, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK);
    56         cucul_fill_ellipse(g->cv, xo, yo, 16, 8, "#");
    57         cucul_set_color(g->cv, CUCUL_COLOR_GREEN, CUCUL_COLOR_BLACK);
    58         cucul_draw_thin_ellipse(g->cv, xo, yo, 16, 8);
     55        caca_set_color(g->cv, CACA_COLOR_RED, CACA_COLOR_BLACK);
     56        caca_fill_ellipse(g->cv, xo, yo, 16, 8, "#");
     57        caca_set_color(g->cv, CACA_COLOR_GREEN, CACA_COLOR_BLACK);
     58        caca_draw_thin_ellipse(g->cv, xo, yo, 16, 8);
    5959
    6060        for(i = 0; i < 4; i ++)
     
    6666        y[4] = y[0];
    6767
    68         cucul_set_color(g->cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_BLACK);
    69         cucul_fill_triangle(g->cv, x[0], y[0], x[1], y[1], x[2], y[2], " ");
    70         cucul_fill_triangle(g->cv, x[0], y[0], x[3], y[3], x[2], y[2], " ");
    71         cucul_draw_line(g->cv, x[0], y[0], x[2], y[2], " ");
    72         cucul_set_color(g->cv, CUCUL_COLOR_GREEN, CUCUL_COLOR_BLACK);
    73         cucul_draw_thin_polyline(g->cv, x, y, 4);
     68        caca_set_color(g->cv, CACA_COLOR_BLACK, CACA_COLOR_BLACK);
     69        caca_fill_triangle(g->cv, x[0], y[0], x[1], y[1], x[2], y[2], " ");
     70        caca_fill_triangle(g->cv, x[0], y[0], x[3], y[3], x[2], y[2], " ");
     71        caca_draw_line(g->cv, x[0], y[0], x[2], y[2], " ");
     72        caca_set_color(g->cv, CACA_COLOR_GREEN, CACA_COLOR_BLACK);
     73        caca_draw_thin_polyline(g->cv, x, y, 4);
    7474
    75         cucul_set_canvas_frame(foo_sprite, frame % 5);
    76         cucul_blit(g->cv, xo, yo, foo_sprite, NULL);
     75        caca_set_canvas_frame(foo_sprite, frame % 5);
     76        caca_blit(g->cv, xo, yo, foo_sprite, NULL);
    7777
    7878        caca_refresh_display(g->dp);
Note: See TracChangeset for help on using the changeset viewer.