]>
Commit | Line | Data |
---|---|---|
1 | struct displayfuncs { | |
2 | void (*init) (); | |
3 | }; | |
4 | typedef struct gpsdisplay { | |
5 | struct displayfuncs *funcs; | |
6 | } | |
7 | GPSDisplay; | |
8 | static void PSMyArc(double cx, double cy, double radx, double rady, double sa, double ta) { | |
9 | double ea; | |
10 | double temp; | |
11 | ea = sa + ta; | |
12 | while (sa < ea) { | |
13 | temp = ((int)((sa + 90) / 90)) * 90; | |
14 | PSDoArc(cx, sa, ea < temp ? ea : temp); | |
15 | sa = temp; | |
16 | } | |
17 | } | |
18 | static void PSDrawElipse() { | |
19 | float cx; | |
20 | float cy; | |
21 | float radx; | |
22 | float rady; | |
23 | if (radx != rady) PSMyArc(cx, cy, radx, rady, 0, 360); | |
24 | } | |
25 | static void PSDrawFillCircle() { | |
26 | PSDrawElipse(); | |
27 | } | |
28 | static struct displayfuncs psfuncs[] = { | |
29 | PSDrawFillCircle }; | |
30 | void _GPSDraw_CreateDisplay() { | |
31 | GPSDisplay *gdisp; | |
32 | gdisp->funcs = (void *)&psfuncs; | |
33 | } |