[Patchanim-commit] SF.net SVN: patchanim: [79] trunk/patchanim/src/com/mebigfatguy/patchanim/ io/Pa
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-01-31 06:07:18
|
Revision: 79
http://patchanim.svn.sourceforge.net/patchanim/?rev=79&view=rev
Author: dbrosius
Date: 2008-01-30 22:07:22 -0800 (Wed, 30 Jan 2008)
Log Message:
-----------
fix fencepost export problem when there's only one image
Modified Paths:
--------------
trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java
Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java
===================================================================
--- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-01-31 06:00:42 UTC (rev 78)
+++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-01-31 06:07:22 UTC (rev 79)
@@ -86,29 +86,34 @@
agEncoder.setRepeat((atype != AnimationType.None) ? 0 : -1);
}
- for(int p = 0; p < lastPatch; p++) {
- CombinedPatch startPatch = patches.get(p);
- CombinedPatch endPatch = patches.get(p+1);
- for (int t = 0; t < tweenCount; t++) {
- CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, (double)t / (double)tweenCount);
- PatchGenerator.recalcCombinedImage(tweenPatch, image, oob);
- writeSingleFile(image, imageIndex++, loc, baseName, type);
- }
- }
-
- if (atype == AnimationType.None)
- return;
-
- if (atype == AnimationType.Wave) {
- for (int p = lastPatch; p > 0; p--) {
- CombinedPatch startPatch = patches.get(p-1);
- CombinedPatch endPatch = patches.get(p);
- for (int t = tweenCount - 1; t >= 0; t--) {
+ if (lastPatch == 0) {
+ PatchGenerator.recalcCombinedImage(patches.get(0), image, oob);
+ writeSingleFile(image, imageIndex++, loc, baseName, type);
+ } else {
+ for(int p = 0; p < lastPatch; p++) {
+ CombinedPatch startPatch = patches.get(p);
+ CombinedPatch endPatch = patches.get(p+1);
+ for (int t = 0; t < tweenCount; t++) {
CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, (double)t / (double)tweenCount);
PatchGenerator.recalcCombinedImage(tweenPatch, image, oob);
writeSingleFile(image, imageIndex++, loc, baseName, type);
}
}
+
+ if (atype == AnimationType.None)
+ return;
+
+ if (atype == AnimationType.Wave) {
+ for (int p = lastPatch; p > 0; p--) {
+ 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);
+ PatchGenerator.recalcCombinedImage(tweenPatch, image, oob);
+ writeSingleFile(image, imageIndex++, loc, baseName, type);
+ }
+ }
+ }
}
} finally {
if (type == ExportType.AnimatedGif) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|