Changeset 185 for libcaca/trunk/libcaca/triangle.c
 Timestamp:
 Nov 16, 2003, 1:33:35 AM (19 years ago)
 Location:
 libcaca/trunk/libcaca
 Files:

 1 edited
 1 moved
Legend:
 Unmodified
 Added
 Removed

libcaca/trunk/libcaca/triangle.c
r159 r185 1 1 /* 2 * lib eeASCIIArt library2 * libcaca ASCIIArt library 3 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 4 * All Rights Reserved … … 25 25 #include <stdlib.h> 26 26 27 #include " ee.h"28 #include " ee_internals.h"27 #include "caca.h" 28 #include "caca_internals.h" 29 29 30 void ee_draw_triangle(int x1, int y1, int x2, int y2, int x3, int y3, char c)30 void caca_draw_triangle(int x1, int y1, int x2, int y2, int x3, int y3, char c) 31 31 { 32 ee_draw_line(x1, y1, x2, y2, c);33 ee_draw_line(x2, y2, x3, y3, c);34 ee_draw_line(x3, y3, x1, y1, c);32 caca_draw_line(x1, y1, x2, y2, c); 33 caca_draw_line(x2, y2, x3, y3, c); 34 caca_draw_line(x3, y3, x1, y1, c); 35 35 } 36 36 37 void ee_draw_thin_triangle(int x1, int y1, int x2, int y2, int x3, int y3)37 void caca_draw_thin_triangle(int x1, int y1, int x2, int y2, int x3, int y3) 38 38 { 39 ee_draw_thin_line(x1, y1, x2, y2);40 ee_draw_thin_line(x2, y2, x3, y3);41 ee_draw_thin_line(x3, y3, x1, y1);39 caca_draw_thin_line(x1, y1, x2, y2); 40 caca_draw_thin_line(x2, y2, x3, y3); 41 caca_draw_thin_line(x3, y3, x1, y1); 42 42 } 43 43 44 void ee_fill_triangle(int x1, int y1, int x2, int y2, int x3, int y3, char c)44 void caca_fill_triangle(int x1, int y1, int x2, int y2, int x3, int y3, char c) 45 45 { 46 46 int x, y, xa, xb, xmax, ymax; … … 49 49 if(y1 > y2) 50 50 { 51 ee_fill_triangle(x2, y2, x1, y1, x3, y3, c);51 caca_fill_triangle(x2, y2, x1, y1, x3, y3, c); 52 52 return; 53 53 } … … 55 55 if(y2 > y3) 56 56 { 57 ee_fill_triangle(x1, y1, x3, y3, x2, y2, c);57 caca_fill_triangle(x1, y1, x3, y3, x2, y2, c); 58 58 return; 59 59 } … … 64 64 x3 *= 4; 65 65 66 xmax = ee_get_width()  1;67 ymax = ee_get_height()  1;66 xmax = caca_get_width()  1; 67 ymax = caca_get_height()  1; 68 68 69 69 /* Rasterize our triangle */ … … 97 97 98 98 for(x = xa; x <= xb; x++) 99 ee_putchar(x, y, c);99 caca_putchar(x, y, c); 100 100 } 101 101 }
Note: See TracChangeset
for help on using the changeset viewer.