mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Improve error message when a tile has too many colors
This commit is contained in:
@@ -741,7 +741,6 @@ struct std::hash<TileData> {
|
|||||||
|
|
||||||
namespace unoptimized {
|
namespace unoptimized {
|
||||||
|
|
||||||
// TODO: this is very redundant with `TileData::TileData`; try merging both?
|
|
||||||
static void outputTileData(Png const &png, DefaultInitVec<AttrmapEntry> const &attrmap,
|
static void outputTileData(Png const &png, DefaultInitVec<AttrmapEntry> const &attrmap,
|
||||||
std::vector<Palette> const &palettes,
|
std::vector<Palette> const &palettes,
|
||||||
DefaultInitVec<size_t> const &mappings) {
|
DefaultInitVec<size_t> const &mappings) {
|
||||||
@@ -1004,9 +1003,9 @@ void process() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: nicer error message
|
|
||||||
if (tileColors.size() > options.maxOpaqueColors()) {
|
if (tileColors.size() > options.maxOpaqueColors()) {
|
||||||
fatal("Too many colors in tile at (%" PRIu32 ", %" PRIu32 ")", tile.x, tile.y);
|
fatal("Tile at (%" PRIu32 ", %" PRIu32 ") has %zu opaque colors, more than %" PRIu8 "!",
|
||||||
|
tile.x, tile.y, tileColors.size(), options.maxOpaqueColors());
|
||||||
}
|
}
|
||||||
|
|
||||||
attrs.protoPaletteID = protoPalettes.size();
|
attrs.protoPaletteID = protoPalettes.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user