Changeset 524 for libcaca/trunk/examples/aafire.c
- Timestamp:
- Mar 5, 2006, 7:43:13 PM (17 years ago)
- Location:
- libcaca/trunk/examples
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/examples
- Property svn:ignore
-
old new 3 3 .libs 4 4 .deps 5 cacademo6 cacademo.exe7 5 caca-spritedit 8 6 caca-spritedit.exe
-
- Property svn:ignore
-
libcaca/trunk/examples/aafire.c
r514 r524 38 38 #define MAXTABLE (256*5) 39 39 #ifdef LIBCACA 40 static cucul_t *qq; 41 static caca_t *kk; 40 42 static int XSIZ, YSIZ; 41 static struct c aca_bitmap *caca_bitmap;43 static struct cucul_bitmap *cucul_bitmap; 42 44 static char *bitmap; 43 45 static int pause = 0; … … 97 99 98 100 #ifdef LIBCACA 99 if (caca_init()) 101 qq = cucul_init(); 102 if (!qq) 103 { 104 printf ("Failed to initialize libcucul\n"); 105 exit (1); 106 } 107 kk = caca_attach(qq); 108 if (!kk) 100 109 { 101 110 printf ("Failed to initialize libcaca\n"); 102 111 exit (1); 103 112 } 104 caca_set_delay( 10000);105 XSIZ = c aca_get_width() * 2;106 YSIZ = c aca_get_height() * 2 - 4;113 caca_set_delay(kk, 10000); 114 XSIZ = cucul_get_width(qq) * 2; 115 YSIZ = cucul_get_height(qq) * 2 - 4; 107 116 #else 108 117 context = aa_autoinit (&aa_defparams); … … 130 139 131 140 #ifdef LIBCACA 132 c aca_bitmap = caca_create_bitmap(8, XSIZ, YSIZ - 2, XSIZ, 0, 0, 0, 0);133 c aca_set_bitmap_palette(caca_bitmap, r, g, b, a);134 bitmap = malloc(4 * c aca_get_width() * caca_get_height() * sizeof(char));135 memset(bitmap, 0, 4 * c aca_get_width() * caca_get_height());141 cucul_bitmap = cucul_create_bitmap(qq, 8, XSIZ, YSIZ - 2, XSIZ, 0, 0, 0, 0); 142 cucul_set_bitmap_palette(qq, cucul_bitmap, r, g, b, a); 143 bitmap = malloc(4 * cucul_get_width(qq) * cucul_get_height(qq) * sizeof(char)); 144 memset(bitmap, 0, 4 * cucul_get_width(qq) * cucul_get_height(qq)); 136 145 #else 137 146 aa_hidecursor (context); … … 142 151 { 143 152 #ifdef LIBCACA 144 caca_end(); 153 caca_detach(kk); 154 cucul_end(qq); 145 155 #else 146 156 aa_close (context); … … 224 234 #ifdef LIBCACA 225 235 paused: 226 caca_draw_bitmap(0, 0, caca_get_width() - 1, caca_get_height() - 1, 227 caca_bitmap, bitmap); 228 caca_refresh(); 236 cucul_draw_bitmap(qq, 0, 0, 237 cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, 238 cucul_bitmap, bitmap); 239 caca_refresh(kk); 229 240 /*XSIZ = caca_get_width() * 2; 230 241 YSIZ = caca_get_height() * 2 - 4;*/ … … 249 260 { 250 261 #ifdef LIBCACA 251 switch (caca_get_event( CACA_EVENT_KEY_PRESS))262 switch (caca_get_event(kk, CACA_EVENT_KEY_PRESS)) 252 263 { 253 264 case CACA_EVENT_KEY_PRESS | CACA_KEY_ESCAPE: return;
Note: See TracChangeset
for help on using the changeset viewer.