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

    r544 r1057  
    2727#include "common.h"
    2828
    29 struct cucul_sprite *medium_sprite;
    30 struct cucul_sprite *small_sprite;
     29cucul_canvas_t *medium_sprite;
     30cucul_canvas_t *small_sprite;
    3131
    3232void init_explosions(game *g, explosions *ex)
    3333{
     34    cucul_buffer_t *b;
    3435    int i;
    3536
     
    3940    }
    4041
    41     medium_sprite = cucul_load_sprite(g->qq, "data/xplmed.txt");
    42     small_sprite = cucul_load_sprite(g->qq, "data/xplsmall.txt");
     42    b = cucul_load_file("data/xplmed.caca");
     43    medium_sprite = cucul_import_canvas(b, "");
     44    cucul_free_buffer(b);
     45
     46    b = cucul_load_file("data/xplsmall.caca");
     47    small_sprite = cucul_import_canvas(b, "");
     48    cucul_free_buffer(b);
    4349}
    4450
     
    7783    {
    7884#if 0
    79         cucul_set_fg_color(g->qq, CACA_COLOR_GREEN);
    80         cucul_goto(g->qq, ex->x[i] + 3, ex->y[i]);
     85        cucul_set_fg_color(g->cv, CACA_COLOR_GREEN);
     86        cucul_goto(g->cv, ex->x[i] + 3, ex->y[i]);
    8187        switch(cucul_rand(0,2))
    8288        {
    8389        case 0:
    84             cucul_putchar(g->qq, 'p');
    85             cucul_putchar(g->qq, 'i');
    86             cucul_putchar(g->qq, 'f');
     90            cucul_putchar(g->cv, 'p');
     91            cucul_putchar(g->cv, 'i');
     92            cucul_putchar(g->cv, 'f');
    8793            break;
    8894        case 1:
    89             cucul_putchar(g->qq, 'p');
    90             cucul_putchar(g->qq, 'a');
    91             cucul_putchar(g->qq, 'f');
     95            cucul_putchar(g->cv, 'p');
     96            cucul_putchar(g->cv, 'a');
     97            cucul_putchar(g->cv, 'f');
    9298            break;
    9399        case 2:
    94             cucul_putchar(g->qq, 'p');
    95             cucul_putchar(g->qq, 'o');
    96             cucul_putchar(g->qq, 'u');
    97             cucul_putchar(g->qq, 'f');
     100            cucul_putchar(g->cv, 'p');
     101            cucul_putchar(g->cv, 'o');
     102            cucul_putchar(g->cv, 'u');
     103            cucul_putchar(g->cv, 'f');
    98104            break;
    99105        }
    100         cucul_putchar(g->qq, '!');
     106        cucul_putchar(g->cv, '!');
    101107#endif
    102108
     
    104110        {
    105111            case EXPLOSION_MEDIUM:
    106                 cucul_draw_sprite(g->qq, ex->x[i], ex->y[i], medium_sprite,
    107                                   10 - ex->n[i]);
     112                cucul_set_canvas_frame(medium_sprite, 10 - ex->n[i]);
     113                cucul_blit(g->cv, ex->x[i], ex->y[i], medium_sprite, NULL);
    108114                break;
    109115            case EXPLOSION_SMALL:
    110                 cucul_draw_sprite(g->qq, ex->x[i], ex->y[i], small_sprite,
    111                                   6 - ex->n[i]);
     116                cucul_set_canvas_frame(small_sprite, 6 - ex->n[i]);
     117                cucul_blit(g->cv, ex->x[i], ex->y[i], small_sprite, NULL);
    112118                break;
    113119            case EXPLOSION_NONE:
Note: See TracChangeset for help on using the changeset viewer.