diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapSection.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapSection.java index fa95a1d6e..3fa84fd2d 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapSection.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapSection.java @@ -7,6 +7,7 @@ public final class MapSection { public final MapLayer layerGround; public final MapLayer layerObjects; public final MapLayer layerAbove; + public final MapLayer layerTop; public final boolean[][] isWalkable; private final byte[] layoutHash; @@ -14,12 +15,14 @@ public final class MapSection { MapLayer layerGround , MapLayer layerObjects , MapLayer layerAbove + , MapLayer layerTop , boolean[][] isWalkable , byte[] layoutHash ) { this.layerGround = layerGround; this.layerObjects = layerObjects; this.layerAbove = layerAbove; + this.layerTop = layerTop; this.isWalkable = isWalkable; this.layoutHash = layoutHash; } @@ -28,6 +31,7 @@ public final class MapSection { replaceTileLayerSection(layerGround, replaceLayersWith.layerGround, replacementArea); replaceTileLayerSection(layerObjects, replaceLayersWith.layerObjects, replacementArea); replaceTileLayerSection(layerAbove, replaceLayersWith.layerAbove, replacementArea); + replaceTileLayerSection(layerTop, replaceLayersWith.layerTop, replacementArea); if (replaceLayersWith.isWalkable != null) { final int dy = replacementArea.topLeft.y; final int height = replacementArea.size.height; diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapTranslator.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapTranslator.java index 6f412aed4..ff5c54064 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapTranslator.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapTranslator.java @@ -243,9 +243,10 @@ public final class TMXMapTranslator { private static final String LAYERNAME_GROUND = "ground"; private static final String LAYERNAME_OBJECTS = "objects"; private static final String LAYERNAME_ABOVE = "above"; + private static final String LAYERNAME_TOP = "top"; private static final String LAYERNAME_WALKABLE = "walkable"; private static final String PROPNAME_FILTER = "colorfilter"; - private static final SetOfLayerNames defaultLayerNames = new SetOfLayerNames(LAYERNAME_GROUND, LAYERNAME_OBJECTS, LAYERNAME_ABOVE, LAYERNAME_WALKABLE); + private static final SetOfLayerNames defaultLayerNames = new SetOfLayerNames(LAYERNAME_GROUND, LAYERNAME_OBJECTS, LAYERNAME_ABOVE, LAYERNAME_TOP, LAYERNAME_WALKABLE); private static LayeredTileMap transformMap(TMXLayerMap map, TileCache tileCache) { final Size mapSize = new Size(map.width, map.height); @@ -290,6 +291,7 @@ public final class TMXMapTranslator { if (prop.name.equalsIgnoreCase(LAYERNAME_GROUND)) layerNames.groundLayerName = prop.value; else if (prop.name.equalsIgnoreCase(LAYERNAME_OBJECTS)) layerNames.objectsLayerName = prop.value; else if (prop.name.equalsIgnoreCase(LAYERNAME_ABOVE)) layerNames.aboveLayersName = prop.value; + else if (prop.name.equalsIgnoreCase(LAYERNAME_TOP)) layerNames.topLayersName = prop.value; else if (prop.name.equalsIgnoreCase(LAYERNAME_WALKABLE)) layerNames.walkableLayersName = prop.value; else if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) { if (!requirementPropertiesNames.contains(prop.name)) @@ -331,9 +333,10 @@ public final class TMXMapTranslator { final MapLayer layerGround = transformMapLayer(layersPerLayerName, layerNames.groundLayerName, srcMap, tileCache, area, usedTileIDs); final MapLayer layerObjects = transformMapLayer(layersPerLayerName, layerNames.objectsLayerName, srcMap, tileCache, area, usedTileIDs); final MapLayer layerAbove = transformMapLayer(layersPerLayerName, layerNames.aboveLayersName, srcMap, tileCache, area, usedTileIDs); + final MapLayer layerTop = transformMapLayer(layersPerLayerName, layerNames.topLayersName, srcMap, tileCache, area, usedTileIDs); boolean[][] isWalkable = transformWalkableMapLayer(findLayer(layersPerLayerName, layerNames.walkableLayersName, srcMap.name), area); byte[] layoutHash = calculateLayoutHash(srcMap, layersPerLayerName, layerNames); - return new MapSection(layerGround, layerObjects, layerAbove, isWalkable, layoutHash); + return new MapSection(layerGround, layerObjects, layerAbove, layerTop, isWalkable, layoutHash); } private static TMXLayer findLayer(HashMap layersPerLayerName, String layerName, String mapName) { @@ -434,17 +437,20 @@ public final class TMXMapTranslator { public String groundLayerName; public String objectsLayerName; public String aboveLayersName; + public String topLayersName; public String walkableLayersName; public SetOfLayerNames() { this.groundLayerName = null; this.objectsLayerName = null; this.aboveLayersName = null; + this.topLayersName = null; this.walkableLayersName = null; } - public SetOfLayerNames(String groundLayerName, String objectsLayerName, String aboveLayersName, String walkableLayersName) { + public SetOfLayerNames(String groundLayerName, String objectsLayerName, String aboveLayersName, String topLayersName, String walkableLayersName) { this.groundLayerName = groundLayerName; this.objectsLayerName = objectsLayerName; this.aboveLayersName = aboveLayersName; + this.topLayersName = topLayersName; this.walkableLayersName = walkableLayersName; } } diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/view/MainView.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/view/MainView.java index 60297f0d2..336714964 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/view/MainView.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/view/MainView.java @@ -482,9 +482,8 @@ public final class MainView extends SurfaceView } private void doDrawRect_Above(Canvas canvas, CoordRect area) { - if (!tryDrawMapBitmap(canvas, area, aboveBitmap)) { - tryDrawMapLayer(canvas, area, currentTileMap.currentLayout.layerAbove); - } + tryDrawMapLayer(canvas, area, currentTileMap.currentLayout.layerAbove); + tryDrawMapLayer(canvas, area, currentTileMap.currentLayout.layerTop); if (model.uiSelections.selectedPosition != null) { if (model.uiSelections.selectedMonster != null) {