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/bonus.c

    r544 r1057  
    2727#include "common.h"
    2828
    29 struct cucul_sprite *heart_sprite;
    30 struct cucul_sprite *gem_sprite;
     29cucul_canvas_t *heart_sprite;
     30cucul_canvas_t *gem_sprite;
    3131
    3232void init_bonus(game *g, bonus *bo)
    3333{
     34    cucul_buffer_t *b;
    3435    int i;
    3536
     
    3940    }
    4041
    41     heart_sprite = cucul_load_sprite(g->qq, "data/bonheart.txt");
    42     gem_sprite = cucul_load_sprite(g->qq, "data/bongem.txt");
     42    b = cucul_load_file("data/bonheart.caca");
     43    heart_sprite = cucul_import_canvas(b, "");
     44    cucul_free_buffer(b);
     45
     46    b = cucul_load_file("data/bongem.caca");
     47    gem_sprite = cucul_import_canvas(b, "");
     48    cucul_free_buffer(b);
    4349}
    4450
     
    5258        {
    5359            case BONUS_GREEN:
    54                 cucul_draw_sprite(g->qq, bo->x[i], bo->y[i], gem_sprite,
    55                                   (bo->n[i]/2 % 3) ? 0 : 1);
     60                cucul_set_canvas_frame(gem_sprite, (bo->n[i]/2 % 3) ? 0 : 1);
     61                cucul_blit(g->cv, bo->x[i], bo->y[i], gem_sprite, NULL);
    5662                break;
    5763            case BONUS_LIFE:
    58                 cucul_draw_sprite(g->qq, bo->x[i], bo->y[i], heart_sprite,
    59                                   (bo->n[i] % 3) ? 0 : 1);
     64                cucul_set_canvas_frame(heart_sprite, (bo->n[i] % 3) ? 0 : 1);
     65                cucul_blit(g->cv, bo->x[i], bo->y[i], heart_sprite, NULL);
    6066                break;
    6167            case BONUS_NONE:
Note: See TracChangeset for help on using the changeset viewer.