From e4feeeb6fd2922f1cabda8d4e678046b62426da7 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 27 May 2020 02:24:08 -0700 Subject: [PATCH] Code review feedback --- Src/WICTextureLoader.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Src/WICTextureLoader.cpp b/Src/WICTextureLoader.cpp index 8f3fb15..5641f38 100644 --- a/Src/WICTextureLoader.cpp +++ b/Src/WICTextureLoader.cpp @@ -465,31 +465,28 @@ namespace } else if (SUCCEEDED(metareader->GetMetadataByName(L"/gAMA/ImageGamma", &value)) && value.vt == VT_UI4) { - if (value.uintVal == 45455) - { - sRGB = true; - } + sRGB = (value.uintVal == 45455); } } #if defined(_XBOX_ONE) && defined(_TITLE) else if (memcmp(&containerFormat, &GUID_ContainerFormatJpeg, sizeof(GUID)) == 0) { - if (SUCCEEDED(metareader->GetMetadataByName(L"/app1/ifd/exif/{ushort=40961}", &value)) && value.vt == VT_UI2 && value.uiVal == 1) + if (SUCCEEDED(metareader->GetMetadataByName(L"/app1/ifd/exif/{ushort=40961}", &value)) && value.vt == VT_UI2) { - sRGB = true; + sRGB = (value.uiVal == 1); } } else if (memcmp(&containerFormat, &GUID_ContainerFormatTiff, sizeof(GUID)) == 0) { - if (SUCCEEDED(metareader->GetMetadataByName(L"/ifd/exif/{ushort=40961}", &value)) && value.vt == VT_UI2 && value.uiVal == 1) + if (SUCCEEDED(metareader->GetMetadataByName(L"/ifd/exif/{ushort=40961}", &value)) && value.vt == VT_UI2) { - sRGB = true; + sRGB = (value.uiVal == 1); } } #else - else if (SUCCEEDED(metareader->GetMetadataByName(L"System.Image.ColorSpace", &value)) && value.vt == VT_UI2 && value.uiVal == 1) + else if (SUCCEEDED(metareader->GetMetadataByName(L"System.Image.ColorSpace", &value)) && value.vt == VT_UI2) { - sRGB = true; + sRGB = (value.uiVal == 1); } #endif