Ignore:
Timestamp:
Oct 18, 2008, 11:47:35 PM (12 years ago)
Author:
Sam Hocevar
Message:

Port neercs to the unified libcaca 0.99.beta15 API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/screensaver.c

    r2495 r2995  
    2525#include <unistd.h>
    2626
    27 #include <cucul.h>
     27#include <caca.h>
    2828#include <caca.h>
    2929
     
    8484{
    8585    int x[COUNT], y[COUNT], s[COUNT];
    86     cucul_canvas_t **toaster;
     86    caca_canvas_t **toaster;
    8787};
    8888
     
    9090{
    9191    struct flying_toaster *flying_toaster;
    92     int w = cucul_get_canvas_width(screen_list->cv);
    93     int h = cucul_get_canvas_height(screen_list->cv);
     92    int w = caca_get_canvas_width(screen_list->cv);
     93    int h = caca_get_canvas_height(screen_list->cv);
    9494    int i;
    9595
    9696    flying_toaster = malloc(sizeof(struct flying_toaster));
    97     flying_toaster->toaster = (cucul_canvas_t **)malloc(sizeof(cucul_canvas_t*)*3);
     97    flying_toaster->toaster = (caca_canvas_t **)malloc(sizeof(caca_canvas_t*)*3);
    9898
    9999
    100     flying_toaster->toaster[0] = cucul_create_canvas(0, 0);
    101     flying_toaster->toaster[1] = cucul_create_canvas(0, 0);
    102     flying_toaster->toaster[2] = cucul_create_canvas(0, 0);
     100    flying_toaster->toaster[0] = caca_create_canvas(0, 0);
     101    flying_toaster->toaster[1] = caca_create_canvas(0, 0);
     102    flying_toaster->toaster[2] = caca_create_canvas(0, 0);
    103103
    104104
    105     cucul_import_memory(flying_toaster->toaster[0],
     105    caca_import_memory(flying_toaster->toaster[0],
    106106                        toaster1_text,
    107107                        strlen(toaster1_text), "ansi");
    108     cucul_import_memory(flying_toaster->toaster[1],
     108    caca_import_memory(flying_toaster->toaster[1],
    109109                        toaster2_text,
    110110                        strlen(toaster2_text), "ansi");
    111     cucul_import_memory(flying_toaster->toaster[2],
     111    caca_import_memory(flying_toaster->toaster[2],
    112112                        toaster3_text,
    113113                        strlen(toaster3_text), "ansi");
     
    128128    struct flying_toaster *flying_toaster = screen_list->screensaver_data;
    129129
    130     cucul_free_canvas(flying_toaster->toaster[0]);
    131     cucul_free_canvas(flying_toaster->toaster[1]);
    132     cucul_free_canvas(flying_toaster->toaster[2]);
     130    caca_free_canvas(flying_toaster->toaster[0]);
     131    caca_free_canvas(flying_toaster->toaster[1]);
     132    caca_free_canvas(flying_toaster->toaster[2]);
    133133    free(flying_toaster->toaster);
    134134    free(flying_toaster);
     
    142142    if(!d) return;
    143143
    144     w = cucul_get_canvas_width(screen_list->cv);
    145     h = cucul_get_canvas_height(screen_list->cv);
     144    w = caca_get_canvas_width(screen_list->cv);
     145    h = caca_get_canvas_height(screen_list->cv);
    146146
    147147
    148     cucul_set_color_ansi(screen_list->cv, CUCUL_WHITE, CUCUL_BLACK);
    149     cucul_clear_canvas(screen_list->cv);
     148    caca_set_color_ansi(screen_list->cv, CACA_WHITE, CACA_BLACK);
     149    caca_clear_canvas(screen_list->cv);
    150150
    151151
     
    153153    for(i = 0; i < COUNT; i++)
    154154    {
    155         cucul_blit(screen_list->cv, d->x[i]/PRECISION, d->y[i]/PRECISION, d->toaster[d->s[i]/PRECISION], NULL);
     155        caca_blit(screen_list->cv, d->x[i]/PRECISION, d->y[i]/PRECISION, d->toaster[d->s[i]/PRECISION], NULL);
    156156
    157157        d->x[i]-=40;
    158158        d->y[i]+=10;
    159159
    160         if((d->x[i]/PRECISION) + cucul_get_canvas_width(d->toaster[d->s[i]/PRECISION])<=0)
     160        if((d->x[i]/PRECISION) + caca_get_canvas_width(d->toaster[d->s[i]/PRECISION])<=0)
    161161            d->x[i] = ((rand()%w)+w) * PRECISION;
    162162        if((d->y[i]/PRECISION)>=h)
Note: See TracChangeset for help on using the changeset viewer.