- Timestamp:
- Oct 18, 2008, 11:42:24 PM (14 years ago)
- Location:
- ttyvaders/trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
ttyvaders/trunk/bootstrap
r989 r2990 1 1 #! /bin/sh 2 # $Id$ 2 3 3 # bootstrap: the ultimate bootstrap/autogen.sh script for autotools projects 4 # Copyright (c) 2002, 2003, 2004, 2005, 2006 Sam Hocevar <sam@zoy.org> 4 # bootstrap: generic bootstrap/autogen.sh script for autotools projects 5 5 # 6 # This program is free software; you can redistribute it and/or 7 # modify it under the terms of the Do What The Fuck You Want To 8 # Public License, Version 2, as published by Sam Hocevar. See 6 # Copyright (c) 2002-2007 Sam Hocevar <sam@zoy.org> 7 # 8 # This program is free software. It comes without any warranty, to 9 # the extent permitted by applicable law. You can redistribute it 10 # and/or modify it under the terms of the Do What The Fuck You Want 11 # To Public License, Version 2, as published by Sam Hocevar. See 9 12 # http://sam.zoy.org/wtfpl/COPYING for more details. 10 13 # … … 26 29 27 30 # Check for needed features 28 auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *( *\([^)]*\).*/\1/p' $conffile`"31 auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *([[ ]*\([^] )]*\).*/\1/p' $conffile`" 29 32 libtool="`grep -q '^[ \t]*A._PROG_LIBTOOL' $conffile && echo yes || echo no`" 33 pkgconfig="`grep -q '^[ \t]*PKG_PROG_PKG_CONFIG' $conffile && echo yes || echo no`" 30 34 header="`grep -q '^[ \t]*A._CONFIG_HEADER' $conffile && echo yes || echo no`" 31 35 aclocalflags="`sed -ne 's/^[ \t]*ACLOCAL_AMFLAGS[ \t]*=//p' Makefile.am`" … … 33 37 # Check for automake 34 38 amvers="no" 35 for v in "-1.9" "19" "-1.8" "18" "-1.7" "17" "-1.6" "16" "-1.5" "15"; do 36 if automake${v} --version >/dev/null 2>&1; then 37 amvers="${v}" 39 for v in 10 9 8 7 6 5; do 40 if automake-1.${v} --version >/dev/null 2>&1; then 41 amvers="-1.${v}" 42 break 43 elif automake1.${v} --version >/dev/null 2>&1; then 44 amvers="1.${v}" 38 45 break 39 46 fi … … 88 95 fi 89 96 97 # Check for pkg-config 98 if test "$pkgconfig" = "yes"; then 99 if ! pkg-config --version >/dev/null 2>&1; then 100 echo "$0: you need pkg-config" 101 exit 1 102 fi 103 fi 104 90 105 # Remove old cruft 91 106 for x in aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh; do rm -f $x autotools/$x; if test -n "$auxdir"; then rm -f "$auxdir/$x"; fi; done 92 107 rm -Rf autom4te.cache 93 if test -n "$auxdir" -a ! -d "$auxdir"; then mkdir "$auxdir"; fi 108 if test -n "$auxdir"; then 109 if test ! -d "$auxdir"; then 110 mkdir "$auxdir" 111 fi 112 aclocalflags="${aclocalflags} -I $auxdir -I ." 113 fi 94 114 95 115 # Explain what we are doing from now … … 99 119 if test "$libtool" = "yes"; then 100 120 ${libtoolize} --copy --force 101 if test -n "$auxdir" -a -f "ltmain.sh"; then121 if test -n "$auxdir" -a ! "$auxdir" = "." -a -f "ltmain.sh"; then 102 122 echo "$0: working around a minor libtool issue" 103 123 mv ltmain.sh "$auxdir/" … … 105 125 fi 106 126 107 if test -n "$auxdir"; then 108 aclocal${amvers} -I autotools ${aclocalflags} 109 else 110 aclocal${amvers} ${aclocalflags} 111 fi 127 aclocal${amvers} ${aclocalflags} 112 128 autoconf${acvers} 113 129 if test "$header" = "yes"; then -
ttyvaders/trunk/configure.ac
r1444 r2990 27 27 28 28 CACA="no" 29 PKG_CHECK_MODULES(CACA, caca >= 0.99.beta 9,29 PKG_CHECK_MODULES(CACA, caca >= 0.99.beta15, 30 30 [CACA="yes"], 31 31 [AC_MSG_RESULT(no) 32 AC_MSG_ERROR([you need libcaca version 0.99.beta 9or later])])32 AC_MSG_ERROR([you need libcaca version 0.99.beta15 or later])]) 33 33 34 34 # Optimizations -
ttyvaders/trunk/src/aliens.c
r1460 r2990 19 19 #include "common.h" 20 20 21 c ucul_canvas_t *foo_sprite;22 c ucul_canvas_t *bar_sprite;23 c ucul_canvas_t *baz_sprite;21 caca_canvas_t *foo_sprite; 22 caca_canvas_t *bar_sprite; 23 caca_canvas_t *baz_sprite; 24 24 25 25 void init_aliens(game *g, aliens *al) 26 26 { 27 c ucul_buffer_t *b;27 caca_buffer_t *b; 28 28 int i; 29 29 … … 33 33 } 34 34 35 b = c ucul_load_file("data/foofight.caca");36 foo_sprite = c ucul_import_canvas(b, "");37 c ucul_free_buffer(b);35 b = caca_load_file("data/foofight.caca"); 36 foo_sprite = caca_import_canvas(b, ""); 37 caca_free_buffer(b); 38 38 39 b = c ucul_load_file("data/barfight.caca");40 bar_sprite = c ucul_import_canvas(b, "");41 c ucul_free_buffer(b);39 b = caca_load_file("data/barfight.caca"); 40 bar_sprite = caca_import_canvas(b, ""); 41 caca_free_buffer(b); 42 42 43 b = c ucul_load_file("data/bazfight.caca");44 baz_sprite = c ucul_import_canvas(b, "");45 c ucul_free_buffer(b);43 b = caca_load_file("data/bazfight.caca"); 44 baz_sprite = caca_import_canvas(b, ""); 45 caca_free_buffer(b); 46 46 } 47 47 … … 55 55 { 56 56 case ALIEN_FOO: 57 c ucul_set_canvas_frame(foo_sprite, al->img[i] % 5);58 c ucul_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); 59 59 break; 60 60 case ALIEN_BAR: 61 c ucul_set_canvas_frame(bar_sprite, al->img[i] % 2);62 c ucul_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); 63 63 break; 64 64 case ALIEN_BAZ: 65 c ucul_set_canvas_frame(baz_sprite, al->img[i] % 4);66 c ucul_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); 67 67 break; 68 68 case ALIEN_NONE: … … 83 83 add_explosion(g, g->ex, al->x[i], al->y[i], 0, 0, EXPLOSION_MEDIUM); 84 84 al->type[i] = ALIEN_NONE; 85 add_bonus(g, g->bo, al->x[i], al->y[i], c ucul_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); 86 86 } 87 87 -
ttyvaders/trunk/src/bonus.c
r1460 r2990 19 19 #include "common.h" 20 20 21 c ucul_canvas_t *heart_sprite;22 c ucul_canvas_t *gem_sprite;21 caca_canvas_t *heart_sprite; 22 caca_canvas_t *gem_sprite; 23 23 24 24 void init_bonus(game *g, bonus *bo) 25 25 { 26 c ucul_buffer_t *b;26 caca_buffer_t *b; 27 27 int i; 28 28 … … 32 32 } 33 33 34 b = c ucul_load_file("data/bonheart.caca");35 heart_sprite = c ucul_import_canvas(b, "");36 c ucul_free_buffer(b);34 b = caca_load_file("data/bonheart.caca"); 35 heart_sprite = caca_import_canvas(b, ""); 36 caca_free_buffer(b); 37 37 38 b = c ucul_load_file("data/bongem.caca");39 gem_sprite = c ucul_import_canvas(b, "");40 c ucul_free_buffer(b);38 b = caca_load_file("data/bongem.caca"); 39 gem_sprite = caca_import_canvas(b, ""); 40 caca_free_buffer(b); 41 41 } 42 42 … … 50 50 { 51 51 case BONUS_GREEN: 52 c ucul_set_canvas_frame(gem_sprite, (bo->n[i]/2 % 3) ? 0 : 1);53 c ucul_blit(g->cv, bo->x[i], bo->y[i], gem_sprite, NULL);52 caca_set_canvas_frame(gem_sprite, (bo->n[i]/2 % 3) ? 0 : 1); 53 caca_blit(g->cv, bo->x[i], bo->y[i], gem_sprite, NULL); 54 54 break; 55 55 case BONUS_LIFE: 56 c ucul_set_canvas_frame(heart_sprite, (bo->n[i] % 3) ? 0 : 1);57 c ucul_blit(g->cv, bo->x[i], bo->y[i], heart_sprite, NULL);56 caca_set_canvas_frame(heart_sprite, (bo->n[i] % 3) ? 0 : 1); 57 caca_blit(g->cv, bo->x[i], bo->y[i], heart_sprite, NULL); 58 58 break; 59 59 case BONUS_NONE: -
ttyvaders/trunk/src/box.c
r1460 r2990 38 38 int j, frame; 39 39 40 c ucul_set_color(g->cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);40 caca_set_color(g->cv, CACA_COLOR_YELLOW, CACA_COLOR_BLACK); 41 41 42 42 /* Draw the thin horizontal line */ 43 43 if(b->frame < 8) 44 44 { 45 c ucul_draw_line(g->cv, b->x - b->w * b->frame / 16, b->y,45 caca_draw_line(g->cv, b->x - b->w * b->frame / 16, b->y, 46 46 b->x + b->w * b->frame / 16 - 1, b->y, "X"); 47 47 return; … … 51 51 frame = b->frame < 12 ? b->frame : 12; 52 52 53 c ucul_draw_line(g->cv, b->x - b->w / 2, b->y - b->h * (frame - 8) / 8,53 caca_draw_line(g->cv, b->x - b->w / 2, b->y - b->h * (frame - 8) / 8, 54 54 b->x + b->w / 2 - 1, b->y - b->h * (frame - 8) / 8, "X"); 55 c ucul_draw_line(g->cv, b->x - b->w / 2, b->y + b->h * (frame - 8) / 8,55 caca_draw_line(g->cv, b->x - b->w / 2, b->y + b->h * (frame - 8) / 8, 56 56 b->x + b->w / 2 - 1, b->y + b->h * (frame - 8) / 8, "X"); 57 57 58 c ucul_draw_line(g->cv, b->x - b->w / 2, b->y - b->h * (frame - 8) / 8,58 caca_draw_line(g->cv, b->x - b->w / 2, b->y - b->h * (frame - 8) / 8, 59 59 b->x - b->w / 2, b->y + b->h * (frame - 8) / 8 - 1, "X"); 60 c ucul_draw_line(g->cv, b->x + b->w / 2 - 1, b->y - b->h * (frame - 8) / 8,60 caca_draw_line(g->cv, b->x + b->w / 2 - 1, b->y - b->h * (frame - 8) / 8, 61 61 b->x + b->w / 2 - 1, b->y + b->h * (frame - 8) / 8 - 1, "X"); 62 62 63 c ucul_set_color(g->cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_BLACK);63 caca_set_color(g->cv, CACA_COLOR_BLACK, CACA_COLOR_BLACK); 64 64 65 65 for(j = b->y - b->h * (frame - 8) / 8 + 1; … … 67 67 j++) 68 68 { 69 c ucul_draw_line(g->cv, b->x - b->w / 2 + 1, j,69 caca_draw_line(g->cv, b->x - b->w / 2 + 1, j, 70 70 b->x + b->w / 2 - 2, j, "X"); 71 71 } … … 77 77 78 78 /* Draw the text inside the frame */ 79 c ucul_set_color(g->cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);79 caca_set_color(g->cv, CACA_COLOR_YELLOW, CACA_COLOR_BLACK); 80 80 81 81 /* FIXME: use a font */ 82 c ucul_putstr(g->cv, b->x - b->w / 2 + 12, b->y - b->h / 2 + 2,82 caca_putstr(g->cv, b->x - b->w / 2 + 12, b->y - b->h / 2 + 2, 83 83 "XXXX. .XXXX X X .XXXX .XXXX XXXX."); 84 c ucul_putstr(g->cv, b->x - b->w / 2 + 12, b->y - b->h / 2 + 3,84 caca_putstr(g->cv, b->x - b->w / 2 + 12, b->y - b->h / 2 + 3, 85 85 "X `X X' X X X X' X' X `X"); 86 c ucul_putstr(g->cv, b->x - b->w / 2 + 12, b->y - b->h / 2 + 4,86 caca_putstr(g->cv, b->x - b->w / 2 + 12, b->y - b->h / 2 + 4, 87 87 "XXXX' XXXXX X X `XXX XXXX X X"); 88 c ucul_putstr(g->cv, b->x - b->w / 2 + 12, b->y - b->h / 2 + 5,88 caca_putstr(g->cv, b->x - b->w / 2 + 12, b->y - b->h / 2 + 5, 89 89 "X' X' `X X. ,X `X X' X ,X"); 90 c ucul_putstr(g->cv, b->x - b->w / 2 + 12, b->y - b->h / 2 + 6,90 caca_putstr(g->cv, b->x - b->w / 2 + 12, b->y - b->h / 2 + 6, 91 91 "X X X `XXXX XXXX' `XXXX XXXX'"); 92 92 } -
ttyvaders/trunk/src/ceo.c
r1460 r2990 28 28 caca_event_t ev; 29 29 30 c ucul_clear_canvas(g->cv);30 caca_clear_canvas(g->cv); 31 31 32 32 if(caca_get_event(g->dp, CACA_EVENT_KEY_PRESS, &ev, 0) -
ttyvaders/trunk/src/collide.c
r1460 r2990 120 120 { 121 121 add_explosion(g, ex, GET_MIN(t->left[y-j], x+3), y-j, 0, 1, EXPLOSION_SMALL); 122 t->left[y-j] -= c ucul_rand(0,2);122 t->left[y-j] -= caca_rand(0,2); 123 123 } 124 124 else if(x + 3 >= t->right[y-j]) 125 125 { 126 126 add_explosion(g, ex, GET_MAX(t->right[y-j], x-2), y-j, 0, 1, EXPLOSION_SMALL); 127 t->right[y-j] += c ucul_rand(0,2);127 t->right[y-j] += caca_rand(0,2); 128 128 } 129 129 } -
ttyvaders/trunk/src/common.h
r1460 r2990 125 125 int w, h; 126 126 127 c ucul_canvas_t *cv;127 caca_canvas_t *cv; 128 128 caca_display_t *dp; 129 129 -
ttyvaders/trunk/src/explosions.c
r1460 r2990 19 19 #include "common.h" 20 20 21 c ucul_canvas_t *medium_sprite;22 c ucul_canvas_t *small_sprite;21 caca_canvas_t *medium_sprite; 22 caca_canvas_t *small_sprite; 23 23 24 24 void init_explosions(game *g, explosions *ex) 25 25 { 26 c ucul_buffer_t *b;26 caca_buffer_t *b; 27 27 int i; 28 28 … … 32 32 } 33 33 34 b = c ucul_load_file("data/xplmed.caca");35 medium_sprite = c ucul_import_canvas(b, "");36 c ucul_free_buffer(b);34 b = caca_load_file("data/xplmed.caca"); 35 medium_sprite = caca_import_canvas(b, ""); 36 caca_free_buffer(b); 37 37 38 b = c ucul_load_file("data/xplsmall.caca");39 small_sprite = c ucul_import_canvas(b, "");40 c ucul_free_buffer(b);38 b = caca_load_file("data/xplsmall.caca"); 39 small_sprite = caca_import_canvas(b, ""); 40 caca_free_buffer(b); 41 41 } 42 42 … … 75 75 { 76 76 #if 0 77 c ucul_set_fg_color(g->cv, CACA_COLOR_GREEN);78 c ucul_goto(g->cv, ex->x[i] + 3, ex->y[i]);79 switch(c ucul_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)) 80 80 { 81 81 case 0: 82 c ucul_putchar(g->cv, 'p');83 c ucul_putchar(g->cv, 'i');84 c ucul_putchar(g->cv, 'f');82 caca_putchar(g->cv, 'p'); 83 caca_putchar(g->cv, 'i'); 84 caca_putchar(g->cv, 'f'); 85 85 break; 86 86 case 1: 87 c ucul_putchar(g->cv, 'p');88 c ucul_putchar(g->cv, 'a');89 c ucul_putchar(g->cv, 'f');87 caca_putchar(g->cv, 'p'); 88 caca_putchar(g->cv, 'a'); 89 caca_putchar(g->cv, 'f'); 90 90 break; 91 91 case 2: 92 c ucul_putchar(g->cv, 'p');93 c ucul_putchar(g->cv, 'o');94 c ucul_putchar(g->cv, 'u');95 c ucul_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'); 96 96 break; 97 97 } 98 c ucul_putchar(g->cv, '!');98 caca_putchar(g->cv, '!'); 99 99 #endif 100 100 … … 102 102 { 103 103 case EXPLOSION_MEDIUM: 104 c ucul_set_canvas_frame(medium_sprite, 10 - ex->n[i]);105 c ucul_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); 106 106 break; 107 107 case EXPLOSION_SMALL: 108 c ucul_set_canvas_frame(small_sprite, 6 - ex->n[i]);109 c ucul_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); 110 110 break; 111 111 case EXPLOSION_NONE: -
ttyvaders/trunk/src/intro.c
r1460 r2990 24 24 { 25 25 caca_event_t ev; 26 c ucul_canvas_t *foo_sprite;27 c ucul_canvas_t *bar_sprite;28 c ucul_canvas_t *baz_sprite;29 c ucul_buffer_t *b;26 caca_canvas_t *foo_sprite; 27 caca_canvas_t *bar_sprite; 28 caca_canvas_t *baz_sprite; 29 caca_buffer_t *b; 30 30 int frame = 0; 31 31 32 b = c ucul_load_file("data/foofight.caca");33 foo_sprite = c ucul_import_canvas(b, "");34 c ucul_free_buffer(b);32 b = caca_load_file("data/foofight.caca"); 33 foo_sprite = caca_import_canvas(b, ""); 34 caca_free_buffer(b); 35 35 36 b = c ucul_load_file("data/barfight.caca");37 bar_sprite = c ucul_import_canvas(b, "");38 c ucul_free_buffer(b);36 b = caca_load_file("data/barfight.caca"); 37 bar_sprite = caca_import_canvas(b, ""); 38 caca_free_buffer(b); 39 39 40 b = c ucul_load_file("data/bazfight.caca");41 baz_sprite = c ucul_import_canvas(b, "");42 c ucul_free_buffer(b);40 b = caca_load_file("data/bazfight.caca"); 41 baz_sprite = caca_import_canvas(b, ""); 42 caca_free_buffer(b); 43 43 44 44 while(caca_get_event(g->dp, CACA_EVENT_KEY_PRESS, &ev, 0) == 0) … … 48 48 frame++; 49 49 50 c ucul_clear_canvas(g->cv);50 caca_clear_canvas(g->cv); 51 51 52 xo = c ucul_get_canvas_width(g->cv) / 2;53 yo = c ucul_get_canvas_height(g->cv) / 2;52 xo = caca_get_canvas_width(g->cv) / 2; 53 yo = caca_get_canvas_height(g->cv) / 2; 54 54 55 c ucul_set_color(g->cv, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK);56 c ucul_fill_ellipse(g->cv, xo, yo, 16, 8, "#");57 c ucul_set_color(g->cv, CUCUL_COLOR_GREEN, CUCUL_COLOR_BLACK);58 c ucul_draw_thin_ellipse(g->cv, xo, yo, 16, 8);55 caca_set_color(g->cv, CACA_COLOR_RED, CACA_COLOR_BLACK); 56 caca_fill_ellipse(g->cv, xo, yo, 16, 8, "#"); 57 caca_set_color(g->cv, CACA_COLOR_GREEN, CACA_COLOR_BLACK); 58 caca_draw_thin_ellipse(g->cv, xo, yo, 16, 8); 59 59 60 60 for(i = 0; i < 4; i ++) … … 66 66 y[4] = y[0]; 67 67 68 c ucul_set_color(g->cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_BLACK);69 c ucul_fill_triangle(g->cv, x[0], y[0], x[1], y[1], x[2], y[2], " ");70 c ucul_fill_triangle(g->cv, x[0], y[0], x[3], y[3], x[2], y[2], " ");71 c ucul_draw_line(g->cv, x[0], y[0], x[2], y[2], " ");72 c ucul_set_color(g->cv, CUCUL_COLOR_GREEN, CUCUL_COLOR_BLACK);73 c ucul_draw_thin_polyline(g->cv, x, y, 4);68 caca_set_color(g->cv, CACA_COLOR_BLACK, CACA_COLOR_BLACK); 69 caca_fill_triangle(g->cv, x[0], y[0], x[1], y[1], x[2], y[2], " "); 70 caca_fill_triangle(g->cv, x[0], y[0], x[3], y[3], x[2], y[2], " "); 71 caca_draw_line(g->cv, x[0], y[0], x[2], y[2], " "); 72 caca_set_color(g->cv, CACA_COLOR_GREEN, CACA_COLOR_BLACK); 73 caca_draw_thin_polyline(g->cv, x, y, 4); 74 74 75 c ucul_set_canvas_frame(foo_sprite, frame % 5);76 c ucul_blit(g->cv, xo, yo, foo_sprite, NULL);75 caca_set_canvas_frame(foo_sprite, frame % 5); 76 caca_blit(g->cv, xo, yo, foo_sprite, NULL); 77 77 78 78 caca_refresh_display(g->dp); -
ttyvaders/trunk/src/main.c
r1460 r2990 34 34 srand(time(NULL)); 35 35 36 g->cv = c ucul_create_canvas(0, 0);36 g->cv = caca_create_canvas(0, 0); 37 37 if(!g->cv) 38 38 return 1; … … 45 45 46 46 /* Initialize our program */ 47 g->w = c ucul_get_canvas_width(g->cv);48 g->h = c ucul_get_canvas_height(g->cv);47 g->w = caca_get_canvas_width(g->cv); 48 g->h = caca_get_canvas_height(g->cv); 49 49 50 50 intro(g); … … 55 55 /* Clean up */ 56 56 caca_free_display(g->dp); 57 c ucul_free_canvas(g->cv);57 caca_free_canvas(g->cv); 58 58 59 59 return 0; … … 195 195 196 196 /* XXX: to be removed */ 197 if(c ucul_rand(0, 9) == 0)197 if(caca_rand(0, 9) == 0) 198 198 { 199 199 int list[3] = { ALIEN_FOO, ALIEN_BAR, ALIEN_BAZ }; 200 200 201 add_alien(g, g->al, 0, rand() % g->h / 2, list[c ucul_rand(0,2)]);201 add_alien(g, g->al, 0, rand() % g->h / 2, list[caca_rand(0,2)]); 202 202 } 203 203 … … 228 228 229 229 /* Clear screen */ 230 c ucul_clear_canvas(g->cv);230 caca_clear_canvas(g->cv); 231 231 232 232 /* Print starfield, tunnel, aliens, player and explosions */ -
ttyvaders/trunk/src/overlay.c
r1460 r2990 25 25 26 26 /* Draw life jauge */ 27 c ucul_set_color(g->cv, CUCUL_COLOR_DARKGRAY, CUCUL_COLOR_BLACK);28 c ucul_putstr(g->cv, 4, 1, dots30);27 caca_set_color(g->cv, CACA_COLOR_DARKGRAY, CACA_COLOR_BLACK); 28 caca_putstr(g->cv, 4, 1, dots30); 29 29 30 30 if(g->p->life > MAX_LIFE * 7 / 10) 31 31 { 32 c ucul_set_color(g->cv, CUCUL_COLOR_GREEN, CUCUL_COLOR_BLACK);32 caca_set_color(g->cv, CACA_COLOR_GREEN, CACA_COLOR_BLACK); 33 33 } 34 34 else if(g->p->life > MAX_LIFE * 3 / 10) 35 35 { 36 c ucul_set_color(g->cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);36 caca_set_color(g->cv, CACA_COLOR_YELLOW, CACA_COLOR_BLACK); 37 37 } 38 38 else 39 39 { 40 c ucul_set_color(g->cv, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK);40 caca_set_color(g->cv, CACA_COLOR_RED, CACA_COLOR_BLACK); 41 41 } 42 42 43 c ucul_putstr(g->cv, 4, 1, dashes30 + (MAX_LIFE - g->p->life) * 30 / MAX_LIFE);43 caca_putstr(g->cv, 4, 1, dashes30 + (MAX_LIFE - g->p->life) * 30 / MAX_LIFE); 44 44 45 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);46 c ucul_putstr(g->cv, 1, 1, "L |");47 c ucul_putstr(g->cv, 34, 1, "|");45 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 46 caca_putstr(g->cv, 1, 1, "L |"); 47 caca_putstr(g->cv, 34, 1, "|"); 48 48 49 49 /* Draw weapon jauge */ 50 c ucul_set_color(g->cv, CUCUL_COLOR_DARKGRAY, CUCUL_COLOR_BLACK);51 c ucul_putstr(g->cv, 42, 1, dots30 + 10);50 caca_set_color(g->cv, CACA_COLOR_DARKGRAY, CACA_COLOR_BLACK); 51 caca_putstr(g->cv, 42, 1, dots30 + 10); 52 52 53 53 if(g->p->special > MAX_SPECIAL * 9 / 10) 54 54 { 55 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);55 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 56 56 } 57 57 else if(g->p->special > MAX_SPECIAL * 3 / 10) 58 58 { 59 c ucul_set_color(g->cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);59 caca_set_color(g->cv, CACA_COLOR_CYAN, CACA_COLOR_BLACK); 60 60 } 61 61 else 62 62 { 63 c ucul_set_color(g->cv, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK);63 caca_set_color(g->cv, CACA_COLOR_BLUE, CACA_COLOR_BLACK); 64 64 } 65 65 66 c ucul_putstr(g->cv, 42, 1, dashes30 + 1066 caca_putstr(g->cv, 42, 1, dashes30 + 10 67 67 + (MAX_SPECIAL - g->p->special) * 20 / MAX_SPECIAL); 68 68 69 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);70 c ucul_putstr(g->cv, 39, 1, "S |");71 c ucul_putstr(g->cv, 62, 1, "|");69 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 70 caca_putstr(g->cv, 39, 1, "S |"); 71 caca_putstr(g->cv, 62, 1, "|"); 72 72 } 73 73 -
ttyvaders/trunk/src/player.c
r1460 r2990 19 19 #include "common.h" 20 20 21 c ucul_canvas_t *ship_sprite;21 caca_canvas_t *ship_sprite; 22 22 23 23 /* Init tunnel */ 24 24 player * create_player(game *g) 25 25 { 26 c ucul_buffer_t *b;26 caca_buffer_t *b; 27 27 28 28 player *p = malloc(sizeof(player)); … … 39 39 p->dead = 0; 40 40 41 b = c ucul_load_file("data/ship.caca");42 ship_sprite = c ucul_import_canvas(b, "");43 c ucul_free_buffer(b);41 b = caca_load_file("data/ship.caca"); 42 ship_sprite = caca_import_canvas(b, ""); 43 caca_free_buffer(b); 44 44 45 45 return p; … … 56 56 return; 57 57 58 c ucul_set_canvas_frame(ship_sprite, 0);59 c ucul_blit(g->cv, p->x, p->y, ship_sprite, NULL);58 caca_set_canvas_frame(ship_sprite, 0); 59 caca_blit(g->cv, p->x, p->y, ship_sprite, NULL); 60 60 } 61 61 -
ttyvaders/trunk/src/starfield.c
r1460 r2990 30 30 for(i = 0; i < STARS; i++) 31 31 { 32 s[i].x = c ucul_rand(0, g->w - 1);33 s[i].y = c ucul_rand(0, g->h - 1);34 s[i].z = c ucul_rand(1, 3);35 s[i].c = c ucul_rand(0, 1) ? CUCUL_COLOR_LIGHTGRAY : CUCUL_COLOR_DARKGRAY;36 s[i].ch = c ucul_rand(0, 1) ? '.' : '\'';32 s[i].x = caca_rand(0, g->w - 1); 33 s[i].y = caca_rand(0, g->h - 1); 34 s[i].z = caca_rand(1, 3); 35 s[i].c = caca_rand(0, 1) ? CACA_COLOR_LIGHTGRAY : CACA_COLOR_DARKGRAY; 36 s[i].ch = caca_rand(0, 1) ? '.' : '\''; 37 37 } 38 38 … … 48 48 if(s[i].x >= 0) 49 49 { 50 c ucul_set_color(g->cv, s[i].c, CUCUL_COLOR_BLACK);51 c ucul_putchar(g->cv, s[i].x, s[i].y, s[i].ch);50 caca_set_color(g->cv, s[i].c, CACA_COLOR_BLACK); 51 caca_putchar(g->cv, s[i].x, s[i].y, s[i].ch); 52 52 } 53 53 } … … 62 62 if(s[i].x < 0) 63 63 { 64 s[i].x = c ucul_rand(0, g->w - 1);64 s[i].x = caca_rand(0, g->w - 1); 65 65 s[i].y = 0; 66 s[i].z = c ucul_rand(1, 2);67 s[i].c = c ucul_rand(0, 1) ? CUCUL_COLOR_LIGHTGRAY : CUCUL_COLOR_DARKGRAY;68 s[i].ch = c ucul_rand(0, 1) ? '.' : '\'';66 s[i].z = caca_rand(1, 2); 67 s[i].c = caca_rand(0, 1) ? CACA_COLOR_LIGHTGRAY : CACA_COLOR_DARKGRAY; 68 s[i].ch = caca_rand(0, 1) ? '.' : '\''; 69 69 } 70 70 else if(s[i].y < g->h-1) -
ttyvaders/trunk/src/ttyvaders.c
r1460 r2990 19 19 #include <caca.h> 20 20 21 c ucul_canvas_t *cv;21 caca_canvas_t *cv; 22 22 caca_display_t *dp; 23 23 24 c ucul_canvas_t *ship, *alien;24 caca_canvas_t *ship, *alien; 25 25 26 26 unsigned int shipx, shipy; 27 27 28 28 unsigned int frame, w, h; 29 int ground[8 0];29 int ground[81]; 30 30 31 31 static void run_game(void); … … 33 33 int main(int argc, char **argv) 34 34 { 35 cucul_buffer_t *b; 36 37 cv = cucul_create_canvas(80, 24); 35 cv = caca_create_canvas(80, 24); 38 36 if(!cv) 39 37 return 1; … … 46 44 47 45 /* Initialize our program */ 48 w = c ucul_get_canvas_width(cv);49 h = c ucul_get_canvas_height(cv);46 w = caca_get_canvas_width(cv); 47 h = caca_get_canvas_height(cv); 50 48 51 49 /* Load data */ 52 b = cucul_load_file("data/ship.ans"); 53 ship = cucul_import_canvas(b, ""); 54 cucul_free_buffer(b); 55 b = cucul_load_file("data/alien.ans"); 56 alien = cucul_import_canvas(b, ""); 57 cucul_free_buffer(b); 50 ship = caca_create_canvas(0, 0); 51 caca_import_file(ship, "data/ship.ans", ""); 52 alien = caca_create_canvas(0, 0); 53 caca_import_file(alien, "data/alien.ans", ""); 58 54 59 55 /* Go ! */ … … 62 58 /* Clean up */ 63 59 caca_free_display(dp); 64 c ucul_free_canvas(cv);60 caca_free_canvas(cv); 65 61 66 62 return 0; … … 79 75 return; 80 76 81 ground[80] += c ucul_rand(-1, 2);77 ground[80] += caca_rand(-1, 2); 82 78 if(ground[80] < 2) 83 79 ground[80] = 3; … … 102 98 { 103 99 /* Draw the sky */ 104 c ucul_set_color_ansi(cv, CUCUL_LIGHTBLUE, CUCUL_LIGHTCYAN);100 caca_set_color_ansi(cv, CACA_LIGHTBLUE, CACA_LIGHTCYAN); 105 101 for(j = h - 24; j < h - 18 + ((40 - i) * (40 - i) / (40 * 40 / 10)) + (i & 1); j++) 106 c ucul_putchar(cv, i, j, ' ');107 c ucul_putchar(cv, i, j++, 0x2591);108 c ucul_putchar(cv, i, j++, 0x2591);109 c ucul_putchar(cv, i, j++, 0x2591);110 c ucul_putchar(cv, i, j++, 0x2592);111 c ucul_putchar(cv, i, j++, 0x2592);112 c ucul_putchar(cv, i, j++, 0x2592);113 c ucul_putchar(cv, i, j++, 0x2593);114 c ucul_putchar(cv, i, j++, 0x2593);115 c ucul_putchar(cv, i, j++, 0x2593);116 c ucul_set_color_ansi(cv, CUCUL_LIGHTBLUE, CUCUL_LIGHTBLUE);102 caca_put_char(cv, i, j, ' '); 103 caca_put_char(cv, i, j++, 0x2591); 104 caca_put_char(cv, i, j++, 0x2591); 105 caca_put_char(cv, i, j++, 0x2591); 106 caca_put_char(cv, i, j++, 0x2592); 107 caca_put_char(cv, i, j++, 0x2592); 108 caca_put_char(cv, i, j++, 0x2592); 109 caca_put_char(cv, i, j++, 0x2593); 110 caca_put_char(cv, i, j++, 0x2593); 111 caca_put_char(cv, i, j++, 0x2593); 112 caca_set_color_ansi(cv, CACA_LIGHTBLUE, CACA_LIGHTBLUE); 117 113 for( ; j < h; j++) 118 c ucul_putchar(cv, i, j, ' ');114 caca_put_char(cv, i, j, ' '); 119 115 120 116 /* TODO: Draw the mountains */ … … 122 118 /* Draw the ground */ 123 119 j = h - ground[i]; 124 c ucul_set_color_ansi(cv, CUCUL_BLACK, CUCUL_LIGHTBLUE);125 if(i >= 4 && ground[i] == ground[i - 6]120 caca_set_color_ansi(cv, CACA_BLACK, CACA_LIGHTBLUE); 121 /* if(i >= 4 && ground[i] == ground[i - 6] 126 122 && ground[i] != ground[i - 7]) 127 123 { 128 c ucul_putstr(cv, i - 3, j - 2, "Omm");129 c ucul_putstr(cv, i - 6, j - 1, "(/)-(/)");130 } 131 c ucul_set_color_ansi(cv, CUCUL_RED, CUCUL_GREEN);124 caca_putstr(cv, i - 3, j - 2, "Omm"); 125 caca_putstr(cv, i - 6, j - 1, "(/)-(/)"); 126 }*/ 127 caca_set_color_ansi(cv, CACA_RED, CACA_GREEN); 132 128 if(ground[i + 1] > ground[i]) 133 c ucul_putchar(cv, i, j++, 0x2588); // UTF-8: 0x259f129 caca_put_char(cv, i, j++, 0x2588); // UTF-8: 0x259f 134 130 else if(ground[i + 1] < ground[i]) 135 131 { 136 132 j++; 137 c ucul_putchar(cv, i, j++, 0x2588); // UTF-8: 0x2599133 caca_put_char(cv, i, j++, 0x2588); // UTF-8: 0x2599 138 134 } 139 135 else 140 c ucul_putchar(cv, i, j++, 0x2584);141 c ucul_set_color_ansi(cv, CUCUL_RED, CUCUL_BROWN);142 c ucul_putchar(cv, i, j++, 0x2593);143 c ucul_putchar(cv, i, j++, 0x2592);144 c ucul_putchar(cv, i, j++, 0x2591);136 caca_put_char(cv, i, j++, 0x2584); 137 caca_set_color_ansi(cv, CACA_RED, CACA_BROWN); 138 caca_put_char(cv, i, j++, 0x2593); 139 caca_put_char(cv, i, j++, 0x2592); 140 caca_put_char(cv, i, j++, 0x2591); 145 141 for( ; j < h; j++) 146 c ucul_putchar(cv, i, j, ' ');142 caca_put_char(cv, i, j, ' '); 147 143 } 148 144 } … … 150 146 static void display_stuff(void) 151 147 { 152 c ucul_blit(cv, shipx, shipy, ship, NULL);153 c ucul_blit(cv, 68, h - 22, alien, NULL);154 c ucul_blit(cv, 52, h - 16, alien, NULL);155 c ucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE);156 c ucul_printf(cv, 2, h - 2, " %i fps ", 1000000 / (1 + caca_get_display_time(dp)));148 caca_blit(cv, shipx, shipy, ship, NULL); 149 caca_blit(cv, 68, h - 22, alien, NULL); 150 caca_blit(cv, 52, h - 16, alien, NULL); 151 caca_set_color_ansi(cv, CACA_WHITE, CACA_BLUE); 152 caca_printf(cv, 2, h - 2, " %i fps ", 1000000 / (1 + caca_get_display_time(dp))); 157 153 } 158 154 -
ttyvaders/trunk/src/tunnel.c
r1460 r2990 70 70 char c; 71 71 72 c ucul_set_color(g->cv, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK);72 caca_set_color(g->cv, CACA_COLOR_RED, CACA_COLOR_BLACK); 73 73 74 74 /* Left border */ … … 83 83 c = (i == 0 || t->left[i] > t->left[i-1]) ? '\\' : '<'; 84 84 85 c ucul_putchar(g->cv, t->left[i] + 1, i, c);85 caca_putchar(g->cv, t->left[i] + 1, i, c); 86 86 87 87 if(i + 1 < g->h) 88 88 for(j = 1; j < t->left[i+1] - t->left[i]; j++) 89 c ucul_putchar(g->cv, t->left[i] + j + 1, i, '_');89 caca_putchar(g->cv, t->left[i] + j + 1, i, '_'); 90 90 } 91 91 … … 103 103 if(i + 1 < g->h) 104 104 for(j = 1; j < t->right[i] - t->right[i+1]; j++) 105 c ucul_putchar(g->cv, t->right[i+1] + j - 1, i, '_');105 caca_putchar(g->cv, t->right[i+1] + j - 1, i, '_'); 106 106 107 c ucul_putchar(g->cv, t->right[i] - 1, i, c);107 caca_putchar(g->cv, t->right[i] - 1, i, c); 108 108 } 109 109 110 c ucul_set_color(g->cv, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_RED);110 caca_set_color(g->cv, CACA_COLOR_LIGHTRED, CACA_COLOR_RED); 111 111 112 112 /* Left concrete */ 113 113 for(i = 0; i < g->h ; i++) 114 114 for(j = 0 ; j <= t->left[i]; j++) 115 c ucul_putchar(g->cv, j, i, '#');115 caca_putchar(g->cv, j, i, '#'); 116 116 117 117 /* Right concrete */ 118 118 for(i = 0; i < g->h ; i++) 119 119 for(j = t->right[i] ; j < g->w ; j++) 120 c ucul_putchar(g->cv, j, i, '#');120 caca_putchar(g->cv, j, i, '#'); 121 121 } 122 122 … … 134 134 135 135 /* Generate new values */ 136 i = delta[c ucul_rand(0,5)];137 j = delta[c ucul_rand(0,5)];136 i = delta[caca_rand(0,5)]; 137 j = delta[caca_rand(0,5)]; 138 138 139 139 /* Check in which direction we need to alter tunnel */ -
ttyvaders/trunk/src/weapons.c
r1460 r2990 25 25 static void draw_fragbomb(game *g, int x, int y, int frame); 26 26 27 c ucul_canvas_t *bomb_sprite;28 c ucul_canvas_t *fragbomb_sprite;27 caca_canvas_t *bomb_sprite; 28 caca_canvas_t *fragbomb_sprite; 29 29 30 30 void init_weapons(game *g, weapons *wp) 31 31 { 32 c ucul_buffer_t *b;32 caca_buffer_t *b; 33 33 int i; 34 34 … … 38 38 } 39 39 40 b = c ucul_load_file("data/wpnbomb.caca");41 bomb_sprite = c ucul_import_canvas(b, "");42 c ucul_free_buffer(b);43 44 b = c ucul_load_file("data/wpnfrag.caca");45 bomb_sprite = c ucul_import_canvas(b, "");46 c ucul_free_buffer(b);40 b = caca_load_file("data/wpnbomb.caca"); 41 bomb_sprite = caca_import_canvas(b, ""); 42 caca_free_buffer(b); 43 44 b = caca_load_file("data/wpnfrag.caca"); 45 bomb_sprite = caca_import_canvas(b, ""); 46 caca_free_buffer(b); 47 47 } 48 48 … … 56 56 { 57 57 case WEAPON_LASER: 58 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);59 c ucul_putchar(g->cv, wp->x[i] >> 4, wp->y[i] >> 4, '|');60 c ucul_set_color(g->cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);61 c ucul_putchar(g->cv, wp->x[i] >> 4, (wp->y[i] >> 4) + 1, '|');58 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 59 caca_putchar(g->cv, wp->x[i] >> 4, wp->y[i] >> 4, '|'); 60 caca_set_color(g->cv, CACA_COLOR_CYAN, CACA_COLOR_BLACK); 61 caca_putchar(g->cv, wp->x[i] >> 4, (wp->y[i] >> 4) + 1, '|'); 62 62 break; 63 63 case WEAPON_SEEKER: 64 c ucul_set_color(g->cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);65 c ucul_putchar(g->cv, wp->x3[i] >> 4, wp->y3[i] >> 4, '.');66 c ucul_putchar(g->cv, wp->x2[i] >> 4, wp->y2[i] >> 4, 'o');67 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);68 c ucul_putchar(g->cv, wp->x[i] >> 4, wp->y[i] >> 4, '@');64 caca_set_color(g->cv, CACA_COLOR_CYAN, CACA_COLOR_BLACK); 65 caca_putchar(g->cv, wp->x3[i] >> 4, wp->y3[i] >> 4, '.'); 66 caca_putchar(g->cv, wp->x2[i] >> 4, wp->y2[i] >> 4, 'o'); 67 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 68 caca_putchar(g->cv, wp->x[i] >> 4, wp->y[i] >> 4, '@'); 69 69 break; 70 70 case WEAPON_BOMB: 71 c ucul_set_color(g->cv, CUCUL_COLOR_DARKGRAY, CUCUL_COLOR_BLACK);72 c ucul_putchar(g->cv, (wp->x[i] - wp->vx[i]) >> 4, (wp->y[i] - wp->vy[i]) >> 4, '.');73 c ucul_putchar(g->cv, (wp->x3[i] - wp->vx[i]) >> 4, (wp->y3[i] - wp->vy[i]) >> 4, '.');74 c ucul_putchar(g->cv, (wp->x2[i] - wp->vx[i]) >> 4, (wp->y2[i] - wp->vy[i]) >> 4, '.');75 c ucul_putchar(g->cv, wp->x3[i] >> 4, wp->y3[i] >> 4, '.');76 c ucul_putchar(g->cv, wp->x2[i] >> 4, wp->y2[i] >> 4, '.');71 caca_set_color(g->cv, CACA_COLOR_DARKGRAY, CACA_COLOR_BLACK); 72 caca_putchar(g->cv, (wp->x[i] - wp->vx[i]) >> 4, (wp->y[i] - wp->vy[i]) >> 4, '.'); 73 caca_putchar(g->cv, (wp->x3[i] - wp->vx[i]) >> 4, (wp->y3[i] - wp->vy[i]) >> 4, '.'); 74 caca_putchar(g->cv, (wp->x2[i] - wp->vx[i]) >> 4, (wp->y2[i] - wp->vy[i]) >> 4, '.'); 75 caca_putchar(g->cv, wp->x3[i] >> 4, wp->y3[i] >> 4, '.'); 76 caca_putchar(g->cv, wp->x2[i] >> 4, wp->y2[i] >> 4, '.'); 77 77 draw_bomb(g, wp->x[i] >> 4, wp->y[i] >> 4, wp->vx[i], wp->vy[i]); 78 78 break; … … 334 334 } 335 335 336 c ucul_set_canvas_frame(bomb_sprite, frame);337 c ucul_blit(g->cv, x, y, bomb_sprite, NULL);336 caca_set_canvas_frame(bomb_sprite, frame); 337 caca_blit(g->cv, x, y, bomb_sprite, NULL); 338 338 } 339 339 … … 341 341 { 342 342 /* Draw the head */ 343 c ucul_set_canvas_frame(fragbomb_sprite, frame & 1);344 c ucul_blit(g->cv, x, y, fragbomb_sprite, NULL);343 caca_set_canvas_frame(fragbomb_sprite, frame & 1); 344 caca_blit(g->cv, x, y, fragbomb_sprite, NULL); 345 345 346 346 /* Draw the tail */ 347 c ucul_set_canvas_frame(fragbomb_sprite, 2 + (frame % 4));348 c ucul_blit(g->cv, x, y, fragbomb_sprite, NULL);347 caca_set_canvas_frame(fragbomb_sprite, 2 + (frame % 4)); 348 caca_blit(g->cv, x, y, fragbomb_sprite, NULL); 349 349 } 350 350 … … 357 357 { 358 358 case 24: 359 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);360 c ucul_putstr(g->cv, x, y-3, "__");361 c ucul_putchar(g->cv, x-1, y-2, '\'');362 c ucul_putchar(g->cv, x+2, y-2, '`');359 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 360 caca_putstr(g->cv, x, y-3, "__"); 361 caca_putchar(g->cv, x-1, y-2, '\''); 362 caca_putchar(g->cv, x+2, y-2, '`'); 363 363 break; 364 364 case 23: 365 c ucul_set_color(g->cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);366 c ucul_putstr(g->cv, x, y-3, "__");367 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);368 c ucul_putstr(g->cv, x-2, y-2, "-'");369 c ucul_putstr(g->cv, x+2, y-2, "`-");365 caca_set_color(g->cv, CACA_COLOR_CYAN, CACA_COLOR_BLACK); 366 caca_putstr(g->cv, x, y-3, "__"); 367 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 368 caca_putstr(g->cv, x-2, y-2, "-'"); 369 caca_putstr(g->cv, x+2, y-2, "`-"); 370 370 break; 371 371 case 22: 372 c ucul_set_color(g->cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);373 c ucul_putstr(g->cv, x, y-3, "__");374 c ucul_putchar(g->cv, x-1, y-2, '\'');375 c ucul_putchar(g->cv, x+2, y-2, '`');376 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);377 c ucul_putstr(g->cv, x-3, y-2, ",-");378 c ucul_putstr(g->cv, x+3, y-2, "-.");372 caca_set_color(g->cv, CACA_COLOR_CYAN, CACA_COLOR_BLACK); 373 caca_putstr(g->cv, x, y-3, "__"); 374 caca_putchar(g->cv, x-1, y-2, '\''); 375 caca_putchar(g->cv, x+2, y-2, '`'); 376 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 377 caca_putstr(g->cv, x-3, y-2, ",-"); 378 caca_putstr(g->cv, x+3, y-2, "-."); 379 379 break; 380 380 case 21: 381 c ucul_set_color(g->cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);382 c ucul_putstr(g->cv, x-1, y-3, "____");383 c ucul_putchar(g->cv, x-2, y-2, '\'');384 c ucul_putchar(g->cv, x+3, y-2, '`');385 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);386 c ucul_putstr(g->cv, x-4, y-2, ",-");387 c ucul_putstr(g->cv, x+4, y-2, "-.");381 caca_set_color(g->cv, CACA_COLOR_CYAN, CACA_COLOR_BLACK); 382 caca_putstr(g->cv, x-1, y-3, "____"); 383 caca_putchar(g->cv, x-2, y-2, '\''); 384 caca_putchar(g->cv, x+3, y-2, '`'); 385 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 386 caca_putstr(g->cv, x-4, y-2, ",-"); 387 caca_putstr(g->cv, x+4, y-2, "-."); 388 388 break; 389 389 case 20: 390 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);391 c ucul_putstr(g->cv, x, y-3, "%%");392 c ucul_putchar(g->cv, x-4, y-2, ',');393 c ucul_putchar(g->cv, x+5, y-2, '.');394 c ucul_set_color(g->cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);395 c ucul_putchar(g->cv, x-1, y-3, ':');396 c ucul_putchar(g->cv, x+2, y-3, ':');397 c ucul_putstr(g->cv, x-3, y-2, "-'");398 c ucul_putstr(g->cv, x+3, y-2, "`-");390 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 391 caca_putstr(g->cv, x, y-3, "%%"); 392 caca_putchar(g->cv, x-4, y-2, ','); 393 caca_putchar(g->cv, x+5, y-2, '.'); 394 caca_set_color(g->cv, CACA_COLOR_CYAN, CACA_COLOR_BLACK); 395 caca_putchar(g->cv, x-1, y-3, ':'); 396 caca_putchar(g->cv, x+2, y-3, ':'); 397 caca_putstr(g->cv, x-3, y-2, "-'"); 398 caca_putstr(g->cv, x+3, y-2, "`-"); 399 399 break; 400 400 case 19: 401 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);402 c ucul_putstr(g->cv, x, y-4, "%%");403 c ucul_putstr(g->cv, x, y-3, "##");404 c ucul_set_color(g->cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);405 c ucul_putchar(g->cv, x-1, y-4, ':');406 c ucul_putchar(g->cv, x+2, y-4, ':');407 c ucul_putchar(g->cv, x-1, y-3, '%');408 c ucul_putchar(g->cv, x+2, y-3, '%');409 c ucul_putstr(g->cv, x-4, y-2, ",-'");410 c ucul_putstr(g->cv, x+3, y-2, "`-.");411 c ucul_set_color(g->cv, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK);412 c ucul_putchar(g->cv, x-2, y-3, ':');413 c ucul_putchar(g->cv, x+3, y-3, ':');401 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 402 caca_putstr(g->cv, x, y-4, "%%"); 403 caca_putstr(g->cv, x, y-3, "##"); 404 caca_set_color(g->cv, CACA_COLOR_CYAN, CACA_COLOR_BLACK); 405 caca_putchar(g->cv, x-1, y-4, ':'); 406 caca_putchar(g->cv, x+2, y-4, ':'); 407 caca_putchar(g->cv, x-1, y-3, '%'); 408 caca_putchar(g->cv, x+2, y-3, '%'); 409 caca_putstr(g->cv, x-4, y-2, ",-'"); 410 caca_putstr(g->cv, x+3, y-2, "`-."); 411 caca_set_color(g->cv, CACA_COLOR_BLUE, CACA_COLOR_BLACK); 412 caca_putchar(g->cv, x-2, y-3, ':'); 413 caca_putchar(g->cv, x+3, y-3, ':'); 414 414 break; 415 415 case 18: 416 416 default: 417 417 r = (18 - frame) * (18 - frame); 418 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);419 c ucul_putstr(g->cv, x-1, y-5-r, ":%%:");420 c ucul_putstr(g->cv, x-1, y-4-r, "%##%");421 c ucul_set_color(g->cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);422 c ucul_putchar(g->cv, x-2, y-4-r, ':');423 c ucul_putchar(g->cv, x+3, y-4-r, ':');424 c ucul_putchar(g->cv, x-2, y-2, '\'');425 c ucul_putchar(g->cv, x+3, y-2, '`');426 c ucul_set_color(g->cv, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK);427 c ucul_putchar(g->cv, x-3, y-2, ':');428 c ucul_putchar(g->cv, x+4, y-2, ':');418 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 419 caca_putstr(g->cv, x-1, y-5-r, ":%%:"); 420 caca_putstr(g->cv, x-1, y-4-r, "%##%"); 421 caca_set_color(g->cv, CACA_COLOR_CYAN, CACA_COLOR_BLACK); 422 caca_putchar(g->cv, x-2, y-4-r, ':'); 423 caca_putchar(g->cv, x+3, y-4-r, ':'); 424 caca_putchar(g->cv, x-2, y-2, '\''); 425 caca_putchar(g->cv, x+3, y-2, '`'); 426 caca_set_color(g->cv, CACA_COLOR_BLUE, CACA_COLOR_BLACK); 427 caca_putchar(g->cv, x-3, y-2, ':'); 428 caca_putchar(g->cv, x+4, y-2, ':'); 429 429 for(i = 0; i <= r; i++) 430 430 { 431 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);432 c ucul_putstr(g->cv, x-1, y-3-i, ((i+frame) % 5) ? "####" : "%%%%");433 c ucul_set_color(g->cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);434 c ucul_putchar(g->cv, x-2, y-3-i, '%');435 c ucul_putchar(g->cv, x+3, y-3-i, '%');436 c ucul_set_color(g->cv, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK);437 c ucul_putchar(g->cv, x-3, y-3-i, ':');438 c ucul_putchar(g->cv, x+4, y-3-i, ':');431 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_BLACK); 432 caca_putstr(g->cv, x-1, y-3-i, ((i+frame) % 5) ? "####" : "%%%%"); 433 caca_set_color(g->cv, CACA_COLOR_CYAN, CACA_COLOR_BLACK); 434 caca_putchar(g->cv, x-2, y-3-i, '%'); 435 caca_putchar(g->cv, x+3, y-3-i, '%'); 436 caca_set_color(g->cv, CACA_COLOR_BLUE, CACA_COLOR_BLACK); 437 caca_putchar(g->cv, x-3, y-3-i, ':'); 438 caca_putchar(g->cv, x+4, y-3-i, ':'); 439 439 } 440 440 break; … … 447 447 448 448 /* Lots of duplicate pixels, but we don't care */ 449 c ucul_set_color(g->cv, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK);450 c ucul_draw_ellipse(g->cv, x, y, r, r / 2, ":");451 c ucul_set_color(g->cv, CUCUL_COLOR_LIGHTBLUE, CUCUL_COLOR_BLUE);452 c ucul_draw_ellipse(g->cv, x, y, r + 1, r / 2, "#");453 c ucul_set_color(g->cv, CUCUL_COLOR_BLUE, CUCUL_COLOR_LIGHTBLUE);454 c ucul_draw_ellipse(g->cv, x, y, r + 2, r / 2, "#");455 c ucul_set_color(g->cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_LIGHTBLUE);456 c ucul_draw_ellipse(g->cv, x, y, r + 2, r / 2 + 1, "#");457 c ucul_set_color(g->cv, CUCUL_COLOR_LIGHTBLUE, CUCUL_COLOR_CYAN);458 c ucul_draw_ellipse(g->cv, x, y, r + 3, r / 2 + 1, "#");459 c ucul_set_color(g->cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_CYAN);460 c ucul_draw_ellipse(g->cv, x, y, r + 3, r / 2 + 2, "#");461 c ucul_set_color(g->cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_WHITE);462 c ucul_draw_ellipse(g->cv, x, y, r + 4, r / 2 + 2, "#");463 c ucul_draw_ellipse(g->cv, x, y, r + 4, r / 2 + 3, " ");464 } 465 449 caca_set_color(g->cv, CACA_COLOR_BLUE, CACA_COLOR_BLACK); 450 caca_draw_ellipse(g->cv, x, y, r, r / 2, ":"); 451 caca_set_color(g->cv, CACA_COLOR_LIGHTBLUE, CACA_COLOR_BLUE); 452 caca_draw_ellipse(g->cv, x, y, r + 1, r / 2, "#"); 453 caca_set_color(g->cv, CACA_COLOR_BLUE, CACA_COLOR_LIGHTBLUE); 454 caca_draw_ellipse(g->cv, x, y, r + 2, r / 2, "#"); 455 caca_set_color(g->cv, CACA_COLOR_CYAN, CACA_COLOR_LIGHTBLUE); 456 caca_draw_ellipse(g->cv, x, y, r + 2, r / 2 + 1, "#"); 457 caca_set_color(g->cv, CACA_COLOR_LIGHTBLUE, CACA_COLOR_CYAN); 458 caca_draw_ellipse(g->cv, x, y, r + 3, r / 2 + 1, "#"); 459 caca_set_color(g->cv, CACA_COLOR_WHITE, CACA_COLOR_CYAN); 460 caca_draw_ellipse(g->cv, x, y, r + 3, r / 2 + 2, "#"); 461 caca_set_color(g->cv, CACA_COLOR_CYAN, CACA_COLOR_WHITE); 462 caca_draw_ellipse(g->cv, x, y, r + 4, r / 2 + 2, "#"); 463 caca_draw_ellipse(g->cv, x, y, r + 4, r / 2 + 3, " "); 464 } 465
Note: See TracChangeset
for help on using the changeset viewer.