From 41b10e4d40f713024874faf90b6a6d9cbe635dce Mon Sep 17 00:00:00 2001 From: mjn-mixael Date: Fri, 22 Sep 2023 23:44:15 -0500 Subject: [PATCH 1/2] xstr debug filter --- code/localization/localize.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/localization/localize.cpp b/code/localization/localize.cpp index 2e1402f4223..4b6ba1ca9aa 100644 --- a/code/localization/localize.cpp +++ b/code/localization/localize.cpp @@ -1187,6 +1187,8 @@ const char *XSTR(const char *str, int index, bool force_lookup) return str; } + nprintf(("XSTR", "Localizing String: %i, \"%s\"\n", index, str)); + // for some internal strings, such as the ones we loaded using $Has XStr:, // we want to force a lookup even if we're normally untranslated if (Lcl_current_lang != LCL_UNTRANSLATED || force_lookup) From 1dc701270f8a5420e59d065e978564c81deaf261 Mon Sep 17 00:00:00 2001 From: mjn-mixael Date: Sat, 23 Sep 2023 18:35:36 -0500 Subject: [PATCH 2/2] optimize this entirely out of release builds --- code/localization/localize.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/localization/localize.cpp b/code/localization/localize.cpp index 4b6ba1ca9aa..c4c5c00bc2e 100644 --- a/code/localization/localize.cpp +++ b/code/localization/localize.cpp @@ -1187,7 +1187,9 @@ const char *XSTR(const char *str, int index, bool force_lookup) return str; } +#ifndef NDEBUG nprintf(("XSTR", "Localizing String: %i, \"%s\"\n", index, str)); +#endif // for some internal strings, such as the ones we loaded using $Has XStr:, // we want to force a lookup even if we're normally untranslated