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

    r1460 r2990  
    1919#include "common.h"
    2020
    21 cucul_canvas_t *foo_sprite;
    22 cucul_canvas_t *bar_sprite;
    23 cucul_canvas_t *baz_sprite;
     21caca_canvas_t *foo_sprite;
     22caca_canvas_t *bar_sprite;
     23caca_canvas_t *baz_sprite;
    2424
    2525void init_aliens(game *g, aliens *al)
    2626{
    27     cucul_buffer_t *b;
     27    caca_buffer_t *b;
    2828    int i;
    2929
     
    3333    }
    3434
    35     b = cucul_load_file("data/foofight.caca");
    36     foo_sprite = cucul_import_canvas(b, "");
    37     cucul_free_buffer(b);
     35    b = caca_load_file("data/foofight.caca");
     36    foo_sprite = caca_import_canvas(b, "");
     37    caca_free_buffer(b);
    3838
    39     b = cucul_load_file("data/barfight.caca");
    40     bar_sprite = cucul_import_canvas(b, "");
    41     cucul_free_buffer(b);
     39    b = caca_load_file("data/barfight.caca");
     40    bar_sprite = caca_import_canvas(b, "");
     41    caca_free_buffer(b);
    4242
    43     b = cucul_load_file("data/bazfight.caca");
    44     baz_sprite = cucul_import_canvas(b, "");
    45     cucul_free_buffer(b);
     43    b = caca_load_file("data/bazfight.caca");
     44    baz_sprite = caca_import_canvas(b, "");
     45    caca_free_buffer(b);
    4646}
    4747
     
    5555        {
    5656            case ALIEN_FOO:
    57                 cucul_set_canvas_frame(foo_sprite, al->img[i] % 5);
    58                 cucul_blit(g->cv, al->x[i], al->y[i], foo_sprite, NULL);
     57                caca_set_canvas_frame(foo_sprite, al->img[i] % 5);
     58                caca_blit(g->cv, al->x[i], al->y[i], foo_sprite, NULL);
    5959                break;
    6060            case ALIEN_BAR:
    61                 cucul_set_canvas_frame(bar_sprite, al->img[i] % 2);
    62                 cucul_blit(g->cv, al->x[i], al->y[i], bar_sprite, NULL);
     61                caca_set_canvas_frame(bar_sprite, al->img[i] % 2);
     62                caca_blit(g->cv, al->x[i], al->y[i], bar_sprite, NULL);
    6363                break;
    6464            case ALIEN_BAZ:
    65                 cucul_set_canvas_frame(baz_sprite, al->img[i] % 4);
    66                 cucul_blit(g->cv, al->x[i], al->y[i], baz_sprite, NULL);
     65                caca_set_canvas_frame(baz_sprite, al->img[i] % 4);
     66                caca_blit(g->cv, al->x[i], al->y[i], baz_sprite, NULL);
    6767                break;
    6868            case ALIEN_NONE:
     
    8383            add_explosion(g, g->ex, al->x[i], al->y[i], 0, 0, EXPLOSION_MEDIUM);
    8484            al->type[i] = ALIEN_NONE;
    85             add_bonus(g, g->bo, al->x[i], al->y[i], cucul_rand(0,4) ? BONUS_GREEN : BONUS_LIFE);
     85            add_bonus(g, g->bo, al->x[i], al->y[i], caca_rand(0,4) ? BONUS_GREEN : BONUS_LIFE);
    8686        }
    8787
Note: See TracChangeset for help on using the changeset viewer.