aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx/gfx_system.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/gfx/gfx_system.h')
-rw-r--r--engines/sci/gfx/gfx_system.h42
1 files changed, 32 insertions, 10 deletions
diff --git a/engines/sci/gfx/gfx_system.h b/engines/sci/gfx/gfx_system.h
index 35f5dbed27..0e474c8985 100644
--- a/engines/sci/gfx/gfx_system.h
+++ b/engines/sci/gfx/gfx_system.h
@@ -66,16 +66,6 @@ struct gfx_mode_t {
};
-
-/** Full color */
-struct gfx_color_t {
- PaletteEntry visual;
- uint8 alpha; /**< transparency = (1-opacity) */
- int8 priority, control;
- byte mask; /**< see mask values below */
-};
-
-
// TODO: Replace rect_t by Common::Rect
/** Rectangle description */
struct rect_t {
@@ -259,6 +249,38 @@ enum gfx_rectangle_fill_t {
/** @} */
+/** Full color */
+struct gfx_color_t {
+ PaletteEntry visual;
+ uint8 alpha; /**< transparency = (1-opacity) */
+ int8 priority, control;
+ byte mask; /**< see mask values below */
+
+ bool operator==(const gfx_color_t &c) const {
+ if (mask != c.mask)
+ return false;
+
+ if (mask & GFX_MASK_VISUAL) {
+ if (visual.r != c.visual.r || visual.g != c.visual.g || visual.b != c.visual.b || alpha != c.alpha)
+ return false;
+ }
+
+ if (mask & GFX_MASK_PRIORITY)
+ if (priority != c.priority)
+ return false;
+
+ if (mask & GFX_MASK_CONTROL)
+ if (control != c.control)
+ return false;
+
+ return true;
+ }
+
+ bool operator!=(const gfx_color_t &c) const {
+ return !(*this == c);
+ }
+};
+
} // End of namespace Sci
#endif // SCI_GFX_GFX_SYSTEM