home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / new / gfx / misc / flaminator / flaminator.oprx next >
Text File  |  1994-09-09  |  25KB  |  918 lines

  1. /*                      FLAMINATOR v1.5b                           */
  2. /*                                                                 */
  3. /*                    ©1993 Carmen Rizzolo                         */
  4. /*                                                                 */
  5. /*                     for OpalPaint v1.4+                         */
  6. /*                                                                 */
  7.  
  8. /* History:                                                        */
  9. /* v0.9   2/24/93  Just Starting, but the program is pretty much   */
  10. /*                 done, in my head.                               */
  11. /* v0.95  2/25/93  The script is done and (semi-)functional, but   */
  12. /*                 it's bumping into bugs.  Needs a little         */
  13. /*                 polishing.                                      */
  14. /* v1.0   2/25/93  Finally done and fairly stable.  Consult        */
  15. /*                 documentation for more info.                    */
  16. /* v1.0a  2/25/93  Fixed version number in startup requestor.      */
  17. /*                 Fixed Method number in one of these goofy       */
  18. /*                 REMARK thingies.  Nothing that matters.         */
  19. /* v1.0b  2/26/93  Corrected some spelling errors in the           */
  20. /*                 documentation.                                  */
  21. /* v1.1   2/26/93  Vastly icreased speed.  By optimizing the       */
  22. /*                 diffusion and smoothing process.  Now uses Blur */
  23. /*                 DrawMode instead of Smooth to avoid the cross-  */
  24. /*                 hatch look.  Then Uses Smooth DrawMode for top  */
  25. /*                 scanline to repair Blur's sloppiness.  Only one */
  26. /*                 or two Smooth passes are really all you'll ever */
  27. /*                 need now.                                       */
  28. /*                 Also, the flames seem to look better now.       */
  29. /* v1.1b 2/26/93   Now only performs diffuse and blur operations   */
  30. /*                 from upper-left corner to brush-size + 25       */
  31. /*                 pixels.                                         */
  32. /* v1.1c 2/27/93   Now only performs diffuse and blur operations   */
  33. /*                 from upper-left of brush to lower-left of brush */
  34. /*                 MUCH faster.                                    */
  35. /* v1.1d 2/27/93   Speeded it up a bit more.  I don't think I can  */
  36. /*                 squeeze much more speed out of this thing!      */
  37. /* v1.1e 2/28/93   Do you want to go FASTER??! :)  I did it again. */
  38. /*                 It's turbo-charged, especially for Hi-Res work. */
  39. /*                 I also changed the sample images.  I think it   */
  40. /*                 makes a bit of a better animation now.          */
  41. /* v1.1f 3/2/93    Fixed some bad syntax.  Thanks for the          */
  42. /*                 correction Martin!                              */
  43. /* v1.2  3/6/93    By request, I added another 'method.'  Be       */
  44. /*                 sure to browse the documentation for a full     */
  45. /*                 explanation of how this works.                  */
  46. /* v1.2b 4/11/93   Fixed AskString requestors to be friendly with  */
  47. /*                 OpalPaint v2.3 and higher                       */
  48. /* v1.5  9/3/94    Upgraded requestors to take full advantage of   */
  49. /*                 OpalPaint v2.3's new Customizable requestors.   */
  50. /*                 Added Savable Default file feature              */
  51. /*                 Added Custom Flame colour-set feature.          */
  52. /*                 Added ability to visually preview your flame    */
  53. /*                 colour-set.                                     */
  54. /*                 Added ability to disable blur passes.  Why?     */
  55. /*                 HeckifIKnow!                                    */
  56. /* v1.5b           Added lables for hottest to coolest colours in  */
  57. /*                 the "Custom" flame colour settings area.        */
  58.  
  59. /*  See documentation for more information                         */
  60.  
  61. /* Initialization of variables.  Don't touch unless you know what
  62.    you are doing. */
  63.  
  64. ROOT = 'pic.'
  65. ZERO = '0'
  66. Options Results
  67. Address 'OpalPaint_Rexx'
  68.  
  69. Call Panic()
  70. Call VersionCheck()
  71. Call ConfirmFlaminator()
  72.  
  73. Call AskMethod()
  74. Call AskColour()
  75. Call AskFlamePrefs()
  76.  
  77. /* Get BackgroundSource pathname */
  78. If Method < 2 Then Do
  79.     Call GetDefaults()
  80.     PathNameDef = BkgndSrcPathDef
  81.     ReqTitle = 'Enter the pathname of your BACKGROUND source image(s)'
  82.     ReqHail = 'Get BACKGROUND animation PATH'
  83.     Call PathNameGetter()
  84.     BkgndSrcPathDef = PathNameDef
  85.     BackGroundSource = PathName
  86.     Call SaveDefaults()
  87.     End
  88.  
  89. If Method = 0 Then Call CheckDirForFiles()
  90.  
  91. /* Get FlameSource pathname */
  92. Call GetDefaults()
  93. PathNameDef = FlameSrcPathDef
  94. ReqTitle = 'Enter the pathname of your FLAME source image(s)'
  95. ReqHail = 'Get FLAME animation PATH'
  96. Call PathNameGetter()
  97. FlameSrcPathDef = PathNameDef
  98. FlameSource = PathName
  99. Call SaveDefaults()
  100.  
  101. If FlameSource = BackgroundSource Then Do
  102.     Okay 'FATAL ERROR!  The FLAME source images can NOT be in\nthe same drawer as the BACKGROUND source images.\nPlease make sure you are REALLY ready to launch this script.\nRead the documentation for more info.  Exiting...'
  103.     Exit
  104.     End
  105.  
  106. Call GetFlameNumbers()
  107.  
  108. /* Get Destination pathname for Method 0 or 2 */
  109. If Method ~= 1 Then Do
  110.     Call GetDefaults()
  111.     PathNameDef = DestPathDef
  112.     ReqTitle = 'Enter pathname for FLAMED DESTINATION images.'
  113.     ReqHail = 'Get DESTINATION animation PATH'
  114.     Call PathNameGetter()
  115.     DestPathDef = PathNameDef
  116.     FlameDest = PathName
  117.     Call SaveDefaults()
  118.  
  119.     If FlameDest = BackgroundSource Then Do
  120.         Okay 'FATAL ERROR!  The FLAMED destination images can NOT be in\nthe same drawer as the BACKGROUND source images.\nPlease make sure you are REALLY ready to launch this script.\nRead the documentation for more info.  Exiting...'
  121.         Exit
  122.         End
  123.     End
  124.  
  125. If Method = 1 Then Do
  126.     Call AskOverwrite()
  127.  
  128.     If Overwrite = 0 Then Do
  129.         Call GetDefaults()
  130.         PathNameDef = DestPathDef
  131.         ReqTitle = 'Enter pathname for FLAMED DESTINATION images.'
  132.         ReqHail = 'Get DESTINATION animation PATH'
  133.         Call PathNameGetter()
  134.         DestPathDef = PathNameDef
  135.         FlameDest = PathName
  136.         Call SaveDefaults()
  137.  
  138.         If FlameDest = BackgroundSource Then Do
  139.             Okay 'FATAL ERROR!  The FLAMED destination images can NOT be in\nthe same drawer as the BACKGROUND source images.\nPlease make sure you are REALLY ready to launch this script.\nRead the documentation for more info.  Exiting...'
  140.             Exit
  141.             End
  142.         End
  143.     End
  144.  
  145. If Method = 2 Then Do
  146.     Finder = Exists('Ram:Method2/')
  147.     If Finder = 0 Then Do
  148.         Address COMMAND
  149.         'Makedir ram:Method2'
  150.         End
  151.     BackgroundSource = 'Ram:Method2'
  152.     Address 'OpalPaint_Rexx'
  153.     Save BackgroundSource || '/pic.0001'
  154.     Method = 0
  155.     End
  156.  
  157. /* Here we go!!  I'll take it from here. */
  158. Address 'OpalPaint_Rexx'
  159. Okay 'Here we go.'
  160.  
  161. Call Panic()
  162.  
  163. Do A = StartFrame to EndFrame
  164.  
  165.     /* Get IFF Variables */
  166.     Iff = Root || Zero || Zero || Zero || A
  167.     If A < 10000 & A > 999 Then Iff = Root || A
  168.     If A < 1000 & A > 99 Then Iff = Root || Zero || A
  169.     If A < 100 & A > 9  Then Iff = Root || Zero || Zero || A
  170.  
  171.     /* Search for next FLAME frame and load*/
  172.     DisplayStatus 'Find ' || A
  173.     Finder = Exists(FlameSource || Iff)
  174.     If Finder = 1 Then Do
  175.         Load Flamesource || Iff
  176.         PageSize
  177.         Parse Var Result X2 Y2
  178.  
  179.         /* Set pots */
  180.         SetPot 1 0 0 0
  181.         SetPot 2 255 255 255
  182.         SetPot 3 FlameCol1
  183.         SetPot 4 FlameCol2
  184.         SetPot 5 FlameCol3
  185.         SetPot 6 FlameCol4
  186.         SetPot 7 1 1 1
  187.  
  188.         DisplayStatus 'Initialze'
  189.         Trans 0
  190.         Texture 0
  191.         FillMode SOLID
  192.         SetDrawMode 1
  193.         SmoothPaper
  194.         ActiveNozzle 1
  195.         MaskSten 0
  196.         ColSten 1
  197.  
  198.         /* Check for special brightness code */
  199.         If Method = 0 Then Do
  200.             DisplayStatus 'Code Check'
  201.             MethodCode = 1
  202.             ReadPixel 0 0
  203.             Parse Var Result R G B
  204.             If R > 0 Then MethodCode = 1
  205.             ReadPixel 1 0
  206.             Parse Var Result R G B
  207.             If R > 0 Then MethodCode = 2
  208.             ReadPixel 2 0
  209.             Parse Var Result R G B
  210.             If R > 0 Then MethodCode = 3
  211.             ReadPixel 3 0
  212.             Parse Var Result R G B
  213.             If R > 0 Then MethodCode = 4
  214.             ReadPixel 4 0
  215.             Parse Var Result R G B
  216.             If R > 0 Then MethodCode = 5
  217.             End
  218.  
  219.         /* Cleanup corner */
  220.         ActivePot 1
  221.         'StenEnable DISABLE'
  222.         Line 0 0 5 0
  223.  
  224.         /* Turn on Stencil to fix white to 255 255 255 */
  225.         DisplayStatus 'Fix White'
  226.         SetC