From bdf2553c305d3f452a9f8a0b14d877ffc5fb6c8a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 12 Dec 2016 15:34:13 -0500 Subject: [PATCH] v0.5.0: more improvements to tile maps adjusted which tiles are rendered fixed bugs involving secret doors --- .../tiles/DungeonTerrainTilemap.java | 10 +++++++--- .../tiles/DungeonTileSheet.java | 12 ++++++------ .../tiles/DungeonWallsTilemap.java | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTerrainTilemap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTerrainTilemap.java index 4b82ebc60..5ba0f89d0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTerrainTilemap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTerrainTilemap.java @@ -38,7 +38,7 @@ public class DungeonTerrainTilemap extends DungeonTilemap { if (!flat) { if ((DungeonTileSheet.doorTiles.contains(tile))) { return DungeonTileSheet.getRaisedDoorTile(tile, map[pos - mapWidth]); - } else if (tile == Terrain.WALL || tile == Terrain.WALL_DECO){ + } else if (tile == Terrain.WALL || tile == Terrain.WALL_DECO || tile == Terrain.SECRET_DOOR){ return DungeonTileSheet.getRaisedWallTile( tile, pos, @@ -65,7 +65,11 @@ public class DungeonTerrainTilemap extends DungeonTilemap { @Override protected boolean needsRender(int pos) { - return (Level.discoverable[pos] || data[pos] == DungeonTileSheet.CHASM) - && data[pos] != DungeonTileSheet.WATER; + return data[pos] != DungeonTileSheet.WATER || + ( + pos + mapWidth < size && + DungeonTileSheet.wallStitcheable.contains(map[pos]) && + DungeonTileSheet.wallStitcheable.contains(map[pos + mapWidth]) + ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTileSheet.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTileSheet.java index 29445ecc8..4bb2d4aeb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTileSheet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTileSheet.java @@ -193,15 +193,15 @@ public class DungeonTileSheet { public static int getRaisedWallTile(int tile, int pos, int right, int below, int left){ int result; - if (doorTiles.contains(below)) result = RAISED_WALL_DOOR; - else if (tile == Terrain.WALL) result = RAISED_WALL; - else if (tile == Terrain.WALL_DECO) result = RAISED_WALL_DECO; - else return -1; + if (doorTiles.contains(below)) result = RAISED_WALL_DOOR; + else if (tile == Terrain.WALL || tile == Terrain.SECRET_DOOR) result = RAISED_WALL; + else if (tile == Terrain.WALL_DECO) result = RAISED_WALL_DECO; + else return -1; result = getVisualWithAlts(result, pos); - if (!wallStitcheable.contains(right)) result += 1; - if (!wallStitcheable.contains(left)) result += 2; + if (!wallStitcheable.contains(right)) result += 1; + if (!wallStitcheable.contains(left)) result += 2; return result; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonWallsTilemap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonWallsTilemap.java index 24c5c6d52..39bd512c9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonWallsTilemap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonWallsTilemap.java @@ -92,6 +92,6 @@ public class DungeonWallsTilemap extends DungeonTilemap { @Override protected boolean needsRender(int pos) { - return data[pos] != -1 && Level.discoverable[pos]; + return data[pos] != -1; } }