Name: | »Filled polygon«
| ||||||||||||||||||||||||||||||||||||||
Line-A number: | $A006
| ||||||||||||||||||||||||||||||||||||||
Syntax: | See 'Bindings for filled_polygon'
| ||||||||||||||||||||||||||||||||||||||
Description: | This Line-A function draws one line of a filled polygon through
calls of the horizontal line function. For drawing the whole polygon this
function must be called for any possible Y-coordinate. In addition, as
for filled rectangle, there is the option to permit drawing of the polygon only
within a passed clipping rectangle.
All vertices of the polygon are passed in the field ptsin, the number of vertices is contained in the second element of the contrl field. In C this means that contrl[1] will hold the number of vertices, ptsin[0] the X-coordinate of the first vertex, ptsin[1] the Y-coordinate of the first vertex, ptsin[2] the X-coordinate of the second vertex, ... The last vertex in ptsin must be the first one again, so that the polygon is closed! The Y-coordinate of the line to be drawn is passed in the Line-A parameter block in y1. The following Line-A variables are used:
The binding from TC passes the line pattern, the writing mode and colour not to the filled_polygon function, but uses separate functions set_fg_bp, set_wrt_mode, set_pattern and set_clipping for setting the parameters in the Line-A parameter block. | ||||||||||||||||||||||||||||||||||||||
Return value: | The function does not return a result.
| ||||||||||||||||||||||||||||||||||||||
Availability: | All TOS versions.
| ||||||||||||||||||||||||||||||||||||||
See also: | Binding Horizontal line Filled rectangle
|
Pure-C: | void filled_polygon( int16_t *xy, int16_t count );
|
Assembler: | It is assumed that the contrl field has already been entered in
the Line-A parameter block.
; Save registers movem.l D0-D2/A0-A2,-(A7) ; Pointer parameter block LINEA move.l pParamblk,A0 ; contrl to a1 move.w (4,A0),A1 ; No. or vertexes to contrl[1] move.w count,(2,A1) ; Save old value of the ptsin field move.l (12,A0),-(A7) ; Field with coordinates of vertexes in LINEA.ptsin move.l xy,(12,A0) ; Line to be drawn, Y-coordinate in LINEA.y1 move.w y1,(40,A0) ; Bit for first plane in LINEA.fg_bp_1 move.w colbit0,(24,A0) ; Bit for first plane in LINEA.fg_bp_2 move.w colbit1,(26,A0) ; Bit for first plane in LINEA.fg_bp_3 move.w colbit2,(28,A0) ; Bit for first plane in LINEA.fg_bp_4 move.w colbit3,(30,A0) ; Writing mode in LINEA.wrt_mode move.w wmode,(36,A0) ; Line pattern in LINEA.patptr move.w patptr,(46,A0) ; No. of patterns in LINEA.patmsk move.w patmsk,(50,A0) ; Clipmode in LINEA.clip move.w mode,(54,A0) ; Top left clip corner, X-coordinate in LINEA.xmn_clip move.w cx1,(56,A0) ; Top left clip corner, Y-coordinate in LINEA.ymn_clip move.w cy1,(58,A0) ; Bottom right clip corner, X-coordinate in LINEA.xmx_clip move.w cx2,(60,A0) ; Bottom right clip corner, Y-coordinate in LINEA.ymx_clip move.w cy2,(62,A0) ; Line-A opcode dc.w $A006 ; Pointer parameter block LINEA move.l pParamblk,A0 ; Restore old value of the ptsin field move.l (A7)+,(12,A0) ; Restore registers movem.l (A7)+,D0-D2/A0-A2 |