diff options
author | Redix <redix@hotmail.de> | 2017-07-28 05:37:35 +0200 |
---|---|---|
committer | Redix <redix@hotmail.de> | 2017-07-28 05:37:35 +0200 |
commit | 89b88475c035f08c0e302c04f87c14275c5ae73d (patch) | |
tree | 6a442b42261e0da98bbfcb844d474f4312647724 | |
parent | f3f3a44a01e77dce43e3a21e7d7ea7c608ee8b87 (diff) |
Added background color configuration0.6.4-cp-r3
-rw-r--r-- | src/engine/client/client.cpp | 3 | ||||
-rw-r--r-- | src/engine/shared/config_variables.h | 2 | ||||
-rw-r--r-- | src/game/client/components/menus_settings.cpp | 37 | ||||
-rw-r--r-- | src/game/client/render_map.cpp | 4 | ||||
-rw-r--r-- | src/game/variables.h | 5 |
5 files changed, 47 insertions, 4 deletions
diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 0e4b623f3..0eb87c054 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -778,8 +778,7 @@ const char *CClient::ErrorString() void CClient::Render() { - if(g_Config.m_GfxClear) - Graphics()->Clear(1,1,0); + Graphics()->Clear(g_Config.m_ClBackgroundRed/255.0f, g_Config.m_ClBackgroundGreen/255.0f, g_Config.m_ClBackgroundBlue/255.0f); GameClient()->OnRender(); DebugRender(); diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index 0a2d8cec0..3effe5013 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -66,7 +66,7 @@ MACRO_CONFIG_INT(GfxBorderless, gfx_borderless, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CL MACRO_CONFIG_INT(GfxFullscreen, gfx_fullscreen, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Fullscreen") MACRO_CONFIG_INT(GfxAlphabits, gfx_alphabits, 0, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Alpha bits for framebuffer (fullscreen only)") MACRO_CONFIG_INT(GfxColorDepth, gfx_color_depth, 24, 16, 24, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Colors bits for framebuffer (fullscreen only)") -MACRO_CONFIG_INT(GfxClear, gfx_clear, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Clear screen before rendering") +//MACRO_CONFIG_INT(GfxClear, gfx_clear, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Clear screen before rendering") MACRO_CONFIG_INT(GfxVsync, gfx_vsync, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Vertical sync") MACRO_CONFIG_INT(GfxDisplayAllModes, gfx_display_all_modes, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "") MACRO_CONFIG_INT(GfxTextureCompression, gfx_texture_compression, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Use texture compression") diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 7d508d390..6c4f1bc07 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -1223,7 +1223,7 @@ void CMenus::RenderSettingsChat(CUIRect MainView) void CMenus::RenderSettingsHudMod(CUIRect MainView) { - CUIRect Button; + CUIRect Button, Label; CUIRect LeftView, RightView; MainView.VSplitMid(&LeftView, &RightView); @@ -1394,6 +1394,41 @@ void CMenus::RenderSettingsHudMod(CUIRect MainView) g_Config.m_ClChatsound = 1; g_Config.m_ClWarningTeambalance = 1; } + + RightView.HSplitTop(20.0f, 0, &RightView); + RightView.HSplitTop(20.0f, &Button, &RightView); + UI()->DoLabel(&Button, Localize("Map settings"), 14.0f, -1); + + RightView.HSplitTop(10.0f, &Button, &RightView); + + RightView.HSplitTop(20.0f, &Button, &RightView); + if(DoButton_CheckBox(&g_Config.m_ClShowQuads, Localize("Show quads"), g_Config.m_ClShowQuads, &Button)) + g_Config.m_ClShowQuads ^= 1; + + int *paColorSlider[3] = { &g_Config.m_ClBackgroundRed, &g_Config.m_ClBackgroundGreen, &g_Config.m_ClBackgroundBlue }; + const char *paLabels[] = { + Localize("Red"), + Localize("Green"), + Localize("Blue") }; + + RightView.HSplitTop(10.0f, &Button, &RightView); + + RightView.HSplitTop(20.0f, &Label, &RightView); + UI()->DoLabelScaled(&Label, Localize("Background color"), 14.0f, -1); + RightView.VSplitLeft(20.0f, 0, &RightView); + RightView.HSplitTop(2.5f, 0, &RightView); + + for(int i = 0; i < 3; i++) + { + RightView.HSplitTop(20.0f, &Label, &RightView); + Label.VSplitLeft(100.0f, &Label, &Button); + Button.HMargin(2.0f, &Button); + + float k = (*paColorSlider[i]) / 255.0f; + k = DoScrollbarH(paColorSlider[i], &Button, k); + *paColorSlider[i] = (int)(k*255.0f); + UI()->DoLabelScaled(&Label, paLabels[i], 15.0f, -1); + } } void CMenus::RenderSettingsRace(CUIRect MainView) diff --git a/src/game/client/render_map.cpp b/src/game/client/render_map.cpp index de853ff9e..1b875355b 100644 --- a/src/game/client/render_map.cpp +++ b/src/game/client/render_map.cpp @@ -3,6 +3,7 @@ #include <math.h> #include <base/math.h> #include <engine/graphics.h> +#include <engine/shared/config.h> #include <engine/textrender.h> #include <game/generated/protocol.h> #include <game/generated/client_data.h> @@ -83,6 +84,9 @@ static void Rotate(CPoint *pCenter, CPoint *pPoint, float Rotation) void CRenderTools::RenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags, ENVELOPE_EVAL pfnEval, void *pUser, float Zoom) { + if(!g_Config.m_ClShowQuads) + return; + Graphics()->QuadsBegin(); float Conv = 1/255.0f; for(int i = 0; i < NumQuads; i++) diff --git a/src/game/variables.h b/src/game/variables.h index a20866c04..28385da9a 100644 --- a/src/game/variables.h +++ b/src/game/variables.h @@ -69,6 +69,11 @@ MACRO_CONFIG_INT(ClServermsgsound, cl_servermsgsound, 1, 0, 1, CFGFLAG_CLIENT|CF MACRO_CONFIG_INT(ClChatsound, cl_chatsound, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Turnes chat sound on or off") MACRO_CONFIG_INT(ClSpreesounds, cl_spreesounds, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Turnes spreesounds on or off") +MACRO_CONFIG_INT(ClShowQuads, cl_show_quads, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show quads") +MACRO_CONFIG_INT(ClBackgroundRed, cl_background_red, 255, 0, 255, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Background color red") +MACRO_CONFIG_INT(ClBackgroundGreen, cl_background_green, 255, 0, 255, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Background color green") +MACRO_CONFIG_INT(ClBackgroundBlue, cl_background_blue, 0, 0, 255, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Background color blue") + /* Beep-Mod */ MACRO_CONFIG_STR(ClSearchName, cl_search_name, 64, "", CFGFLAG_CLIENT|CFGFLAG_SAVE, "Names to search for in chat messages") MACRO_CONFIG_INT(ClAntiSpam, cl_anti_spam, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Disables multiple messages") |