ref: 832e0ec972c2890bc08f36d546a17d187a348e40
parent: caaf7a8444a1bb8f5045b8874a2d0ddd0b1cc665
author: ISSOtm <eldredhabert0@gmail.com>
date: Fri May 20 16:13:46 EDT 2022
Report position in color errors
--- a/src/gfx/process.cpp
+++ b/src/gfx/process.cpp
@@ -333,9 +333,9 @@
uint32_t css = color.toCSS();
if (std::find(indeterminates.begin(), indeterminates.end(), css)
== indeterminates.end()) {
- error(
- "Color #%08x is neither transparent (alpha < %u) nor opaque (alpha >= %u)",
- css, Rgba::transparency_threshold, Rgba::opacity_threshold);
+ error("Color #%08x is neither transparent (alpha < %u) nor opaque (alpha >= "
+ "%u) [first seen at x: %" PRIu32 ", y: %" PRIu32 "]",
+ css, Rgba::transparency_threshold, Rgba::opacity_threshold, x, y);
indeterminates.push_back(css);
}
} else if (Rgba const *other = colors.registerColor(color); other) {
@@ -342,9 +342,10 @@
std::tuple conflicting{color.toCSS(), other->toCSS()};
// Do not report combinations twice
if (std::find(conflicts.begin(), conflicts.end(), conflicting) == conflicts.end()) {
- warning("Fusing colors #%08x and #%08x into Game Boy color $%04x",
- std::get<0>(conflicting), std::get<1>(conflicting),
- color.cgbColor()); // TODO: indicate position
+ warning("Fusing colors #%08x and #%08x into Game Boy color $%04x [first seen "
+ "at x: %" PRIu32 ", y: %" PRIu32 "]",
+ std::get<0>(conflicting), std::get<1>(conflicting), color.cgbColor(), x,
+ y);
// Do not report this combination again
conflicts.emplace_back(conflicting);
}