From a3f9952b9ea022bf5673a4bc24a64873789fd40d Mon Sep 17 00:00:00 2001 From: Sylvie <35663410+Rangi42@users.noreply.github.com> Date: Thu, 8 Aug 2024 13:50:51 -0400 Subject: [PATCH] Advise on how to use `-x` to make `-r` work (#1459) --- src/gfx/reverse.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gfx/reverse.cpp b/src/gfx/reverse.cpp index df525b05..a622ba4c 100644 --- a/src/gfx/reverse.cpp +++ b/src/gfx/reverse.cpp @@ -172,6 +172,15 @@ void reverse() { options.verbosePrint(Options::VERB_INTERM, "Picked reversing width of %zu tiles\n", width); } if (mapSize % width != 0) { + if (options.trim == 0 && !tilemap) { + fatal( + "Total number of tiles (%zu) cannot be divided by image width (%zu tiles)\n" + "(To proceed anyway with this image width, try passing `-x %zu`)", + mapSize, + width, + width - mapSize % width + ); + } fatal( "Total number of tiles (%zu) cannot be divided by image width (%zu tiles)", mapSize,