home *** CD-ROM | disk | FTP | other *** search
- /*
- ** RenderAsDCTV.fred
- **
- ** $VER: RenderAsDCTV.fred 1.2.0 (24.10.93)
- **
- ** This program can be run from an InvokeADPro list to convert images
- ** into DCTV format. Including this program automatically causes a pre
- ** program to be executed as well (to select the screen modes).
- **
- ** Clips Imported:
- ** FREDScreenType - Screen type to be used
- ** FREDLockPalette - ~0 if locked palette wanted
- ** 0 if floating palette wanted
- ** defined in a SaveAs pre script
- ** FREDRenderType - Render type to be used
- **
- ** 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 FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
-
- /*
- ** Get the required clips.
- **
- ** See if FREDLockPalette was previously defined. It will be if we are
- ** making an ANIM, for example. Set it to false if FREDLockPalette was not
- ** found.
- */
-
- PaletteFlag = GETCLIP( "FREDLockPalette" )
- IF (PaletteFlag = "") THEN
- PaletteFlag = 0
-
- ScreenType = GETCLIP( "FREDScreenType" )
- IF (ScreenType = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDScreenType," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- RenderType = GETCLIP( "FREDRenderType" )
- IF (RenderType = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDRenderType," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
-
- /*
- ** If the definition of PaletteFile should change for any reason, change it
- ** also in the SaveAs post script which cleans up the file if it is present.
- */
-
- PaletteFile = "T:TempPalette"
-
-
- /*
- ** See what type of data is loaded in ADPro/MorphPlus.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE
- IF (RESULT ~= 0) THEN
- EXIT 10
-
-
- /*
- ** If this isn't the first call then we may have to load a predefined palette.
- */
-
- IF ((FirstCallSeq = 0) & (PaletteFlag ~= 0)) THEN DO
- PLOAD PaletteFile
- IF (RC ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Loading of temp palette failed." || NL ||,
- "Argument Information:" | NL ||,
- "Filename = " || PaletteFile
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- PSTATUS "LOCKED"
- END
-
-
- /*
- ** Do the conversion.
- */
-
- SCREEN_TYPE ScreenType
- RENDER_TYPE RenderType
-
- OPERATOR "DCTV"
- IF (RC ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "The operator DCTV" || NL ||,
- "failed to execute."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- PSTATUS "UNLOCKED"
-
-
- /*
- ** If this IS first call and we want a locked palette, we need to save one.
- */
-
- IF ((FirstCallSeq ~= 0) & (PaletteFlag ~= 0)) THEN DO
- PSAVE PaletteFile
- IF (RC ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Saving of temp palette failed." || NL ||,
- "Argument Information:" || NL ||,
- "Filename = " || PaletteFile
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- END
-
- EXIT 0
-