mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Codechange: Don't format strings passed to GrfMsg unless the message will be used.
This makes GrfMsg() behave more like Debug().
This commit is contained in:
parent
ba0acb87eb
commit
55acc1b36d
@ -202,7 +202,7 @@ void ResetNewGRFData();
|
||||
void ResetPersistentNewGRFData();
|
||||
|
||||
void GrfMsgI(int severity, const std::string &msg);
|
||||
#define GrfMsg(severity, format_string, ...) GrfMsgI(severity, fmt::format(FMT_STRING(format_string), ## __VA_ARGS__))
|
||||
#define GrfMsg(severity, format_string, ...) do { if ((severity) == 0 || _debug_grf_level >= (severity)) GrfMsgI(severity, fmt::format(FMT_STRING(format_string), ## __VA_ARGS__)); } while (false)
|
||||
|
||||
bool GetGlobalVariable(uint8_t param, uint32_t *value, const GRFFile *grffile);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user