Merge pull request #1245 from PatrickvL/log_mask

Log masks with their actual value
This commit is contained in:
Luke Usher 2018-06-02 18:39:44 +01:00 committed by GitHub
commit de7d2929b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -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 :

View File

@ -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)