Ignore:
Timestamp:
Sep 27, 2008, 3:12:46 PM (11 years ago)
Author:
Sam Hocevar
Message:

Starting refactoring to get rid of libcucul. The initial reason for the
split is rendered moot by the plugin system: when enabled, binaries do
not link directly with libX11 or libGL. I hope this is a step towards
more consisteny and clarity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/aafire.c

    r2304 r2821  
    3030#   include <string.h>
    3131#endif
    32 #include "cucul.h"
    3332#include "caca.h"
    3433#else
     
    4140#define MAXTABLE (256*5)
    4241#ifdef LIBCACA
    43 static cucul_canvas_t *cv;
     42static caca_canvas_t *cv;
    4443static caca_display_t *dp;
    4544static int XSIZ, YSIZ;
    46 static cucul_dither_t *cucul_dither;
     45static caca_dither_t *caca_dither;
    4746static char *bitmap;
    4847static int paused = 0;
     
    102101
    103102#ifdef LIBCACA
    104   cv = cucul_create_canvas(80, 32);
     103  cv = caca_create_canvas(80, 32);
    105104  if (!cv)
    106105    {
    107       printf ("Failed to initialize libcucul\n");
     106      printf ("Failed to initialize libcaca\n");
    108107      exit (1);
    109108    }
     
    115114    }
    116115  caca_set_display_time(dp, 10000);
    117   XSIZ = cucul_get_canvas_width(cv) * 2;
    118   YSIZ = cucul_get_canvas_height(cv) * 2 - 4;
     116  XSIZ = caca_get_canvas_width(cv) * 2;
     117  YSIZ = caca_get_canvas_height(cv) * 2 - 4;
    119118#else
    120119  context = aa_autoinit (&aa_defparams);
     
    142141
    143142#ifdef LIBCACA
    144   cucul_dither = cucul_create_dither(8, XSIZ, YSIZ - 2, XSIZ, 0, 0, 0, 0);
    145   cucul_set_dither_palette(cucul_dither, r, g, b, a);
    146   bitmap = malloc(4 * cucul_get_canvas_width(cv)
    147                     * cucul_get_canvas_height(cv));
    148   memset(bitmap, 0, 4 * cucul_get_canvas_width(cv)
    149                       * cucul_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));
    150149#else
    151150  aa_hidecursor (context);
     
    157156#ifdef LIBCACA
    158157  caca_free_display(dp);
    159   cucul_free_canvas(cv);
     158  caca_free_canvas(cv);
    160159#else
    161160  aa_close (context);
     
    239238#ifdef LIBCACA
    240239_paused:
    241   cucul_dither_bitmap(cv, 0, 0, cucul_get_canvas_width(cv),
    242                       cucul_get_canvas_height(cv), cucul_dither, bitmap);
    243   cucul_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);
    244243  if (sloop < 100)
    245     cucul_put_str(cv, cucul_get_canvas_width(cv) - 30,
    246                   cucul_get_canvas_height(cv) - 2,
     244    caca_put_str(cv, caca_get_canvas_width(cv) - 30,
     245                  caca_get_canvas_height(cv) - 2,
    247246                  " -=[ Powered by libcaca ]=- ");
    248247 
Note: See TracChangeset for help on using the changeset viewer.