home *** CD-ROM | disk | FTP | other *** search
- /*
- ** GradualMosaic.fred.pre
- **
- ** $VER: GradualMosaic.fred.pre 1.1.0 (23.10.93)
- **
- ** If the GradualMosaic.fred script appears in the InvokeADPro list,
- ** this program will ask the user to enter the starting and ending values
- ** for the mosaic.
- **
- ** Clips Exported:
- ** FREDGradualMosaicXOffCurr - Current X Offset
- ** FREDGradualMosaicYOffCurr - Current Y Offset
- ** FREDGradualMosaicWidthCurr - Current Tile Width
- ** FREDGradualMosaicHeightCurr - Current Tile Height
- ** FREDGradualMosaicXOffIncr - X Offset increment per frame
- ** FREDGradualMosaicYOffIncr - Y Offset increment per frame
- ** FREDGradualMosaicWidthIncr - Tile Width increment per frame
- ** FREDGradualMosaicHeightIncr - Tile Height increment per frame
- ** FREDGradualMosaicXOffFinal - Final X Offset
- ** FREDGradualMosaicYOffFinal - Final Y Offset
- ** FREDGradualMosaicWidthFinal - Final Tile Width
- ** FREDGradualMosaicHeightFinal - Final Tile Height
- ** FREDGradualMosaicNumberOfFrames - The number of frames selected
- ** FREDGradualMosaicFrameCount - The number of frames already processed
- **
- ** NOTE: Clip names are case sensitive.
- **
- ** This script requires FRED v1.4.0 (or higher) to run. Also required is
- ** ADPro v2.5.0 (or higher).
- **
- ** Copyright © 1993 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- ADDRESS "ADPro"
- OPTIONS RESULTS
-
- PARSE ARG NumberOfCells NumberOfFrames
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
-
- /*
- ** Ensure that at least two frames are to be processed.
- */
-
- IF (NumberOfFrames < 2) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Frame count must be more than 2."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
-
- /*
- ** Ask the user for the initial parameters.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting X Offset"' 0 0 32767 TRUE
- IF (RESULT = (0-1)) THEN
- EXIT 10
- CurrXOff = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting Y Offset"' 0 0 32767 TRUE
- IF (RESULT = (0-1)) THEN
- EXIT 10
- CurrYOff = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting Tile Width"' 20 1 32767 TRUE
- IF (RESULT = (1-1)) THEN
- EXIT 10
- CurrWidth = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting Tile Height"' 20 1 32767 TRUE
- IF (RESULT = (1-1)) THEN
- EXIT 10
- CurrHeight = RESULT
-
-
- /*
- ** Ask the user for the final parameters.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending X Offset"' 0 0 32767 TRUE
- IF (RESULT = (0-1)) THEN
- EXIT 10
- FinalXOff = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending Y Offset"' 0 0 32767 TRUE
- IF (RESULT = (0-1)) THEN
- EXIT 10
- FinalYOff = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending Tile Width"' 20 1 32767 TRUE
- IF (RESULT = (1-1)) THEN
- EXIT 10
- FinalWidth = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending Tile Height"' 20 1 32767 TRUE
- IF (RESULT = (1-1)) THEN
- EXIT 10
- FinalHeight = RESULT
-
-
- /*
- ** Update the clips.
- */
-
- SETCLIP( "FREDGradualMosaicXOffCurr", CurrXOff )
- SETCLIP( "FREDGradualMosaicYOffCurr", CurrYOff )
- SETCLIP( "FREDGradualMosaicWidthCurr", CurrWidth )
- SETCLIP( "FREDGradualMosaicHeightCurr", CurrHeight )
- SETCLIP( "FREDGradualMosaicXOffIncr", (FinalXOff - CurrXOff) / (NumberOfFrames - 1) )
- SETCLIP( "FREDGradualMosaicYOffIncr", (FinalYOff - CurrYOff) / (NumberOfFrames - 1) )
- SETCLIP( "FREDGradualMosaicWidthIncr", (FinalWidth - CurrWidth) / (NumberOfFrames - 1) )
- SETCLIP( "FREDGradualMosaicHeightIncr", (FinalHeight - CurrHeight) / (NumberOfFrames - 1) )
- SETCLIP( "FREDGradualMosaicXOffFinal", FinalXOff )
- SETCLIP( "FREDGradualMosaicYOffFinal", FinalYOff )
- SETCLIP( "FREDGradualMosaicWidthFinal", FinalWidth )
- SETCLIP( "FREDGradualMosaicHeightFinal", FinalHeight )
- SETCLIP( "FREDGradualMosaicNumberOfFrames", NumberOfFrames )
- SETCLIP( "FREDGradualMosaicFrameCount", 0 )
-
- EXIT 0
-