[Scummvm-git-logs] scummvm master -> e9aa47f55ce60bce599b4db35d69261ac8932eba

sev- sev at scummvm.org
Mon Sep 11 08:13:12 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e9aa47f55c GRAPHICS: Compare all fields in a PixelFormat individually instead of using memcmp.


Commit: e9aa47f55ce60bce599b4db35d69261ac8932eba
    https://github.com/scummvm/scummvm/commit/e9aa47f55ce60bce599b4db35d69261ac8932eba
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2017-09-11T08:13:09+02:00

Commit Message:
GRAPHICS: Compare all fields in a PixelFormat individually instead of using memcmp.

Changed paths:
    graphics/pixelformat.h


diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 7b966a8..6b22a14 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 {





More information about the Scummvm-git-logs mailing list