Changeset 105
- Timestamp:
- Nov 9, 2003, 10:36:24 PM (17 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/libee/Makefile.am
r97 r105 20 20 ee.h \ 21 21 io.c \ 22 math.c \ 23 line.c \ 22 24 circle.c \ 23 line.c \ 24 math.c \ 25 triangle.c \ 25 26 $(NULL) 26 27 libee_a_CPPFLAGS = $(CPPFLAGS_slang) $(CPPFLAGS_ncurses) -
libcaca/trunk/libee/ee.h
r103 r105 74 74 char ee_get_key(void); 75 75 76 void ee_draw_circle(int, int, int, char);77 76 void ee_draw_line(int, int, int, int, char); 78 77 void ee_draw_thin_line(int, int, int, int); 78 void ee_draw_circle(int, int, int, char); 79 void ee_fill_triangle(int, int, int, int, int, int, char); 79 80 80 81 int ee_rand(int, int); -
libcaca/trunk/test/Makefile.am
r85 r105 21 21 22 22 demo_CPPFLAGS = -I../libee $(CPPFLAGS_slang) $(CPPFLAGS_ncurses) 23 demo_LDADD = ../libee/libee.a $(LDFLAGS_slang) $(LDFLAGS_ncurses) 23 demo_LDADD = ../libee/libee.a $(LDFLAGS_slang) $(LDFLAGS_ncurses) -lm 24 24 -
libcaca/trunk/test/demo.c
r103 r105 21 21 */ 22 22 23 #include "config.h" 24 23 25 #include <math.h> 24 26 #include <string.h> … … 32 34 static void demo_thin_lines(void); 33 35 static void demo_circles(void); 36 static void demo_triangle(void); 34 37 static void demo_radar(void); 35 38 … … 83 86 case '5': 84 87 ee_clear(); 88 demo = demo_triangle; 89 break; 90 case '6': 91 ee_clear(); 85 92 demo = demo_radar; 86 93 break; … … 124 131 ee_putstr("4: circles demo"); 125 132 ee_goto(4, 10); 126 ee_putstr("5: radar demo"); 133 ee_putstr("5: triangle demo"); 134 ee_goto(4, 11); 135 ee_putstr("6: radar demo"); 127 136 128 137 ee_goto(4, yo - 2); … … 217 226 ee_draw_circle(x, y, r, '*'); 218 227 } 228 229 ee_refresh(); 230 } 231 232 static void demo_triangle(void) 233 { 234 static int i = 0; 235 236 int xo, yo, x1, y1, x2, y2, x3, y3; 237 238 i++; 239 240 xo = ee_get_width() * 5 / 8; 241 yo = 2; 242 243 x1 = ee_get_width() / 8 + sin(0.03*i) * 5; 244 y1 = ee_get_height() / 2 + cos(0.03*i) * 5; 245 246 x2 = ee_get_width() - 10 - cos(0.02*i) * 10; 247 y2 = ee_get_height() - 5 + sin(0.02*i) * 5; 248 249 x3 = ee_get_width() / 4 - sin(0.02*i) * 5; 250 y3 = ee_get_height() + cos(0.02*i) * 5; 251 252 ee_clear(); 253 254 ee_color(EE_GREEN); 255 ee_fill_triangle(xo, yo, x2, y2, x1, y1, '%'); 256 ee_color(EE_YELLOW); 257 ee_draw_thin_line(xo, yo, x2, y2); 258 ee_draw_thin_line(x2, y2, x1, y1); 259 ee_draw_thin_line(x1, y1, xo, yo); 260 261 ee_color(EE_RED); 262 ee_fill_triangle(x1, y1, x2, y2, x3, y3, '#'); 263 ee_color(EE_YELLOW); 264 ee_draw_thin_line(x1, y1, x2, y2); 265 ee_draw_thin_line(x2, y2, x3, y3); 266 ee_draw_thin_line(x3, y3, x1, y1); 267 268 ee_color(EE_BLUE); 269 ee_fill_triangle(xo, yo, x2, y2, x3, y3, '%'); 270 ee_color(EE_YELLOW); 271 ee_draw_thin_line(xo, yo, x2, y2); 272 ee_draw_thin_line(x2, y2, x3, y3); 273 ee_draw_thin_line(x3, y3, xo, yo); 219 274 220 275 ee_refresh();
Note: See TracChangeset
for help on using the changeset viewer.