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

  1. /*
  2. ** SaveToA2410.fred.pre
  3. **
  4. ** $VER: SaveToA2410.fred.pre 1.0.0 (31.10.93)
  5. **
  6. ** If the SaveToA2410.fred script appears in the InvokeADPro list,
  7. ** this program will ask the user to select the A2410 settings to use.
  8. **
  9. ** Clips Exported:
  10. **    FREDA2410BoardNum    -    Number of board to use
  11. **    FREDA2410Resolution    -    Display resolution to use
  12. **    FREDA2410SrcXOff    -    X Offset into source image
  13. **    FREDA2410SrcYOff    -    Y Offset into source image
  14. **    FREDA2410DestXOff    -    X Offset into destination buffer
  15. **    FREDA2410DestYOff    -    Y Offset into destination buffer
  16. **    FREDA2410DestWidth    -    Width in destination buffer
  17. **    FREDA2410DestHeight    -    Height in destination buffer
  18. **
  19. ** NOTE: Clip names are case sensitive.
  20. **
  21. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  22. ** ADPro v2.5.0 (or higher).
  23. **
  24. ** Copyright © 1993 ASDG, Incorporated
  25. ** All Rights Reserved
  26. */
  27.  
  28.  
  29. ADDRESS "ADPro"
  30. OPTIONS RESULTS
  31.  
  32. PARSE ARG NumberOfCells NumberOfFrames
  33.  
  34. NL = '0A'X
  35. SQ = '27'X
  36. DQ = '22'X
  37. TRUE  = 1
  38. FALSE = 0
  39.  
  40.  
  41. /*
  42. ** Ask the user which board and resolution to use.
  43. */
  44.  
  45. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Board number"' 1 1 5 TRUE
  46. IF (RESULT = (1-1)) THEN
  47.     EXIT 10
  48. BoardNum = RESULT
  49.  
  50. ResID.0 = "1024 x  768  NonLace"
  51. ResID.1 = " 800 x  600  NonLace"
  52. ResID.2 = " 640 x  400  Lace"
  53. ResID.3 = "1024 x  768  Lace"
  54. ResID.4 = "1024 x 1024  NonLace"
  55. ResID.5 = " 736 x  480  NonLace"
  56. ResID.6 = "1024 x 1024  NonLace"
  57. MinResID = 0
  58. MaxResID = 6
  59. DefResID = 0
  60.  
  61. String = '"' || ResID.DefResID || '"'
  62. DO LoopCounter = MinResID TO MaxResID
  63.     String = String '"' || ResID.LoopCounter || '"'
  64. END
  65.  
  66. continue = FALSE
  67. DO UNTIL (continue = TRUE)
  68.     ADPRO_TO_FRONT
  69.  
  70.     LISTVIEW '"Display Resolutions:"' 10 ITEMS String
  71.     LISTVIEW_RC = RC
  72.     PARSE VAR ADPRO_RESULT '"'ResStr'"' scratch
  73.  
  74.     IF (LISTVIEW_RC ~= 0) & (LISTVIEW_RC ~= 1) THEN DO
  75.         ADPRO_TO_FRONT
  76.  
  77.         OKAYN '"SaveToA2410.fred"' '"This value is required."' '"Retry|Cancel"'
  78.         IF (RC = 0) THEN
  79.             EXIT 10
  80.     END
  81.     ELSE
  82.         continue = TRUE
  83. END
  84.  
  85. ResSelected = MinResID
  86. DO WHILE (ResSelected <= MaxResID) & (COMPARE( ResStr, ResID.ResSelected ) ~= 0)
  87.     ResSelected = ResSelected + 1
  88. END
  89.  
  90. Res = ResID.ResSelected
  91.  
  92.  
  93. /*
  94. ** Ask the user for the source image specifications.
  95. */
  96.  
  97. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Source X Offset"' 0 0 99999 TRUE
  98. IF (RESULT = (0-1)) THEN
  99.     EXIT 10
  100. SrcXOff = RESULT
  101.  
  102. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Source Y Offset"' 0 0 99999 TRUE
  103. IF (RESULT = (0-1)) THEN
  104.     EXIT 10
  105. SrcYOff = RESULT
  106.  
  107.  
  108. /*
  109. ** Ask the user for the destination area specifications.
  110. */
  111.  
  112. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Destination X Offset"' 0 0 99999 TRUE
  113. IF (RESULT = (0-1)) THEN
  114.     EXIT 10
  115. DestXOff = RESULT
  116.  
  117. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Destination Y Offset"' 0 0 99999 TRUE
  118. IF (RESULT = (0-1)) THEN
  119.     EXIT 10
  120. DestYOff = RESULT
  121.  
  122. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Destination Width"' 1 1 99999 TRUE
  123. IF (RESULT = (1-1)) THEN
  124.     EXIT 10
  125. DestWidth = RESULT
  126.  
  127. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Destination Height"' 1 1 99999 TRUE
  128. IF (RESULT = (1-1)) THEN
  129.     EXIT 10
  130. DestHeight = RESULT
  131.  
  132.  
  133. /*
  134. ** Update the clips.
  135. */
  136.  
  137. SETCLIP( "FREDA2410BoardNum", BoardNum )
  138. SETCLIP( "FREDA2410Resolution", Res )
  139. SETCLIP( "FREDA2410SrcXOff", SrcXOff )
  140. SETCLIP( "FREDA2410SrcYOff", SrcYOff )
  141. SETCLIP( "FREDA2410DestXOff", DestXOff )
  142. SETCLIP( "FREDA2410DestYOff", DestYOff )
  143. SETCLIP( "FREDA2410DestWidth", DestWidth )
  144. SETCLIP( "FREDA2410DestHeight", DestHeight )
  145.  
  146. EXIT 0
  147.