Changeset 1043 for libcaca/trunk/src
- Timestamp:
- Sep 17, 2006, 2:53:48 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/src/cacademo.c
r1042 r1043 61 61 #define YSIZ 256 62 62 63 #define OFFSET_X(i) (i*2)64 #define OFFSET_Y(i) (i*2)+165 66 63 /* Global variables */ 67 64 static int frame = 0; … … 223 220 for(i = 0; i < (sizeof(star) / sizeof(*star)) / 2; i++) 224 221 { 225 x = star[ OFFSET_X(i)];226 y = star[ OFFSET_Y(i)];227 228 star_rot[ OFFSET_X(i)] = x * cos(angle) - y * sin(angle);229 star_rot[ OFFSET_Y(i)] = y * cos(angle) + x * sin(angle);222 x = star[i * 2]; 223 y = star[i * 2 + 1]; 224 225 star_rot[i * 2] = x * cos(angle) - y * sin(angle); 226 star_rot[i * 2 + 1] = y * cos(angle) + x * sin(angle); 230 227 } 231 228 … … 235 232 #define DO_TRI(a, b, c) \ 236 233 cucul_fill_triangle(mask, \ 237 star_rot[ OFFSET_X(a)]*mulx+w2, star_rot[OFFSET_Y(a)]*muly+h2, \238 star_rot[ OFFSET_X(b)]*mulx+w2, star_rot[OFFSET_Y(b)]*muly+h2, \239 star_rot[ OFFSET_X(c)]*mulx+w2, star_rot[OFFSET_Y(c)]*muly+h2, "#")234 star_rot[(a)*2] * mulx + w2, star_rot[(a)*2+1] * muly + h2, \ 235 star_rot[(b)*2] * mulx + w2, star_rot[(b)*2+1] * muly + h2, \ 236 star_rot[(c)*2] * mulx + w2, star_rot[(c)*2+1] * muly + h2, "#") 240 237 DO_TRI(0, 1, 9); 241 238 DO_TRI(1, 2, 3);
Note: See TracChangeset
for help on using the changeset viewer.