/* Program to use ADPro to create a compromise palette for a number of pictures or frames, in a chosen number of colours. There must be some space in the same directory to hold temporary files. */
trace r
options results
address "ADPro"
lformat "UNIVERSAL"
sformat "IFF"
GETFILES '"Hold down shift & click on Files"'
IF RC ~= 0 THEN EXIT
TheFiles = ADPRO_RESULT
NumberOfFiles = WORDS(TheFiles)
stripwidth = trunc(320/NumberOfFiles)
getnumber '"How many colours?"' 32 2 256
colours = ADPro_result
if rc~=0 then exit
if colours>256 then colours = 256
getfile '"File name for palette..."'
if rc~=0 then do
okay1 "No file selected"
exit
end
palettename = ADPro_result
pstatus unlocked
do i = 1 to NumberOfFiles
filename = word(TheFiles,i) /* this filename includes the path */
load filename
if rc ~=0 then break
abs_scale stripwidth 200
render_type "HAM" /* number of colours */
screen_type 4 /* 0 for NTSC machines */
execute
newname = compress(filename||".s", '"') /* compress deals with a bug in ADPro */
/* should really strip name from path & check if now too long */
save newname "IMAGE"
if rc~=0 then do
okay1 '"Trouble saving file "||newname'
exit
end
end /* end of multiple files */
lformat "BACKDROP"
load "X" 320 200 "COLOR" /* black backdrop */
lformat "UNIVERSAL"
do i = 1 to NumberOfFiles
filename = word(TheFiles,i)
newname = compress(filename||".strip", '"')
if length(newname)>30 then newname = right(newname,30)