home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 20
/
AACD20.BIN
/
AACD
/
Graphics
/
PerfectPaint
/
rexx
/
general
/
LoadADPro_Picture.rx
< prev
next >
Wrap
Text File
|
1999-12-10
|
2KB
|
129 lines
/* LoadAdpro Picture*/
options results
parse ARG Port b
IF ~SHOW('P','ADPro') THEN
DO
ADDRESS value Port
pp_Warn "Can't*locate*ADPro"
EXIT
END
p=1
d=0
c=0
ADDRESS COMMAND
sens=0
if EXISTS('PerfectPaint:Prefs/Rexx_Prefs/LoadADPro_Picture') THEN DO
IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/LoadADPro_Picture', "R") then DO
p = READLN('lfile')
d = READLN('lfile')
c = READLN('lfile')
CALL CLOSE('lfile')
END
END
ADDRESS value Port
pp_GetDepth
if result=24 then DO
a=24
END
else DO
a=2**result
END
IF a~=24 then DO
pp_DialogInit 250 100 "*Load*ADPro*Picture*" 3
pp_Cycle 0 80 7 130 16 "Palette" 1 "New*Palette|Current*Palette" p
pp_Cycle 1 80 27 130 16 "Dithering" 1 "No|Floyd" d
pp_Cycle 2 80 47 130 16 "Colors" 1 "Current*Depth|2|4|8|16|32|64|128|256" c
pp_Dialog
rc=result
if rc=0 then
do
EXIT
end
pp_GetDialog 0
p=result
pp_GetDialog 1
d=result
pp_GetDialog 2
c=result
CALL SavePrefs('LoadADPro_Picture',p,d,c)
c=2**c
ADDRESS value Port
pp_Psave 'ram:t/ppptemp'
IF c=1 THEN
DO
c=a
END
ENDIF
ADDRESS 'ADPro'
ADPRO_TO_FRONT
AVAIL_MODES_ONLY OFF
IF p=0 THEN
DO
PSTATUS "UNLOCKED"
END
ELSE
DO
PLOAD 'ram:t/ppptemp'
PSTATUS "LOCKED"
END
SFORMAT "IFF"
SCREEN_TYPE "NONINTERLACED"
RENDER_TYPE c
DITHER d
EXECUTE
SAVE 'ram:t/pptemp' "IMAGE"
END
ELSE
DO
ADDRESS 'ADPro'
ADPRO_TO_FRONT
SAVE 'ram:t/pptemp' "RAW"
END
ADDRESS value Port
pp_ShowScreen
pp_Load 'ram:t/pptemp'
ADDRESS COMMAND
'delete >nil: ram:t/pptemp'
if a~=24 then DO
'delete >nil: ram:t/ppptemp'
END
EXIT
SavePrefs: PROCEDURE
Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
if EXISTS(Prefname) THEN DO
ADDRESS COMMAND
'delete >nil: '||Prefname
END
IF OPEN('pfile',PrefName,'W') THEN DO
do i=2 to ARG()
CALL WRITELN('pfile',ARG(i))
end
CALL CLOSE('pfile')
RETURN