From f6f4b4024a295c5924dbddd0c158c9c0fa2847c1 Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Fri, 21 Sep 2018 11:00:23 -0500 Subject: [PATCH] Placeholder tile for primary layer when requesting out-of-bounds tile --- tileset.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tileset.cpp b/tileset.cpp index 55fa6258..24c2ab3f 100755 --- a/tileset.cpp +++ b/tileset.cpp @@ -40,7 +40,11 @@ QImage Metatile::getMetatileImage(int tile, Tileset *primaryTileset, Tileset *se if (tile_image.isNull()) { // Some metatiles specify tiles that are outside the valid range. // These are treated as completely transparent, so they can be skipped without - // being drawn. + // being drawn unless they're on the bottom layer, in which case we need + // a placeholder. + if (layer == 0) { + metatile_painter.fillRect(x * 8, y * 8, 8, 8, palettes.value(0).value(0)); + } continue; }