home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 20 / AACD20.BIN / AACD / Graphics / PerfectPaint / rexx / general / LoadADPro_Brush.rx next >
Text File  |  1999-12-10  |  2KB  |  98 lines

  1. /* LoadAdpro Brush*/
  2.  
  3.     options results
  4.     parse ARG Port b
  5.  
  6.     IF ~SHOW('P','ADPro') THEN
  7.         DO
  8.             ADDRESS value Port
  9.         pp_Warn "Can't*locate*ADPro"
  10.       EXIT
  11.         END
  12.  
  13.     ADDRESS COMMAND
  14.     d=0
  15.     if EXISTS('PerfectPaint:Prefs/Rexx_Prefs/LoadADPro_Brush') THEN DO
  16.         IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/LoadADPro_Brush', "R") then DO
  17.             d = READLN('lfile')
  18.             CALL CLOSE('lfile')
  19.         END
  20.     END
  21.  
  22.     ADDRESS value Port
  23.         pp_GetDepth
  24.         if result=24 then DO
  25.             a=24
  26.         END
  27.         else DO
  28.             a=2**result
  29.             pp_Psave 'ram:t/ppptemp'
  30.         END
  31.  
  32.     IF a~=24 then DO
  33.         pp_DialogInit 250 90 "*Load*ADPro*Brush*" 1
  34.             pp_Cycle 0 100 20 100 16 "Dithering" 1 "No|Floyd" d
  35.         pp_Dialog    
  36.  
  37.         rc=result
  38.         if rc=0 then
  39.             do
  40.                 EXIT
  41.             end    
  42.  
  43.         pp_GetDialog 0
  44.         d=result
  45.  
  46.         CALL SavePrefs('LoadADPro_Brush',d)    
  47.  
  48.         ADDRESS 'ADPro'
  49.         ADPRO_TO_FRONT
  50.         AVAIL_MODES_ONLY OFF
  51.         PLOAD 'ram:t/ppptemp'
  52.         PSTATUS "LOCKED"
  53.         SFORMAT "IFF"
  54.     SCREEN_TYPE "NONINTERLACED"
  55.         RENDER_TYPE a
  56.         DITHER d
  57.         EXECUTE
  58.         SAVE 'ram:t/pptemp' "IMAGE"
  59.     END
  60.     ELSE DO
  61.         ADDRESS 'ADPro'
  62.         ADPRO_TO_FRONT
  63.         SAVE 'ram:t/pptemp' "RAW"    
  64.     END
  65.  
  66.     ADDRESS value Port
  67.         pp_ShowScreen
  68.         pp_BLoad 'ram:t/pptemp'
  69.  
  70.     ADDRESS COMMAND
  71.         'delete >nil: ram:t/pptemp'
  72.         if a~=24 then DO
  73.             'delete >nil: ram:t/ppptemp'
  74.         END
  75.  
  76.     EXIT
  77.     
  78.  
  79.  
  80. SavePrefs: PROCEDURE
  81.     
  82.     Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
  83.  
  84.     if EXISTS(Prefname) THEN DO
  85.         ADDRESS COMMAND
  86.         'delete >nil: '||Prefname
  87.     END
  88.  
  89.     IF OPEN('pfile',PrefName,'W') THEN DO
  90.  
  91.     do i=2 to ARG()
  92.         CALL WRITELN('pfile',ARG(i))
  93.     end
  94.  
  95.     CALL CLOSE('pfile')
  96.  
  97. RETURN
  98.