From 9956242b4eee89cbf1c2a0109ba4fe03acd4c319 Mon Sep 17 00:00:00 2001 From: Jupeyy Date: Tue, 8 Jun 2021 01:06:07 +0200 Subject: [PATCH] Remove cl_load_country_flags --- src/engine/shared/config_variables.h | 1 - src/game/client/components/countryflags.cpp | 30 ++++++--------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index 47ef04342..1a218d778 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -22,7 +22,6 @@ MACRO_CONFIG_INT(ClRefreshRateInactive, cl_refresh_rate_inactive, 120, 0, 10000, MACRO_CONFIG_INT(ClEditor, cl_editor, 0, 0, 1, CFGFLAG_CLIENT, "") MACRO_CONFIG_INT(ClEditorUndo, cl_editorundo, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Undo function in editor") MACRO_CONFIG_INT(ClEditorDilate, cl_editor_dilate, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Automatically dilates embedded images") -MACRO_CONFIG_INT(ClLoadCountryFlags, cl_load_country_flags, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Load and show country flags") MACRO_CONFIG_STR(ClSkinFilterString, cl_skin_filter_string, 25, "", CFGFLAG_SAVE | CFGFLAG_CLIENT, "Skin filtering string") MACRO_CONFIG_INT(ClAutoDemoRecord, cl_auto_demo_record, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Automatically record demos") diff --git a/src/game/client/components/countryflags.cpp b/src/game/client/components/countryflags.cpp index e1717e863..d601d9c7c 100644 --- a/src/game/client/components/countryflags.cpp +++ b/src/game/client/components/countryflags.cpp @@ -58,28 +58,21 @@ void CCountryFlags::LoadCountryflagsIndexfile() // load the graphic file char aBuf[128]; CImageInfo Info; - bool LoadCountryFlags = g_Config.m_ClLoadCountryFlags; - if(LoadCountryFlags) + str_format(aBuf, sizeof(aBuf), "countryflags/%s.png", aOrigin); + if(!Graphics()->LoadPNG(&Info, aBuf, IStorage::TYPE_ALL)) { - str_format(aBuf, sizeof(aBuf), "countryflags/%s.png", aOrigin); - if(!Graphics()->LoadPNG(&Info, aBuf, IStorage::TYPE_ALL)) - { - char aMsg[128]; - str_format(aMsg, sizeof(aMsg), "failed to load '%s'", aBuf); - Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "countryflags", aMsg); - continue; - } + char aMsg[128]; + str_format(aMsg, sizeof(aMsg), "failed to load '%s'", aBuf); + Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "countryflags", aMsg); + continue; } // add entry CCountryFlag CountryFlag; CountryFlag.m_CountryCode = CountryCode; str_copy(CountryFlag.m_aCountryCodeString, aOrigin, sizeof(CountryFlag.m_aCountryCodeString)); - if(LoadCountryFlags) - { - CountryFlag.m_Texture = Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, Info.m_Format, 0); - Graphics()->FreePNG(&Info); - } + CountryFlag.m_Texture = Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, Info.m_Format, 0); + Graphics()->FreePNG(&Info); if(g_Config.m_Debug) { @@ -152,11 +145,4 @@ void CCountryFlags::Render(int CountryCode, const ColorRGBA *pColor, float x, fl Graphics()->QuadsDrawTL(&QuadItem, 1); Graphics()->QuadsEnd(); } - else - { - CTextCursor Cursor; - TextRender()->SetCursor(&Cursor, x, y, 10.0f, TEXTFLAG_RENDER | TEXTFLAG_STOP_AT_END); - Cursor.m_LineWidth = w; - TextRender()->TextEx(&Cursor, pFlag->m_aCountryCodeString, -1); - } }