mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Don't format strings passed to GrfMsg unless the message will be used.
This makes GrfMsg() behave more like Debug().pull/12857/head
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