From fb891e4c081d5f0678cdda3855daa82728dc0ac0 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Thu, 14 Jan 2016 10:50:41 -0600 Subject: SCI: Implement SCI32 kPalVary and kPalette setFade This also fixes kPalCycle signatures to be more accurate. --- engines/sci/graphics/helpers.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'engines/sci/graphics/helpers.h') diff --git a/engines/sci/graphics/helpers.h b/engines/sci/graphics/helpers.h index 4889f12bd2..e5b9f2aaed 100644 --- a/engines/sci/graphics/helpers.h +++ b/engines/sci/graphics/helpers.h @@ -121,6 +121,15 @@ struct Window : public Port, public Common::Serializable { struct Color { byte used; byte r, g, b; + +#ifdef ENABLE_SCI32 + bool operator==(const Color &other) const { + return used == other.used && r == other.r && g == other.g && b == other.b; + } + inline bool operator!=(const Color &other) const { + return !(*this == other); + } +#endif }; struct Palette { @@ -128,6 +137,21 @@ struct Palette { uint32 timestamp; Color colors[256]; byte intensity[256]; + +#ifdef ENABLE_SCI32 + bool operator==(const Palette &other) const { + for (int i = 0; i < ARRAYSIZE(colors); ++i) { + if (colors[i] != other.colors[i]) { + return false; + } + } + + return false; + } + inline bool operator!=(const Palette &other) const { + return !(*this == other); + } +#endif }; struct PalSchedule { -- cgit v1.2.3