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 copied

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/conic.c

    r2819 r2821  
    11/*
    2  *  libcucul      Canvas for ultrafast compositing of Unicode letters
     2 *  libcaca       Colour ASCII-Art library
    33 *  Copyright (c) 2002-2006 Sam Hocevar <sam@zoy.org>
    44 *                All Rights Reserved
     
    2424#endif
    2525
    26 #include "cucul.h"
    27 #include "cucul_internals.h"
    28 
    29 static void ellipsepoints(cucul_canvas_t *, int, int, int, int, uint32_t, int);
     26#include "caca.h"
     27#include "caca_internals.h"
     28
     29static void ellipsepoints(caca_canvas_t *, int, int, int, int, uint32_t, int);
    3030
    3131/** \brief Draw a circle on the canvas using the given character.
     
    3333 *  This function never fails.
    3434 *
    35  *  \param cv The handle to the libcucul canvas.
     35 *  \param cv The handle to the libcaca canvas.
    3636 *  \param x Center X coordinate.
    3737 *  \param y Center Y coordinate.
     
    4040 *  \return This function always returns 0.
    4141 */
    42 int cucul_draw_circle(cucul_canvas_t *cv, int x, int y, int r, uint32_t ch)
     42int caca_draw_circle(caca_canvas_t *cv, int x, int y, int r, uint32_t ch)
    4343{
    4444    int test, dx, dy;
     
    6060 *  This function never fails.
    6161 *
    62  *  \param cv The handle to the libcucul canvas.
     62 *  \param cv The handle to the libcaca canvas.
    6363 *  \param xo Center X coordinate.
    6464 *  \param yo Center Y coordinate.
     
    6868 *  \return This function always returns 0.
    6969 */
    70 int cucul_fill_ellipse(cucul_canvas_t *cv, int xo, int yo, int a, int b,
     70int caca_fill_ellipse(caca_canvas_t *cv, int xo, int yo, int a, int b,
    7171                       uint32_t ch)
    7272{
     
    8585        {
    8686            d1 += b*b*(2*x*1) + a*a*(-2*y+2);
    87             cucul_draw_line(cv, xo - x, yo - y, xo + x, yo - y, ch);
    88             cucul_draw_line(cv, xo - x, yo + y, xo + x, yo + y, ch);
     87            caca_draw_line(cv, xo - x, yo - y, xo + x, yo - y, ch);
     88            caca_draw_line(cv, xo - x, yo + y, xo + x, yo + y, ch);
    8989            y--;
    9090        }
     
    9292    }
    9393
    94     cucul_draw_line(cv, xo - x, yo - y, xo + x, yo - y, ch);
    95     cucul_draw_line(cv, xo - x, yo + y, xo + x, yo + y, ch);
     94    caca_draw_line(cv, xo - x, yo - y, xo + x, yo - y, ch);
     95    caca_draw_line(cv, xo - x, yo + y, xo + x, yo + y, ch);
    9696
    9797    d2 = b*b*(x+0.5)*(x+0.5) + a*a*(y-1)*(y-1) - a*a*b*b;
     
    109109
    110110        y--;
    111         cucul_draw_line(cv, xo - x, yo - y, xo + x, yo - y, ch);
    112         cucul_draw_line(cv, xo - x, yo + y, xo + x, yo + y, ch);
     111        caca_draw_line(cv, xo - x, yo - y, xo + x, yo - y, ch);
     112        caca_draw_line(cv, xo - x, yo + y, xo + x, yo + y, ch);
    113113    }
    114114
     
    120120 *  This function never fails.
    121121 *
    122  *  \param cv The handle to the libcucul canvas.
     122 *  \param cv The handle to the libcaca canvas.
    123123 *  \param xo Center X coordinate.
    124124 *  \param yo Center Y coordinate.
     
    128128 *  \return This function always returns 0.
    129129 */
    130 int cucul_draw_ellipse(cucul_canvas_t *cv, int xo, int yo, int a, int b,
     130int caca_draw_ellipse(caca_canvas_t *cv, int xo, int yo, int a, int b,
    131131                       uint32_t ch)
    132132{
     
    177177 *  This function never fails.
    178178 *
    179  *  \param cv The handle to the libcucul canvas.
     179 *  \param cv The handle to the libcaca canvas.
    180180 *  \param xo Center X coordinate.
    181181 *  \param yo Center Y coordinate.
     
    184184 *  \return This function always returns 0.
    185185 */
    186 int cucul_draw_thin_ellipse(cucul_canvas_t *cv, int xo, int yo, int a, int b)
     186int caca_draw_thin_ellipse(caca_canvas_t *cv, int xo, int yo, int a, int b)
    187187{
    188188    /* FIXME: this is not correct */
     
    235235}
    236236
    237 static void ellipsepoints(cucul_canvas_t *cv, int xo, int yo, int x, int y,
     237static void ellipsepoints(caca_canvas_t *cv, int xo, int yo, int x, int y,
    238238                          uint32_t ch, int thin)
    239239{
     
    269269
    270270        }
    271         cucul_put_char(cv, xo + x, yo + y, c);
     271        caca_put_char(cv, xo + x, yo + y, c);
    272272    }
    273273    if((b & (0x2|0x4)) == (0x2|0x4)) {
     
    291291
    292292        }
    293         cucul_put_char(cv, xo - x, yo + y, c);
     293        caca_put_char(cv, xo - x, yo + y, c);
    294294    }
    295295
     
    315315
    316316        }
    317         cucul_put_char(cv, xo + x, yo - y, c);
     317        caca_put_char(cv, xo + x, yo - y, c);
    318318    }
    319319
     
    338338
    339339        }
    340         cucul_put_char(cv, xo - x, yo - y, c);
    341     }
    342 
    343        
    344 }
    345 
     340        caca_put_char(cv, xo - x, yo - y, c);
     341    }
     342
     343       
     344}
     345
Note: See TracChangeset for help on using the changeset viewer.