mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Report position in color errors
This commit is contained in:
@@ -333,18 +333,19 @@ public:
|
|||||||
uint32_t css = color.toCSS();
|
uint32_t css = color.toCSS();
|
||||||
if (std::find(indeterminates.begin(), indeterminates.end(), css)
|
if (std::find(indeterminates.begin(), indeterminates.end(), css)
|
||||||
== indeterminates.end()) {
|
== indeterminates.end()) {
|
||||||
error(
|
error("Color #%08x is neither transparent (alpha < %u) nor opaque (alpha >= "
|
||||||
"Color #%08x is neither transparent (alpha < %u) nor opaque (alpha >= %u)",
|
"%u) [first seen at x: %" PRIu32 ", y: %" PRIu32 "]",
|
||||||
css, Rgba::transparency_threshold, Rgba::opacity_threshold);
|
css, Rgba::transparency_threshold, Rgba::opacity_threshold, x, y);
|
||||||
indeterminates.push_back(css);
|
indeterminates.push_back(css);
|
||||||
}
|
}
|
||||||
} else if (Rgba const *other = colors.registerColor(color); other) {
|
} else if (Rgba const *other = colors.registerColor(color); other) {
|
||||||
std::tuple conflicting{color.toCSS(), other->toCSS()};
|
std::tuple conflicting{color.toCSS(), other->toCSS()};
|
||||||
// Do not report combinations twice
|
// Do not report combinations twice
|
||||||
if (std::find(conflicts.begin(), conflicts.end(), conflicting) == conflicts.end()) {
|
if (std::find(conflicts.begin(), conflicts.end(), conflicting) == conflicts.end()) {
|
||||||
warning("Fusing colors #%08x and #%08x into Game Boy color $%04x",
|
warning("Fusing colors #%08x and #%08x into Game Boy color $%04x [first seen "
|
||||||
std::get<0>(conflicting), std::get<1>(conflicting),
|
"at x: %" PRIu32 ", y: %" PRIu32 "]",
|
||||||
color.cgbColor()); // TODO: indicate position
|
std::get<0>(conflicting), std::get<1>(conflicting), color.cgbColor(), x,
|
||||||
|
y);
|
||||||
// Do not report this combination again
|
// Do not report this combination again
|
||||||
conflicts.emplace_back(conflicting);
|
conflicts.emplace_back(conflicting);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user