Fix two RGBGFX bugs (#1671)

* Fix two RGBGFX bugs

* Fix clang-format idempotence

* Update src/gfx/rgba.cpp

Co-authored-by: Eldred Habert <me@eldred.fr>

---------

Co-authored-by: Eldred Habert <me@eldred.fr>
This commit is contained in:
Rangi
2025-04-24 09:39:14 -04:00
committed by GitHub
parent a72843748f
commit 2a5b9b5f98
19 changed files with 14 additions and 10 deletions

View File

@@ -604,9 +604,9 @@ static std::tuple<DefaultInitVec<size_t>, std::vector<Palette>>
// Convert the palette spec to actual palettes
std::vector<Palette> palettes(options.palSpec.size());
for (auto [spec, pal] : zip(options.palSpec, palettes)) {
for (size_t i = 0; i < options.nbColorsPerPal && (!spec[i] || spec[i]->isOpaque()); ++i) {
for (size_t i = 0; i < options.nbColorsPerPal; ++i) {
// If the spec has a gap, there's no need to copy anything.
if (spec[i]) {
if (spec[i].has_value() && !spec[i]->isTransparent()) {
pal[i] = spec[i]->cgbColor();
}
}