Changeset 1330 for libcaca/trunk/cucul/triangle.c
 Timestamp:
 Nov 11, 2006, 9:11:26 AM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

libcaca/trunk/cucul/triangle.c
r1174 r1330 37 37 * \param x3 X coordinate of the third point. 38 38 * \param y3 Y coordinate of the third point. 39 * \param str UTF8 string representing the character that should be used 40 * to draw the triangle outline. 39 * \param ch UTF32 character to be used to draw the triangle outline. 41 40 * \return This function always returns 0. 42 41 */ 43 42 int 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) 45 44 { 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); 49 48 50 49 return 0; … … 85 84 * \param x3 X coordinate of the third point. 86 85 * \param y3 Y coordinate of the third point. 87 * \param str UTF8 string representing the character that should be used 88 * to fill the triangle. 86 * \param ch UTF32 character to be used to fill the triangle. 89 87 * \return This function always returns 0. 90 88 */ 91 89 int 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) 93 91 { 94 92 int x, y, xmin, xmax, ymin, ymax; 95 93 long int xx1, xx2, xa, xb, sl21, sl31, sl32; 96 uint32_t ch;97 94 98 95 /* Bubblesort y1 <= y2 <= y3 */ 99 96 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); 101 98 102 99 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); 106 101 107 102 /* Compute slopes and promote precision */
Note: See TracChangeset
for help on using the changeset viewer.