home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
647.lha
/
TacTix
/
ellipse
next >
Wrap
Text File
|
1991-07-01
|
4KB
|
108 lines
\ ju:ellipse RRY
\ 901026 memf_fast reqmt in GR.AREA.INIT may now work on A500 computers
\ or any with all chip RAM.
\ Based on PB's ju:polygon
\ On Oct 24, 1989, in a phone call with Russ Yost,
\ Phil Burk granted permission for this file to
\ be placed in the public domain.
\ This utility supports use of the AreaEllipse AmigaDOS graphics
\ library function.
\ This system will set up a temp rastport twice the size of
\ the current rastport. See jd:demo_ellipse for an example.
\
\ ju:polygon is Copyright 1987 - Phil Burk
\ RY890818 modified for external control of area-coords, which controls
\ size of areabuffer, and to clear and dealloc areabuffer.
\ RY890923 provided temp.ras twice size of bit.plane, big and or many
\ ellipses before gr.areaend.
include? gr-currport ju:amiga_graph
include? allocraster() ju:graph_support
ANEW TASK-ELLIPSE
\ Declare structures.
tmpras EL-TMPRAS
areainfo EL-AREAINFO
variable el-areabuffer variable area-coords \ RY 890918
100 area-coords ! \ default: supports 45 ellipses RY 890918
\ Store required value in area-coords before using GR.AREA.INIT .
: INITAREA() ( areainfo areabuffer count -- )
callvoid>abs graphics_lib initarea
;
\ Areabuffer creation in dictionary replaced by
\ allocblock in gr.area.init RY 890918
\ Following word must be paired with a following GR.AREAEND, after some
\ GR.AREA.MOVE's and GR.AREA.DRAWS. or AREA.ELLIPSE's (see jd:demo_ellipse)
: GR.AREA.INIT { | rpcur rpx rpy -- , setup current rastport for AREAFILL }
gr-currport @ dup 0= abort" GR.AREA.INIT - no current rastport !"
>rel -> rpcur
el-areainfo
memf_clear ( memf_fast or ) \ RY Must clear trash from previous
\ use.
\ 901026 Deleted memfast reqmt for computers with no
\ fast ram - i.e., all chip ram.
area-coords @ 5 * allocblock? \ RY890918 get buffer block addr
dup el-areabuffer ! \ RY890818 save for freeblock
area-coords @ initarea() \ RY890818 chngd to var.
el-areainfo >abs rpcur ..! rp_areainfo
el-tmpras rpcur ..@ rp_bitmap >rel bitmap>wh -> rpy -> rpx
rpx rpy 2* allocraster() \ RY890923 double tmpras for big or
\ many ellipses.
dup 0= abort" GR.AREA.INIT - no mem for temp ras! "
rpx rpy 2* rassize() \ Doubling temp.ras RRY
inittmpras()
el-tmpras if>abs rpcur ..! rp_tmpras
;
: GR.AREA.TERM ( -- ) \ simply frees tempras. RRY
gr-currport @ dup 0= abort" GR.AREA.TERM - no current rastport !"
>rel ..@ rp_tmpras >rel
..@ tr_rasptr >rel
gr-currport @ >rel ..@ rp_bitmap >rel bitmap>wh 2* \ Doubled tmpras.
freeraster()
NULL gr-currport @ >rel ..! rp_tmpras
;
: GR.AREAMOVE ( x y -- )
gr-currport @ -rot
callvoid graphics_lib areamove
;
: GR.AREADRAW ( x y -- )
gr-currport @ -rot
callvoid graphics_lib areadraw
;
\ Precede next function by Gr.Area.init. After 1 or more executions of
\ next function, follow by Gr.Areaend (see below) to execute the area
\ fills.
: gr.areaellipse() ( left fp x, left fp y, hor-radius, ver-radius )
>r >r gr-currport @ -rot r> r>
call graphics_lib areaellipse
abort" GR.AREAELLIPSE Vector Table Full."
;
: GR.AREAEND ( -- ) \ Must follow each GR.AREA.INIT; Pairs cannot be nested.
gr-currport @
callvoid graphics_lib areaend
el-areabuffer @ freeblock \ Frees areabuffer RY 890918
gr.area.term \ frees tempras
;