Browse Source

Added color comparison

Eiyeron Fulmincendii 9 years ago
parent
commit
0a3435694d
2 changed files with 7 additions and 0 deletions
  1. 5 0
      src/render/Pixel.cpp
  2. 2 0
      src/render/Pixel.h

+ 5 - 0
src/render/Pixel.cpp

@@ -26,6 +26,11 @@ PIXEL &PIXEL::operator=(unsigned value)
     return *this;
     return *this;
 }
 }
 
 
+bool PIXEL::operator==(const PIXEL& col)
+{
+	return value == col.value;
+}
+
 #define CONST_COLOR(color, r, g, b) \
 #define CONST_COLOR(color, r, g, b) \
     const WalrusRPG::Graphics::Pixel WalrusRPG::Graphics::color(r, g, b)
     const WalrusRPG::Graphics::Pixel WalrusRPG::Graphics::color(r, g, b)
 CONST_COLOR(Black, 0, 0, 0);
 CONST_COLOR(Black, 0, 0, 0);

+ 2 - 0
src/render/Pixel.h

@@ -36,6 +36,8 @@ namespace WalrusRPG
             operator std::uint16_t() const;
             operator std::uint16_t() const;
 
 
             Pixel &operator=(unsigned value);
             Pixel &operator=(unsigned value);
+           
+            bool operator==(const Pixel&col);
         };
         };
 
 
         extern const Pixel Black;
         extern const Pixel Black;