Ignore:
Timestamp:
Oct 18, 2008, 11:42:24 PM (12 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/explosions.c

    r1460 r2990  
    1919#include "common.h"
    2020
    21 cucul_canvas_t *medium_sprite;
    22 cucul_canvas_t *small_sprite;
     21caca_canvas_t *medium_sprite;
     22caca_canvas_t *small_sprite;
    2323
    2424void init_explosions(game *g, explosions *ex)
    2525{
    26     cucul_buffer_t *b;
     26    caca_buffer_t *b;
    2727    int i;
    2828
     
    3232    }
    3333
    34     b = cucul_load_file("data/xplmed.caca");
    35     medium_sprite = cucul_import_canvas(b, "");
    36     cucul_free_buffer(b);
     34    b = caca_load_file("data/xplmed.caca");
     35    medium_sprite = caca_import_canvas(b, "");
     36    caca_free_buffer(b);
    3737
    38     b = cucul_load_file("data/xplsmall.caca");
    39     small_sprite = cucul_import_canvas(b, "");
    40     cucul_free_buffer(b);
     38    b = caca_load_file("data/xplsmall.caca");
     39    small_sprite = caca_import_canvas(b, "");
     40    caca_free_buffer(b);
    4141}
    4242
     
    7575    {
    7676#if 0
    77         cucul_set_fg_color(g->cv, CACA_COLOR_GREEN);
    78         cucul_goto(g->cv, ex->x[i] + 3, ex->y[i]);
    79         switch(cucul_rand(0,2))
     77        caca_set_fg_color(g->cv, CACA_COLOR_GREEN);
     78        caca_goto(g->cv, ex->x[i] + 3, ex->y[i]);
     79        switch(caca_rand(0,2))
    8080        {
    8181        case 0:
    82             cucul_putchar(g->cv, 'p');
    83             cucul_putchar(g->cv, 'i');
    84             cucul_putchar(g->cv, 'f');
     82            caca_putchar(g->cv, 'p');
     83            caca_putchar(g->cv, 'i');
     84            caca_putchar(g->cv, 'f');
    8585            break;
    8686        case 1:
    87             cucul_putchar(g->cv, 'p');
    88             cucul_putchar(g->cv, 'a');
    89             cucul_putchar(g->cv, 'f');
     87            caca_putchar(g->cv, 'p');
     88            caca_putchar(g->cv, 'a');
     89            caca_putchar(g->cv, 'f');
    9090            break;
    9191        case 2:
    92             cucul_putchar(g->cv, 'p');
    93             cucul_putchar(g->cv, 'o');
    94             cucul_putchar(g->cv, 'u');
    95             cucul_putchar(g->cv, 'f');
     92            caca_putchar(g->cv, 'p');
     93            caca_putchar(g->cv, 'o');
     94            caca_putchar(g->cv, 'u');
     95            caca_putchar(g->cv, 'f');
    9696            break;
    9797        }
    98         cucul_putchar(g->cv, '!');
     98        caca_putchar(g->cv, '!');
    9999#endif
    100100
     
    102102        {
    103103            case EXPLOSION_MEDIUM:
    104                 cucul_set_canvas_frame(medium_sprite, 10 - ex->n[i]);
    105                 cucul_blit(g->cv, ex->x[i], ex->y[i], medium_sprite, NULL);
     104                caca_set_canvas_frame(medium_sprite, 10 - ex->n[i]);
     105                caca_blit(g->cv, ex->x[i], ex->y[i], medium_sprite, NULL);
    106106                break;
    107107            case EXPLOSION_SMALL:
    108                 cucul_set_canvas_frame(small_sprite, 6 - ex->n[i]);
    109                 cucul_blit(g->cv, ex->x[i], ex->y[i], small_sprite, NULL);
     108                caca_set_canvas_frame(small_sprite, 6 - ex->n[i]);
     109                caca_blit(g->cv, ex->x[i], ex->y[i], small_sprite, NULL);
    110110                break;
    111111            case EXPLOSION_NONE:
Note: See TracChangeset for help on using the changeset viewer.