From b2f5ee9c0b0cc39a697a98d82e1fd852849082e4 Mon Sep 17 00:00:00 2001 From: patrickvl Date: Sat, 2 Jun 2018 16:49:52 +0200 Subject: [PATCH] Log masks with their actual value --- src/Common/Logging.h | 7 ++++--- src/CxbxKrnl/EmuD3D8Logging.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Common/Logging.h b/src/Common/Logging.h index f0374b447..357793867 100644 --- a/src/Common/Logging.h +++ b/src/Common/Logging.h @@ -342,9 +342,10 @@ extern thread_local std::string _logPrefix; // Macro's for Flags-ToString conversions : #define FLAGS2STR_HEADER(FlagType) LOGRENDER_HEADER_BY_REF(FlagType); -#define FLAGS2STR_START(FlagType) std::string TYPE2PCHAR(FlagType)(const FlagType &value) { std::string res; -#define FLAG2STR(f) if (((uint32)value & f) == f) res = res + #f"|"; -#define FLAGS2STR_END if (!res.empty()) res.pop_back(); return res; } +#define FLAGS2STR_START(FlagType) std::string TYPE2PCHAR(FlagType)(const FlagType &value) { std::stringstream ss; +#define FLAG2STR(f) if (((uint32)value & f) == f) ss << #f << "|"; +#define FLAG2STR_MASK(f) ss << #f"=" << (value & f) << "|"; +#define FLAGS2STR_END std::string res = ss.str(); if (!res.empty()) res.pop_back(); return res; } #define FLAGS2STR_END_and_LOGRENDER(FlagType) FLAGS2STR_END LOGRENDER_TYPE(FlagType) // Macro's for Struct-member rendering : diff --git a/src/CxbxKrnl/EmuD3D8Logging.cpp b/src/CxbxKrnl/EmuD3D8Logging.cpp index 94ff96ee3..cff903d99 100644 --- a/src/CxbxKrnl/EmuD3D8Logging.cpp +++ b/src/CxbxKrnl/EmuD3D8Logging.cpp @@ -504,7 +504,7 @@ FLAGS2STR_END_and_LOGRENDER(D3DTEXOPCAPS) // FVFCaps FLAGS2STR_START(D3DFVFCAPS) - FLAG2STR(D3DFVFCAPS_TEXCOORDCOUNTMASK) + FLAG2STR_MASK(D3DFVFCAPS_TEXCOORDCOUNTMASK) FLAG2STR(D3DFVFCAPS_DONOTSTRIPELEMENTS) FLAG2STR(D3DFVFCAPS_PSIZE) FLAGS2STR_END_and_LOGRENDER(D3DFVFCAPS)