home *** CD-ROM | disk | FTP | other *** search
- /*
- ** SaveToDP4ANIM.fred.post
- **
- ** $VER: SaveToDP4ANIM.fred.post 1.1.0 (24.10.93)
- **
- ** If the SaveToDP4ANIM.fred script appears in the InvokeADPro list,
- ** this program will adjust up the current DPaint IV AGA ANIM to its
- ** proper length.
- **
- ** Clips Imported:
- ** FREDDP4ANIMOverwrite - ~0 if the current ANIM should be overwritten
- ** 0 if it should be appended to
- ** FREDDP4ANIMOrigNumFrames - Original number of ANIM frames in
- ** DPaint before this script is executed
- ** FREDLockPalette - ~0 if user wanted a locked palette
- ** - 0 if not
- **
- ** 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
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
- PaletteFile = "T:TempPalette"
-
-
- /*
- ** Get the required clips. Error if any are missing.
- */
-
- Overwrite = GETCLIP( "FREDDP4ANIMOverwrite" )
- IF (Overwrite = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDDP4ANIMOverwrite," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- OrigNumFrames = GETCLIP( "FREDDP4ANIMOrigNumFrames" )
- IF (OrigNumFrames = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDDP4ANIMOrigNumFrames," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- PaletteFlag = GETCLIP( "FREDLockPalette" )
- IF (PaletteFlag = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDLockPalette," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
-
- /*
- ** Delete the extra frame (for overwrites only).
- */
-
- IF (Overwrite ~= 0) THEN DO
- /*
- ** CAUTION...KLUDGE AHEAD
- **
- ** This should actually only be FNum = 1, but there seems to be
- ** a problem with DPaint giving an error when trying to delete page 2 of
- ** a 2 page ANIM, so 2 frames need to stay from the previous ANIM.
- **
- ** This kludge should still work when/if a fixed version of DPaint is used
- ** with this script, since the error condition is always avoided.
- */
-
- IF (OrigNumFrames = 1) THEN
- FNum = 1
- ELSE
- FNum = 2
- END
- ELSE DO
- IF (OrigNumFrames = 1) THEN
- FNum = 1
- ELSE
- FNum = 0
- END
-
- DO WHILE (FNum > 0)
- SAVER "DPAINT" "XXX" "IMAGE" "DELETE" FNum
- IF (RC ~= 0) THEN DO
- Why = ADPRO_RESULT
- ADPRO_TO_FRONT
- OKAY1 "Removal of ANIM frame " || FNum || NL ||,
- "failed:" || NL || Why
- SCREEN_TO_FRONT "FRED"
- END
-
- FNum = FNum - 1
- END
-
-
- /*
- ** Delete the palette file, if it was defined and used.
- */
-
- IF ((PaletteFlag ~= "") & (PaletteFlag ~= 0)) THEN
- ADDRESS COMMAND "Delete >NIL:" PaletteFile
-
- EXIT 0
-