home *** CD-ROM | disk | FTP | other *** search
- import java.awt.image.MemoryImageSource;
-
- public class UnrollTransition extends BannerTransition {
- static int[] fillPixels = new int[]{-1, -16777216, -16777216, -1};
- int[] unrollAmount;
- int location;
-
- public UnrollTransition() {
- super.numOfFrames = 9;
- }
-
- public void finishInit() {
- float var1 = (float)super.imageHeight / (float)(super.numOfFrames + 1) / ((float)(super.numOfFrames + 2) / 2.0F);
- int var2 = 0;
- this.unrollAmount = new int[super.numOfFrames + 1];
-
- for(int var3 = 0; var3 <= super.numOfFrames; ++var3) {
- this.unrollAmount[var3] = (int)(var1 * (float)(super.numOfFrames - var3 + 1));
- var2 += this.unrollAmount[var3];
- }
-
- if (var2 < 0) {
- int var10002 = this.unrollAmount[0]--;
- }
-
- super.delay = 220;
- this.location = super.pixelsPerImage;
- System.arraycopy(super.owner.banners[super.owner.currentBanner].imagePixels, 0, super.workPixels, 0, super.pixelsPerImage);
-
- for(int var4 = 0; var4 < super.numOfFrames; ++var4) {
- this.location -= this.unrollAmount[var4] * super.imageWidth;
-
- try {
- Thread.sleep(150L);
- } catch (InterruptedException var6) {
- }
-
- this.Unroll(var4);
-
- try {
- Thread.sleep(100L);
- } catch (InterruptedException var5) {
- }
-
- super.frames[var4] = super.owner.createImage(new MemoryImageSource(super.imageWidth, super.imageHeight, super.workPixels, 0, super.imageWidth));
- super.owner.prepareImage(super.frames[var4], super.owner);
- System.arraycopy(super.owner.banners[super.owner.nextBanner].imagePixels, this.location, super.workPixels, this.location, this.unrollAmount[var4] * super.imageWidth);
- }
-
- super.workPixels = null;
- }
-
- void Unroll(int var1) {
- int var2 = super.imageWidth;
- int[] var3 = new int[this.unrollAmount[var1]];
-
- for(int var4 = 0; var4 < this.unrollAmount[var1]; ++var4) {
- var3[var4] = 4;
- }
-
- var3[0] = 2;
- if (this.unrollAmount[var1] > 1) {
- var3[1] = 3;
- }
-
- if (this.unrollAmount[var1] > 2) {
- var3[this.unrollAmount[var1] - 1] = 2;
- }
-
- if (this.unrollAmount[var1] > 3) {
- var3[this.unrollAmount[var1] - 2] = 3;
- }
-
- int var5 = 0;
-
- for(int var6 = this.location; var6 < this.location + this.unrollAmount[var1] * super.imageWidth; var6 += super.imageWidth) {
- try {
- System.arraycopy(super.owner.banners[super.owner.nextBanner].imagePixels, var6 - var2 + var3[var5], super.workPixels, var6, super.imageWidth - var3[var5]);
- System.arraycopy(fillPixels, 0, super.workPixels, var6 + super.imageWidth - var3[var5], var3[var5]);
- ++var5;
- var2 += super.imageWidth + super.imageWidth;
- } catch (ArrayIndexOutOfBoundsException var8) {
- break;
- }
- }
-
- for(int var7 = this.location + super.imageWidth - 1; var7 > this.location; --var7) {
- int[] var10000 = super.workPixels;
- var10000[var7] |= -5592406;
- var10000 = super.workPixels;
- int var10001 = var7 + this.unrollAmount[var1];
- var10000[var10001] &= -11184811;
- }
-
- }
- }
-