From b5ff6fcc1e572d1a6150ee2af159be68ee2c2a94 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sat, 7 Feb 2009 12:47:15 -0500 Subject: Fixed Event layer rendering glitch --- .../fourpuzzle/gamestate/mapview/MapViewGameState.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/com') diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java index 9c8e9d7..7c4de27 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java @@ -208,12 +208,24 @@ public class MapViewGameState implements GameState { BufferedImage eventLayer = new BufferedImage(currentMap.getSize().width*16, currentMap.getSize().height*16, BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = eventLayer.createGraphics(); + EventList events = currentMap.getEvents(); + + for (LayerEvent event : events) + { + if (event.getLayer() != Layer.Above) + { + event.render(g2); + } + } + Game.getHeroEvent().render(g2); - EventList events = currentMap.getEvents(); for (LayerEvent event : events) { - event.render(g2); + if (event.getLayer() == Layer.Above) + { + event.render(g2); + } } g.drawImage(eventLayer, 0, 0, Game.WIDTH, Game.HEIGHT, x, y, x+Game.WIDTH, y+Game.HEIGHT, null); -- cgit 1.4.1