diff --git a/src/main/java/com/chrisnewland/demofx/effect/effectfactory/ChristmasFXScriptFactory.java b/src/main/java/com/chrisnewland/demofx/effect/effectfactory/ChristmasFXScriptFactory.java index 338c04e..6b25632 100644 --- a/src/main/java/com/chrisnewland/demofx/effect/effectfactory/ChristmasFXScriptFactory.java +++ b/src/main/java/com/chrisnewland/demofx/effect/effectfactory/ChristmasFXScriptFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017 Chris Newland. + * Copyright (c) 2017 Chris Newland. * Licensed under https://github.com/chriswhocodes/demofx/blob/master/LICENSE-BSD */ package com.chrisnewland.demofx.effect.effectfactory; @@ -10,7 +10,7 @@ import com.chrisnewland.demofx.DemoConfig; import com.chrisnewland.demofx.effect.IEffect; import com.chrisnewland.demofx.effect.fade.FadeOutEffect; -import com.chrisnewland.demofx.effect.fake3d.SnowField; +import com.chrisnewland.demofx.effect.fake3d.SnowfieldSprite; import com.chrisnewland.demofx.effect.ray.RayTrace; import com.chrisnewland.demofx.effect.real3d.TexturedCube; import com.chrisnewland.demofx.effect.text.TextWaveSprite; @@ -38,7 +38,7 @@ public List getEffects(DemoConfig config) long length = 48_000; addEffect(0, length, new RayTrace(config)); - addEffect(0, length, new SnowField(config, 8000, snowflake)); + addEffect(0, length, new SnowfieldSprite(config, 8000, snowflake)); addEffect(0, length, new TexturedCube(config, paper, 240, 1, 1, 240, 480, 32, 32)); @@ -60,4 +60,4 @@ private void addEffect(long start, long duration, IEffect effect) System.out.println("Adding " + start + " to " + (start + duration) + " " + effect.getClass().getName()); } -} \ No newline at end of file +} diff --git a/src/main/java/com/chrisnewland/demofx/effect/effectfactory/SimpleEffectFactory.java b/src/main/java/com/chrisnewland/demofx/effect/effectfactory/SimpleEffectFactory.java index 036fc3a..d248168 100755 --- a/src/main/java/com/chrisnewland/demofx/effect/effectfactory/SimpleEffectFactory.java +++ b/src/main/java/com/chrisnewland/demofx/effect/effectfactory/SimpleEffectFactory.java @@ -16,6 +16,7 @@ import com.chrisnewland.demofx.effect.fake3d.Sheet; import com.chrisnewland.demofx.effect.fake3d.Sprite3D; import com.chrisnewland.demofx.effect.fake3d.Starfield; +import com.chrisnewland.demofx.effect.fake3d.SnowfieldSprite; import com.chrisnewland.demofx.effect.fake3d.StarfieldSprite; import com.chrisnewland.demofx.effect.fake3d.Tunnel; import com.chrisnewland.demofx.effect.fractal.ChristmasTrees; @@ -162,6 +163,7 @@ public List getEffects(DemoConfig config) availableEffectNames.add("squares"); availableEffectNames.add("stars"); availableEffectNames.add("starfield"); + availableEffectNames.add("snowfieldsprite"); availableEffectNames.add("starfieldsprite"); availableEffectNames.add("textbounce"); availableEffectNames.add("texcube"); @@ -202,7 +204,7 @@ private IEffect getEffect(String name, DemoConfig config) case "binarybackground": return new BinaryBackground(config); - + case "blur": return new Blur(config); @@ -220,7 +222,7 @@ private IEffect getEffect(String name, DemoConfig config) case "chord": return new Chord(config); - + case "christmastrees": return new ChristmasTrees(config); @@ -271,7 +273,7 @@ private IEffect getEffect(String name, DemoConfig config) case "gc": return new GCVisualiser(config); - + case "glowboard": return new Glowboard(config); @@ -353,6 +355,9 @@ private IEffect getEffect(String name, DemoConfig config) case "sierpinski": return new Sierpinski(config); + case "snowfieldsprite": + return new SnowfieldSprite(config); + case "spin": return new Spin(config); diff --git a/src/main/java/com/chrisnewland/demofx/effect/fake3d/SnowField.java b/src/main/java/com/chrisnewland/demofx/effect/fake3d/SnowfieldSprite.java similarity index 85% rename from src/main/java/com/chrisnewland/demofx/effect/fake3d/SnowField.java rename to src/main/java/com/chrisnewland/demofx/effect/fake3d/SnowfieldSprite.java index d0f1f98..f30b8ce 100644 --- a/src/main/java/com/chrisnewland/demofx/effect/fake3d/SnowField.java +++ b/src/main/java/com/chrisnewland/demofx/effect/fake3d/SnowfieldSprite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016 Chris Newland. + * Copyright (c) 2017 Chris Newland. * Licensed under https://github.com/chriswhocodes/demofx/blob/master/LICENSE-BSD */ package com.chrisnewland.demofx.effect.fake3d; @@ -10,7 +10,7 @@ import javafx.scene.image.Image; -public class SnowField extends AbstractEffect +public class SnowfieldSprite extends AbstractEffect { private double[] starX; private double[] starY; @@ -23,14 +23,11 @@ public class SnowField extends AbstractEffect private double sine = 0; - // private static final double SPEED = 0.01; - // private static final double MAX_DEPTH = 5; - private boolean spin = true; - private Image sprite = ImageUtil.loadImageFromResources("starshine.png"); + private Image sprite = ImageUtil.loadImageFromResources("flake.png"); - public SnowField(DemoConfig config) + public SnowfieldSprite(DemoConfig config) { super(config); @@ -42,7 +39,7 @@ public SnowField(DemoConfig config) init(); } - public SnowField(DemoConfig config, int starCount, Image sprite) + public SnowfieldSprite(DemoConfig config, int starCount, Image sprite) { super(config); @@ -53,7 +50,7 @@ public SnowField(DemoConfig config, int starCount, Image sprite) init(); } - public SnowField(DemoConfig config, int starCount, long startMillis, long stopMillis) + public SnowfieldSprite(DemoConfig config, int starCount, long startMillis, long stopMillis) { super(config); @@ -165,4 +162,4 @@ else if (x > width) gc.drawImage(sprite, x, y, size, size); } } -} \ No newline at end of file +}