1 /**
2  ** BCC2GRX  -  Interfacing Borland based graphics programs to LIBGRX
3  ** Copyright (C) 1993-97 by Hartmut Schirmer
4  **
5  **
6  ** Contact :                Hartmut Schirmer
7  **                          Feldstrasse 118
8  **                  D-24105 Kiel
9  **                          Germany
10  **
11  ** e-mail : hsc@techfak.uni-kiel.de
12  **
13  ** This file is part of the GRX graphics library.
14  **
15  ** The GRX graphics library is free software; you can redistribute it
16  ** and/or modify it under some conditions; see the "copying.grx" file
17  ** for details.
18  **
19  ** This library is distributed in the hope that it will be useful,
20  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
21  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22  **
23  **/
24 
25 #include "bccgrx00.h"
26 
27 static struct arccoordstype  ac;
28 
29 #ifdef GRX_VERSION
30 #define GrGetLastArcCoords GrLastArcCoords
31 #endif
32 
33 /* ----------------------------------------------------------------- */
__gr_ellipse(int x,int y,int st,int en,int xradius,int yradius)34 void __gr_ellipse(int x, int y, int st, int en,
35 				int xradius, int yradius  )
36 {
37   _DO_INIT_CHECK;
38   st *= 10;
39   en *= 10;
40   GrEllipseArc(x+VL,y+VT+PY,XR(xradius),YR(yradius),st,en,
41 	       #ifdef GRX_VERSION
42 	       (en-st!=0&&(en-st)%3600==0) ? GR_ARC_STYLE_CLOSE1 : GR_ARC_STYLE_OPEN,
43 	       #endif
44 	       COL);
45   {
46 #if defined(GR_DRV_VER_GRD) || defined(GRX_VERSION)
47     /* GRX 1.03 or newer */
48     int xs, ys, xc, yc, xe, ye;
49     GrGetLastArcCoords(&xs,&ys,&xe,&ye,&xc,&yc);
50 #else
51     /* GRX 1.02+ */
52 # define xs _grx_arc_xs
53 # define ys _grx_arc_ys
54 # define xc _grx_arc_xc
55 # define yc _grx_arc_yc
56 # define xe _grx_arc_xe
57 # define ye _grx_arc_ye
58 #endif
59     ac.x      = xc - VL;
60     ac.y      = yc - VT - PY;
61     ac.xstart = xs - VL;
62     ac.ystart = ys - VT - PY;
63     ac.xend   = xe - VL;
64     ac.yend   = ye - VT - PY;
65   }
66 }
67 
68 /* ----------------------------------------------------------------- */
getarccoords(struct arccoordstype * arccoords)69 void getarccoords(struct arccoordstype  *arccoords)
70 {
71   _DO_INIT_CHECK;
72   memcpy( arccoords, &ac, sizeof(ac));
73 }
74