mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
@@ -37,6 +37,7 @@ struct Rgba {
|
|||||||
auto shl = [](uint8_t val, unsigned shift) { return static_cast<uint32_t>(val) << shift; };
|
auto shl = [](uint8_t val, unsigned shift) { return static_cast<uint32_t>(val) << shift; };
|
||||||
return shl(red, 24) | shl(green, 16) | shl(blue, 8) | shl(alpha, 0);
|
return shl(red, 24) | shl(green, 16) | shl(blue, 8) | shl(alpha, 0);
|
||||||
}
|
}
|
||||||
|
friend bool operator==(Rgba const &lhs, Rgba const &rhs) { return lhs.toCSS() == rhs.toCSS(); }
|
||||||
friend bool operator!=(Rgba const &lhs, Rgba const &rhs) { return lhs.toCSS() != rhs.toCSS(); }
|
friend bool operator!=(Rgba const &lhs, Rgba const &rhs) { return lhs.toCSS() != rhs.toCSS(); }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -140,7 +140,8 @@ void reverse() {
|
|||||||
|
|
||||||
std::vector<std::array<Rgba, 4>> palettes{
|
std::vector<std::array<Rgba, 4>> palettes{
|
||||||
{Rgba(0xFFFFFFFF), Rgba(0xAAAAAAFF), Rgba(0x555555FF), Rgba(0x000000FF)}
|
{Rgba(0xFFFFFFFF), Rgba(0xAAAAAAFF), Rgba(0x555555FF), Rgba(0x000000FF)}
|
||||||
};
|
};
|
||||||
|
// If a palette file is used as input, it overrides the default colours.
|
||||||
if (options.palettes.has_value()) {
|
if (options.palettes.has_value()) {
|
||||||
File file;
|
File file;
|
||||||
if (!file.open(*options.palettes, std::ios::in | std::ios::binary)) {
|
if (!file.open(*options.palettes, std::ios::in | std::ios::binary)) {
|
||||||
@@ -171,6 +172,14 @@ void reverse() {
|
|||||||
warning("Read %zu palettes, more than the specified limit of %zu", palettes.size(),
|
warning("Read %zu palettes, more than the specified limit of %zu", palettes.size(),
|
||||||
options.nbPalettes);
|
options.nbPalettes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.palSpecType == Options::EXPLICIT && palettes != options.palSpec) {
|
||||||
|
warning("Colors in the palette file do not match those specified with `-c`!");
|
||||||
|
}
|
||||||
|
} else if (options.palSpecType == Options::EMBEDDED) {
|
||||||
|
warning("An embedded palette was requested, but no palette file was specified; ignoring request.");
|
||||||
|
} else if (options.palSpecType == Options::EXPLICIT) {
|
||||||
|
palettes = std::move(options.palSpec); // We won't be using it again.
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<DefaultInitVec<uint8_t>> attrmap;
|
std::optional<DefaultInitVec<uint8_t>> attrmap;
|
||||||
|
|||||||
Reference in New Issue
Block a user