[Patchanim-commit] SF.net SVN: patchanim:[253] trunk/patchanim/src/com/mebigfatguy/patchanim/ surfa
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-12-25 18:15:33
|
Revision: 253
http://patchanim.svn.sourceforge.net/patchanim/?rev=253&view=rev
Author: dbrosius
Date: 2008-12-25 18:15:30 +0000 (Thu, 25 Dec 2008)
Log Message:
-----------
push tweenStyle down to tweener
Modified Paths:
--------------
trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java
trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchAnimator.java
Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java
===================================================================
--- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-12-25 18:12:33 UTC (rev 252)
+++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-12-25 18:15:30 UTC (rev 253)
@@ -24,6 +24,7 @@
import java.util.ResourceBundle;
import com.mebigfatguy.patchanim.PatchColor;
+import com.mebigfatguy.patchanim.TweenStyle;
import com.mebigfatguy.patchanim.gui.PatchPanelMediator;
import com.mebigfatguy.patchanim.main.PatchAnimBundle;
@@ -69,7 +70,7 @@
return new CombinedPatch(getPatch(PatchColor.Red).getOrder(), true);
}
}
- public static CombinedPatch tween(CombinedPatch startPatch, CombinedPatch endPatch, double frac) {
+ public static CombinedPatch tween(CombinedPatch startPatch, CombinedPatch endPatch, TweenStyle tweenStyle, double frac) {
CombinedPatch tweenPatch = new CombinedPatch(startPatch.getPatch(PatchColor.Red).getOrder(), false);
{
PatchCoords sRedCoords = startPatch.getPatch(PatchColor.Red);
Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchAnimator.java
===================================================================
--- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchAnimator.java 2008-12-25 18:12:33 UTC (rev 252)
+++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchAnimator.java 2008-12-25 18:15:30 UTC (rev 253)
@@ -26,13 +26,14 @@
import com.mebigfatguy.patchanim.AnimationType;
import com.mebigfatguy.patchanim.OutOfBoundsColor;
import com.mebigfatguy.patchanim.PatchAnimDocument;
+import com.mebigfatguy.patchanim.TweenStyle;
import com.mebigfatguy.patchanim.gui.events.PatchCompletionEvent;
import com.mebigfatguy.patchanim.gui.events.PatchCompletionListener;
public class PatchAnimator {
- private Set<PatchCompletionListener> pcListeners = new HashSet<PatchCompletionListener>();
- private PatchAnimDocument document;
+ private final Set<PatchCompletionListener> pcListeners = new HashSet<PatchCompletionListener>();
+ private final PatchAnimDocument document;
public PatchAnimator(PatchAnimDocument paDocument) {
document = paDocument;
@@ -49,6 +50,7 @@
int tweenCount = document.getTweenCount();
OutOfBoundsColor oob = document.getOutOfBoundsColor();
AnimationType atype = document.getAnimationType();
+ TweenStyle tweenStyle = document.getTweenStyle();
if (lastPatch == 0) {
PatchGenerator.recalcCombinedImage(patches.get(0), image, oob);
@@ -58,7 +60,7 @@
CombinedPatch startPatch = patches.get(p);
CombinedPatch endPatch = patches.get(p+1);
for (int t = 0; t < tweenCount + 1; t++) {
- CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, (double)t / (double)(tweenCount + 1));
+ CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, tweenStyle, (double)t / (double)(tweenCount + 1));
PatchGenerator.recalcCombinedImage(tweenPatch, image, oob);
firePatchCompleted(image);
}
@@ -78,7 +80,7 @@
CombinedPatch startPatch = patches.get(lastPatch);
CombinedPatch endPatch = patches.get(0);
for (int t = 0; t < tweenCount + 1; t++) {
- CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, (double)t / (double)(tweenCount + 1));
+ CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, tweenStyle, (double)t / (double)(tweenCount + 1));
PatchGenerator.recalcCombinedImage(tweenPatch, image, oob);
firePatchCompleted(image);
}
@@ -90,7 +92,7 @@
CombinedPatch startPatch = patches.get(p-1);
CombinedPatch endPatch = patches.get(p);
for (int t = tweenCount + 1; t > 0; t--) {
- CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, (double)t / (double)(tweenCount + 1));
+ CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, tweenStyle, (double)t / (double)(tweenCount + 1));
PatchGenerator.recalcCombinedImage(tweenPatch, image, oob);
firePatchCompleted(image);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|