mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-20 20:57:06 +00:00
Only sort generated palette colors by PLTE order for indexed PNG images
Non-indexed images can still have a PLTE chunk. We should use `sortRgb` instead of `sortIndexed` for them, since their pixels' colors may not all be present in the PLTE chunk and would be unsortable.
This commit is contained in:
@@ -14,6 +14,7 @@ struct Png {
|
||||
uint32_t height = 0;
|
||||
std::vector<Rgba> pixels{};
|
||||
std::vector<Rgba> palette{};
|
||||
bool isIndexed = false;
|
||||
|
||||
Png() {}
|
||||
Png(char const *filename, std::streambuf &file);
|
||||
|
||||
Reference in New Issue
Block a user