/* ** GradualScale.fred.pre ** ** $VER: GradualScale.fred.pre 1.1.0 (23.10.93) ** ** If the GradualScale.fred script appears in the InvokeADPro list, ** this program will ask the user to enter the beginning and ending width and height. ** ** Clips Exported: ** FREDGradualWidthCurr - Current width ** FREDGradualHeightCurr - Current height ** FREDGradualWidthIncr - Width increment per frame ** FREDGradualHeightIncr - Height increment per frame ** FREDGradualWidthFinal - Final width ** FREDGradualHeightFinal - Final height ** FREDNumberOfFrames - The number of frames selected ** FREDFrameCount - 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 © 1992-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 /* ** Set some default values. */ StartingWidth = 640 StartingHeight = 400 EndingWidth = 320 EndingHeight = 200 /* ** See what type of data is loaded in ADPro/MorphPlus. */ CALL "FREDSCRIPTS:FREDFunctions/CheckForImageData" IF (RESULT = 0) THEN DO XSIZE StartingWidth = ADPRO_RESULT YSIZE StartingHeight = ADPRO_RESULT END /* ** Ask the user for a starting size using the currently loaded width as default. */ CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting width"' StartingWidth 1 999999 TRUE StartingWidth = RESULT IF (StartingWidth = (1-1)) THEN EXIT 10 /* ** Ask the user for a starting size using the currently loaded height as default. */ CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting height"' StartingHeight 1 999999 TRUE StartingHeight = RESULT IF (StartingHeight = (1-1)) THEN EXIT 10 /* ** Ask the user for an ending size using the currently loaded width as default. */ CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending width"' EndingWidth 1 999999 TRUE EndingWidth = RESULT IF (EndingWidth = (1-1)) THEN EXIT 10 /* ** Ask the user for an ending size using the currently loaded height as default. */ CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending height"' EndingHeight 1 999999 TRUE EndingHeight = RESULT IF (EndingHeight = (1-1)) THEN EXIT 10 /* ** Update the clips. */ SETCLIP( "FREDGradualWidthCurr", StartingWidth ) SETCLIP( "FREDGradualHeightCurr", StartingHeight ) SETCLIP( "FREDGradualWidthIncr", (EndingWidth - StartingWidth) / (NumberOfFrames - 1) ) SETCLIP( "FREDGradualHeightIncr", (EndingHeight - StartingHeight) / (NumberOfFrames - 1) ) SETCLIP( "FREDGradualWidthFinal", EndingWidth ) SETCLIP( "FREDGradualHeightFinal", EndingHeight ) SETCLIP( "FREDNumberOfFrames", NumberOfFrames ) SETCLIP( "FREDFrameCount", 0 ) EXIT 0