mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-18 03:37:06 +00:00
First color of -c palettes with transparent pixels is transparent $8000, not unspecified $ffff
This commit is contained in:
+12
-2
@@ -365,8 +365,9 @@ static std::pair<std::vector<size_t>, std::vector<Palette>>
|
|||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
std::vector<Palette> palettes(nbPalettes);
|
std::vector<Palette> palettes(nbPalettes);
|
||||||
|
|
||||||
// If the image contains at least one transparent pixel, force transparency in the first slot of
|
// If the image contains at least one transparent pixel, force transparency in the first slot of
|
||||||
// all palettes
|
// all palettes.
|
||||||
if (options.hasTransparentPixels) {
|
if (options.hasTransparentPixels) {
|
||||||
for (Palette &pal : palettes) {
|
for (Palette &pal : palettes) {
|
||||||
pal.colors[0] = Rgba::transparent;
|
pal.colors[0] = Rgba::transparent;
|
||||||
@@ -400,8 +401,17 @@ static std::pair<std::vector<size_t>, std::vector<Palette>>
|
|||||||
|
|
||||||
static std::pair<std::vector<size_t>, std::vector<Palette>>
|
static std::pair<std::vector<size_t>, std::vector<Palette>>
|
||||||
makePalsAsSpecified(std::vector<ColorSet> const &colorSets) {
|
makePalsAsSpecified(std::vector<ColorSet> const &colorSets) {
|
||||||
// Convert the palette spec to actual palettes
|
|
||||||
std::vector<Palette> palettes(options.palSpec.size());
|
std::vector<Palette> palettes(options.palSpec.size());
|
||||||
|
|
||||||
|
// If the image contains at least one transparent pixel, force transparency in the first slot of
|
||||||
|
// all palettes
|
||||||
|
if (options.hasTransparentPixels) {
|
||||||
|
for (Palette &pal : palettes) {
|
||||||
|
pal.colors[0] = Rgba::transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert the palette spec to actual palettes
|
||||||
bool gaveDeprecationWarning = false;
|
bool gaveDeprecationWarning = false;
|
||||||
for (auto [spec, pal] : zip(options.palSpec, palettes)) {
|
for (auto [spec, pal] : zip(options.palSpec, palettes)) {
|
||||||
bool skipFirst = false;
|
bool skipFirst = false;
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user