/* ** RenderAsDefined.fred.pre ** ** $VER: RenderAsDefined.fred.pre 1.3.1 (12.4.94) ** ** If the RenderAsDefined.fred script appears in the InvokeADPro list, ** this program will ask the user to select a screen mode, render mode, and ** dither type into which the images will be rendered. ** ** Clips Exported: ** FREDRenderScreen - Render screen to use ** FREDDither - Dither to be used ** FREDDitherAmt - Dither amount to be used ** FREDLockPalette - 2 to lock to a specific palette ** 1 to lock to the current palette ** 0 to leave the palette unlocked ** ** 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-1994 Elastic Reality, Inc. ** All Rights Reserved */ ADDRESS "ADPro" OPTIONS RESULTS PARSE ARG NumberOfCells NumberOfFrames NL = '0A'X SQ = '27'X DQ = '22'X TRUE = 1 FALSE = 0 PaletteFile = "T:TempRenderPalette" /* ** Ask the user to select the screen mode. */ ADPRO_TO_FRONT GET_SCREEN_MODE '"Select Render Screen"' "Amiga" "XXX" 0 0 16 IF (RC ~= 0) THEN DO ADPRO_TO_FRONT OKAY1 "Could not select render screen." SCREEN_TO_FRONT "FRED" EXIT 10 END RenderScreen = ADPRO_RESULT /* ** Ask the user to select the dither mode to use. */ GETLIST DITHERS String = ADPRO_RESULT IF (RC ~= 0) THEN DO ADPRO_TO_FRONT OKAY1 "Could not retrieve" || NL ||, "dither list." SCREEN_TO_FRONT "FRED" EXIT 10 END continue = 0 DO UNTIL (continue = 1) ADPRO_TO_FRONT LISTVIEW '"Dithers Available:"' 10 ITEMS String LISTVIEW_RC = RC PARSE VAR ADPRO_RESULT '"'DitherModeStr'"' scratch IF (LISTVIEW_RC ~= 0) & (LISTVIEW_RC ~= 1) THEN DO ADPRO_TO_FRONT OKAYN '"RenderAsDefined.fred"' '"This value is required."' '"Retry|Cancel"' IF (RC = 0) THEN EXIT 10 END ELSE continue = 1 END IF (DitherModeStr = "Off") THEN /* Off */ DitherMode = 0 ELSE IF (DitherModeStr = "Floyd (1)") THEN /* Floyd (1) */ DitherMode = 1 ELSE IF (DitherModeStr = "Burkes (2)") THEN /* Burkes (2) */ DitherMode = 2 ELSE IF (DitherModeStr = "Sierra (3)") THEN /* Sierra (3) */ DitherMode = 3 ELSE IF (DitherModeStr = "Jarvis (4)") THEN /* Jarvis (4) */ DitherMode = 4 ELSE IF (DitherModeStr = "Stucki (5)") THEN /* Stucki (5) */ DitherMode = 5 ELSE IF (DitherModeStr = "Random (6)") THEN /* Random (6) */ DitherMode = 6 ELSE IF (DitherModeStr = "Lg Ord (7)") THEN /* Lg Ord (7) */ DitherMode = 7 ELSE IF (DitherModeStr = "Sm Ord (8)") THEN /* Sm Ord (8) */ DitherMode = 8 ELSE DitherMode = 0 /* ** If dither is Random or Ordered, get the Dither Amount. */ IF (DitherMode = 6) | (DitherMode = 7) | (DitherMode = 8) THEN DO CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Enter Dither Amount"' 16 1 256 TRUE IF (RESULT = (1-1)) THEN EXIT 10 DitherAmt = RESULT SETCLIP( "FREDDitherAmt", DitherAmt ) END /* ** Ask which palette to render with */ ADPRO_TO_FRONT OKAYN '"RenderAsDefined.fred"' '"Render with which palette?"' '"External...|First Frame|Unlocked|Cancel"' IF (RC = 0) THEN DO SCREEN_TO_FRONT "FRED" EXIT 10 END ELSE LockPalette = 3 - RC IF (LockPalette = 2) THEN DO continue = FALSE DO UNTIL (continue = TRUE) CALL "FREDSCRIPTS:FREDFunctions/GetAFile" '"Select Palette File"' '""""' '""""' TRUE RenderPalette = RESULT IF (RenderPalette = DQ||DQ) THEN EXIT 10 IF (EXISTS( RenderPalette )) THEN DO ADDRESS COMMAND "Copy >NIL: <:NIL" RenderPalette PaletteFile continue = TRUE END END END SCREEN_TO_FRONT "FRED" /* ** Update the clips. */ SETCLIP( "FREDRenderScreen", RenderScreen ) SETCLIP( "FREDDither", DitherMode ) SETCLIP( "FREDLockPalette", LockPalette ) EXIT 0