Changeset 2821 for libcaca/trunk/src/aafire.c
- Timestamp:
- Sep 27, 2008, 3:12:46 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/src/aafire.c
r2304 r2821 30 30 # include <string.h> 31 31 #endif 32 #include "cucul.h"33 32 #include "caca.h" 34 33 #else … … 41 40 #define MAXTABLE (256*5) 42 41 #ifdef LIBCACA 43 static c ucul_canvas_t *cv;42 static caca_canvas_t *cv; 44 43 static caca_display_t *dp; 45 44 static int XSIZ, YSIZ; 46 static c ucul_dither_t *cucul_dither;45 static caca_dither_t *caca_dither; 47 46 static char *bitmap; 48 47 static int paused = 0; … … 102 101 103 102 #ifdef LIBCACA 104 cv = c ucul_create_canvas(80, 32);103 cv = caca_create_canvas(80, 32); 105 104 if (!cv) 106 105 { 107 printf ("Failed to initialize libc ucul\n");106 printf ("Failed to initialize libcaca\n"); 108 107 exit (1); 109 108 } … … 115 114 } 116 115 caca_set_display_time(dp, 10000); 117 XSIZ = c ucul_get_canvas_width(cv) * 2;118 YSIZ = c ucul_get_canvas_height(cv) * 2 - 4;116 XSIZ = caca_get_canvas_width(cv) * 2; 117 YSIZ = caca_get_canvas_height(cv) * 2 - 4; 119 118 #else 120 119 context = aa_autoinit (&aa_defparams); … … 142 141 143 142 #ifdef LIBCACA 144 c ucul_dither = cucul_create_dither(8, XSIZ, YSIZ - 2, XSIZ, 0, 0, 0, 0);145 c ucul_set_dither_palette(cucul_dither, r, g, b, a);146 bitmap = malloc(4 * c ucul_get_canvas_width(cv)147 * c ucul_get_canvas_height(cv));148 memset(bitmap, 0, 4 * c ucul_get_canvas_width(cv)149 * c ucul_get_canvas_height(cv));143 caca_dither = caca_create_dither(8, XSIZ, YSIZ - 2, XSIZ, 0, 0, 0, 0); 144 caca_set_dither_palette(caca_dither, r, g, b, a); 145 bitmap = malloc(4 * caca_get_canvas_width(cv) 146 * caca_get_canvas_height(cv)); 147 memset(bitmap, 0, 4 * caca_get_canvas_width(cv) 148 * caca_get_canvas_height(cv)); 150 149 #else 151 150 aa_hidecursor (context); … … 157 156 #ifdef LIBCACA 158 157 caca_free_display(dp); 159 c ucul_free_canvas(cv);158 caca_free_canvas(cv); 160 159 #else 161 160 aa_close (context); … … 239 238 #ifdef LIBCACA 240 239 _paused: 241 c ucul_dither_bitmap(cv, 0, 0, cucul_get_canvas_width(cv),242 c ucul_get_canvas_height(cv), cucul_dither, bitmap);243 c ucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE);240 caca_dither_bitmap(cv, 0, 0, caca_get_canvas_width(cv), 241 caca_get_canvas_height(cv), caca_dither, bitmap); 242 caca_set_color_ansi(cv, CACA_WHITE, CACA_BLUE); 244 243 if (sloop < 100) 245 c ucul_put_str(cv, cucul_get_canvas_width(cv) - 30,246 c ucul_get_canvas_height(cv) - 2,244 caca_put_str(cv, caca_get_canvas_width(cv) - 30, 245 caca_get_canvas_height(cv) - 2, 247 246 " -=[ Powered by libcaca ]=- "); 248 247
Note: See TracChangeset
for help on using the changeset viewer.