home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 61 / af061a.adf / Macros / Mix02.clssa < prev    next >
Text File  |  1993-05-01  |  4KB  |  142 lines

  1. /***********************************************************************
  2.  GADGET: "Multi-HF-Mix" "2" AUTO TYP: "?"
  3.  
  4.  $DAT >>Mix02.clssa<< 01 May 1993 - (C) ProDAD Holger Burkarth
  5.  
  6.  Mix two SSA anims together, in various ways. With some other features.
  7. ************************************************************************/
  8.  
  9. Options Results
  10. Address clariSSA
  11.  
  12.   FailAt 10
  13.   AltFail=RESULT
  14.  
  15.   DO FOREVER
  16.     Anims=""
  17.     GetAnimInfo Source_A
  18.     IF RESULT~='' THEN Anims=Anims||" Source_A "
  19.     GetAnimInfo Source_B
  20.     IF RESULT~='' THEN Anims=Anims||" Source_B "
  21.     GetAnimInfo Source_C
  22.     IF RESULT~='' THEN Anims=Anims||" Source_C "
  23.     GetAnimInfo Source_D
  24.     IF RESULT~='' THEN Anims=Anims||" Source_D "
  25.  
  26.     IF Anims~='' THEN DO
  27.       SelectAnim Anims "TITLE 'Select an Anim for mixing.' REQ"
  28.       IF rc~=0 THEN LEAVE
  29.       Anim1=RESULT
  30.  
  31.       Anim2=""
  32.  
  33.       MSRequester "TITLE '*** Multi-HF-Mix ***''Select preferred processing mode.'",
  34.                   "PTEXT 'Integrate Anim with Other.''Calculate Anim with Other in Usual Way.''Integrate One Anim.''Use Only One Anim.'"
  35.  
  36.       EffMode=RESULT
  37.       IF EffMode < 3 THEN DO
  38.         SelectAnim Anims "TITLE 'Select the second @ anim which is to be mixed.' REQ"
  39.         IF rc~=0 THEN LEAVE
  40.         Anim2=RESULT
  41.       END
  42.  
  43.       NUM=1
  44.       Ver=1; VerStep=1
  45.  
  46.       IF EffMode=1 | EffMode=3 THEN DO
  47.         INTRequest "'Enter the Interval to''''>>Advance Recording By<<'" Ver
  48.         IF rc~=0 THEN LEAVE
  49.         Ver=MIN(30,MAX(1,RESULT))
  50.         INTRequest "'Enter the''Frame Offset.'" VerStep
  51.         IF rc~=0 THEN LEAVE
  52.         VerStep=MIN(30,MAX(1,RESULT))
  53.       END
  54.       ELSE DO
  55.         INTRequest "'Record Each Frame?'" NUM
  56.         IF rc~=0 THEN LEAVE
  57.         NUM=MIN(30,MAX(1,RESULT))
  58.       END
  59.  
  60.       SelectAnim Anim1
  61.       GetArea
  62.       MarkRange1=RESULT
  63.       PARSE VAR RESULT "FROM" Start1 "TO" Last1 Mod1
  64.  
  65.       IF Anim2~="" THEN DO
  66.         SelectAnim Anim2
  67.         GetArea
  68.         MarkRange2=RESULT
  69.         PARSE VAR RESULT "FROM" Start2 "TO" Last2 Mod2
  70.         D2=Last2-Start2
  71.         A2=Start2
  72.       END
  73.  
  74.       D1=Last1-Start1
  75.       Ver=Ver-1
  76.       A1=Start1
  77.  
  78.       IF Anim2~="" THEN DO
  79.         a=0
  80.         M1=0; M2=0
  81.         S=(d1+d2)/VerStep
  82.         IF S>3 THEN DO
  83.           DO FOREVER
  84.             Calc=1/3+a/S
  85.             x=TRUNC(Calc*D1)
  86.             IF M1~=x THEN DO
  87.              M1=x
  88.              IF A1>Last1 THEN LEAVE
  89.              SelectAnim Anim1
  90.              SetArea 'FROM' A1 'TO' A1+Ver
  91.              A1=A1+VerStep
  92.              IF Record(NUM)~=0 THEN LEAVE
  93.             END
  94.             x=TRUNC(Calc*D2)
  95.             IF M2~=x THEN DO
  96.              M2=x
  97.              IF A2>Last2 THEN LEAVE
  98.              SelectAnim Anim2
  99.              SetArea 'FROM' A2 'TO' A2+Ver
  100.              A2=A2+VerStep
  101.              IF Record(NUM)~=0 THEN LEAVE
  102.             END
  103.             IF rc~=0 THEN LEAVE
  104.             a=a+1
  105.           END
  106.           SelectAnim Anim2
  107.           SetArea MarkRange2
  108.         END; ELSE Message '"Selected range!" "too small!!"'
  109.       END
  110.       ELSE DO
  111.         SelectAnim Anim1
  112.         DO UNTIL A1>Last1
  113.            SetArea 'FROM' A1 'TO' A1+Ver
  114.            A1=A1+VerStep
  115.              IF Record(NUM)~=0 THEN LEAVE
  116.         END
  117.       END
  118.       SelectAnim Anim1
  119.       SetArea MarkRange1
  120.       SelectAnim "MASTER"
  121.  
  122.     END; ELSE Message '"No Source Anim available!"'
  123.     LEAVE
  124.   END
  125.   FailAt AltFail
  126. exit
  127.  
  128.  
  129.  
  130. Record: procedure
  131. DO
  132.   ARG NUM
  133.  
  134.     count=0
  135.     DO UNTIL count>=NUM
  136.       count=count+1
  137.       Record 'AREA'
  138.       IF rc~=0 THEN LEAVE
  139.     END
  140.     RETURN(rc)
  141. END
  142.