Changeset 1757 for libcaca/trunk
- Timestamp:
- Feb 23, 2007, 3:34:48 PM (14 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/build-kernel
r1055 r1757 34 34 35 35 # For further development: create floppy images using the kernel 36 #gcc -traditional -c -o bootsect.o /usr/src/linux/arch/i386/boot/bootsect.S37 #ld -Ttext 0x0 -s --oformat binary bootsect.o -o cacademo.img36 gcc -traditional -c -o bootsect.o /usr/src/linux/arch/i386/boot/bootsect.S 37 ld -Ttext 0x0 -s --oformat binary bootsect.o -o cacademo.img 38 38 -
libcaca/trunk/src/cacademo.c
r1462 r1757 53 53 #define TRANSITION_FRAMES 40 54 54 55 #define TRANSITION_COUNT 255 #define TRANSITION_COUNT 3 56 56 #define TRANSITION_CIRCLE 0 57 57 #define TRANSITION_STAR 1 58 58 #define TRANSITION_SQUARE 2 59 59 60 60 /* Common macros for dither-based demos */ … … 211 211 static float star_rot[sizeof(star)/sizeof(*star)]; 212 212 213 214 static float const square[] = 215 { 216 -1, -1, 217 1, -1, 218 1, 1, 219 -1, 1 220 }; 221 static float square_rot[sizeof(square)/sizeof(*square)]; 222 213 223 float mulx = 0.0075f * completed * cucul_get_canvas_width(mask); 214 224 float muly = 0.0075f * completed * cucul_get_canvas_height(mask); … … 220 230 switch(tmode) 221 231 { 232 case TRANSITION_SQUARE: 233 /* Compute rotated coordinates */ 234 for(i = 0; i < (sizeof(square) / sizeof(*square)) / 2; i++) 235 { 236 x = square[i * 2]; 237 y = square[i * 2 + 1]; 238 239 square_rot[i * 2] = x * cos(angle) - y * sin(angle); 240 square_rot[i * 2 + 1] = y * cos(angle) + x * sin(angle); 241 } 242 243 mulx *= 1.8; 244 muly *= 1.8; 245 cucul_fill_triangle(mask, 246 square_rot[0*2] * mulx + w2, square_rot[0*2+1] * muly + h2, \ 247 square_rot[1*2] * mulx + w2, square_rot[1*2+1] * muly + h2, \ 248 square_rot[2*2] * mulx + w2, square_rot[2*2+1] * muly + h2, '#'); 249 cucul_fill_triangle(mask, 250 square_rot[0*2] * mulx + w2, square_rot[0*2+1] * muly + h2, \ 251 square_rot[2*2] * mulx + w2, square_rot[2*2+1] * muly + h2, \ 252 square_rot[3*2] * mulx + w2, square_rot[3*2+1] * muly + h2, '#'); 253 break; 254 255 222 256 case TRANSITION_STAR: 223 257 /* Compute rotated coordinates */ … … 553 587 draw_line(dx / 3, dy / 3, (i / DISCTHICKNESS) % 2); 554 588 draw_line(dy / 3, dx / 3, (i / DISCTHICKNESS) % 2); 555 589 556 590 t += t > 0 ? dx - dy-- : dx; 557 591 }
Note: See TracChangeset
for help on using the changeset viewer.