summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-01-28 16:49:17 -0500
committerStarla Insigna <hatkirby@fourisland.com>2009-01-28 16:49:17 -0500
commit58c3529f14de0e5142e0ba0927d3c7aa9288c799 (patch)
treee53917974a0289df26afa9310cc8d1af4f03d0a1 /src
parentf5884d91e90e858b2672ef416071941fea786923 (diff)
downloadfourpuzzle-58c3529f14de0e5142e0ba0927d3c7aa9288c799.tar.gz
fourpuzzle-58c3529f14de0e5142e0ba0927d3c7aa9288c799.tar.bz2
fourpuzzle-58c3529f14de0e5142e0ba0927d3c7aa9288c799.zip
Fixed LayerEvent rendering condition bug
Replaced said condition with an instanceof check to see if toDraw.getGraphic() is an instance of BlankEventGraphic. The previous way requires BlankEventGraphic() to be instantated many times for no reason, thus wasting resources and causing other problems.
Diffstat (limited to 'src')
-rw-r--r--src/com/fourisland/fourpuzzle/gamestate/mapview/event/LayerEvent.java8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/LayerEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/LayerEvent.java index c88c42b..b31705d 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/LayerEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/LayerEvent.java
@@ -78,13 +78,7 @@ public class LayerEvent extends AbstractEvent implements Event {
78 public void render(Graphics g) 78 public void render(Graphics g)
79 { 79 {
80 PossibleEvent toDraw = getPossibleEvent(); 80 PossibleEvent toDraw = getPossibleEvent();
81 81 if (!(toDraw.getGraphic() instanceof BlankEventGraphic))
82 /* TODO Replace below condition with an instanceof check to
83 * see if toDraw.getGraphic() is an instance of BlankEventGraphic.
84 * The current way requires BlankEventGraphic() to be instantated
85 * many times for no reason. */
86
87 if (!toDraw.getGraphic().equals(new BlankEventGraphic()))
88 { 82 {
89 g.drawImage(toDraw.getImage(), getRenderX(), getRenderY(), null); 83 g.drawImage(toDraw.getImage(), getRenderX(), getRenderY(), null);
90 } 84 }