home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1996 December
/
PCWKCD1296.iso
/
demo
/
wgelectr
/
cameval
/
cam31
/
misc.z
/
OPT_APR.SCR
< prev
next >
Wrap
Text File
|
1995-07-20
|
3KB
|
179 lines
;
; Aperture table optimization and compression script
; Written by: Jeff Miller
; Date: 7/13/95
; Ver: 2.1
;
view_statbar@
view_toolbar@
;view_groffon@
layer_alloff@ 0
update_layerbar@
if padstacks! = 1 then goto 900
ok_cancel "Would you like to clear un-used Dcodes?", clr_ok
if clr_ok = 1 then goto 5
if clr_ok = 0 then goto 6
5
print_msg "Clearing un-used Dcodes -- Please wait..."
gosub 20
6
ok_cancel "Would you like to check for duplicate apertures?", dup_ok
if dup_ok = 1 then goto 7
if dup_ok = 0 then goto 8
7
print_msg "Optimizing duplicate apertures -- Please wait..."
gosub 100
8
ok_cancel "Would you like to compress the aperture table?", com_ok
if com_ok = 1 then goto 9
if com_ok = 0 then goto 10
9
print_msg "Compressing aperture table -- Please wait..."
gosub 300
update_dcodebar@
10
view_statbar@
view_toolbar@
;view_groffon@
print "Optimization complete"
end
;
; Check for un-used Dcodes.
;
20
for j = 10 to highestdcode!
setdcode@ j
if numflashes! = 0 then goto 21
goto 25
21 if numdraws! = 0 then gosub 700
25 next
return
;
;Setup Dcode to check against
;
100
for a = 10 to highestdcode!
setdcode@ a
dcode_a = a
shape_a = dcodeshape!
sizex_a = dcodesizex!
sizey_a = dcodesizey!
name_a$ = dcodename!
if shape_a = 0 then goto 101
gosub 200
101 next
return
;
; Check for duplicates
;
200
for b = dcode_a+1 to highestdcode!
setdcode@ b
dcode_b = b
shape_b = dcodeshape!
sizex_b = dcodesizex!
sizey_b = dcodesizey!
name_b$ = dcodename!
if shape_b = 0 then goto 203
if shape_b = 6 then goto 250
if shape_b = shape_a then goto 201
goto 203
201 if sizex_b = sizex_a then goto 202
goto 203
202 if sizey_b = sizey_a then gosub 500
goto 203
250 if name_a$ = name_b$ then gosub 500
203 next
return
;
; Check for holes in aperture table
;
300
for c = 10 to highestdcode!
setdcode@ c
dcode_c = c
if dcodeshape! = 0 then gosub 400
next
return
;
; Check for apertures that can be moved to fill holes
;
400
done = 0
for d = dcode_c+1 to highestdcode!
if done = 1 then goto 401
setdcode@ d
dcode_d = d
shape_d = dcodeshape!
sizex_d = dcodesizex!
sizey_d = dcodesizey!
name_d$ = dcodename!
if shape_d = 0 then goto 401
gosub 600
done = 1
401 next
return
;
;Transcode subroutine for optimization
;
500
filter$ = dcode_b
change_dcode@
setbydcode@ filter$
edit_group@
axy@ dbminx!,dbminy!
axy@ dbmaxx!,dbmaxy!
back@
edit_chgdcode@ dcode_a
back@
edit_aperture@ dcode_b,0,0,0,dcode_b,""
return
;
;Transcode subroutine for compression
;
600
edit_aperture@ dcode_c,shape_d,sizex_d,sizey_d,dcode_c,name_d$
filter$ = dcode_d
change_dcode@
setbydcode@ filter$
edit_group@
axy@ dbminx!,dbminy!
axy@ dbmaxx!,dbmaxy!
back@
edit_chgdcode@ dcode_c
back@
edit_aperture@ dcode_d,0,0,0,dcode_d,""
return
;
; Clear un-used Dcode
;
700
edit_aperture@ activedcode!,0,0,0,activedcode!,""
return
;
; Padstacks detected
;
900
print "ERROR - Padstacks detected, macro cannot complete."
view_statbar@
view_toolbar@
view_groffon@
end