home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / SaversPseudo.lha / _SCULPTWithDimen < prev    next >
Encoding:
Text File  |  1994-01-31  |  1.9 KB  |  100 lines

  1. /*
  2. ** _SCULPTWithDimen
  3. **
  4. ** $VER: _SCULPTWithDimen 1.0.0 (4.11.93)
  5. **
  6. ** This program can be run from ADPro's savers list to store the current
  7. ** image data in SCULPT format, but it will also include the size of the
  8. ** image within the filename.  This is so that you know exactly what to
  9. ** enter for width and height in the SCULPT loader's control panel.
  10. **
  11. ** Also, the filename extensions that will be used are ".red"/".grn"/".blu"
  12. ** for color image data, and ".gry" of grayscale image data.
  13. **
  14. ** This script required ADPro v2.5.0 (or higher).
  15. **
  16. ** Copyright © 1993 ASDG, Incorporated
  17. ** All Rights Reserved
  18. */
  19.  
  20.  
  21. ADDRESS "ADPro"
  22. OPTIONS RESULTS
  23.  
  24. NL = '0A'X
  25. SQ = '27'X
  26. DQ = '22'X
  27. TRUE  = 1
  28. FALSE = 0
  29. TempDefaults = "T:TempADProDefaults"
  30.  
  31.  
  32. /*
  33. ** Save the current environment.
  34. */
  35.  
  36. SAVE_DEFAULTS TempDefaults
  37.  
  38.  
  39. /*
  40. ** See what type of data is loaded in ADPro/MorphPlus.
  41. */
  42.  
  43. CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE
  44. IF (RESULT ~= 0) THEN
  45.     CALL ErrorOut 10
  46.  
  47. IMAGE_TYPE
  48. ImageType = WORD( ADPRO_RESULT, 1 )
  49. IF (ImageType = "COLOR") THEN
  50.     FNameExt = ".red"
  51. ELSE IF (ImageType = "GRAY") THEN
  52.     FNameExt = ".gry"
  53. ELSE
  54.     FNameExt = ".sculpt"
  55.  
  56.  
  57. /*
  58. ** Ask for the basename to give the SCULPT file.  We will add the dimension
  59. ** and proper filename extension.
  60. */
  61.  
  62. CALL "FREDSCRIPTS:FREDFunctions/GetAFile" '"Select SCULPT Base Name"' '""""' '""""' TRUE
  63. BaseName = RESULT
  64. IF (BaseName = DQ||DQ) THEN
  65.     CALL ErrorOut 10
  66.  
  67. XSIZE
  68. ImageWidth = ADPRO_RESULT
  69.  
  70. YSIZE
  71. ImageHeight = ADPRO_RESULT
  72.  
  73. FName = BaseName || "_" || ImageWidth || "x" || ImageHeight || FNameExt
  74.  
  75. SAVER "SCULPT" FName "RAW"
  76. IF (RC ~= 0) THEN DO
  77.     ADPRO_TO_FRONT
  78.     OKAY1 "Error saving SCULPT file:" || NL ||,
  79.         FName
  80.     CALL ErrorOut 10
  81. END
  82.  
  83. CALL ErrorOut 0
  84.  
  85.  
  86. ErrorOut:
  87.     PARSE ARG ExitCode
  88.  
  89.     IF (EXISTS( TempDefaults )) THEN DO
  90.         LOAD_DEFAULTS TempDefaults
  91.         IF (RC ~= 0) THEN DO
  92.             ADPRO_TO_FRONT
  93.             OKAY1 "Error restoring settings."
  94.         END
  95.  
  96.         ADDRESS COMMAND "Delete >NIL:" TempDefaults
  97.     END
  98.  
  99.     EXIT ExitCode
  100.