Skip to content

Commit 8b0591c

Browse files
authored
fix tilemap debug draw on renderBlit (#3509)
1 parent dbb8dd1 commit 8b0591c

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

flixel/tile/FlxTilemap.hx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,7 @@ class FlxTypedTilemap<Tile:FlxTile> extends FlxBaseTilemap<Tile>
511511
if (tileBitmap == null)
512512
tileBitmap = makeDebugTile(color);
513513
else
514-
{
515-
tileBitmap.fillRect(tileBitmap.rect, FlxColor.TRANSPARENT);
516514
drawDebugTile(tileBitmap, color);
517-
}
518515

519516
setDirty();
520517
return tileBitmap;
@@ -1360,18 +1357,15 @@ class FlxTypedTilemap<Tile:FlxTile> extends FlxBaseTilemap<Tile>
13601357

13611358
function drawDebugTile(debugTile:BitmapData, color:FlxColor):Void
13621359
{
1363-
if (color != FlxColor.TRANSPARENT)
1360+
if (color == FlxColor.TRANSPARENT)
1361+
{
1362+
debugTile.fillRect(debugTile.rect, FlxColor.TRANSPARENT);
1363+
}
1364+
else
13641365
{
1365-
var gfx:Graphics = FlxSpriteUtil.flashGfx;
1366-
gfx.clear();
1367-
gfx.moveTo(0, 0);
1368-
gfx.lineStyle(1, color, 0.5);
1369-
gfx.lineTo(tileWidth - 1, 0);
1370-
gfx.lineTo(tileWidth - 1, tileHeight - 1);
1371-
gfx.lineTo(0, tileHeight - 1);
1372-
gfx.lineTo(0, 0);
1373-
1374-
debugTile.draw(FlxSpriteUtil.flashGfxSprite);
1366+
// 0.5 alpha
1367+
debugTile.fillRect(debugTile.rect, (0x80 << 24) | color.rgb);
1368+
debugTile.fillRect(new Rectangle(1, 1, tileWidth - 2, tileHeight - 2), 0x0);
13751369
}
13761370
}
13771371

0 commit comments

Comments
 (0)