Changeset 544


Ignore:
Timestamp:
Mar 7, 2006, 3:25:20 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • Ported to new libcaca/libcucul API.
Location:
ttyvaders/trunk/src
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • ttyvaders/trunk/src/aliens.c

    r194 r544  
    2727#include "common.h"
    2828
    29 struct caca_sprite *foo_sprite;
    30 struct caca_sprite *bar_sprite;
    31 struct caca_sprite *baz_sprite;
     29struct cucul_sprite *foo_sprite;
     30struct cucul_sprite *bar_sprite;
     31struct cucul_sprite *baz_sprite;
    3232
    3333void init_aliens(game *g, aliens *al)
     
    4040    }
    4141
    42     foo_sprite = caca_load_sprite("data/foofight.txt");
    43     bar_sprite = caca_load_sprite("data/barfight.txt");
    44     baz_sprite = caca_load_sprite("data/bazfight.txt");
     42    foo_sprite = cucul_load_sprite(g->qq, "data/foofight.txt");
     43    bar_sprite = cucul_load_sprite(g->qq, "data/barfight.txt");
     44    baz_sprite = cucul_load_sprite(g->qq, "data/bazfight.txt");
    4545}
    4646
     
    5454        {
    5555            case ALIEN_FOO:
    56                 caca_draw_sprite(al->x[i], al->y[i], foo_sprite, al->img[i] % 5);
     56                cucul_draw_sprite(g->qq, al->x[i], al->y[i], foo_sprite, al->img[i] % 5);
    5757                break;
    5858            case ALIEN_BAR:
    59                 caca_draw_sprite(al->x[i], al->y[i], bar_sprite, al->img[i] % 2);
     59                cucul_draw_sprite(g->qq, al->x[i], al->y[i], bar_sprite, al->img[i] % 2);
    6060                break;
    6161            case ALIEN_BAZ:
    62                 caca_draw_sprite(al->x[i], al->y[i], baz_sprite, al->img[i] % 4);
     62                cucul_draw_sprite(g->qq, al->x[i], al->y[i], baz_sprite, al->img[i] % 4);
    6363                break;
    6464            case ALIEN_NONE:
     
    7979            add_explosion(g, g->ex, al->x[i], al->y[i], 0, 0, EXPLOSION_MEDIUM);
    8080            al->type[i] = ALIEN_NONE;
    81             add_bonus(g, g->bo, al->x[i], al->y[i], caca_rand(0,4) ? BONUS_GREEN : BONUS_LIFE);
     81            add_bonus(g, g->bo, al->x[i], al->y[i], cucul_rand(0,4) ? BONUS_GREEN : BONUS_LIFE);
    8282        }
    8383
  • ttyvaders/trunk/src/bonus.c

    r186 r544  
    2727#include "common.h"
    2828
    29 struct caca_sprite *heart_sprite;
    30 struct caca_sprite *gem_sprite;
     29struct cucul_sprite *heart_sprite;
     30struct cucul_sprite *gem_sprite;
    3131
    3232void init_bonus(game *g, bonus *bo)
     
    3939    }
    4040
    41     heart_sprite = caca_load_sprite("data/bonheart.txt");
    42     gem_sprite = caca_load_sprite("data/bongem.txt");
     41    heart_sprite = cucul_load_sprite(g->qq, "data/bonheart.txt");
     42    gem_sprite = cucul_load_sprite(g->qq, "data/bongem.txt");
    4343}
    4444
     
    5252        {
    5353            case BONUS_GREEN:
    54                 caca_draw_sprite(bo->x[i], bo->y[i], gem_sprite,
    55                                (bo->n[i]/2 % 3) ? 0 : 1);
     54                cucul_draw_sprite(g->qq, bo->x[i], bo->y[i], gem_sprite,
     55                                  (bo->n[i]/2 % 3) ? 0 : 1);
    5656                break;
    5757            case BONUS_LIFE:
    58                 caca_draw_sprite(bo->x[i], bo->y[i], heart_sprite,
    59                                (bo->n[i] % 3) ? 0 : 1);
     58                cucul_draw_sprite(g->qq, bo->x[i], bo->y[i], heart_sprite,
     59                                  (bo->n[i] % 3) ? 0 : 1);
    6060                break;
    6161            case BONUS_NONE:
  • ttyvaders/trunk/src/box.c

    r365 r544  
    4646    int j, frame;
    4747
    48     caca_set_color(CACA_COLOR_YELLOW, CACA_COLOR_BLACK);
     48    cucul_set_color(g->qq, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
    4949
    5050    /* Draw the thin horizontal line */
    5151    if(b->frame < 8)
    5252    {
    53         caca_draw_line(b->x - b->w * b->frame / 16, b->y,
    54                      b->x + b->w * b->frame / 16 - 1, b->y, 'X');
     53        cucul_draw_line(g->qq, b->x - b->w * b->frame / 16, b->y,
     54                               b->x + b->w * b->frame / 16 - 1, b->y, 'X');
    5555        return;
    5656    }
     
    5959    frame = b->frame < 12 ? b->frame : 12;
    6060
    61     caca_draw_line(b->x - b->w / 2, b->y - b->h * (frame - 8) / 8,
    62                  b->x + b->w / 2 - 1, b->y - b->h * (frame - 8) / 8, 'X');
    63     caca_draw_line(b->x - b->w / 2, b->y + b->h * (frame - 8) / 8,
    64                  b->x + b->w / 2 - 1, b->y + b->h * (frame - 8) / 8, 'X');
     61    cucul_draw_line(g->qq, b->x - b->w / 2, b->y - b->h * (frame - 8) / 8,
     62                    b->x + b->w / 2 - 1, b->y - b->h * (frame - 8) / 8, 'X');
     63    cucul_draw_line(g->qq, b->x - b->w / 2, b->y + b->h * (frame - 8) / 8,
     64                    b->x + b->w / 2 - 1, b->y + b->h * (frame - 8) / 8, 'X');
    6565
    66     caca_draw_line(b->x - b->w / 2, b->y - b->h * (frame - 8) / 8,
    67                  b->x - b->w / 2, b->y + b->h * (frame - 8) / 8 - 1, 'X');
    68     caca_draw_line(b->x + b->w / 2 - 1, b->y - b->h * (frame - 8) / 8,
    69                  b->x + b->w / 2 - 1, b->y + b->h * (frame - 8) / 8 - 1, 'X');
     66    cucul_draw_line(g->qq, b->x - b->w / 2, b->y - b->h * (frame - 8) / 8,
     67                    b->x - b->w / 2, b->y + b->h * (frame - 8) / 8 - 1, 'X');
     68    cucul_draw_line(g->qq, b->x + b->w / 2 - 1, b->y - b->h * (frame - 8) / 8,
     69               b->x + b->w / 2 - 1, b->y + b->h * (frame - 8) / 8 - 1, 'X');
    7070
    71     caca_set_color(CACA_COLOR_BLACK, CACA_COLOR_BLACK);
     71    cucul_set_color(g->qq, CUCUL_COLOR_BLACK, CUCUL_COLOR_BLACK);
    7272
    7373    for(j = b->y - b->h * (frame - 8) / 8 + 1;
     
    7575         j++)
    7676    {
    77         caca_draw_line(b->x - b->w / 2 + 1, j,
    78                      b->x + b->w / 2 - 2, j, 'X');
     77        cucul_draw_line(g->qq, b->x - b->w / 2 + 1, j,
     78                        b->x + b->w / 2 - 2, j, 'X');
    7979    }
    8080
     
    8585
    8686    /* Draw the text inside the frame */
    87     caca_set_color(CACA_COLOR_YELLOW, CACA_COLOR_BLACK);
     87    cucul_set_color(g->qq, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
    8888
    8989    /* FIXME: use a font */
    90     caca_putstr(b->x - b->w / 2 + 12, b->y - b->h / 2 + 2,
    91               "XXXX.  .XXXX  X   X  .XXXX  .XXXX  XXXX.");
    92     caca_putstr(b->x - b->w / 2 + 12, b->y - b->h / 2 + 3,
    93               "X  `X  X'  X  X   X  X'     X'     X  `X");
    94     caca_putstr(b->x - b->w / 2 + 12, b->y - b->h / 2 + 4,
    95               "XXXX'  XXXXX  X   X  `XXX   XXXX   X   X");
    96     caca_putstr(b->x - b->w / 2 + 12, b->y - b->h / 2 + 5,
    97               "X'     X' `X  X. ,X     `X  X'     X  ,X");
    98     caca_putstr(b->x - b->w / 2 + 12, b->y - b->h / 2 + 6,
    99               "X      X   X  `XXXX  XXXX'  `XXXX  XXXX'");
     90    cucul_putstr(g->qq, b->x - b->w / 2 + 12, b->y - b->h / 2 + 2,
     91                 "XXXX.  .XXXX  X   X  .XXXX  .XXXX  XXXX.");
     92    cucul_putstr(g->qq, b->x - b->w / 2 + 12, b->y - b->h / 2 + 3,
     93                 "X  `X  X'  X  X   X  X'     X'     X  `X");
     94    cucul_putstr(g->qq, b->x - b->w / 2 + 12, b->y - b->h / 2 + 4,
     95                 "XXXX'  XXXXX  X   X  `XXX   XXXX   X   X");
     96    cucul_putstr(g->qq, b->x - b->w / 2 + 12, b->y - b->h / 2 + 5,
     97                 "X'     X' `X  X. ,X     `X  X'     X  ,X");
     98    cucul_putstr(g->qq, b->x - b->w / 2 + 12, b->y - b->h / 2 + 6,
     99                 "X      X   X  `XXXX  XXXX'  `XXXX  XXXX'");
    100100}
    101101
  • ttyvaders/trunk/src/ceo.c

    r365 r544  
    3434    while(!end)
    3535    {
    36         caca_clear();
     36        cucul_clear(g->qq);
    3737
    38         if(caca_get_event(CACA_EVENT_KEY_PRESS)
     38        if(caca_get_event(g->kk, CACA_EVENT_KEY_PRESS)
    3939            == (CACA_EVENT_KEY_PRESS | '\t'))
    4040        {
     
    4444        fprintf(stderr, "foo\n");
    4545
    46         caca_refresh();
     46        caca_display(g->qq);
    4747
    4848        usleep(40000);
  • ttyvaders/trunk/src/collide.c

    r186 r544  
    128128                {
    129129                    add_explosion(g, ex, GET_MIN(t->left[y-j], x+3), y-j, 0, 1, EXPLOSION_SMALL);
    130                     t->left[y-j] -= caca_rand(0,2);
     130                    t->left[y-j] -= cucul_rand(0,2);
    131131                }
    132132                else if(x + 3 >= t->right[y-j])
    133133                {
    134134                    add_explosion(g, ex, GET_MAX(t->right[y-j], x-2), y-j, 0, 1, EXPLOSION_SMALL);
    135                     t->right[y-j] += caca_rand(0,2);
     135                    t->right[y-j] += cucul_rand(0,2);
    136136                }
    137137            }
  • ttyvaders/trunk/src/common.h

    r186 r544  
    2020 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2121 */
    22 
    23 void intro(void);
    2422
    2523/*
     
    135133    int w, h;
    136134
     135    cucul_t *qq;
     136    caca_t *kk;
     137
    137138    starfield *sf;
    138139    weapons *wp;
     
    145146} game;
    146147
     148void intro(game *g);
     149
    147150/*
    148151 * From aliens.c
  • ttyvaders/trunk/src/explosions.c

    r186 r544  
    2727#include "common.h"
    2828
    29 struct caca_sprite *medium_sprite;
    30 struct caca_sprite *small_sprite;
     29struct cucul_sprite *medium_sprite;
     30struct cucul_sprite *small_sprite;
    3131
    3232void init_explosions(game *g, explosions *ex)
     
    3939    }
    4040
    41     medium_sprite = caca_load_sprite("data/xplmed.txt");
    42     small_sprite = caca_load_sprite("data/xplsmall.txt");
     41    medium_sprite = cucul_load_sprite(g->qq, "data/xplmed.txt");
     42    small_sprite = cucul_load_sprite(g->qq, "data/xplsmall.txt");
    4343}
    4444
     
    7777    {
    7878#if 0
    79         caca_set_color(GREEN);
    80         caca_goto(ex->x[i] + 3, ex->y[i]);
    81         switch(caca_rand(0,2))
     79        cucul_set_fg_color(g->qq, CACA_COLOR_GREEN);
     80        cucul_goto(g->qq, ex->x[i] + 3, ex->y[i]);
     81        switch(cucul_rand(0,2))
    8282        {
    8383        case 0:
    84             caca_putchar('p');
    85             caca_putchar('i');
    86             caca_putchar('f');
     84            cucul_putchar(g->qq, 'p');
     85            cucul_putchar(g->qq, 'i');
     86            cucul_putchar(g->qq, 'f');
    8787            break;
    8888        case 1:
    89             caca_putchar('p');
    90             caca_putchar('a');
    91             caca_putchar('f');
     89            cucul_putchar(g->qq, 'p');
     90            cucul_putchar(g->qq, 'a');
     91            cucul_putchar(g->qq, 'f');
    9292            break;
    9393        case 2:
    94             caca_putchar('p');
    95             caca_putchar('o');
    96             caca_putchar('u');
    97             caca_putchar('f');
     94            cucul_putchar(g->qq, 'p');
     95            cucul_putchar(g->qq, 'o');
     96            cucul_putchar(g->qq, 'u');
     97            cucul_putchar(g->qq, 'f');
    9898            break;
    9999        }
    100         caca_putchar('!');
     100        cucul_putchar(g->qq, '!');
    101101#endif
    102102
     
    104104        {
    105105            case EXPLOSION_MEDIUM:
    106                 caca_draw_sprite(ex->x[i], ex->y[i], medium_sprite,
    107                                10 - ex->n[i]);
     106                cucul_draw_sprite(g->qq, ex->x[i], ex->y[i], medium_sprite,
     107                                  10 - ex->n[i]);
    108108                break;
    109109            case EXPLOSION_SMALL:
    110                 caca_draw_sprite(ex->x[i], ex->y[i], small_sprite,
    111                                6 - ex->n[i]);
     110                cucul_draw_sprite(g->qq, ex->x[i], ex->y[i], small_sprite,
     111                                  6 - ex->n[i]);
    112112                break;
    113113            case EXPLOSION_NONE:
  • ttyvaders/trunk/src/intro.c

    r365 r544  
    2929#include "common.h"
    3030
    31 void intro(void)
     31void intro(game *g)
    3232{
    33     struct caca_sprite *foo_sprite = caca_load_sprite("data/foofight.txt");
    34     struct caca_sprite *bar_sprite = caca_load_sprite("data/barfight.txt");
    35     struct caca_sprite *baz_sprite = caca_load_sprite("data/bazfight.txt");
     33    struct cucul_sprite *foo_sprite = cucul_load_sprite(g->qq, "data/foofight.txt");
     34    struct cucul_sprite *bar_sprite = cucul_load_sprite(g->qq, "data/barfight.txt");
     35    struct cucul_sprite *baz_sprite = cucul_load_sprite(g->qq, "data/bazfight.txt");
    3636
    3737    int frame = 0;
    3838
    39     while(caca_get_event(CACA_EVENT_KEY_PRESS) == 0)
     39    while(caca_get_event(g->kk, CACA_EVENT_KEY_PRESS) == 0)
    4040    {
    4141        int i, xo, yo, x[5], y[5];
     
    4343        frame++;
    4444
    45         caca_clear();
     45        cucul_clear(g->qq);
    4646
    47         xo = caca_get_width() / 2;
    48         yo = caca_get_height() / 2;
     47        xo = cucul_get_width(g->qq) / 2;
     48        yo = cucul_get_height(g->qq) / 2;
    4949
    50         caca_set_color(CACA_COLOR_RED, CACA_COLOR_BLACK);
    51         caca_fill_ellipse(xo, yo, 16, 8, '#');
    52         caca_set_color(CACA_COLOR_GREEN, CACA_COLOR_BLACK);
    53         caca_draw_thin_ellipse(xo, yo, 16, 8);
     50        cucul_set_color(g->qq, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK);
     51        cucul_fill_ellipse(g->qq, xo, yo, 16, 8, '#');
     52        cucul_set_color(g->qq, CUCUL_COLOR_GREEN, CUCUL_COLOR_BLACK);
     53        cucul_draw_thin_ellipse(g->qq, xo, yo, 16, 8);
    5454
    5555        for(i = 0; i < 4; i ++)
     
    6161        y[4] = y[0];
    6262
    63         caca_set_color(CACA_COLOR_BLACK, CACA_COLOR_BLACK);
    64         caca_fill_triangle(x[0], y[0], x[1], y[1], x[2], y[2], ' ');
    65         caca_fill_triangle(x[0], y[0], x[3], y[3], x[2], y[2], ' ');
    66         caca_draw_line(x[0], y[0], x[2], y[2], ' ');
    67         caca_set_color(CACA_COLOR_GREEN, CACA_COLOR_BLACK);
    68         caca_draw_thin_polyline(x, y, 4);
     63        cucul_set_color(g->qq, CUCUL_COLOR_BLACK, CUCUL_COLOR_BLACK);
     64        cucul_fill_triangle(g->qq, x[0], y[0], x[1], y[1], x[2], y[2], ' ');
     65        cucul_fill_triangle(g->qq, x[0], y[0], x[3], y[3], x[2], y[2], ' ');
     66        cucul_draw_line(g->qq, x[0], y[0], x[2], y[2], ' ');
     67        cucul_set_color(g->qq, CUCUL_COLOR_GREEN, CUCUL_COLOR_BLACK);
     68        cucul_draw_thin_polyline(g->qq, x, y, 4);
    6969
    70         caca_draw_sprite(xo, yo, foo_sprite, frame % 5);
     70        cucul_draw_sprite(g->qq, xo, yo, foo_sprite, frame % 5);
    7171
    72         caca_refresh();
     72        caca_display(g->kk);
    7373
    7474        usleep(40000);
  • ttyvaders/trunk/src/main.c

    r365 r544  
    4242    srand(time(NULL));
    4343
    44     if(caca_init())
    45     {
     44    g->qq = cucul_init();
     45    if(!g->qq)
    4646        return 1;
    47     }
    48 
    49     caca_set_delay(40000);
     47
     48    g->kk = caca_attach(g->qq);
     49    if(!g->kk)
     50        return 1;
     51
     52    caca_set_delay(g->kk, 40000);
    5053
    5154    /* Initialize our program */
    52     g->w = caca_get_width();
    53     g->h = caca_get_height();
    54 
    55 intro();
     55    g->w = cucul_get_width(g->qq);
     56    g->h = cucul_get_height(g->qq);
     57
     58intro(g);
    5659
    5760    /* Go ! */
     
    5962
    6063    /* Clean up */
    61     caca_end();
     64    caca_detach(g->kk);
     65    cucul_end(g->qq);
    6266
    6367    return 0;
     
    101105        int event, key;
    102106
    103         while((event = caca_get_event(CACA_EVENT_KEY_PRESS)))
     107        while((event = caca_get_event(g->kk, CACA_EVENT_KEY_PRESS)))
    104108        {
    105109            key = event & 0xffffff;
     
    201205
    202206            /* XXX: to be removed */
    203             if(caca_rand(0, 9) == 0)
     207            if(cucul_rand(0, 9) == 0)
    204208            {
    205209                int list[3] = { ALIEN_FOO, ALIEN_BAR, ALIEN_BAZ };
    206210
    207                 add_alien(g, g->al, 0, rand() % g->h / 2, list[caca_rand(0,2)]);
     211                add_alien(g, g->al, 0, rand() % g->h / 2, list[cucul_rand(0,2)]);
    208212            }
    209213
     
    234238
    235239        /* Clear screen */
    236         caca_clear();
     240        cucul_clear(g->qq);
    237241
    238242        /* Print starfield, tunnel, aliens, player and explosions */
     
    254258
    255259        /* Refresh */
    256         caca_refresh();
     260        caca_display(g->kk);
    257261
    258262        purcompteur++;
  • ttyvaders/trunk/src/overlay.c

    r365 r544  
    3333
    3434    /* Draw life jauge */
    35     caca_set_color(CACA_COLOR_DARKGRAY, CACA_COLOR_BLACK);
    36     caca_putstr(4, 1, dots30);
     35    cucul_set_color(g->qq, CUCUL_COLOR_DARKGRAY, CUCUL_COLOR_BLACK);
     36    cucul_putstr(g->qq, 4, 1, dots30);
    3737
    3838    if(g->p->life > MAX_LIFE * 7 / 10)
    3939    {
    40         caca_set_color(CACA_COLOR_GREEN, CACA_COLOR_BLACK);
     40        cucul_set_color(g->qq, CUCUL_COLOR_GREEN, CUCUL_COLOR_BLACK);
    4141    }
    4242    else if(g->p->life > MAX_LIFE * 3 / 10)
    4343    {
    44         caca_set_color(CACA_COLOR_YELLOW, CACA_COLOR_BLACK);
     44        cucul_set_color(g->qq, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
    4545    }
    4646    else
    4747    {
    48         caca_set_color(CACA_COLOR_RED, CACA_COLOR_BLACK);
     48        cucul_set_color(g->qq, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK);
    4949    }
    5050
    51     caca_putstr(4, 1, dashes30 + (MAX_LIFE - g->p->life) * 30 / MAX_LIFE);
     51    cucul_putstr(g->qq, 4, 1, dashes30 + (MAX_LIFE - g->p->life) * 30 / MAX_LIFE);
    5252
    53     caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
    54     caca_putstr(1, 1, "L |");
    55     caca_putstr(34, 1, "|");
     53    cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     54    cucul_putstr(g->qq, 1, 1, "L |");
     55    cucul_putstr(g->qq, 34, 1, "|");
    5656
    5757    /* Draw weapon jauge */
    58     caca_set_color(CACA_COLOR_DARKGRAY, CACA_COLOR_BLACK);
    59     caca_putstr(42, 1, dots30 + 10);
     58    cucul_set_color(g->qq, CUCUL_COLOR_DARKGRAY, CUCUL_COLOR_BLACK);
     59    cucul_putstr(g->qq, 42, 1, dots30 + 10);
    6060
    6161    if(g->p->special > MAX_SPECIAL * 9 / 10)
    6262    {
    63         caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
     63        cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
    6464    }
    6565    else if(g->p->special > MAX_SPECIAL * 3 / 10)
    6666    {
    67         caca_set_color(CACA_COLOR_CYAN, CACA_COLOR_BLACK);
     67        cucul_set_color(g->qq, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);
    6868    }
    6969    else
    7070    {
    71         caca_set_color(CACA_COLOR_BLUE, CACA_COLOR_BLACK);
     71        cucul_set_color(g->qq, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK);
    7272    }
    7373
    74     caca_putstr(42, 1, dashes30 + 10
     74    cucul_putstr(g->qq, 42, 1, dashes30 + 10
    7575                       + (MAX_SPECIAL - g->p->special) * 20 / MAX_SPECIAL);
    7676
    77     caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
    78     caca_putstr(39, 1, "S |");
    79     caca_putstr(62, 1, "|");
     77    cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     78    cucul_putstr(g->qq, 39, 1, "S |");
     79    cucul_putstr(g->qq, 62, 1, "|");
    8080}
    8181
  • ttyvaders/trunk/src/player.c

    r186 r544  
    2727#include "common.h"
    2828
    29 struct caca_sprite *ship_sprite;
     29struct cucul_sprite *ship_sprite;
    3030
    3131/* Init tunnel */
     
    4545    p->dead = 0;
    4646
    47     ship_sprite = caca_load_sprite("data/ship.txt");
     47    ship_sprite = cucul_load_sprite(g->qq, "data/ship.txt");
    4848
    4949    return p;
     
    6060        return;
    6161
    62     caca_draw_sprite(p->x, p->y, ship_sprite, 0);
     62    cucul_draw_sprite(g->qq, p->x, p->y, ship_sprite, 0);
    6363}
    6464
  • ttyvaders/trunk/src/starfield.c

    r365 r544  
    3838    for(i = 0; i < STARS; i++)
    3939    {
    40         s[i].x = caca_rand(0, g->w - 1);
    41         s[i].y = caca_rand(0, g->h - 1);
    42         s[i].z = caca_rand(1, 3);
    43         s[i].c = caca_rand(0, 1) ? CACA_COLOR_LIGHTGRAY : CACA_COLOR_DARKGRAY;
    44         s[i].ch = caca_rand(0, 1) ? '.' : '\'';
     40        s[i].x = cucul_rand(0, g->w - 1);
     41        s[i].y = cucul_rand(0, g->h - 1);
     42        s[i].z = cucul_rand(1, 3);
     43        s[i].c = cucul_rand(0, 1) ? CUCUL_COLOR_LIGHTGRAY : CUCUL_COLOR_DARKGRAY;
     44        s[i].ch = cucul_rand(0, 1) ? '.' : '\'';
    4545    }
    4646
     
    5656        if(s[i].x >= 0)
    5757        {
    58             caca_set_color(s[i].c, CACA_COLOR_BLACK);
    59             caca_putchar(s[i].x, s[i].y, s[i].ch);
     58            cucul_set_color(g->qq, s[i].c, CUCUL_COLOR_BLACK);
     59            cucul_putchar(g->qq, s[i].x, s[i].y, s[i].ch);
    6060        }
    6161    }
     
    7070        if(s[i].x < 0)
    7171        {
    72             s[i].x = caca_rand(0, g->w - 1);
     72            s[i].x = cucul_rand(0, g->w - 1);
    7373            s[i].y = 0;
    74             s[i].z = caca_rand(1, 2);
    75             s[i].c = caca_rand(0, 1) ? CACA_COLOR_LIGHTGRAY : CACA_COLOR_DARKGRAY;
    76             s[i].ch = caca_rand(0, 1) ? '.' : '\'';
     74            s[i].z = cucul_rand(1, 2);
     75            s[i].c = cucul_rand(0, 1) ? CUCUL_COLOR_LIGHTGRAY : CUCUL_COLOR_DARKGRAY;
     76            s[i].ch = cucul_rand(0, 1) ? '.' : '\'';
    7777        }
    7878        else if(s[i].y < g->h-1)
  • ttyvaders/trunk/src/tunnel.c

    r365 r544  
    7878    char c;
    7979
    80     caca_set_color(CACA_COLOR_RED, CACA_COLOR_BLACK);
     80    cucul_set_color(g->qq, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK);
    8181
    8282    /* Left border */
     
    9191            c = (i == 0 || t->left[i] > t->left[i-1]) ? '\\' : '<';
    9292
    93         caca_putchar(t->left[i] + 1, i, c);
     93        cucul_putchar(g->qq, t->left[i] + 1, i, c);
    9494
    9595        if(i + 1 < g->h)
    9696            for(j = 1; j < t->left[i+1] - t->left[i]; j++)
    97                 caca_putchar(t->left[i] + j + 1, i, '_');
     97                cucul_putchar(g->qq, t->left[i] + j + 1, i, '_');
    9898    }
    9999
     
    111111        if(i + 1 < g->h)
    112112            for(j = 1; j < t->right[i] - t->right[i+1]; j++)
    113                 caca_putchar(t->right[i+1] + j - 1, i, '_');
    114 
    115         caca_putchar(t->right[i] - 1, i, c);
    116     }
    117 
    118     caca_set_color(CACA_COLOR_LIGHTRED, CACA_COLOR_RED);
     113                cucul_putchar(g->qq, t->right[i+1] + j - 1, i, '_');
     114
     115        cucul_putchar(g->qq, t->right[i] - 1, i, c);
     116    }
     117
     118    cucul_set_color(g->qq, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_RED);
    119119
    120120    /* Left concrete */
    121121    for(i = 0; i < g->h ; i++)
    122122        for(j = 0 ; j <= t->left[i]; j++)
    123             caca_putchar(j, i, '#');
     123            cucul_putchar(g->qq, j, i, '#');
    124124
    125125    /* Right concrete */
    126126    for(i = 0; i < g->h ; i++)
    127127        for(j = t->right[i] ; j < g->w ; j++)
    128             caca_putchar(j, i, '#');
     128            cucul_putchar(g->qq, j, i, '#');
    129129}
    130130
     
    142142
    143143    /* Generate new values */
    144     i = delta[caca_rand(0,5)];
    145     j = delta[caca_rand(0,5)];
     144    i = delta[cucul_rand(0,5)];
     145    j = delta[cucul_rand(0,5)];
    146146
    147147    /* Check in which direction we need to alter tunnel */
  • ttyvaders/trunk/src/weapons.c

    r365 r544  
    2727#include "common.h"
    2828
    29 static void draw_bomb(int x, int y, int vx, int vy);
    30 static void draw_nuke(int x, int y, int frame);
    31 static void draw_beam(int x, int y, int frame);
    32 static void draw_fragbomb(int x, int y, int frame);
    33 
    34 struct caca_sprite *bomb_sprite;
    35 struct caca_sprite *fragbomb_sprite;
     29static void draw_bomb(game *g, int x, int y, int vx, int vy);
     30static void draw_nuke(game *g, int x, int y, int frame);
     31static void draw_beam(game *g, int x, int y, int frame);
     32static void draw_fragbomb(game *g, int x, int y, int frame);
     33
     34struct cucul_sprite *bomb_sprite;
     35struct cucul_sprite *fragbomb_sprite;
    3636
    3737void init_weapons(game *g, weapons *wp)
     
    4444    }
    4545
    46     bomb_sprite = caca_load_sprite("data/wpnbomb.txt");
    47     fragbomb_sprite = caca_load_sprite("data/wpnfrag.txt");
     46    bomb_sprite = cucul_load_sprite(g->qq, "data/wpnbomb.txt");
     47    fragbomb_sprite = cucul_load_sprite(g->qq, "data/wpnfrag.txt");
    4848}
    4949
     
    5757        {
    5858            case WEAPON_LASER:
    59                 caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
    60                 caca_putchar(wp->x[i] >> 4, wp->y[i] >> 4, '|');
    61                 caca_set_color(CACA_COLOR_CYAN, CACA_COLOR_BLACK);
    62                 caca_putchar(wp->x[i] >> 4, (wp->y[i] >> 4) + 1, '|');
     59                cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     60                cucul_putchar(g->qq, wp->x[i] >> 4, wp->y[i] >> 4, '|');
     61                cucul_set_color(g->qq, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);
     62                cucul_putchar(g->qq, wp->x[i] >> 4, (wp->y[i] >> 4) + 1, '|');
    6363                break;
    6464            case WEAPON_SEEKER:
    65                 caca_set_color(CACA_COLOR_CYAN, CACA_COLOR_BLACK);
    66                 caca_putchar(wp->x3[i] >> 4, wp->y3[i] >> 4, '.');
    67                 caca_putchar(wp->x2[i] >> 4, wp->y2[i] >> 4, 'o');
    68                 caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
    69                 caca_putchar(wp->x[i] >> 4, wp->y[i] >> 4, '@');
     65                cucul_set_color(g->qq, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);
     66                cucul_putchar(g->qq, wp->x3[i] >> 4, wp->y3[i] >> 4, '.');
     67                cucul_putchar(g->qq, wp->x2[i] >> 4, wp->y2[i] >> 4, 'o');
     68                cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     69                cucul_putchar(g->qq, wp->x[i] >> 4, wp->y[i] >> 4, '@');
    7070                break;
    7171            case WEAPON_BOMB:
    72                 caca_set_color(CACA_COLOR_DARKGRAY, CACA_COLOR_BLACK);
    73                 caca_putchar((wp->x[i] - wp->vx[i]) >> 4, (wp->y[i] - wp->vy[i]) >> 4, '.');
    74                 caca_putchar((wp->x3[i] - wp->vx[i]) >> 4, (wp->y3[i] - wp->vy[i]) >> 4, '.');
    75                 caca_putchar((wp->x2[i] - wp->vx[i]) >> 4, (wp->y2[i] - wp->vy[i]) >> 4, '.');
    76                 caca_putchar(wp->x3[i] >> 4, wp->y3[i] >> 4, '.');
    77                 caca_putchar(wp->x2[i] >> 4, wp->y2[i] >> 4, '.');
    78                 draw_bomb(wp->x[i] >> 4, wp->y[i] >> 4, wp->vx[i], wp->vy[i]);
     72                cucul_set_color(g->qq, CUCUL_COLOR_DARKGRAY, CUCUL_COLOR_BLACK);
     73                cucul_putchar(g->qq, (wp->x[i] - wp->vx[i]) >> 4, (wp->y[i] - wp->vy[i]) >> 4, '.');
     74                cucul_putchar(g->qq, (wp->x3[i] - wp->vx[i]) >> 4, (wp->y3[i] - wp->vy[i]) >> 4, '.');
     75                cucul_putchar(g->qq, (wp->x2[i] - wp->vx[i]) >> 4, (wp->y2[i] - wp->vy[i]) >> 4, '.');
     76                cucul_putchar(g->qq, wp->x3[i] >> 4, wp->y3[i] >> 4, '.');
     77                cucul_putchar(g->qq, wp->x2[i] >> 4, wp->y2[i] >> 4, '.');
     78                draw_bomb(g, wp->x[i] >> 4, wp->y[i] >> 4, wp->vx[i], wp->vy[i]);
    7979                break;
    8080            case WEAPON_FRAGBOMB:
    81                 draw_fragbomb(wp->x[i] >> 4, wp->y[i] >> 4, wp->n[i]);
     81                draw_fragbomb(g, wp->x[i] >> 4, wp->y[i] >> 4, wp->n[i]);
    8282                break;
    8383            case WEAPON_BEAM:
    84                 draw_beam(wp->x[i] >> 4, wp->y[i] >> 4, wp->n[i]);
     84                draw_beam(g, wp->x[i] >> 4, wp->y[i] >> 4, wp->n[i]);
    8585                break;
    8686            case WEAPON_NUKE:
    87                 draw_nuke(wp->x[i] >> 4, wp->y[i] >> 4, wp->n[i]);
     87                draw_nuke(g, wp->x[i] >> 4, wp->y[i] >> 4, wp->n[i]);
    8888                break;
    8989            case WEAPON_LIGHTNING:
     
    171171                if(dx | dy)
    172172                {
    173                     unsigned int norm = caca_sqrt(dx * dx + 4 * dy * dy);
     173                    unsigned int norm = cucul_sqrt(dx * dx + 4 * dy * dy);
    174174                    dx = dx * 32 / norm;
    175175                    dy = dy * 32 / norm;
     
    183183                if(dx | dy)
    184184                {
    185                     unsigned int norm = caca_sqrt(dx * dx + 4 * dy * dy);
     185                    unsigned int norm = cucul_sqrt(dx * dx + 4 * dy * dy);
    186186                    wp->vx[i] = dx * 32 / norm;
    187187                    wp->vy[i] = dy * 32 / norm;
     
    285285}
    286286
    287 static void draw_bomb(int x, int y, int vx, int vy)
     287static void draw_bomb(game *g, int x, int y, int vx, int vy)
    288288{
    289289    int frame;
     
    335335    }
    336336
    337     caca_draw_sprite(x, y, bomb_sprite, frame);
    338 }
    339 
    340 static void draw_fragbomb(int x, int y, int frame)
     337    cucul_draw_sprite(g->qq, x, y, bomb_sprite, frame);
     338}
     339
     340static void draw_fragbomb(game *g, int x, int y, int frame)
    341341{
    342342    /* Draw the head */
    343     caca_draw_sprite(x, y, fragbomb_sprite, frame & 1);
     343    cucul_draw_sprite(g->qq, x, y, fragbomb_sprite, frame & 1);
    344344
    345345    /* Draw the tail */
    346     caca_draw_sprite(x, y, fragbomb_sprite, 2 + (frame % 4));
    347 }
    348 
    349 static void draw_beam(int x, int y, int frame)
     346    cucul_draw_sprite(g->qq, x, y, fragbomb_sprite, 2 + (frame % 4));
     347}
     348
     349static void draw_beam(game *g, int x, int y, int frame)
    350350{
    351351    int r = (29 - frame) * (29 - frame) / 8;
     
    355355    {
    356356        case 24:
    357             caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
    358             caca_putstr(x, y-3, "__");
    359             caca_putchar(x-1, y-2, '\'');
    360             caca_putchar(x+2, y-2, '`');
     357            cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     358            cucul_putstr(g->qq, x, y-3, "__");
     359            cucul_putchar(g->qq, x-1, y-2, '\'');
     360            cucul_putchar(g->qq, x+2, y-2, '`');
    361361            break;
    362362        case 23:
    363             caca_set_color(CACA_COLOR_CYAN, CACA_COLOR_BLACK);
    364             caca_putstr(x, y-3, "__");
    365             caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
    366             caca_putstr(x-2, y-2, "-'");
    367             caca_putstr(x+2, y-2, "`-");
     363            cucul_set_color(g->qq, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);
     364            cucul_putstr(g->qq, x, y-3, "__");
     365            cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     366            cucul_putstr(g->qq, x-2, y-2, "-'");
     367            cucul_putstr(g->qq, x+2, y-2, "`-");
    368368            break;
    369369        case 22:
    370             caca_set_color(CACA_COLOR_CYAN, CACA_COLOR_BLACK);
    371             caca_putstr(x, y-3, "__");
    372             caca_putchar(x-1, y-2, '\'');
    373             caca_putchar(x+2, y-2, '`');
    374             caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
    375             caca_putstr(x-3, y-2, ",-");
    376             caca_putstr(x+3, y-2, "-.");
     370            cucul_set_color(g->qq, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);
     371            cucul_putstr(g->qq, x, y-3, "__");
     372            cucul_putchar(g->qq, x-1, y-2, '\'');
     373            cucul_putchar(g->qq, x+2, y-2, '`');
     374            cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     375            cucul_putstr(g->qq, x-3, y-2, ",-");
     376            cucul_putstr(g->qq, x+3, y-2, "-.");
    377377            break;
    378378        case 21:
    379             caca_set_color(CACA_COLOR_CYAN, CACA_COLOR_BLACK);
    380             caca_putstr(x-1, y-3, "____");
    381             caca_putchar(x-2, y-2, '\'');
    382             caca_putchar(x+3, y-2, '`');
    383             caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
    384             caca_putstr(x-4, y-2, ",-");
    385             caca_putstr(x+4, y-2, "-.");
     379            cucul_set_color(g->qq, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);
     380            cucul_putstr(g->qq, x-1, y-3, "____");
     381            cucul_putchar(g->qq, x-2, y-2, '\'');
     382            cucul_putchar(g->qq, x+3, y-2, '`');
     383            cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     384            cucul_putstr(g->qq, x-4, y-2, ",-");
     385            cucul_putstr(g->qq, x+4, y-2, "-.");
    386386            break;
    387387        case 20:
    388             caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
    389             caca_putstr(x, y-3, "%%");
    390             caca_putchar(x-4, y-2, ',');
    391             caca_putchar(x+5, y-2, '.');
    392             caca_set_color(CACA_COLOR_CYAN, CACA_COLOR_BLACK);
    393             caca_putchar(x-1, y-3, ':');
    394             caca_putchar(x+2, y-3, ':');
    395             caca_putstr(x-3, y-2, "-'");
    396             caca_putstr(x+3, y-2, "`-");
     388            cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     389            cucul_putstr(g->qq, x, y-3, "%%");
     390            cucul_putchar(g->qq, x-4, y-2, ',');
     391            cucul_putchar(g->qq, x+5, y-2, '.');
     392            cucul_set_color(g->qq, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);
     393            cucul_putchar(g->qq, x-1, y-3, ':');
     394            cucul_putchar(g->qq, x+2, y-3, ':');
     395            cucul_putstr(g->qq, x-3, y-2, "-'");
     396            cucul_putstr(g->qq, x+3, y-2, "`-");
    397397            break;
    398398        case 19:
    399             caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
    400             caca_putstr(x, y-4, "%%");
    401             caca_putstr(x, y-3, "##");
    402             caca_set_color(CACA_COLOR_CYAN, CACA_COLOR_BLACK);
    403             caca_putchar(x-1, y-4, ':');
    404             caca_putchar(x+2, y-4, ':');
    405             caca_putchar(x-1, y-3, '%');
    406             caca_putchar(x+2, y-3, '%');
    407             caca_putstr(x-4, y-2, ",-'");
    408             caca_putstr(x+3, y-2, "`-.");
    409             caca_set_color(CACA_COLOR_BLUE, CACA_COLOR_BLACK);
    410             caca_putchar(x-2, y-3, ':');
    411             caca_putchar(x+3, y-3, ':');
     399            cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     400            cucul_putstr(g->qq, x, y-4, "%%");
     401            cucul_putstr(g->qq, x, y-3, "##");
     402            cucul_set_color(g->qq, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);
     403            cucul_putchar(g->qq, x-1, y-4, ':');
     404            cucul_putchar(g->qq, x+2, y-4, ':');
     405            cucul_putchar(g->qq, x-1, y-3, '%');
     406            cucul_putchar(g->qq, x+2, y-3, '%');
     407            cucul_putstr(g->qq, x-4, y-2, ",-'");
     408            cucul_putstr(g->qq, x+3, y-2, "`-.");
     409            cucul_set_color(g->qq, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK);
     410            cucul_putchar(g->qq, x-2, y-3, ':');
     411            cucul_putchar(g->qq, x+3, y-3, ':');
    412412            break;
    413413        case 18:
    414414        default:
    415415            r = (18 - frame) * (18 - frame);
    416             caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
    417             caca_putstr(x-1, y-5-r, ":%%:");
    418             caca_putstr(x-1, y-4-r, "%##%");
    419             caca_set_color(CACA_COLOR_CYAN, CACA_COLOR_BLACK);
    420             caca_putchar(x-2, y-4-r, ':');
    421             caca_putchar(x+3, y-4-r, ':');
    422             caca_putchar(x-2, y-2, '\'');
    423             caca_putchar(x+3, y-2, '`');
    424             caca_set_color(CACA_COLOR_BLUE, CACA_COLOR_BLACK);
    425             caca_putchar(x-3, y-2, ':');
    426             caca_putchar(x+4, y-2, ':');
     416            cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     417            cucul_putstr(g->qq, x-1, y-5-r, ":%%:");
     418            cucul_putstr(g->qq, x-1, y-4-r, "%##%");
     419            cucul_set_color(g->qq, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);
     420            cucul_putchar(g->qq, x-2, y-4-r, ':');
     421            cucul_putchar(g->qq, x+3, y-4-r, ':');
     422            cucul_putchar(g->qq, x-2, y-2, '\'');
     423            cucul_putchar(g->qq, x+3, y-2, '`');
     424            cucul_set_color(g->qq, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK);
     425            cucul_putchar(g->qq, x-3, y-2, ':');
     426            cucul_putchar(g->qq, x+4, y-2, ':');
    427427            for(i = 0; i <= r; i++)
    428428            {
    429                 caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLACK);
    430                 caca_putstr(x-1, y-3-i, ((i+frame) % 5) ? "####" : "%%%%");
    431                 caca_set_color(CACA_COLOR_CYAN, CACA_COLOR_BLACK);
    432                 caca_putchar(x-2, y-3-i, '%');
    433                 caca_putchar(x+3, y-3-i, '%');
    434                 caca_set_color(CACA_COLOR_BLUE, CACA_COLOR_BLACK);
    435                 caca_putchar(x-3, y-3-i, ':');
    436                 caca_putchar(x+4, y-3-i, ':');
     429                cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     430                cucul_putstr(g->qq, x-1, y-3-i, ((i+frame) % 5) ? "####" : "%%%%");
     431                cucul_set_color(g->qq, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);
     432                cucul_putchar(g->qq, x-2, y-3-i, '%');
     433                cucul_putchar(g->qq, x+3, y-3-i, '%');
     434                cucul_set_color(g->qq, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK);
     435                cucul_putchar(g->qq, x-3, y-3-i, ':');
     436                cucul_putchar(g->qq, x+4, y-3-i, ':');
    437437            }
    438438            break;
     
    440440}
    441441
    442 static void draw_nuke(int x, int y, int frame)
     442static void draw_nuke(game *g, int x, int y, int frame)
    443443{
    444444    int r = (29 - frame) * (29 - frame) / 8;
    445445
    446446    /* Lots of duplicate pixels, but we don't care */
    447     caca_set_color(CACA_COLOR_BLUE, CACA_COLOR_BLACK);
    448     caca_draw_ellipse(x, y, r, r / 2, ':');
    449     caca_set_color(CACA_COLOR_LIGHTBLUE, CACA_COLOR_BLUE);
    450     caca_draw_ellipse(x, y, r + 1, r / 2, '#');
    451     caca_set_color(CACA_COLOR_BLUE, CACA_COLOR_LIGHTBLUE);
    452     caca_draw_ellipse(x, y, r + 2, r / 2, '#');
    453     caca_set_color(CACA_COLOR_CYAN, CACA_COLOR_LIGHTBLUE);
    454     caca_draw_ellipse(x, y, r + 2, r / 2 + 1, '#');
    455     caca_set_color(CACA_COLOR_LIGHTBLUE, CACA_COLOR_CYAN);
    456     caca_draw_ellipse(x, y, r + 3, r / 2 + 1, '#');
    457     caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_CYAN);
    458     caca_draw_ellipse(x, y, r + 3, r / 2 + 2, '#');
    459     caca_set_color(CACA_COLOR_CYAN, CACA_COLOR_WHITE);
    460     caca_draw_ellipse(x, y, r + 4, r / 2 + 2, '#');
    461     caca_draw_ellipse(x, y, r + 4, r / 2 + 3, ' ');
    462 }
    463 
     447    cucul_set_color(g->qq, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK);
     448    cucul_draw_ellipse(g->qq, x, y, r, r / 2, ':');
     449    cucul_set_color(g->qq, CUCUL_COLOR_LIGHTBLUE, CUCUL_COLOR_BLUE);
     450    cucul_draw_ellipse(g->qq, x, y, r + 1, r / 2, '#');
     451    cucul_set_color(g->qq, CUCUL_COLOR_BLUE, CUCUL_COLOR_LIGHTBLUE);
     452    cucul_draw_ellipse(g->qq, x, y, r + 2, r / 2, '#');
     453    cucul_set_color(g->qq, CUCUL_COLOR_CYAN, CUCUL_COLOR_LIGHTBLUE);
     454    cucul_draw_ellipse(g->qq, x, y, r + 2, r / 2 + 1, '#');
     455    cucul_set_color(g->qq, CUCUL_COLOR_LIGHTBLUE, CUCUL_COLOR_CYAN);
     456    cucul_draw_ellipse(g->qq, x, y, r + 3, r / 2 + 1, '#');
     457    cucul_set_color(g->qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_CYAN);
     458    cucul_draw_ellipse(g->qq, x, y, r + 3, r / 2 + 2, '#');
     459    cucul_set_color(g->qq, CUCUL_COLOR_CYAN, CUCUL_COLOR_WHITE);
     460    cucul_draw_ellipse(g->qq, x, y, r + 4, r / 2 + 2, '#');
     461    cucul_draw_ellipse(g->qq, x, y, r + 4, r / 2 + 3, ' ');
     462}
     463
Note: See TracChangeset for help on using the changeset viewer.