This is an old version from the tos.hyp. The new is on GitHub!

HomeAESShell libraryFont selection

8.19 Extended graphics library

This library contains functions to animate moving (expanding or contracting) rectangles. The following routines are available for this purpse:

xgrf_2box Animation of moving rectangles
xgrf_stepcalc Parameter calculation for rectangle animation

Note: These functions should be seen primarily as replacements for the functions graf_growbox and graf_shrinkbox, that in PC-GEM were a casualty of the legal dispute between Apple and Digital Research.

See also: graf_growbox   graf_shrinkbox   Style guidelines

8.19.1 xgrf_2box

Name: »Animate rectangles« - Draw a set of moving rectangles.
Opcode: 131
Syntax: int16_t xgrf_2box ( int16_t cx, int16_t cy, int16_t w, int16_t h, int16_t corners, int16_t cnt, int16_t xstep, int16_t ystep, int16_t doubled );
Description: The call xgrf_2box draws a set of rectangles that move on the screen. The following apply:
Parameter Meaning
   
cx Start position in X-direction
cy Start position in Y-direction
w Width of start position
h Height of start position
corners Draw:
0 = Draw complete rectangles
1 = Draw only the corners
cnt Number of single steps
xstep Step size in X-direction
ystep Step size in Y-direction
doubled Step size
0 = Normal step size
1 = Doubled step size


Note: The function is a replacement for the deleted functions of the FORM and GRAF libraries in PC-GEM (due to the legal dispute between Apple and Digital Research).
Return value: This is unknown at present.
Availability: The function is available only as of PC-GEM 2.0, as of KAOS 1.4.2 and MagiC.
Group: Extended graphics library
See also: Binding   xgrf_stepcalc   MagiC

8.19.2 Bindings for xgrf_2box

C: int16_t xgrf_2box ( int16_t cx, int16_t cy, int16_t w, int16_t h, int16_t corners, int16_t cnt, int16_t xstep, int16_t ystep, int16_t doubled );
Binding:
int16_t xgrf_2box ( int16_t cx, int16_t cy, int16_t w, int16_t h,
                    int16_t corners, int16_t cnt,
                    int16_t xstep, int16_t ystep, int16_t doubled )
{
   int_in[0] = cnt;
   int_in[1] = xstep;
   int_in[2] = ystep;
   int_in[3] = doubled;
   int_in[4] = corners;
   int_in[5] = cx;
   int_in[6] = cy;
   int_in[7] = w;
   int_in[8] = h;

   return ( crys_if(131) );
}
GEM-Arrays:

Address Element Contents
control control[0] 131 # Function opcode
control+2 control[1] 9 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] cnt
int_in+2 int_in[1] xstep
int_in+4 int_in[2] ystep
int_in+6 int_in[3] doubled
int_in+8 int_in[4] corners
int_in+10 int_in[5] cx
int_in+12 int_in[6] cy
int_in+14 int_in[7] w
int_in+16 int_in[8] h
int_out int_out[0] Return value

8.19.3 xgrf_stepcalc

Name: »Stepcalc for XGraf« - Parameter calculation for the animation of rectangles.
Opcode: 130
Syntax: int16_t xgrf_stepcalc ( int16_t orgw, int16_t orgh, int16_t xc, int16_t yc, int16_t w, int16_t h, int16_t *pcx, int16_t *pcy, int16_t *pcnt, int16_t *pxstep, int16_t *pystep );
Description: The call xgrf_stepcalc calculates all parameters for a call of xgrf_2box. The following apply:
Parameter Meaning
   
orgw Starting width
orgh Starting height
xc End position in X-direction
yc End position in Y-direction
w Width of final size
h Height of final size
pcx Centred position at completion of process in X-direction
pcy Ditto for Y-directiong
pcnt Number of single steps
pxstep Step size in X-direction
pystep Step size in Y-direction


Note: The centred position, number of steps as well as step size are calculated from the starting size, final size and the end positions of the rectangle.
Return value: This is unknown at present.
Availability: The function is available only as of PC-GEM 2.0, as of KAOS 1.4.2 and MagiC.
Group: Extended graphics library
See also: Binding   xgrf_2box   MagiC

8.19.4 Bindings for xgrf_stepcalc

C: int16_t xgrf_stepcalc ( int16_t orgw, int16_t orgh, int16_t xc, int16_t yc, int16_t w, int16_t h, int16_t *pcx, int16_t *pcy, int16_t *pcnt, int16_t *pxstep, int16_t *pystep );
Binding:
int16_t xgrf_stepcalc ( int16_t orgw, int16_t orgh, int16_t xc,
                        int16_t yc, int16_t w, int16_t h,
                        int16_t *pcx, int16_t *pcy, int16_t *pcnt,
                        int16_t *pxstep, int16_t *pystep )
{
   int_in[0] = orgw;
   int_in[1] = orgh;
   int_in[2] = xc;
   int_in[3] = yc;
   int_in[4] = w;
   int_in[5] = h;

   crys_if (130);

   *pcx    = int_out[1];
   *pcy    = int_out[2];
   *pcnt   = int_out[3];
   *pxstep = int_out[4];
   *pystep = int_out[5];

   return ( int_out[0] );
}
GEM-Arrays:

Address Element Contents
control control[0] 130 # Function opcode
control+2 control[1] 6 # Entry in int_in
control+4 control[2] 6 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] orgw
int_in+2 int_in[1] orgh
int_in+4 int_in[2] xc
int_in+6 int_in[3] yc
int_in+8 int_in[4] w
int_in+10 int_in[5] h
int_out int_out[0] Return value
int_out+2 int_out[1] pcx
int_out+4 int_out[2] pcy
int_out+6 int_out[3] pcnt
int_out+8 int_out[4] pxstep
int_out+10 int_out[5] pystep

HomeAESShell libraryFont selection