home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / FREDScripts.lha / FREDSavers / SaveAsDPIIE.fred < prev    next >
Encoding:
Text File  |  1994-01-31  |  2.3 KB  |  104 lines

  1. /*
  2. ** SaveAsDPIIE.fred
  3. **
  4. ** $VER: SaveAsDPIIE.fred 1.1.0 (24.10.93)
  5. **
  6. ** This program can be run from an InvokeADPro list to save images in
  7. ** DPIIE format.  Including this program automatically causes a pre script
  8. ** to be executed as well (to select the DPIIE file extension).
  9. **
  10. ** Clips Imported:
  11. **    FREDDPIIEFNameSelect    -    String describing how the filename
  12. **                    should be modified
  13. **    FREDDPIIESeqFileSelect    -    Name of sequence file
  14. **
  15. ** NOTE: Clip names are case sensitive.
  16. **
  17. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  18. ** ADPro v2.5.0 (or higher).
  19. **
  20. ** Copyright © 1993 ASDG, Incorporated
  21. ** All Rights Reserved
  22. */
  23.  
  24.  
  25. ADDRESS "ADPro"
  26. OPTIONS RESULTS
  27.  
  28. PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
  29.  
  30. NL = '0A'X
  31. SQ = '27'X
  32. DQ = '22'X
  33. TRUE  = 1
  34. FALSE = 0
  35.  
  36. FrameFName = STRIP(STRIP(FrameFName , "B" , " ") , "B" , '"')
  37.  
  38.  
  39. /*
  40. ** Get the required parameters.  Error if any are missing.
  41. */
  42.  
  43. FNameSelect = GETCLIP( "FREDDPIIEFNameSelect" )
  44. IF (FNameSelect = "") THEN DO
  45.     ADPRO_TO_FRONT
  46.     OKAY1 "Required clip, FREDDPIIEFNameSelect," || NL ||,
  47.         "is not specified."
  48.     SCREEN_TO_FRONT "FRED"
  49.     EXIT 10
  50. END
  51.  
  52. SeqFileSelect = GETCLIP( "FREDDPIIESeqFileSelect" )
  53. IF (SeqFileSelect = "") THEN DO
  54.     ADPRO_TO_FRONT
  55.     OKAY1 "Required clip, FREDDPIIESeqFileSelect," || NL ||,
  56.         "is not specified."
  57.     SCREEN_TO_FRONT "FRED"
  58.     EXIT 10
  59. END
  60.  
  61.  
  62. /*
  63. ** See what type of data is loaded in ADPro/MorphPlus.
  64. */
  65.  
  66. CALL "FREDSCRIPTS:FREDFunctions/CheckForRenderedImageData" TRUE
  67. IF (RESULT ~= 0) THEN
  68.     EXIT 10
  69.  
  70. RENDER_TYPE
  71. IF (ADPRO_RESULT ~= 256) THEN DO
  72.     ADPRO_TO_FRONT
  73.     OKAY1 "Image not rendered in the required" || NL ||,
  74.         "256 colors for DPIIE files."
  75.     SCREEN_TO_FRONT "FRED"
  76.     EXIT 10
  77. END
  78.  
  79.  
  80. /*
  81. ** Do the save.  If we aren't using the same filename, we will use the
  82. ** same basename and make every effort possible to replace the
  83. ** perceived filename extension with the selected DPIIE extension.
  84. */
  85.  
  86. CALL "FREDSCRIPTS:FREDFunctions/ModifyFilename" FNameSelect '"'FrameFName'"' FrameNum FALSE
  87. NewFName = '"'RESULT'"'
  88.  
  89. SAVER "DPIIE" NewFName "IMAGE"
  90. IF (RC ~= 0) THEN DO
  91.     Why = ADPRO_RESULT
  92.     ADPRO_TO_FRONT
  93.     OKAY1 "DPIIE save failed:" || NL || Why || NL ||,
  94.         "Argument Information:" || NL ||,
  95.         "Filename = " || NewFName || NL ||,
  96.         "Type = " || "IMAGE"
  97.     SCREEN_TO_FRONT "FRED"
  98.     EXIT 10
  99. END
  100.  
  101. CALL "FREDSCRIPTS:FREDFunctions/SeqFileAppend" SeqFileSelect NewFName 1
  102.  
  103. EXIT 0
  104.