1do_arc(3) Allegro manual do_arc(3)
2
3
4
6 do_arc - Calculates all the points in a circular arc. Allegro game pro‐
7 gramming library.
8
10 #include <allegro.h>
11
12
13 void do_arc(BITMAP *bmp, int x, int y, fixed a1, fixed a2, int r, int
14 d, void (*proc)(BITMAP *bmp, int x, int y, int d));
15
17 Calculates all the points in a circular arc around point (x, y) with
18 radius r, calling the supplied function for each one. This will be
19 passed a copy of the bmp parameter, the x and y position, and a copy of
20 the d parameter, so it is suitable for use with putpixel(). The arc
21 will be plotted in an anticlockwise direction starting from the angle
22 a1 and ending when it reaches a2. These values are specified in 16.16
23 fixed point format, with 256 equal to a full circle, 64 a right angle,
24 etc. Zero is to the right of the centre point, and larger values
25 rotate anticlockwise from there. Example:
26
27 void draw_explosion_ring(BITMAP *bmp, int x, int y, int d)
28 {
29 ...
30 }
31 do_arc(screen, SCREEN_W/2, SCREEN_H/2,
32 itofix(-21), itofix(43), 50, flame_color,
33 draw_explosion_ring);
34
35
37 do_circle(3), do_ellipse(3), do_line(3), arc(3)
38
39
40
41Allegro version 4.4.2 do_arc(3)