From c61407524fba6ae47e41bd42782402db3cad5dc8 Mon Sep 17 00:00:00 2001 From: Daniel Kempf Date: Fri, 29 Dec 2023 23:13:41 +0100 Subject: [PATCH] Change some conflicts with newest merge --- src/engine/client/client.cpp | 4 ++-- src/engine/config.h | 1 - src/engine/shared/config.cpp | 12 ------------ src/engine/shared/config.h | 8 -------- src/game/client/components/bindwheel.cpp | 2 +- src/game/client/components/menus_settings.cpp | 16 +++++++++------- src/game/client/render_map.cpp | 16 +++++++++------- 7 files changed, 21 insertions(+), 38 deletions(-) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index f2d20f21a5c..e09050da9b5 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -390,7 +390,7 @@ void CClient::EnterGame(int Conn) if(State() == IClient::STATE_DEMOPLAYBACK) return; - m_CodeRunAfterJoin[Conn] = false; + m_aCodeRunAfterJoin[Conn] = false; m_CodeRunAfterJoinConsole[Conn] = false; // now we will wait for two snapshots @@ -1953,7 +1953,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy) if(g_Config.m_ClRunOnJoin[0] || g_Config.m_ClDummyDefaultEyes || g_Config.m_ClPlayerDefaultEyes) SendMsg(Conn, &PackerTimeout, MSGFLAG_VITAL); } - m_CodeRunAfterJoin[Conn] = true; + m_aCodeRunAfterJoin[Conn] = true; } // ack snapshot diff --git a/src/engine/config.h b/src/engine/config.h index a475bfff487..592c6b9b284 100644 --- a/src/engine/config.h +++ b/src/engine/config.h @@ -20,7 +20,6 @@ class IConfigManager : public IInterface virtual class CConfig *Values() = 0; virtual void RegisterCallback(SAVECALLBACKFUNC pfnFunc, void *pUserData) = 0; - virtual void RegisterTCallback(SAVECALLBACKFUNC pfnFunc, void *pUserData) = 0; virtual void WriteLine(const char *pLine) = 0; diff --git a/src/engine/shared/config.cpp b/src/engine/shared/config.cpp index 14c883ee2fe..5aa128e05c7 100644 --- a/src/engine/shared/config.cpp +++ b/src/engine/shared/config.cpp @@ -372,7 +372,6 @@ CConfigManager::CConfigManager() m_pStorage = nullptr; m_ConfigFile = 0; m_NumCallbacks = 0; - m_NumTCallbacks = 0; m_Failed = false; } @@ -568,8 +567,6 @@ bool CConfigManager::TSave() #undef MACRO_CONFIG_COL #undef MACRO_CONFIG_STR - for(int i = 0; i < m_NumTCallbacks; i++) - m_aTCallbacks[i].m_pfnFunc(this, m_aTCallbacks[i].m_pUserData); if(io_sync(m_ConfigFile) != 0) @@ -602,15 +599,6 @@ void CConfigManager::RegisterCallback(SAVECALLBACKFUNC pfnFunc, void *pUserData) m_vCallbacks.emplace_back(pfnFunc, pUserData); } -void CConfigManager::RegisterTCallback(SAVECALLBACKFUNC pfnFunc, void *pUserData) -{ - dbg_assert(m_NumTCallbacks < MAX_CALLBACKS, "too many tater config callbacks"); - m_aTCallbacks[m_NumTCallbacks].m_pfnFunc = pfnFunc; - m_aTCallbacks[m_NumTCallbacks].m_pUserData = pUserData; - m_NumTCallbacks++; -} - - void CConfigManager::WriteLine(const char *pLine) { if(!m_ConfigFile || diff --git a/src/engine/shared/config.h b/src/engine/shared/config.h index 244b685f8d8..81e0088092a 100644 --- a/src/engine/shared/config.h +++ b/src/engine/shared/config.h @@ -80,10 +80,6 @@ class CConfigManager : public IConfigManager }; std::vector m_vCallbacks; - class IStorage *m_pStorage; - IOHANDLE m_ConfigFile; - bool m_Failed; - CCallback m_aCallbacks[MAX_CALLBACKS]; int m_NumCallbacks; std::vector m_vUnknownCommands; @@ -96,9 +92,6 @@ class CConfigManager : public IConfigManager static void Con_Toggle(IConsole::IResult *pResult, void *pUserData); static void Con_ToggleStroke(IConsole::IResult *pResult, void *pUserData); - CCallback m_aTCallbacks[MAX_CALLBACKS]; - int m_NumTCallbacks; - public: CConfigManager(); @@ -112,7 +105,6 @@ class CConfigManager : public IConfigManager CConfig *Values() override { return &g_Config; } void RegisterCallback(SAVECALLBACKFUNC pfnFunc, void *pUserData) override; - void RegisterTCallback(SAVECALLBACKFUNC pfnFunc, void *pUserData) override; void WriteLine(const char *pLine) override; diff --git a/src/game/client/components/bindwheel.cpp b/src/game/client/components/bindwheel.cpp index bbc9fa05ebe..d915d90d205 100644 --- a/src/game/client/components/bindwheel.cpp +++ b/src/game/client/components/bindwheel.cpp @@ -57,7 +57,7 @@ void CBindWheel::OnConsoleInit() { IConfigManager *pConfigManager = Kernel()->RequestInterface(); if(pConfigManager) - pConfigManager->RegisterTCallback(ConfigSaveCallback, this); + pConfigManager->RegisterCallback(ConfigSaveCallback, this); Console()->Register("+bindwheel", "", CFGFLAG_CLIENT, ConBindwheel, this, "Open bindwheel selector"); Console()->Register("bindwheel", "i[bindwheel] s[description:128] s[command:10]", CFGFLAG_CLIENT, ConBind, this, "Edit the command"); diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 45f51302d87..523809761ce 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -684,7 +684,7 @@ void CMenus::RenderSettingsTee(CUIRect MainView) if(*pUseCustomColor) { RandomColorsButton.VSplitLeft(120.0f, &RandomColorsButton, 0); - if(DoButton_Menu(&s_RandomizeColors, "Randomize Colors", 0, &RandomColorsButton, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0, 0, 0, 0.5f), vec4(0, 0, 0, 0.25f))) + if(DoButton_Menu(&s_RandomizeColors, "Randomize Colors", 0, &RandomColorsButton, nullptr, IGraphics::CORNER_ALL, 5.0f)) { if(m_Dummy) { @@ -3424,13 +3424,15 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) ExtMenu.VSplitRight(130.0f, 0, &ExtMenu); ExtMenu.HSplitBottom(25.0f, &ExtMenu, &Button); static CButtonContainer s_DiscordButton; - if(DoButton_Menu(&s_DiscordButton, Localize("Discord"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f))) + + if(DoButton_Menu(&s_DiscordButton, Localize("Discord"), 0, &Button, 0, IGraphics::CORNER_ALL)) { if(!open_link("https://discord.gg/fBvhH93Bt6")) { dbg_msg("menus", "couldn't open link"); } - } + } + } } // ***** PAGE 2 ***** // @@ -4015,7 +4017,7 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) LabelRight.HSplitTop(30.0f, &Button, &LabelRight); static CButtonContainer s_LoadButton; - if(DoButton_Menu(&s_LoadButton, Localize("Load"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f))) + if(DoButton_Menu(&s_LoadButton, Localize("Load"), 0, &Button, 0, IGraphics::CORNER_ALL)) { if(SelectedProfile != -1 && SelectedProfile < (int)GameClient()->m_SkinProfiles.m_Profiles.size()) { @@ -4063,7 +4065,7 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) LabelRight.HSplitTop(30.0f, &Button, &LabelRight); static CButtonContainer s_SaveButton; - if(DoButton_Menu(&s_SaveButton, Localize("Save"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f))) + if(DoButton_Menu(&s_SaveButton, Localize("Save"), 0, &Button, 0, IGraphics::CORNER_ALL)) { GameClient()->m_SkinProfiles.AddProfile( doColors ? *pColorBody : -1, @@ -4085,7 +4087,7 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) { LabelRight.HSplitTop(28.0f, &Button, &LabelRight); static CButtonContainer s_DeleteButton; - if(DoButton_Menu(&s_DeleteButton, Localize("Delete"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f))) + if(DoButton_Menu(&s_DeleteButton, Localize("Delete"), 0, &Button, 0, IGraphics::CORNER_ALL)) { if(SelectedProfile != -1 && SelectedProfile < (int)GameClient()->m_SkinProfiles.m_Profiles.size()) { @@ -4097,7 +4099,7 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) LabelRight.HSplitTop(28.0f, &Button, &LabelRight); static CButtonContainer s_OverrideButton; - if(DoButton_Menu(&s_OverrideButton, Localize("Override"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f))) + if(DoButton_Menu(&s_OverrideButton, Localize("Override"), 0, &Button, 0, IGraphics::CORNER_ALL)) { if(SelectedProfile != -1 && SelectedProfile < (int)GameClient()->m_SkinProfiles.m_Profiles.size()) { diff --git a/src/game/client/render_map.cpp b/src/game/client/render_map.cpp index f99d8e7676e..c2a561d679f 100644 --- a/src/game/client/render_map.cpp +++ b/src/game/client/render_map.cpp @@ -906,6 +906,7 @@ void CRenderTools::RenderGameTileOutlines(CTile *pTiles, int w, int h, float Sca Graphics()->QuadsEnd(); Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1); } + void CRenderTools::RenderTeleOutlines(CTile *pTiles, CTeleTile *pTele, int w, int h, float Scale, float Alpha) { float ScreenX0, ScreenY0, ScreenX1, ScreenY1; @@ -1035,6 +1036,7 @@ void CRenderTools::RenderTeleOutlines(CTile *pTiles, CTeleTile *pTele, int w, in Graphics()->QuadsEnd(); Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1); } + void CRenderTools::RenderTeleOverlay(CTeleTile *pTele, int w, int h, float Scale, float Alpha) { if(!g_Config.m_ClTextEntities) @@ -1090,7 +1092,7 @@ void CRenderTools::RenderTeleOverlay(CTeleTile *pTele, int w, int h, float Scale Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1); } -void CRenderTools::RenderSpeedupOverlay(CSpeedupTile *pSpeedup, int w, int h, float Scale, float Alpha) const +void CRenderTools::RenderSpeedupOverlay(CSpeedupTile *pSpeedup, int w, int h, float Scale, float Alpha) { float ScreenX0, ScreenY0, ScreenX1, ScreenY1; Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1); @@ -1157,7 +1159,7 @@ void CRenderTools::RenderSpeedupOverlay(CSpeedupTile *pSpeedup, int w, int h, fl Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1); } -void CRenderTools::RenderSwitchOverlay(CSwitchTile *pSwitch, int w, int h, float Scale, float Alpha) const +void CRenderTools::RenderSwitchOverlay(CSwitchTile *pSwitch, int w, int h, float Scale, float Alpha) { if(!g_Config.m_ClTextEntities) return; @@ -1215,7 +1217,7 @@ void CRenderTools::RenderSwitchOverlay(CSwitchTile *pSwitch, int w, int h, float Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1); } -void CRenderTools::RenderTuneOverlay(CTuneTile *pTune, int w, int h, float Scale, float Alpha) const +void CRenderTools::RenderTuneOverlay(CTuneTile *pTune, int w, int h, float Scale, float Alpha) { if(!g_Config.m_ClTextEntities) return; @@ -1265,7 +1267,7 @@ void CRenderTools::RenderTuneOverlay(CTuneTile *pTune, int w, int h, float Scale Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1); } -void CRenderTools::RenderTelemap(CTeleTile *pTele, int w, int h, float Scale, ColorRGBA Color, int RenderFlags) const +void CRenderTools::RenderTelemap(CTeleTile *pTele, int w, int h, float Scale, ColorRGBA Color, int RenderFlags) { float ScreenX0, ScreenY0, ScreenX1, ScreenY1; Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1); @@ -1382,7 +1384,7 @@ void CRenderTools::RenderTelemap(CTeleTile *pTele, int w, int h, float Scale, Co Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1); } -void CRenderTools::RenderSpeedupmap(CSpeedupTile *pSpeedupTile, int w, int h, float Scale, ColorRGBA Color, int RenderFlags) const +void CRenderTools::RenderSpeedupmap(CSpeedupTile *pSpeedupTile, int w, int h, float Scale, ColorRGBA Color, int RenderFlags) { //Graphics()->TextureSet(img_get(tmap->image)); float ScreenX0, ScreenY0, ScreenX1, ScreenY1; @@ -1501,7 +1503,7 @@ void CRenderTools::RenderSpeedupmap(CSpeedupTile *pSpeedupTile, int w, int h, fl Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1); } -void CRenderTools::RenderSwitchmap(CSwitchTile *pSwitchTile, int w, int h, float Scale, ColorRGBA Color, int RenderFlags) const +void CRenderTools::RenderSwitchmap(CSwitchTile *pSwitchTile, int w, int h, float Scale, ColorRGBA Color, int RenderFlags) { //Graphics()->TextureSet(img_get(tmap->image)); float ScreenX0, ScreenY0, ScreenX1, ScreenY1; @@ -1663,7 +1665,7 @@ void CRenderTools::RenderSwitchmap(CSwitchTile *pSwitchTile, int w, int h, float Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1); } -void CRenderTools::RenderTunemap(CTuneTile *pTune, int w, int h, float Scale, ColorRGBA Color, int RenderFlags) const +void CRenderTools::RenderTunemap(CTuneTile *pTune, int w, int h, float Scale, ColorRGBA Color, int RenderFlags) { float ScreenX0, ScreenY0, ScreenX1, ScreenY1; Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1);