Ignore:
Timestamp:
Nov 11, 2006, 9:11:26 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Switch back to UTF-32 arguments for drawing primitives, now that we properly export cucul_utf8_to_utf32(). Evil API breakage, but no one uses these functions anyway.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/triangle.c

    r1174 r1330  
    3737 *  \param x3 X coordinate of the third point.
    3838 *  \param y3 Y coordinate of the third point.
    39  *  \param str UTF-8 string representing the character that should be used
    40  *         to draw the triangle outline.
     39 *  \param ch UTF-32 character to be used to draw the triangle outline.
    4140 *  \return This function always returns 0.
    4241 */
    4342int cucul_draw_triangle(cucul_canvas_t *cv, int x1, int y1, int x2, int y2,
    44                         int x3, int y3, char const *str)
     43                        int x3, int y3, unsigned long int ch)
    4544{
    46     cucul_draw_line(cv, x1, y1, x2, y2, str);
    47     cucul_draw_line(cv, x2, y2, x3, y3, str);
    48     cucul_draw_line(cv, x3, y3, x1, y1, str);
     45    cucul_draw_line(cv, x1, y1, x2, y2, ch);
     46    cucul_draw_line(cv, x2, y2, x3, y3, ch);
     47    cucul_draw_line(cv, x3, y3, x1, y1, ch);
    4948
    5049    return 0;
     
    8584 *  \param x3 X coordinate of the third point.
    8685 *  \param y3 Y coordinate of the third point.
    87  *  \param str UTF-8 string representing the character that should be used
    88  *         to fill the triangle.
     86 *  \param ch UTF-32 character to be used to fill the triangle.
    8987 *  \return This function always returns 0.
    9088 */
    9189int cucul_fill_triangle(cucul_canvas_t *cv, int x1, int y1, int x2, int y2,
    92                         int x3, int y3, char const *str)
     90                        int x3, int y3, unsigned long int ch)
    9391{
    9492    int x, y, xmin, xmax, ymin, ymax;
    9593    long int xx1, xx2, xa, xb, sl21, sl31, sl32;
    96     uint32_t ch;
    9794
    9895    /* Bubble-sort y1 <= y2 <= y3 */
    9996    if(y1 > y2)
    100         return cucul_fill_triangle(cv, x2, y2, x1, y1, x3, y3, str);
     97        return cucul_fill_triangle(cv, x2, y2, x1, y1, x3, y3, ch);
    10198
    10299    if(y2 > y3)
    103         return cucul_fill_triangle(cv, x1, y1, x3, y3, x2, y2, str);
    104 
    105     ch = cucul_utf8_to_utf32(str, NULL);
     100        return cucul_fill_triangle(cv, x1, y1, x3, y3, x2, y2, ch);
    106101
    107102    /* Compute slopes and promote precision */
Note: See TracChangeset for help on using the changeset viewer.