[UI/Windows] Object out of scope optimization for better codegeneration (lower level scope)

This commit is contained in:
Herman Semenov
2023-12-20 12:35:02 +03:00
parent ca94de8d4b
commit 95f535dab0
19 changed files with 59 additions and 69 deletions
+2 -2
View File
@@ -163,15 +163,15 @@ UI::EventReturn DisplayLayoutScreen::OnPostProcShaderChange(UI::EventParams &e)
}
static std::string PostShaderTranslateName(const char *value) {
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
auto ps = GetI18NCategory(I18NCat::POSTSHADERS);
if (!strcmp(value, "Off")) {
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
// Off is a legacy fake item (gonna migrate off it later).
return gr->T("Add postprocessing shader");
}
const ShaderInfo *info = GetPostShaderInfo(value);
if (info) {
auto ps = GetI18NCategory(I18NCat::POSTSHADERS);
return ps->T(value, info ? info->name.c_str() : value);
} else {
return value;