home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / FREDScripts.lha / FREDRenderers / RenderAsDCTV.fred < prev    next >
Encoding:
Text File  |  1994-01-31  |  2.9 KB  |  141 lines

  1. /*
  2. ** RenderAsDCTV.fred
  3. **
  4. ** $VER: RenderAsDCTV.fred 1.2.0 (24.10.93)
  5. **
  6. ** This program can be run from an InvokeADPro list to convert images
  7. ** into DCTV format.  Including this program automatically causes a pre
  8. ** program to be executed as well (to select the screen modes).
  9. **
  10. ** Clips Imported:
  11. **    FREDScreenType        -    Screen type to be used
  12. **    FREDLockPalette        -     ~0 if locked palette wanted
  13. **                    0  if floating palette wanted
  14. **                    defined in a SaveAs pre script
  15. **    FREDRenderType        -    Render type to be used
  16. **
  17. ** NOTE: Clip names are case sensitive
  18. **
  19. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  20. ** ADPro v2.5.0 (or higher).
  21. **
  22. ** Copyright © 1992-1993 ASDG, Incorporated
  23. ** All Rights Reserved
  24. */
  25.  
  26.  
  27. ADDRESS "ADPro"
  28. OPTIONS RESULTS
  29.  
  30. PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
  31.  
  32. NL = '0A'X
  33. SQ = '27'X
  34. DQ = '22'X
  35. TRUE  = 1
  36. FALSE = 0
  37.  
  38.  
  39. /*
  40. ** Get the required clips.
  41. **
  42. ** See if FREDLockPalette was previously defined.  It will be if we are
  43. ** making an ANIM, for example.  Set it to false if FREDLockPalette was not
  44. ** found.
  45. */
  46.  
  47. PaletteFlag = GETCLIP( "FREDLockPalette" )
  48. IF (PaletteFlag = "") THEN
  49.     PaletteFlag = 0
  50.  
  51. ScreenType = GETCLIP( "FREDScreenType" )
  52. IF (ScreenType = "") THEN DO
  53.     ADPRO_TO_FRONT
  54.     OKAY1 "Required clip, FREDScreenType," || NL ||,
  55.         "is not specified."
  56.     SCREEN_TO_FRONT "FRED"
  57.     EXIT 10
  58. END
  59.  
  60. RenderType = GETCLIP( "FREDRenderType" )
  61. IF (RenderType = "") THEN DO
  62.     ADPRO_TO_FRONT
  63.     OKAY1 "Required clip, FREDRenderType," || NL ||,
  64.         "is not specified."
  65.     SCREEN_TO_FRONT "FRED"
  66.     EXIT 10
  67. END
  68.  
  69.  
  70. /*
  71. ** If the definition of PaletteFile should change for any reason, change it
  72. ** also in the SaveAs post script which cleans up the file if it is present.
  73. */
  74.  
  75. PaletteFile = "T:TempPalette"
  76.  
  77.  
  78. /*
  79. ** See what type of data is loaded in ADPro/MorphPlus.
  80. */
  81.  
  82. CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE
  83. IF (RESULT ~= 0) THEN
  84.     EXIT 10
  85.  
  86.  
  87. /*
  88. ** If this isn't the first call then we may have to load a predefined palette.
  89. */
  90.  
  91. IF ((FirstCallSeq = 0) & (PaletteFlag ~= 0)) THEN DO
  92.     PLOAD PaletteFile
  93.     IF (RC ~= 0) THEN DO
  94.         ADPRO_TO_FRONT
  95.         OKAY1 "Loading of temp palette failed." || NL ||,
  96.             "Argument Information:" | NL ||,
  97.             "Filename = " || PaletteFile
  98.         SCREEN_TO_FRONT "FRED"
  99.         EXIT 10
  100.     END
  101.     PSTATUS "LOCKED"
  102. END
  103.  
  104.  
  105. /*
  106. ** Do the conversion.
  107. */
  108.  
  109. SCREEN_TYPE ScreenType
  110. RENDER_TYPE RenderType
  111.  
  112. OPERATOR "DCTV"
  113. IF (RC ~= 0) THEN DO
  114.     ADPRO_TO_FRONT
  115.     OKAY1 "The operator DCTV" || NL ||,
  116.         "failed to execute."
  117.     SCREEN_TO_FRONT "FRED"
  118.     EXIT 10
  119. END
  120.  
  121. PSTATUS "UNLOCKED"
  122.  
  123.  
  124. /*
  125. ** If this IS first call and we want a locked palette, we need to save one.
  126. */
  127.  
  128. IF ((FirstCallSeq ~= 0) & (PaletteFlag ~= 0)) THEN DO
  129.     PSAVE PaletteFile
  130.     IF (RC ~= 0) THEN DO
  131.         ADPRO_TO_FRONT
  132.         OKAY1 "Saving of temp palette failed." || NL ||,
  133.             "Argument Information:" || NL ||,
  134.             "Filename = " || PaletteFile
  135.         SCREEN_TO_FRONT "FRED"
  136.         EXIT 10
  137.     END
  138. END
  139.  
  140. EXIT 0
  141.