diff options
Diffstat (limited to 'engines/cine/pal.cpp')
-rw-r--r-- | engines/cine/pal.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp index 94c0f59dc0..3341da39c5 100644 --- a/engines/cine/pal.cpp +++ b/engines/cine/pal.cpp @@ -208,6 +208,10 @@ Palette &Palette::rotateRight(byte firstIndex, byte lastIndex) { return *this; } +bool Palette::empty() const { + return _colors.empty(); +} + uint Palette::colorCount() const { return _colors.size(); } @@ -222,6 +226,13 @@ Palette &Palette::fillWithBlack() { return *this; } +// TODO: Add better heuristic for checking whether the color format is valid +bool Palette::isValid() const { + // Check that the color format has been actually set and not just default constructed. + // Also check that the alpha channel is discarded. + return _format != Graphics::PixelFormat() && _format.aLoss == 8; +} + Graphics::PixelFormat Palette::colorFormat() const { return _format; } |