diff options
author | Cameron Cawley | 2017-09-05 20:57:26 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-09-11 08:13:09 +0200 |
commit | e9aa47f55ce60bce599b4db35d69261ac8932eba (patch) | |
tree | 54ea5dca09915d1f62e9e93a7bcf4340e8168f41 /graphics | |
parent | 6558578f5423b3e1f072a4a06e12a51f48e91102 (diff) | |
download | scummvm-rg350-e9aa47f55ce60bce599b4db35d69261ac8932eba.tar.gz scummvm-rg350-e9aa47f55ce60bce599b4db35d69261ac8932eba.tar.bz2 scummvm-rg350-e9aa47f55ce60bce599b4db35d69261ac8932eba.zip |
GRAPHICS: Compare all fields in a PixelFormat individually instead of using memcmp.
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/pixelformat.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h index 7b966a8a15..6b22a14142 100644 --- a/graphics/pixelformat.h +++ b/graphics/pixelformat.h @@ -159,7 +159,15 @@ struct PixelFormat { inline bool operator==(const PixelFormat &fmt) const { // TODO: If aLoss==8, then the value of aShift is irrelevant, and should be ignored. - return 0 == memcmp(this, &fmt, sizeof(PixelFormat)); + return bytesPerPixel == fmt.bytesPerPixel && + rLoss == fmt.rLoss && + gLoss == fmt.gLoss && + bLoss == fmt.bLoss && + aLoss == fmt.aLoss && + rShift == fmt.rShift && + gShift == fmt.gShift && + bShift == fmt.bShift && + aShift == fmt.aShift; } inline bool operator!=(const PixelFormat &fmt) const { |