mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Compute height and width directly in tile units
Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
This commit is contained in:
@@ -774,9 +774,9 @@ static void outputTileData(Png const &png, DefaultInitVec<AttrmapEntry> const &a
|
|||||||
fatal("Failed to open \"%s\": %s", output.c_str(options.output), strerror(errno));
|
fatal("Failed to open \"%s\": %s", output.c_str(options.output), strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t width = options.inputSlice.width ? options.inputSlice.width * 8 : png.getWidth();
|
uint16_t widthTiles = options.inputSlice.width ? options.inputSlice.width : png.getWidth() / 8;
|
||||||
uint16_t height = options.inputSlice.height ? options.inputSlice.height * 8 : png.getHeight();
|
uint16_t heightTiles = options.inputSlice.height ? options.inputSlice.height : png.getHeight() / 8;
|
||||||
uint64_t remainingTiles = (width / 8) * (height / 8);
|
uint64_t remainingTiles = widthTiles * heightTiles;
|
||||||
if (remainingTiles <= options.trim) {
|
if (remainingTiles <= options.trim) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user