Ignore:
Timestamp:
Sep 18, 2006, 6:54:08 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Bring the tree back in sync with the new libcaca API.
File:
1 edited

Legend:

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

    r544 r1057  
    2727#include "common.h"
    2828
    29 struct cucul_sprite *foo_sprite;
    30 struct cucul_sprite *bar_sprite;
    31 struct cucul_sprite *baz_sprite;
     29cucul_canvas_t *foo_sprite;
     30cucul_canvas_t *bar_sprite;
     31cucul_canvas_t *baz_sprite;
    3232
    3333void init_aliens(game *g, aliens *al)
    3434{
     35    cucul_buffer_t *b;
    3536    int i;
    3637
     
    4041    }
    4142
    42     foo_sprite = cucul_load_sprite(g->qq, "data/foofight.txt");
    43     bar_sprite = cucul_load_sprite(g->qq, "data/barfight.txt");
    44     baz_sprite = cucul_load_sprite(g->qq, "data/bazfight.txt");
     43    b = cucul_load_file("data/foofight.caca");
     44    foo_sprite = cucul_import_canvas(b, "");
     45    cucul_free_buffer(b);
     46
     47    b = cucul_load_file("data/barfight.caca");
     48    bar_sprite = cucul_import_canvas(b, "");
     49    cucul_free_buffer(b);
     50
     51    b = cucul_load_file("data/bazfight.caca");
     52    baz_sprite = cucul_import_canvas(b, "");
     53    cucul_free_buffer(b);
    4554}
    4655
     
    5463        {
    5564            case ALIEN_FOO:
    56                 cucul_draw_sprite(g->qq, al->x[i], al->y[i], foo_sprite, al->img[i] % 5);
     65                cucul_set_canvas_frame(foo_sprite, al->img[i] % 5);
     66                cucul_blit(g->cv, al->x[i], al->y[i], foo_sprite, NULL);
    5767                break;
    5868            case ALIEN_BAR:
    59                 cucul_draw_sprite(g->qq, al->x[i], al->y[i], bar_sprite, al->img[i] % 2);
     69                cucul_set_canvas_frame(bar_sprite, al->img[i] % 2);
     70                cucul_blit(g->cv, al->x[i], al->y[i], bar_sprite, NULL);
    6071                break;
    6172            case ALIEN_BAZ:
    62                 cucul_draw_sprite(g->qq, al->x[i], al->y[i], baz_sprite, al->img[i] % 4);
     73                cucul_set_canvas_frame(baz_sprite, al->img[i] % 4);
     74                cucul_blit(g->cv, al->x[i], al->y[i], baz_sprite, NULL);
    6375                break;
    6476            case ALIEN_NONE:
Note: See TracChangeset for help on using the changeset viewer.