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

  1. /*
  2. ** SimPrint.fred.pre
  3. **
  4. ** $VER: SimPrint.fred.pre 1.1.0 (23.10.93)
  5. **
  6. ** If the SimPrint.fred script appears in the InvokeADPro list,
  7. ** this program will ask the user for the dither method and mask size
  8. ** to use with the Sim_Print operator.
  9. **
  10. ** Clips Exported:
  11. **    FREDSimPrintDither    -    Dither to use.
  12. **    FREDSimPrintMaskSize    -    Dither mask size.
  13. **
  14. ** NOTE: Clip names are case sensitive.
  15. **
  16. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  17. ** ADPro v2.5.0 (or higher).
  18. **
  19. ** Copyright © 1993 ASDG, Incorporated
  20. ** All Rights Reserved
  21. */
  22.  
  23.  
  24. ADDRESS "ADPro"
  25. OPTIONS RESULTS
  26.  
  27. PARSE ARG NumberOfCells NumberOfFrames
  28.  
  29. NL = '0A'X
  30. SQ = '27'X
  31. DQ = '22'X
  32. TRUE  = 1
  33. FALSE = 0
  34.  
  35.  
  36. /*
  37. ** Ask the user which type of dither method should be used.
  38. */
  39.  
  40. DitherID.1 = "Halftone"
  41. DitherID.2 = "Ordered"
  42. DitherID.3 = "Vertical Line"
  43. DitherID.4 = "Horizontal Line"
  44. DitherID.5 = "Fwd Diagonal Line"
  45. DitherID.6 = "Bwd Diagonal Line"
  46. DitherID.7 = "Fwd Brick"
  47. DitherID.8 = "Bwd Brick"
  48. MinDitherID = 1
  49. MaxDitherID = 8
  50. DefDitherID = 1
  51.  
  52. DitherName.1 = "HALFTONEA"
  53. DitherName.2 = "ORDERED"
  54. DitherName.3 = "VERTICAL"
  55. DitherName.4 = "HORIZONTAL"
  56. DitherName.5 = "FWDDIAGONAL"
  57. DitherName.6 = "BCKDIAGONAL"
  58. DitherName.7 = "FWDBRICK"
  59. DitherName.8 = "BCKBRICK"
  60.  
  61. String = '"' || DitherID.DefDitherID || '"'
  62. DO LoopCounter = MinDitherID TO MaxDitherID
  63.     String = String '"' || DitherID.LoopCounter || '"'
  64. END
  65.  
  66. continue = 0
  67. DO UNTIL (continue = 1)
  68.     ADPRO_TO_FRONT
  69.  
  70.     LISTVIEW '"Dither Types:"' (MaxDitherID-MinDitherID+1) ITEMS String
  71.     LISTVIEW_RC = RC
  72.     PARSE VAR ADPRO_RESULT '"'DitherTypeStr'"' scratch
  73.  
  74.     IF (LISTVIEW_RC ~= 0) & (LISTVIEW_RC ~= 1) THEN DO
  75.         ADPRO_TO_FRONT
  76.  
  77.         OKAYN '"SimPrint.fred"' '"This value is required."' '"Retry|Cancel"'
  78.         IF (RC = 0) THEN
  79.             EXIT 10
  80.     END
  81.     ELSE
  82.         continue = 1
  83. END
  84.  
  85. DitherSelected = MinDitherID
  86. DO WHILE (DitherSelected <= MaxDitherID) & (COMPARE( DitherTypeStr, DitherID.DitherSelected ) ~= 0)
  87.     DitherSelected = DitherSelected + 1
  88. END
  89.  
  90. DitherType = DitherName.DitherSelected
  91.  
  92.  
  93. /*
  94. ** Ask the user for the mask size.
  95. */
  96.  
  97. MaskSizeID.1 = "2"
  98. MaskSizeID.2 = "4"
  99. MaskSizeID.3 = "8"
  100. MaskSizeID.4 = "16"
  101. MinMaskSizeID = 1
  102. MaxMaskSizeID = 4
  103. DefMaskSizeID = 1
  104.  
  105. String = '"' || MaskSizeID.DefMaskSizeID || '"'
  106. DO LoopCounter = MinMaskSizeID TO MaxMaskSizeID
  107.     String = String '"' || MaskSizeID.LoopCounter || '"'
  108. END
  109.  
  110. continue = 0
  111. DO UNTIL (continue = 1)
  112.     ADPRO_TO_FRONT
  113.  
  114.     LISTVIEW '"Mask Size:"' (MaxMaskSizeID-MinMaskSizeID+1) ITEMS String
  115.     LISTVIEW_RC = RC
  116.     PARSE VAR ADPRO_RESULT '"'MaskSizeTypeStr'"' scratch
  117.  
  118.     IF (LISTVIEW_RC ~= 0) & (LISTVIEW_RC ~= 1) THEN DO
  119.         ADPRO_TO_FRONT
  120.  
  121.         OKAYN '"SimPrint.fred"' '"This value is required."' '"Retry|Cancel"'
  122.         IF (RC = 0) THEN
  123.             EXIT 10
  124.     END
  125.     ELSE
  126.         continue = 1
  127. END
  128.  
  129. MaskSizeSelected = MinMaskSizeID
  130. DO WHILE (MaskSizeSelected <= MaxMaskSizeID) & (COMPARE( MaskSizeTypeStr, MaskSizeID.MaskSizeSelected ) ~= 0)
  131.     MaskSizeSelected = MaskSizeSelected + 1
  132. END
  133.  
  134. MaskSize = MaskSizeID.MaskSizeSelected
  135.  
  136. SCREEN_TO_FRONT "FRED"
  137.  
  138.  
  139. /*
  140. ** Update the clips.
  141. */
  142.  
  143. SETCLIP( "FREDSimPrintDither", DitherType )
  144. SETCLIP( "FREDSimPrintMaskSize", MaskSize )
  145.  
  146. EXIT 0
  147.