Ignore:
Timestamp:
Nov 16, 2003, 1:33:35 AM (19 years ago)
Author:
Sam Hocevar
Message:
  • Renamed libee to libcaca. Far less collisions.
Location:
libcaca/trunk/test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/test/Makefile.am

    r183 r185  
    11###############################################################################
    2 # Automake targets and declarations for libee tests
     2# Automake targets and declarations for libcaca tests
    33###############################################################################
    44
    5 AM_CPPFLAGS = -I$(top_srcdir)/libee
     5AM_CPPFLAGS = -I$(top_srcdir)/libcaca
    66
    77if USE_SLANG
     
    1515
    1616demo_SOURCES = demo.c
    17 demo_LDADD = ../libee/libee.a $(LDFLAGS_slang) $(LDFLAGS_ncurses) -lm
     17demo_LDADD = ../libcaca/libcaca.a $(LDFLAGS_slang) $(LDFLAGS_ncurses) -lm
    1818demo_CFLAGS = `pkg-config --cflags gtk+-2.0`
    1919demo_LDFLAGS = `pkg-config --libs gtk+-2.0`
    2020
    2121spritedit_SOURCES = spritedit.c
    22 spritedit_LDADD = ../libee/libee.a $(LDFLAGS_slang) $(LDFLAGS_ncurses) -lm
     22spritedit_LDADD = ../libcaca/libcaca.a $(LDFLAGS_slang) $(LDFLAGS_ncurses) -lm
    2323
  • libcaca/trunk/test/demo.c

    r183 r185  
    11/*
    2  *   demo          demo using libee
     2 *   demo          demo using libcaca
    33 *   Copyright (c) 2003 Sam Hocevar <sam@zoy.org>
    44 *                 All Rights Reserved
     
    3030#include <gdk/gdkpixbuf.h>
    3131
    32 #include "ee.h"
     32#include "caca.h"
    3333
    3434static void display_menu(void);
     
    4747int bounds = 0;
    4848int outline = 0;
    49 struct ee_sprite *sprite = NULL;
     49struct caca_sprite *sprite = NULL;
    5050
    5151GdkPixbuf *pixbuf;
     
    5858    int quit = 0;
    5959
    60     if(ee_init())
     60    if(caca_init())
    6161    {
    6262        return 1;
    6363    }
    6464
    65     ee_set_delay(40000);
     65    caca_set_delay(40000);
    6666
    6767    /* Initialize data */
    68     sprite = ee_load_sprite("data/barboss.txt");
     68    sprite = caca_load_sprite("data/barboss.txt");
    6969
    7070gdk_init (&argc, &argv);
     
    8383    /* Main menu */
    8484    display_menu();
    85     ee_refresh();
     85    caca_refresh();
    8686
    8787    /* Go ! */
    8888    while(!quit)
    8989    {
    90         char key = ee_get_key();
     90        char key = caca_get_key();
    9191
    9292        if(key && demo)
    9393        {
    9494            display_menu();
    95             ee_refresh();
     95            caca_refresh();
    9696            demo = NULL;
    9797        }
     
    149149
    150150            if(demo)
    151                 ee_clear();
    152 
    153             key = ee_get_key();
     151                caca_clear();
     152
     153            key = caca_get_key();
    154154            if(key)
    155155                goto handle_key;
    156156
    157             ee_refresh();
     157            caca_refresh();
    158158        }
    159159
     
    162162            demo();
    163163
    164             ee_set_color(EE_WHITE);
    165             ee_draw_thin_box(1, 1, ee_get_width() - 2, ee_get_height() - 2);
    166             ee_printf(4, 1, "[%i.%i fps]----",
    167                             1000000 / ee_get_rendertime(),
    168                             (10000000 / ee_get_rendertime()) % 10);
    169             ee_refresh();
     164            caca_set_color(EE_WHITE);
     165            caca_draw_thin_box(1, 1, caca_get_width() - 2, caca_get_height() - 2);
     166            caca_printf(4, 1, "[%i.%i fps]----",
     167                            1000000 / caca_get_rendertime(),
     168                            (10000000 / caca_get_rendertime()) % 10);
     169            caca_refresh();
    170170        }
    171171    }
    172172
    173173    /* Clean up */
    174     ee_free_sprite(sprite);
    175     ee_end();
     174    caca_free_sprite(sprite);
     175    caca_end();
    176176
    177177    return 0;
     
    180180static void display_menu(void)
    181181{
    182     int xo = ee_get_width() - 2;
    183     int yo = ee_get_height() - 2;
    184 
    185     ee_clear();
    186     ee_set_color(EE_WHITE);
    187     ee_draw_thin_box(1, 1, xo, yo);
    188 
    189     ee_putstr((xo - strlen("libee demo")) / 2, 3, "libee demo");
    190     ee_putstr((xo - strlen("============")) / 2, 4, "============");
    191 
    192     ee_putstr(4, 6, "demos:");
    193     ee_putstr(4, 7, "'f': full");
    194     ee_putstr(4, 8, "'1': dots");
    195     ee_putstr(4, 9, "'2': lines");
    196     ee_putstr(4, 10, "'3': boxes");
    197     ee_putstr(4, 11, "'4': triangles");
    198     ee_putstr(4, 12, "'5': ellipses");
    199     ee_putstr(4, 13, "'s': sprites");
    200     ee_putstr(4, 14, "'c': color");
    201     ee_putstr(4, 15, "'i': image blit");
    202 
    203     ee_putstr(4, 17, "settings:");
    204     ee_printf(4, 18, "'o': outline: %s",
     182    int xo = caca_get_width() - 2;
     183    int yo = caca_get_height() - 2;
     184
     185    caca_clear();
     186    caca_set_color(EE_WHITE);
     187    caca_draw_thin_box(1, 1, xo, yo);
     188
     189    caca_putstr((xo - strlen("libcaca demo")) / 2, 3, "libcaca demo");
     190    caca_putstr((xo - strlen("==============")) / 2, 4, "==============");
     191
     192    caca_putstr(4, 6, "demos:");
     193    caca_putstr(4, 7, "'f': full");
     194    caca_putstr(4, 8, "'1': dots");
     195    caca_putstr(4, 9, "'2': lines");
     196    caca_putstr(4, 10, "'3': boxes");
     197    caca_putstr(4, 11, "'4': triangles");
     198    caca_putstr(4, 12, "'5': ellipses");
     199    caca_putstr(4, 13, "'s': sprites");
     200    caca_putstr(4, 14, "'c': color");
     201    caca_putstr(4, 15, "'i': image blit");
     202
     203    caca_putstr(4, 17, "settings:");
     204    caca_printf(4, 18, "'o': outline: %s",
    205205              outline == 0 ? "none" : outline == 1 ? "solid" : "thin");
    206     ee_printf(4, 19, "'b': drawing boundaries: %s",
     206    caca_printf(4, 19, "'b': drawing boundaries: %s",
    207207              bounds == 0 ? "screen" : "infinite");
    208208
    209     ee_putstr(4, yo - 2, "'q': quit");
     209    caca_putstr(4, yo - 2, "'q': quit");
    210210}
    211211
     
    218218    i++;
    219219
    220     ee_clear();
     220    caca_clear();
    221221
    222222    /* Draw the sun */
    223     ee_set_color(EE_YELLOW);
    224     xo = ee_get_width() / 4;
    225     yo = ee_get_height() / 4 + 5 * sin(0.03*i);
     223    caca_set_color(EE_YELLOW);
     224    xo = caca_get_width() / 4;
     225    yo = caca_get_height() / 4 + 5 * sin(0.03*i);
    226226
    227227    for(j = 0; j < 16; j++)
     
    229229        xa = xo - (30 + sin(0.03*i) * 8) * sin(0.03*i + M_PI*j/8);
    230230        ya = yo + (15 + sin(0.03*i) * 4) * cos(0.03*i + M_PI*j/8);
    231         ee_draw_thin_line(xo, yo, xa, ya);
     231        caca_draw_thin_line(xo, yo, xa, ya);
    232232    }
    233233
    234234    j = 15 + sin(0.03*i) * 8;
    235     ee_set_color(EE_WHITE);
    236     ee_fill_ellipse(xo, yo, j, j / 2, '#');
    237     ee_set_color(EE_YELLOW);
    238     ee_draw_ellipse(xo, yo, j, j / 2, '#');
     235    caca_set_color(EE_WHITE);
     236    caca_fill_ellipse(xo, yo, j, j / 2, '#');
     237    caca_set_color(EE_YELLOW);
     238    caca_draw_ellipse(xo, yo, j, j / 2, '#');
    239239
    240240    /* Draw the pyramid */
    241     xo = ee_get_width() * 5 / 8;
     241    xo = caca_get_width() * 5 / 8;
    242242    yo = 2;
    243243
    244     xa = ee_get_width() / 8 + sin(0.03*i) * 5;
    245     ya = ee_get_height() / 2 + cos(0.03*i) * 5;
    246 
    247     xb = ee_get_width() - 10 - cos(0.02*i) * 10;
    248     yb = ee_get_height() * 3 / 4 - 5 + sin(0.02*i) * 5;
    249 
    250     xc = ee_get_width() / 4 - sin(0.02*i) * 5;
    251     yc = ee_get_height() * 3 / 4 + cos(0.02*i) * 5;
    252 
    253     ee_set_color(EE_GREEN);
    254     ee_fill_triangle(xo, yo, xb, yb, xa, ya, '%');
    255     ee_set_color(EE_YELLOW);
    256     ee_draw_thin_triangle(xo, yo, xb, yb, xa, ya);
    257 
    258     ee_set_color(EE_RED);
    259     ee_fill_triangle(xa, ya, xb, yb, xc, yc, '#');
    260     ee_set_color(EE_YELLOW);
    261     ee_draw_thin_triangle(xa, ya, xb, yb, xc, yc);
    262 
    263     ee_set_color(EE_BLUE);
    264     ee_fill_triangle(xo, yo, xb, yb, xc, yc, '%');
    265     ee_set_color(EE_YELLOW);
    266     ee_draw_thin_triangle(xo, yo, xb, yb, xc, yc);
     244    xa = caca_get_width() / 8 + sin(0.03*i) * 5;
     245    ya = caca_get_height() / 2 + cos(0.03*i) * 5;
     246
     247    xb = caca_get_width() - 10 - cos(0.02*i) * 10;
     248    yb = caca_get_height() * 3 / 4 - 5 + sin(0.02*i) * 5;
     249
     250    xc = caca_get_width() / 4 - sin(0.02*i) * 5;
     251    yc = caca_get_height() * 3 / 4 + cos(0.02*i) * 5;
     252
     253    caca_set_color(EE_GREEN);
     254    caca_fill_triangle(xo, yo, xb, yb, xa, ya, '%');
     255    caca_set_color(EE_YELLOW);
     256    caca_draw_thin_triangle(xo, yo, xb, yb, xa, ya);
     257
     258    caca_set_color(EE_RED);
     259    caca_fill_triangle(xa, ya, xb, yb, xc, yc, '#');
     260    caca_set_color(EE_YELLOW);
     261    caca_draw_thin_triangle(xa, ya, xb, yb, xc, yc);
     262
     263    caca_set_color(EE_BLUE);
     264    caca_fill_triangle(xo, yo, xb, yb, xc, yc, '%');
     265    caca_set_color(EE_YELLOW);
     266    caca_draw_thin_triangle(xo, yo, xb, yb, xc, yc);
    267267
    268268    /* Draw a background triangle */
     
    270270    ya = 2;
    271271
    272     xb = ee_get_width() - 3;
    273     yb = ee_get_height() / 2;
    274 
    275     xc = ee_get_width() / 3;
    276     yc = ee_get_height() - 3;
    277 
    278     ee_set_color(EE_CYAN);
    279     ee_draw_thin_triangle(xa, ya, xb, yb, xc, yc);
    280 
    281     xo = ee_get_width() / 2 + cos(0.027*i) * ee_get_width() / 3;
    282     yo = ee_get_height() / 2 - sin(0.027*i) * ee_get_height() / 2;
    283 
    284     ee_draw_thin_line(xa, ya, xo, yo);
    285     ee_draw_thin_line(xb, yb, xo, yo);
    286     ee_draw_thin_line(xc, yc, xo, yo);
     272    xb = caca_get_width() - 3;
     273    yb = caca_get_height() / 2;
     274
     275    xc = caca_get_width() / 3;
     276    yc = caca_get_height() - 3;
     277
     278    caca_set_color(EE_CYAN);
     279    caca_draw_thin_triangle(xa, ya, xb, yb, xc, yc);
     280
     281    xo = caca_get_width() / 2 + cos(0.027*i) * caca_get_width() / 3;
     282    yo = caca_get_height() / 2 - sin(0.027*i) * caca_get_height() / 2;
     283
     284    caca_draw_thin_line(xa, ya, xo, yo);
     285    caca_draw_thin_line(xb, yb, xo, yo);
     286    caca_draw_thin_line(xc, yc, xo, yo);
    287287
    288288    /* Draw a sprite on the pyramid */
    289     ee_draw_sprite(xo, yo, sprite, 0);
     289    caca_draw_sprite(xo, yo, sprite, 0);
    290290
    291291    /* Draw a trail behind the foreground sprite */
    292292    for(j = i - 60; j < i; j++)
    293293    {
    294         int delta = ee_rand(-5, 5);
    295         ee_set_color(ee_rand(0, 15));
    296         ee_putchar(ee_get_width() / 2
    297                     + cos(0.02*j) * (delta + ee_get_width() / 4),
    298                    ee_get_height() / 2
    299                     + sin(0.02*j) * (delta + ee_get_height() / 3),
     294        int delta = caca_rand(-5, 5);
     295        caca_set_color(caca_rand(0, 15));
     296        caca_putchar(caca_get_width() / 2
     297                    + cos(0.02*j) * (delta + caca_get_width() / 4),
     298                   caca_get_height() / 2
     299                    + sin(0.02*j) * (delta + caca_get_height() / 3),
    300300                   '#');
    301301    }
    302302
    303303    /* Draw foreground sprite */
    304     ee_draw_sprite(ee_get_width() / 2 + cos(0.02*i) * ee_get_width() / 4,
    305                    ee_get_height() / 2 + sin(0.02*i) * ee_get_height() / 3,
     304    caca_draw_sprite(caca_get_width() / 2 + cos(0.02*i) * caca_get_width() / 4,
     305                   caca_get_height() / 2 + sin(0.02*i) * caca_get_height() / 3,
    306306                   sprite, 0);
    307307}
     
    309309static void demo_dots(void)
    310310{
    311     int xmax = ee_get_width() - 1;
    312     int ymax = ee_get_height() - 1;
     311    int xmax = caca_get_width() - 1;
     312    int ymax = caca_get_height() - 1;
    313313    int i;
    314314
     
    316316    {
    317317        /* Putpixel */
    318         ee_set_color(ee_rand(0, 15));
    319         ee_putchar(ee_rand(0, xmax), ee_rand(0, ymax), '#');
     318        caca_set_color(caca_rand(0, 15));
     319        caca_putchar(caca_rand(0, xmax), caca_rand(0, ymax), '#');
    320320    }
    321321}
     
    326326    char buf[BUFSIZ];
    327327
    328     ee_clear();
     328    caca_clear();
    329329    for(i = 0; i < 16; i++)
    330330    {
    331         sprintf(buf, "'%c': %i (%s)", 'a' + i, i, ee_get_color_name(i));
    332         ee_set_color(EE_WHITE);
    333         ee_putstr(4, i + 3, buf);
    334         ee_set_color(i);
    335         ee_putstr(40, i + 3, "XXXXXXXXXX-XX--X----------");
     331        sprintf(buf, "'%c': %i (%s)", 'a' + i, i, caca_get_color_name(i));
     332        caca_set_color(EE_WHITE);
     333        caca_putstr(4, i + 3, buf);
     334        caca_set_color(i);
     335        caca_putstr(40, i + 3, "XXXXXXXXXX-XX--X----------");
    336336    }
    337337}
     
    339339static void demo_lines(void)
    340340{
    341     int w = ee_get_width();
    342     int h = ee_get_height();
     341    int w = caca_get_width();
     342    int h = caca_get_height();
    343343    int xa, ya, xb, yb;
    344344
    345345    if(bounds)
    346346    {
    347         xa = ee_rand(- w, 2 * w); ya = ee_rand(- h, 2 * h);
    348         xb = ee_rand(- w, 2 * w); yb = ee_rand(- h, 2 * h);
     347        xa = caca_rand(- w, 2 * w); ya = caca_rand(- h, 2 * h);
     348        xb = caca_rand(- w, 2 * w); yb = caca_rand(- h, 2 * h);
    349349    }
    350350    else
    351351    {
    352         xa = ee_rand(0, w - 1); ya = ee_rand(0, h - 1);
    353         xb = ee_rand(0, w - 1); yb = ee_rand(0, h - 1);
    354     }
    355 
    356     ee_set_color(ee_rand(0, 15));
     352        xa = caca_rand(0, w - 1); ya = caca_rand(0, h - 1);
     353        xb = caca_rand(0, w - 1); yb = caca_rand(0, h - 1);
     354    }
     355
     356    caca_set_color(caca_rand(0, 15));
    357357    if(outline > 1)
    358         ee_draw_thin_line(xa, ya, xb, yb);
     358        caca_draw_thin_line(xa, ya, xb, yb);
    359359    else
    360         ee_draw_line(xa, ya, xb, yb, '#');
     360        caca_draw_line(xa, ya, xb, yb, '#');
    361361}
    362362
    363363static void demo_boxes(void)
    364364{
    365     int w = ee_get_width();
    366     int h = ee_get_height();
     365    int w = caca_get_width();
     366    int h = caca_get_height();
    367367    int xa, ya, xb, yb;
    368368
    369369    if(bounds)
    370370    {
    371         xa = ee_rand(- w, 2 * w); ya = ee_rand(- h, 2 * h);
    372         xb = ee_rand(- w, 2 * w); yb = ee_rand(- h, 2 * h);
     371        xa = caca_rand(- w, 2 * w); ya = caca_rand(- h, 2 * h);
     372        xb = caca_rand(- w, 2 * w); yb = caca_rand(- h, 2 * h);
    373373    }
    374374    else
    375375    {
    376         xa = ee_rand(0, w - 1); ya = ee_rand(0, h - 1);
    377         xb = ee_rand(0, w - 1); yb = ee_rand(0, h - 1);
    378     }
    379 
    380     ee_set_color(ee_rand(0, 15));
    381     ee_fill_box(xa, ya, xb, yb, '#');
    382 
    383     ee_set_color(ee_rand(0, 15));
     376        xa = caca_rand(0, w - 1); ya = caca_rand(0, h - 1);
     377        xb = caca_rand(0, w - 1); yb = caca_rand(0, h - 1);
     378    }
     379
     380    caca_set_color(caca_rand(0, 15));
     381    caca_fill_box(xa, ya, xb, yb, '#');
     382
     383    caca_set_color(caca_rand(0, 15));
    384384    if(outline == 2)
    385         ee_draw_thin_box(xa, ya, xb, yb);
     385        caca_draw_thin_box(xa, ya, xb, yb);
    386386    else if(outline == 1)
    387         ee_draw_box(xa, ya, xb, yb, '#');
     387        caca_draw_box(xa, ya, xb, yb, '#');
    388388}
    389389
    390390static void demo_ellipses(void)
    391391{
    392     int w = ee_get_width();
    393     int h = ee_get_height();
     392    int w = caca_get_width();
     393    int h = caca_get_height();
    394394    int x, y, a, b;
    395395
    396396    if(bounds)
    397397    {
    398         x = ee_rand(- w, 2 * w); y = ee_rand(- h, 2 * h);
    399         a = ee_rand(0, w); b = ee_rand(0, h);
     398        x = caca_rand(- w, 2 * w); y = caca_rand(- h, 2 * h);
     399        a = caca_rand(0, w); b = caca_rand(0, h);
    400400    }
    401401    else
     
    403403        do
    404404        {
    405             x = ee_rand(0, w); y = ee_rand(0, h);
    406             a = ee_rand(0, w); b = ee_rand(0, h);
     405            x = caca_rand(0, w); y = caca_rand(0, h);
     406            a = caca_rand(0, w); b = caca_rand(0, h);
    407407
    408408        } while(x - a < 0 || x + a >= w || y - b < 0 || y + b >= h);
    409409    }
    410410
    411     ee_set_color(ee_rand(0, 15));
    412     ee_fill_ellipse(x, y, a, b, '#');
    413 
    414     ee_set_color(ee_rand(0, 15));
     411    caca_set_color(caca_rand(0, 15));
     412    caca_fill_ellipse(x, y, a, b, '#');
     413
     414    caca_set_color(caca_rand(0, 15));
    415415    if(outline == 2)
    416         ee_draw_thin_ellipse(x, y, a, b);
     416        caca_draw_thin_ellipse(x, y, a, b);
    417417    else if(outline == 1)
    418         ee_draw_ellipse(x, y, a, b, '#');
     418        caca_draw_ellipse(x, y, a, b, '#');
    419419}
    420420
    421421static void demo_triangles(void)
    422422{
    423     int w = ee_get_width();
    424     int h = ee_get_height();
     423    int w = caca_get_width();
     424    int h = caca_get_height();
    425425    int xa, ya, xb, yb, xc, yc;
    426426
    427427    if(bounds)
    428428    {
    429         xa = ee_rand(- w, 2 * w); ya = ee_rand(- h, 2 * h);
    430         xb = ee_rand(- w, 2 * w); yb = ee_rand(- h, 2 * h);
    431         xc = ee_rand(- w, 2 * w); yc = ee_rand(- h, 2 * h);
     429        xa = caca_rand(- w, 2 * w); ya = caca_rand(- h, 2 * h);
     430        xb = caca_rand(- w, 2 * w); yb = caca_rand(- h, 2 * h);
     431        xc = caca_rand(- w, 2 * w); yc = caca_rand(- h, 2 * h);
    432432    }
    433433    else
    434434    {
    435435
    436         xa = ee_rand(0, w - 1); ya = ee_rand(0, h - 1);
    437         xb = ee_rand(0, w - 1); yb = ee_rand(0, h - 1);
    438         xc = ee_rand(0, w - 1); yc = ee_rand(0, h - 1);
    439     }
    440 
    441     ee_set_color(ee_rand(0, 15));
    442     ee_fill_triangle(xa, ya, xb, yb, xc, yc, '#');
    443 
    444     ee_set_color(ee_rand(0, 15));
     436        xa = caca_rand(0, w - 1); ya = caca_rand(0, h - 1);
     437        xb = caca_rand(0, w - 1); yb = caca_rand(0, h - 1);
     438        xc = caca_rand(0, w - 1); yc = caca_rand(0, h - 1);
     439    }
     440
     441    caca_set_color(caca_rand(0, 15));
     442    caca_fill_triangle(xa, ya, xb, yb, xc, yc, '#');
     443
     444    caca_set_color(caca_rand(0, 15));
    445445    if(outline == 2)
    446         ee_draw_thin_triangle(xa, ya, xb, yb, xc, yc);
     446        caca_draw_thin_triangle(xa, ya, xb, yb, xc, yc);
    447447    else if(outline == 1)
    448         ee_draw_triangle(xa, ya, xb, yb, xc, yc, '#');
     448        caca_draw_triangle(xa, ya, xb, yb, xc, yc, '#');
    449449}
    450450
    451451static void demo_sprites(void)
    452452{
    453     ee_draw_sprite(ee_rand(0, ee_get_width() - 1),
    454                    ee_rand(0, ee_get_height() - 1), sprite, 0);
     453    caca_draw_sprite(caca_rand(0, caca_get_width() - 1),
     454                   caca_rand(0, caca_get_height() - 1), sprite, 0);
    455455}
    456456
    457457static void demo_blit(void)
    458458{
    459 ee_set_color(EE_LIGHTGRAY);
    460     ee_blit(6, 4, ee_get_width() - 6, ee_get_height() - 4, pixels, bufx, bufy);
    461 }
    462 
     459caca_set_color(EE_LIGHTGRAY);
     460    caca_blit(6, 4, caca_get_width() - 6, caca_get_height() - 4, pixels, bufx, bufy);
     461}
     462
  • libcaca/trunk/test/spritedit.c

    r153 r185  
    11/*
    2  *   spritedit     sprite editor using libee
     2 *   spritedit     sprite editor using libcaca
    33 *   Copyright (c) 2003 Sam Hocevar <sam@zoy.org>
    44 *                 All Rights Reserved
     
    2525#include <stdio.h>
    2626
    27 #include "ee.h"
     27#include "caca.h"
    2828
    2929int main(int argc, char **argv)
    3030{
    3131    int quit = 0;
    32     struct ee_sprite *sprite;
     32    struct caca_sprite *sprite;
    3333    int frame = 0;
    3434
     
    3939    }
    4040
    41     if(ee_init())
     41    if(caca_init())
    4242        return 1;
    4343
    44     sprite = ee_load_sprite(argv[1]);
     44    sprite = caca_load_sprite(argv[1]);
    4545
    4646    if(!sprite)
    4747    {
    48         ee_end();
     48        caca_end();
    4949        fprintf(stderr, "%s: could not open `%s'.\n", argv[0], argv[1]);
    5050        return 1;
     
    5757        char buf[BUFSIZ];
    5858
    59         switch(ee_get_key())
     59        switch(caca_get_key())
    6060        {
    6161        case 0:
     
    6969            break;
    7070        case '+':
    71             if(frame < ee_get_sprite_frames(sprite) - 1)
     71            if(frame < caca_get_sprite_frames(sprite) - 1)
    7272                frame++;
    7373            break;
    7474        }
    7575
    76         ee_clear();
     76        caca_clear();
    7777
    78         ee_set_color(EE_WHITE);
    79         ee_draw_thin_box(0, 0, ee_get_width() - 1, ee_get_height() - 1);
     78        caca_set_color(EE_WHITE);
     79        caca_draw_thin_box(0, 0, caca_get_width() - 1, caca_get_height() - 1);
    8080
    81         ee_putstr(3, 0, "[ Sprite editor for libee ]");
     81        caca_putstr(3, 0, "[ Sprite editor for libcaca ]");
    8282
    8383        sprintf(buf, "sprite `%s'", argv[1]);
    84         ee_putstr(3, 2, buf);
    85         sprintf(buf, "frame %i/%i", frame, ee_get_sprite_frames(sprite) - 1);
    86         ee_putstr(3, 3, buf);
     84        caca_putstr(3, 2, buf);
     85        sprintf(buf, "frame %i/%i", frame, caca_get_sprite_frames(sprite) - 1);
     86        caca_putstr(3, 3, buf);
    8787
    8888        /* Crosshair */
    89         ee_draw_thin_line(57, 2, 57, 18);
    90         ee_draw_thin_line(37, 10, 77, 10);
    91         ee_putchar(57, 10, '+');
     89        caca_draw_thin_line(57, 2, 57, 18);
     90        caca_draw_thin_line(37, 10, 77, 10);
     91        caca_putchar(57, 10, '+');
    9292
    9393        /* Boxed sprite */
    94         xa = -1 - ee_get_sprite_dx(sprite, frame);
    95         ya = -1 - ee_get_sprite_dy(sprite, frame);
    96         xb = xa + 1 + ee_get_sprite_width(sprite, frame);
    97         yb = ya + 1 + ee_get_sprite_height(sprite, frame);
    98         ee_set_color(EE_BLACK);
    99         ee_fill_box(57 + xa, 10 + ya, 57 + xb, 10 + yb, ' ');
    100         ee_set_color(EE_WHITE);
    101         ee_draw_thin_box(57 + xa, 10 + ya, 57 + xb, 10 + yb);
    102         ee_draw_sprite(57, 10, sprite, frame);
     94        xa = -1 - caca_get_sprite_dx(sprite, frame);
     95        ya = -1 - caca_get_sprite_dy(sprite, frame);
     96        xb = xa + 1 + caca_get_sprite_width(sprite, frame);
     97        yb = ya + 1 + caca_get_sprite_height(sprite, frame);
     98        caca_set_color(EE_BLACK);
     99        caca_fill_box(57 + xa, 10 + ya, 57 + xb, 10 + yb, ' ');
     100        caca_set_color(EE_WHITE);
     101        caca_draw_thin_box(57 + xa, 10 + ya, 57 + xb, 10 + yb);
     102        caca_draw_sprite(57, 10, sprite, frame);
    103103
    104104        /* Free sprite */
    105         ee_draw_sprite(20, 10, sprite, frame);
     105        caca_draw_sprite(20, 10, sprite, frame);
    106106
    107         ee_refresh();
     107        caca_refresh();
    108108    }
    109109
    110110    /* Clean up */
    111     ee_end();
     111    caca_end();
    112112
    113113    return 0;
Note: See TracChangeset for help on using the changeset viewer.