home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / arexx / scripti.lha / 3-DEE / Scripti / ScreenModes / ScreenMode.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1993-05-19  |  1.9 KB  |  96 lines

  1. /*
  2. -----------------------------------------------------------------------------
  3. This AREXX-Script will make any image appearable on a (AGA) screen.
  4. The codes for the screen are written in a doc.
  5.  
  6. Host address: ADPro (Art Department Professional   ®ASDG)
  7. Written by Jan Van Overbeke, 3-DEE, ©1993.
  8. Read the AREXX-Scripti doc, for more info about operation and rights!
  9. -----------------------------------------------------------------------------
  10. */
  11.  
  12. arg filename screen
  13. if ~ exists(filename)|filename='' then do
  14.     say 'Unable to find the image !!'
  15.     say 'See Ya...'
  16.     say ''
  17.     exit
  18.     end
  19.  
  20. options results
  21. address 'ADPro'
  22. say 'ScreenMode: Written by JAN VAN OVERBEKE, 3-DEE, ©1993'
  23. say 'Image: 'filename
  24. say 'SAVE: IFF Original Colors.'
  25. say ''
  26.  
  27. LFORMAT "UNIVERSAL"
  28. if RC ~=0 then do
  29.     say 'Unable to select the UNIVERSAL loader.'
  30.     say 'See Ya...'
  31.     say ''
  32.     exit
  33.     end
  34.  
  35. say 'Loading.........'
  36. LOAD filename
  37. if RC ~=0 then do
  38.     say 'Had some problems while loading.'
  39.     say 'See Ya...'
  40.     say ''
  41.     exit
  42.     end
  43.  
  44. /* ---- Is it 24 bit?  ---- */
  45. /* ---- If it is, quit ---- */
  46. /* ------------------------ */
  47. IMAGE
  48. help=ADPRO_RESULT
  49. if ~(pos('RENDERED',help)>0|pos('BITPLANE',help)>0) then do
  50.     say "24Bit images can't have a screenmode"
  51.     say 'Except a custom one!'
  52.     say 'See Ya......'
  53.     say ''
  54.     exit
  55.     end
  56.  
  57. /* ---- Adjust palette ---- */
  58. /* ------------------------ */
  59. render_type
  60. colors=ADPRO_RESULT
  61. palette=0
  62. if colors='HAM' then palette=16
  63. if colors='HAM8' then palette=64
  64. if palette=0 then palette=colors
  65. ptotal palette
  66. pused palette
  67.  
  68. say 'Converting......'
  69. SCREEN_TYPE screen
  70. execute
  71. if RC ~= 0 then do
  72.     say 'Unable to change SCREEN FORMAT.'
  73.     say 'Wrong argument????'
  74.     say 'See Ya...'
  75.     say ''
  76.     exit
  77.     end
  78.  
  79. SFORMAT "IFF"
  80. if RC ~=0 then do
  81.     say 'Unable to select the IFF Saver.'
  82.     say 'See Ya...'
  83.     say ''
  84.     exit
  85.     end
  86.  
  87. say 'Saving..........'
  88. filename=filename'.new'
  89. SAVE filename "IMAGE"
  90. if RC~=0 then do
  91.     say 'Problems while saving: NOT SAVED.'
  92.     say 'See Ya...'
  93.     end
  94. say ''
  95. exit
  96.