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

  1. /*
  2. ** RenderAsDefined.fred.pre
  3. **
  4. ** $VER: RenderAsDefined.fred.pre 1.3.0 (30.10.93)
  5. **
  6. ** If the RenderAsDefined.fred script appears in the InvokeADPro list,
  7. ** this program will ask the user to select a screen mode, render mode, and
  8. ** dither type into which the images will be rendered.
  9. **
  10. ** Clips Exported:
  11. **    FREDRenderScreen    -    Render screen to use
  12. **    FREDDither        -    Dither to be used
  13. **    FREDDitherAmt        -    Dither amount to be used
  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 © 1992-1993 ASDG, Incorporated
  21. ** All Rights Reserved
  22. */
  23.  
  24.  
  25. ADDRESS "ADPro"
  26. OPTIONS RESULTS
  27.  
  28. PARSE ARG NumberOfCells NumberOfFrames
  29.  
  30. NL = '0A'X
  31. SQ = '27'X
  32. DQ = '22'X
  33. TRUE  = 1
  34. FALSE = 0
  35.  
  36.  
  37. /*
  38. ** Ask the user to select the screen mode.
  39. */
  40.  
  41. ADPRO_TO_FRONT
  42.  
  43. GET_SCREEN_MODE '"Select Render Screen"' "Amiga" "XXX" 0 0 16
  44. IF (RC ~= 0) THEN DO
  45.     ADPRO_TO_FRONT
  46.     OKAY1 "Could not select render screen."
  47.     SCREEN_TO_FRONT "FRED"
  48.     EXIT 10
  49. END
  50.  
  51. RenderScreen = ADPRO_RESULT
  52.  
  53.  
  54. /*
  55. ** Ask the user to select the dither mode to use.
  56. */
  57.  
  58. GETLIST DITHERS
  59. String = ADPRO_RESULT
  60. IF (RC ~= 0) THEN DO
  61.     ADPRO_TO_FRONT
  62.     OKAY1 "Could not retrieve" || NL ||,
  63.         "dither list."
  64.     SCREEN_TO_FRONT "FRED"
  65.     EXIT 10
  66. END
  67.  
  68. continue = 0
  69. DO UNTIL (continue = 1)
  70.     ADPRO_TO_FRONT
  71.  
  72.     LISTVIEW '"Dithers Available:"' 10 ITEMS String
  73.     LISTVIEW_RC = RC
  74.     PARSE VAR ADPRO_RESULT '"'DitherModeStr'"' scratch
  75.  
  76.     IF (LISTVIEW_RC ~= 0) & (LISTVIEW_RC ~= 1) THEN DO
  77.         ADPRO_TO_FRONT
  78.  
  79.         OKAYN '"RenderAsDefined.fred"' '"This value is required."' '"Retry|Cancel"'
  80.         IF (RC = 0) THEN
  81.             EXIT 10
  82.     END
  83.     ELSE
  84.         continue = 1
  85. END
  86.  
  87. IF (DitherModeStr = "Off") THEN            /* Off */
  88.     DitherMode = 0
  89. ELSE IF (DitherModeStr = "Floyd (1)") THEN    /* Floyd (1) */
  90.     DitherMode = 1
  91. ELSE IF (DitherModeStr = "Burkes (2)") THEN    /* Burkes (2) */
  92.     DitherMode = 2
  93. ELSE IF (DitherModeStr = "Sierra (3)") THEN    /* Sierra (3) */
  94.     DitherMode = 3
  95. ELSE IF (DitherModeStr = "Jarvis (4)") THEN    /* Jarvis (4) */
  96.     DitherMode = 4
  97. ELSE IF (DitherModeStr = "Stucki (5)") THEN    /* Stucki (5) */
  98.     DitherMode = 5
  99. ELSE IF (DitherModeStr = "Random (6)") THEN    /* Random (6) */
  100.     DitherMode = 6
  101. ELSE IF (DitherModeStr = "Lg Ord (7)") THEN    /* Lg Ord (7) */
  102.     DitherMode = 7
  103. ELSE IF (DitherModeStr = "Sm Ord (8)") THEN    /* Sm Ord (8) */
  104.     DitherMode = 8
  105. ELSE
  106.     DitherMode = 0
  107.  
  108.  
  109. /*
  110. ** If dither is Random or Ordered, get the Dither Amount.
  111. */
  112.  
  113. IF (DitherMode = 6) | (DitherMode = 7) | (DitherMode = 8) THEN DO
  114.     CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Enter Dither Amount"' 16 1 256 TRUE
  115.     IF (RESULT = (1-1)) THEN
  116.         EXIT 10
  117.     DitherAmt = RESULT
  118.  
  119.     SETCLIP( "FREDDitherAmt", DitherAmt )
  120. END
  121.  
  122. SCREEN_TO_FRONT "FRED"
  123.  
  124.  
  125. /*
  126. ** Update the clips.
  127. */
  128.  
  129. SETCLIP( "FREDRenderScreen", RenderScreen )
  130. SETCLIP( "FREDDither", DitherMode )
  131.  
  132. EXIT 0
  133.