mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
clang-format fixes
This commit is contained in:
parent
a52c8a22a6
commit
f7b37eaf6a
|
@ -17,33 +17,33 @@
|
|||
#endif
|
||||
|
||||
#if defined(CONF_FAMILY_UNIX)
|
||||
#include <sys/time.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <signal.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* unix net includes */
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <errno.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
#include <arpa/inet.h>
|
||||
/* unix net includes */
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <dirent.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#if defined(CONF_PLATFORM_MACOSX)
|
||||
// some lock and pthread functions are already defined in headers
|
||||
// included from Carbon.h
|
||||
// this prevents having duplicate definitions of those
|
||||
#define _lock_set_user_
|
||||
#define _task_user_
|
||||
#if defined(CONF_PLATFORM_MACOSX)
|
||||
// some lock and pthread functions are already defined in headers
|
||||
// included from Carbon.h
|
||||
// this prevents having duplicate definitions of those
|
||||
#define _lock_set_user_
|
||||
#define _task_user_
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <mach/mach_time.h>
|
||||
#endif
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <mach/mach_time.h>
|
||||
#endif
|
||||
|
||||
#elif defined(CONF_FAMILY_WINDOWS)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
|
|
@ -1029,7 +1029,6 @@ void str_utf8_truncate(char *dst, int dst_size, const char *src, int truncation_
|
|||
*/
|
||||
void str_truncate(char *dst, int dst_size, const char *src, int truncation_len);
|
||||
|
||||
|
||||
/*
|
||||
Function: str_length
|
||||
Returns the length of a zero terminated string.
|
||||
|
|
|
@ -65,9 +65,9 @@
|
|||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "client.h"
|
||||
#include "friends.h"
|
||||
#include "serverbrowser.h"
|
||||
#include "client.h"
|
||||
|
||||
#if defined(CONF_VIDEORECORDER)
|
||||
#include "video.h"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include <memory>
|
||||
|
||||
#include <base/hash.h>
|
||||
#include <engine/client/friends.h>
|
||||
#include <engine/client/http.h>
|
||||
#include <engine/client/updater.h>
|
||||
|
||||
|
|
|
@ -181,8 +181,8 @@ MACRO_CONFIG_STR(SvReservedSlotsPass, sv_reserved_slots_pass, 32, "", CFGFLAG_SE
|
|||
MACRO_CONFIG_INT(SvHit, sv_hit, 1, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Whether players can hammer/grenade/laser each other or not")
|
||||
MACRO_CONFIG_INT(SvEndlessDrag, sv_endless_drag, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Turns endless hooking on/off")
|
||||
MACRO_CONFIG_INT(SvTestingCommands, sv_test_cmds, 0, 0, 1, CFGFLAG_SERVER, "Turns testing commands aka cheats on/off (setting only works in initial config)")
|
||||
MACRO_CONFIG_INT(SvFreezeDelay, sv_freeze_delay, 3, 1, 30, CFGFLAG_SERVER|CFGFLAG_GAME, "How many seconds the players will remain frozen (applies to all except delayed freeze in switch layer & deepfreeze)")
|
||||
MACRO_CONFIG_INT(ClDDRaceBindsSet, cl_race_binds_set, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "What level the DDRace binds are set to (this is automated, you don't need to use this)")
|
||||
MACRO_CONFIG_INT(SvFreezeDelay, sv_freeze_delay, 3, 1, 30, CFGFLAG_SERVER | CFGFLAG_GAME, "How many seconds the players will remain frozen (applies to all except delayed freeze in switch layer & deepfreeze)")
|
||||
MACRO_CONFIG_INT(ClDDRaceBindsSet, cl_race_binds_set, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "What level the DDRace binds are set to (this is automated, you don't need to use this)")
|
||||
MACRO_CONFIG_INT(SvEndlessSuperHook, sv_endless_super_hook, 0, 0, 1, CFGFLAG_SERVER, "Endless hook for super players on/off")
|
||||
MACRO_CONFIG_INT(SvHideScore, sv_hide_score, 0, 0, 1, CFGFLAG_SERVER, "Whether players scores will be announced or not")
|
||||
MACRO_CONFIG_INT(SvSaveWorseScores, sv_save_worse_scores, 1, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Whether to save worse scores when you already have a better one")
|
||||
|
|
|
@ -486,7 +486,7 @@ public:
|
|||
GetPath(Type, pDir, pBuffer, BufferSize);
|
||||
}
|
||||
|
||||
virtual const char* GetBinaryPath(const char *pFilename, char *pBuffer, unsigned BufferSize)
|
||||
virtual const char *GetBinaryPath(const char *pFilename, char *pBuffer, unsigned BufferSize)
|
||||
{
|
||||
str_format(pBuffer, BufferSize, "%s%s%s", m_aBinarydir, !m_aBinarydir[0] ? "" : "/", pFilename);
|
||||
return pBuffer;
|
||||
|
|
|
@ -36,8 +36,8 @@ public:
|
|||
virtual void GetCompletePath(int Type, const char *pDir, char *pBuffer, unsigned BufferSize) = 0;
|
||||
|
||||
virtual bool RemoveBinaryFile(const char *pFilename) = 0;
|
||||
virtual bool RenameBinaryFile(const char* pOldFilename, const char* pNewFilename) = 0;
|
||||
virtual const char* GetBinaryPath(const char *pFilename, char *pBuffer, unsigned BufferSize) = 0;
|
||||
virtual bool RenameBinaryFile(const char *pOldFilename, const char *pNewFilename) = 0;
|
||||
virtual const char *GetBinaryPath(const char *pFilename, char *pBuffer, unsigned BufferSize) = 0;
|
||||
|
||||
static void StripPathAndExtension(const char *pFilename, char *pBuffer, int BufferSize);
|
||||
};
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
#include <game/version.h>
|
||||
#include <game/generated/protocol.h>
|
||||
|
||||
#include <game/generated/client_data.h>
|
||||
#include <game/client/components/binds.h>
|
||||
#include <game/client/components/console.h>
|
||||
#include <game/client/components/sounds.h>
|
||||
#include <game/client/gameclient.h>
|
||||
#include <game/client/lineinput.h>
|
||||
#include <game/generated/client_data.h>
|
||||
#include <game/localization.h>
|
||||
#include <mastersrv/mastersrv.h>
|
||||
|
||||
|
@ -158,7 +158,7 @@ int CMenus::DoButton_Menu(const void *pID, const char *pText, int Checked, const
|
|||
if(pImageName)
|
||||
{
|
||||
CUIRect Image;
|
||||
pRect->VSplitRight(pRect->h*4.0f, &Text, &Image); // always correct ratio for image
|
||||
pRect->VSplitRight(pRect->h * 4.0f, &Text, &Image); // always correct ratio for image
|
||||
|
||||
// render image
|
||||
const CMenuImage *pImage = FindMenuImage(pImageName);
|
||||
|
@ -175,13 +175,12 @@ int CMenus::DoButton_Menu(const void *pID, const char *pText, int Checked, const
|
|||
}
|
||||
}
|
||||
|
||||
Text.HMargin(pRect->h>=20.0f?2.0f:1.0f, &Text);
|
||||
Text.HMargin((Text.h*FontFactor)/2.0f, &Text);
|
||||
UI()->DoLabel(&Text, pText, Text.h*ms_FontmodHeight, 0);
|
||||
Text.HMargin(pRect->h >= 20.0f ? 2.0f : 1.0f, &Text);
|
||||
Text.HMargin((Text.h * FontFactor) / 2.0f, &Text);
|
||||
UI()->DoLabel(&Text, pText, Text.h * ms_FontmodHeight, 0);
|
||||
return UI()->DoButtonLogic(pID, pText, Checked, pRect);
|
||||
}
|
||||
|
||||
|
||||
void CMenus::DoButton_KeySelect(const void *pID, const char *pText, int Checked, const CUIRect *pRect)
|
||||
{
|
||||
RenderTools()->DrawUIRect(pRect, ColorRGBA(1,1,1,0.5f * ButtonColorMul(pID)), CUI::CORNER_ALL, 5.0f);
|
||||
|
@ -728,7 +727,7 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
if(Client()->State() == IClient::STATE_OFFLINE)
|
||||
{
|
||||
Box.VSplitLeft(100.0f, &Button, &Box);
|
||||
static int s_StartButton=0;
|
||||
static int s_StartButton = 0;
|
||||
if(DoButton_MenuTab(&s_StartButton, Localize("Menu"), false, &Button, CUI::CORNER_T))
|
||||
{
|
||||
m_ShowStart = true;
|
||||
|
@ -741,8 +740,8 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
if(m_ActivePage == PAGE_NEWS)
|
||||
{
|
||||
Box.VSplitLeft(100.0f, &Button, &Box);
|
||||
static int s_NewsButton=0;
|
||||
if(DoButton_MenuTab(&s_NewsButton, Localize("News"), m_ActivePage==PAGE_NEWS, &Button, CUI::CORNER_T))
|
||||
static int s_NewsButton = 0;
|
||||
if(DoButton_MenuTab(&s_NewsButton, Localize("News"), m_ActivePage == PAGE_NEWS, &Button, CUI::CORNER_T))
|
||||
{
|
||||
NewPage = PAGE_NEWS;
|
||||
m_DoubleClickIndex = -1;
|
||||
|
@ -751,8 +750,8 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
else if(m_ActivePage == PAGE_DEMOS)
|
||||
{
|
||||
Box.VSplitLeft(100.0f, &Button, &Box);
|
||||
static int s_DemosButton=0;
|
||||
if(DoButton_MenuTab(&s_DemosButton, Localize("Demos"), m_ActivePage==PAGE_DEMOS, &Button, CUI::CORNER_T))
|
||||
static int s_DemosButton = 0;
|
||||
if(DoButton_MenuTab(&s_DemosButton, Localize("Demos"), m_ActivePage == PAGE_DEMOS, &Button, CUI::CORNER_T))
|
||||
{
|
||||
DemolistPopulate();
|
||||
NewPage = PAGE_DEMOS;
|
||||
|
@ -762,8 +761,8 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
else
|
||||
{
|
||||
Box.VSplitLeft(100.0f, &Button, &Box);
|
||||
static int s_InternetButton=0;
|
||||
if(DoButton_MenuTab(&s_InternetButton, Localize("Internet"), m_ActivePage==PAGE_INTERNET, &Button, CUI::CORNER_TL))
|
||||
static int s_InternetButton = 0;
|
||||
if(DoButton_MenuTab(&s_InternetButton, Localize("Internet"), m_ActivePage == PAGE_INTERNET, &Button, CUI::CORNER_TL))
|
||||
{
|
||||
if(ServerBrowser()->GetCurrentType() != IServerBrowser::TYPE_INTERNET)
|
||||
ServerBrowser()->Refresh(IServerBrowser::TYPE_INTERNET);
|
||||
|
@ -772,8 +771,8 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
}
|
||||
|
||||
Box.VSplitLeft(100.0f, &Button, &Box);
|
||||
static int s_LanButton=0;
|
||||
if(DoButton_MenuTab(&s_LanButton, Localize("LAN"), m_ActivePage==PAGE_LAN, &Button, 0))
|
||||
static int s_LanButton = 0;
|
||||
if(DoButton_MenuTab(&s_LanButton, Localize("LAN"), m_ActivePage == PAGE_LAN, &Button, 0))
|
||||
{
|
||||
if(ServerBrowser()->GetCurrentType() != IServerBrowser::TYPE_LAN)
|
||||
ServerBrowser()->Refresh(IServerBrowser::TYPE_LAN);
|
||||
|
@ -782,8 +781,8 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
}
|
||||
|
||||
Box.VSplitLeft(100.0f, &Button, &Box);
|
||||
static int s_FavoritesButton=0;
|
||||
if(DoButton_MenuTab(&s_FavoritesButton, Localize("Favorites"), m_ActivePage==PAGE_FAVORITES, &Button, 0))
|
||||
static int s_FavoritesButton = 0;
|
||||
if(DoButton_MenuTab(&s_FavoritesButton, Localize("Favorites"), m_ActivePage == PAGE_FAVORITES, &Button, 0))
|
||||
{
|
||||
if(ServerBrowser()->GetCurrentType() != IServerBrowser::TYPE_FAVORITES)
|
||||
ServerBrowser()->Refresh(IServerBrowser::TYPE_FAVORITES);
|
||||
|
@ -792,8 +791,8 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
}
|
||||
|
||||
Box.VSplitLeft(100.0f, &Button, &Box);
|
||||
static int s_DDNetButton=0;
|
||||
if(DoButton_MenuTab(&s_DDNetButton, "DDNet", m_ActivePage==PAGE_DDNET, &Button, 0))
|
||||
static int s_DDNetButton = 0;
|
||||
if(DoButton_MenuTab(&s_DDNetButton, "DDNet", m_ActivePage == PAGE_DDNET, &Button, 0))
|
||||
{
|
||||
if(ServerBrowser()->GetCurrentType() != IServerBrowser::TYPE_DDNET)
|
||||
{
|
||||
|
@ -805,8 +804,8 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
}
|
||||
|
||||
Box.VSplitLeft(100.0f, &Button, &Box);
|
||||
static int s_KoGButton=0;
|
||||
if(DoButton_MenuTab(&s_KoGButton, "KoG", m_ActivePage==PAGE_KOG, &Button, CUI::CORNER_TR))
|
||||
static int s_KoGButton = 0;
|
||||
if(DoButton_MenuTab(&s_KoGButton, "KoG", m_ActivePage == PAGE_KOG, &Button, CUI::CORNER_TR))
|
||||
{
|
||||
if(ServerBrowser()->GetCurrentType() != IServerBrowser::TYPE_KOG)
|
||||
{
|
||||
|
@ -846,7 +845,7 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
if(GameClient()->m_GameInfo.m_Race)
|
||||
{
|
||||
Box.VSplitLeft(90.0f, &Button, &Box);
|
||||
if(DoButton_MenuTab(&s_GhostButton, Localize("Ghost"), m_ActivePage==PAGE_GHOST, &Button, 0))
|
||||
if(DoButton_MenuTab(&s_GhostButton, Localize("Ghost"), m_ActivePage == PAGE_GHOST, &Button, 0))
|
||||
NewPage = PAGE_GHOST;
|
||||
}
|
||||
}
|
||||
|
@ -2215,8 +2214,8 @@ void CMenus::RenderBackground()
|
|||
bool CMenus::CheckHotKey(int Key) const
|
||||
{
|
||||
return m_Popup == POPUP_NONE &&
|
||||
!Input()->KeyIsPressed(KEY_LSHIFT) && !Input()->KeyIsPressed(KEY_RSHIFT) && !Input()->KeyIsPressed(KEY_LCTRL) && !Input()->KeyIsPressed(KEY_RCTRL) && !Input()->KeyIsPressed(KEY_LALT) && // no modifier
|
||||
Input()->KeyIsPressed(Key) && m_pClient->m_pGameConsole->IsClosed();
|
||||
!Input()->KeyIsPressed(KEY_LSHIFT) && !Input()->KeyIsPressed(KEY_RSHIFT) && !Input()->KeyIsPressed(KEY_LCTRL) && !Input()->KeyIsPressed(KEY_RCTRL) && !Input()->KeyIsPressed(KEY_LALT) && // no modifier
|
||||
Input()->KeyIsPressed(Key) && m_pClient->m_pGameConsole->IsClosed();
|
||||
}
|
||||
|
||||
int CMenus::DoButton_CheckBox_DontCare(const void *pID, const char *pText, int Checked, const CUIRect *pRect)
|
||||
|
|
|
@ -49,7 +49,7 @@ class CMenus : public CComponent
|
|||
int DoButton_DemoPlayer(const void *pID, const char *pText, int Checked, const CUIRect *pRect);
|
||||
int DoButton_Sprite(const void *pID, int ImageID, int SpriteID, int Checked, const CUIRect *pRect, int Corners);
|
||||
int DoButton_Toggle(const void *pID, int Checked, const CUIRect *pRect, bool Active);
|
||||
int DoButton_Menu(const void *pID, const char *pText, int Checked, const CUIRect *pRect, const char *pImageName=0, int Corners=CUI::CORNER_ALL, float r=5.0f, float FontFactor=0.0f, vec4 ColorHot=vec4(1.0f, 1.0f, 1.0f, 0.75f), vec4 Color=vec4(1,1,1,0.5f));
|
||||
int DoButton_Menu(const void *pID, const char *pText, int Checked, const CUIRect *pRect, const char *pImageName = 0, int Corners = CUI::CORNER_ALL, float r = 5.0f, float FontFactor = 0.0f, vec4 ColorHot = vec4(1.0f, 1.0f, 1.0f, 0.75f), vec4 Color = vec4(1, 1, 1, 0.5f));
|
||||
int DoButton_MenuTab(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Corners);
|
||||
|
||||
int DoButton_CheckBox_Common(const void *pID, const char *pText, const char *pBoxText, const CUIRect *pRect);
|
||||
|
@ -124,7 +124,7 @@ class CMenus : public CComponent
|
|||
|
||||
static int MenuImageScan(const char *pName, int IsDir, int DirType, void *pUser);
|
||||
|
||||
const CMenuImage *FindMenuImage(const char* pName);
|
||||
const CMenuImage *FindMenuImage(const char *pName);
|
||||
|
||||
// loading
|
||||
int m_LoadCurrent;
|
||||
|
@ -462,7 +462,6 @@ public:
|
|||
};
|
||||
|
||||
private:
|
||||
|
||||
static int GhostlistFetchCallback(const char *pName, int IsDir, int StorageType, void *pUser);
|
||||
void SetMenuPage(int NewPage);
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
|
|||
Left.HSplitTop(5.0f, 0, &Left);
|
||||
Left.HSplitTop(20.0f, &Button, &Left);
|
||||
if(DoButton_CheckBox(&g_Config.m_ClSkipStartMenu, Localize("Skip the main menu"), g_Config.m_ClSkipStartMenu, &Button))
|
||||
g_Config.m_ClSkipStartMenu^= 1;
|
||||
g_Config.m_ClSkipStartMenu ^= 1;
|
||||
|
||||
// auto demo settings
|
||||
{
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
#include <engine/client/updater.h>
|
||||
#include <engine/shared/config.h>
|
||||
|
||||
#include <game/editor/editor.h>
|
||||
#include <game/version.h>
|
||||
#include <game/client/components/console.h>
|
||||
#include <game/client/render.h>
|
||||
#include <game/client/ui.h>
|
||||
#include <game/editor/editor.h>
|
||||
#include <game/version.h>
|
||||
|
||||
#include "menus.h"
|
||||
|
||||
|
@ -20,13 +20,13 @@ void CMenus::RenderStartMenu(CUIRect MainView)
|
|||
// render logo
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_BANNER].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(1,1,1,1);
|
||||
IGraphics::CQuadItem QuadItem(MainView.w/2-170, 60, 360, 103);
|
||||
Graphics()->SetColor(1, 1, 1, 1);
|
||||
IGraphics::CQuadItem QuadItem(MainView.w / 2 - 170, 60, 360, 103);
|
||||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
|
||||
const float Rounding = 10.0f;
|
||||
const float VMargin = MainView.w/2-190.0f;
|
||||
const float VMargin = MainView.w / 2 - 190.0f;
|
||||
|
||||
CUIRect Button;
|
||||
int NewPage = -1;
|
||||
|
|
|
@ -215,11 +215,11 @@ void CRenderTools::DrawRoundRectExt(float x, float y, float w, float h, float r,
|
|||
void CRenderTools::DrawRoundRectExt4(float x, float y, float w, float h, vec4 ColorTopLeft, vec4 ColorTopRight, vec4 ColorBottomLeft, vec4 ColorBottomRight, float r, int Corners)
|
||||
{
|
||||
int Num = 8;
|
||||
for(int i = 0; i < Num; i+=2)
|
||||
for(int i = 0; i < Num; i += 2)
|
||||
{
|
||||
float a1 = i/(float)Num * pi/2;
|
||||
float a2 = (i+1)/(float)Num * pi/2;
|
||||
float a3 = (i+2)/(float)Num * pi/2;
|
||||
float a1 = i / (float)Num * pi / 2;
|
||||
float a2 = (i + 1) / (float)Num * pi / 2;
|
||||
float a3 = (i + 2) / (float)Num * pi / 2;
|
||||
float Ca1 = cosf(a1);
|
||||
float Ca2 = cosf(a2);
|
||||
float Ca3 = cosf(a3);
|
||||
|
@ -227,138 +227,137 @@ void CRenderTools::DrawRoundRectExt4(float x, float y, float w, float h, vec4 Co
|
|||
float Sa2 = sinf(a2);
|
||||
float Sa3 = sinf(a3);
|
||||
|
||||
if(Corners&1) // TL
|
||||
if(Corners & 1) // TL
|
||||
{
|
||||
Graphics()->SetColor(ColorTopLeft.r, ColorTopLeft.g, ColorTopLeft.b, ColorTopLeft.a);
|
||||
IGraphics::CFreeformItem ItemF = IGraphics::CFreeformItem(
|
||||
x+r, y+r,
|
||||
x+(1-Ca1)*r, y+(1-Sa1)*r,
|
||||
x+(1-Ca3)*r, y+(1-Sa3)*r,
|
||||
x+(1-Ca2)*r, y+(1-Sa2)*r);
|
||||
x + r, y + r,
|
||||
x + (1 - Ca1) * r, y + (1 - Sa1) * r,
|
||||
x + (1 - Ca3) * r, y + (1 - Sa3) * r,
|
||||
x + (1 - Ca2) * r, y + (1 - Sa2) * r);
|
||||
Graphics()->QuadsDrawFreeform(&ItemF, 1);
|
||||
}
|
||||
|
||||
if(Corners&2) // TR
|
||||
if(Corners & 2) // TR
|
||||
{
|
||||
Graphics()->SetColor(ColorTopRight.r, ColorTopRight.g, ColorTopRight.b, ColorTopRight.a);
|
||||
IGraphics::CFreeformItem ItemF = IGraphics::CFreeformItem(
|
||||
x+w-r, y+r,
|
||||
x+w-r+Ca1*r, y+(1-Sa1)*r,
|
||||
x+w-r+Ca3*r, y+(1-Sa3)*r,
|
||||
x+w-r+Ca2*r, y+(1-Sa2)*r);
|
||||
x + w - r, y + r,
|
||||
x + w - r + Ca1 * r, y + (1 - Sa1) * r,
|
||||
x + w - r + Ca3 * r, y + (1 - Sa3) * r,
|
||||
x + w - r + Ca2 * r, y + (1 - Sa2) * r);
|
||||
Graphics()->QuadsDrawFreeform(&ItemF, 1);
|
||||
}
|
||||
|
||||
if(Corners&4) // BL
|
||||
if(Corners & 4) // BL
|
||||
{
|
||||
Graphics()->SetColor(ColorBottomLeft.r, ColorBottomLeft.g, ColorBottomLeft.b, ColorBottomLeft.a);
|
||||
IGraphics::CFreeformItem ItemF = IGraphics::CFreeformItem(
|
||||
x+r, y+h-r,
|
||||
x+(1-Ca1)*r, y+h-r+Sa1*r,
|
||||
x+(1-Ca3)*r, y+h-r+Sa3*r,
|
||||
x+(1-Ca2)*r, y+h-r+Sa2*r);
|
||||
x + r, y + h - r,
|
||||
x + (1 - Ca1) * r, y + h - r + Sa1 * r,
|
||||
x + (1 - Ca3) * r, y + h - r + Sa3 * r,
|
||||
x + (1 - Ca2) * r, y + h - r + Sa2 * r);
|
||||
Graphics()->QuadsDrawFreeform(&ItemF, 1);
|
||||
}
|
||||
|
||||
if(Corners&8) // BR
|
||||
if(Corners & 8) // BR
|
||||
{
|
||||
Graphics()->SetColor(ColorBottomRight.r, ColorBottomRight.g, ColorBottomRight.b, ColorBottomRight.a);
|
||||
IGraphics::CFreeformItem ItemF = IGraphics::CFreeformItem(
|
||||
x+w-r, y+h-r,
|
||||
x+w-r+Ca1*r, y+h-r+Sa1*r,
|
||||
x+w-r+Ca3*r, y+h-r+Sa3*r,
|
||||
x+w-r+Ca2*r, y+h-r+Sa2*r);
|
||||
x + w - r, y + h - r,
|
||||
x + w - r + Ca1 * r, y + h - r + Sa1 * r,
|
||||
x + w - r + Ca3 * r, y + h - r + Sa3 * r,
|
||||
x + w - r + Ca2 * r, y + h - r + Sa2 * r);
|
||||
Graphics()->QuadsDrawFreeform(&ItemF, 1);
|
||||
}
|
||||
|
||||
if(Corners&16) // ITL
|
||||
if(Corners & 16) // ITL
|
||||
{
|
||||
Graphics()->SetColor(ColorTopLeft.r, ColorTopLeft.g, ColorTopLeft.b, ColorTopLeft.a);
|
||||
IGraphics::CFreeformItem ItemF = IGraphics::CFreeformItem(
|
||||
x, y,
|
||||
x+(1-Ca1)*r, y-r+Sa1*r,
|
||||
x+(1-Ca3)*r, y-r+Sa3*r,
|
||||
x+(1-Ca2)*r, y-r+Sa2*r);
|
||||
x, y,
|
||||
x + (1 - Ca1) * r, y - r + Sa1 * r,
|
||||
x + (1 - Ca3) * r, y - r + Sa3 * r,
|
||||
x + (1 - Ca2) * r, y - r + Sa2 * r);
|
||||
Graphics()->QuadsDrawFreeform(&ItemF, 1);
|
||||
}
|
||||
|
||||
if(Corners&32) // ITR
|
||||
if(Corners & 32) // ITR
|
||||
{
|
||||
Graphics()->SetColor(ColorTopRight.r, ColorTopRight.g, ColorTopRight.b, ColorTopRight.a);
|
||||
IGraphics::CFreeformItem ItemF = IGraphics::CFreeformItem(
|
||||
x+w, y,
|
||||
x+w-r+Ca1*r, y-r+Sa1*r,
|
||||
x+w-r+Ca3*r, y-r+Sa3*r,
|
||||
x+w-r+Ca2*r, y-r+Sa2*r);
|
||||
x + w, y,
|
||||
x + w - r + Ca1 * r, y - r + Sa1 * r,
|
||||
x + w - r + Ca3 * r, y - r + Sa3 * r,
|
||||
x + w - r + Ca2 * r, y - r + Sa2 * r);
|
||||
Graphics()->QuadsDrawFreeform(&ItemF, 1);
|
||||
}
|
||||
|
||||
if(Corners&64) // IBL
|
||||
if(Corners & 64) // IBL
|
||||
{
|
||||
Graphics()->SetColor(ColorBottomLeft.r, ColorBottomLeft.g, ColorBottomLeft.b, ColorBottomLeft.a);
|
||||
IGraphics::CFreeformItem ItemF = IGraphics::CFreeformItem(
|
||||
x, y+h,
|
||||
x+(1-Ca1)*r, y+h+(1-Sa1)*r,
|
||||
x+(1-Ca3)*r, y+h+(1-Sa3)*r,
|
||||
x+(1-Ca2)*r, y+h+(1-Sa2)*r);
|
||||
x, y + h,
|
||||
x + (1 - Ca1) * r, y + h + (1 - Sa1) * r,
|
||||
x + (1 - Ca3) * r, y + h + (1 - Sa3) * r,
|
||||
x + (1 - Ca2) * r, y + h + (1 - Sa2) * r);
|
||||
Graphics()->QuadsDrawFreeform(&ItemF, 1);
|
||||
}
|
||||
|
||||
if(Corners&128) // IBR
|
||||
if(Corners & 128) // IBR
|
||||
{
|
||||
Graphics()->SetColor(ColorBottomRight.r, ColorBottomRight.g, ColorBottomRight.b, ColorBottomRight.a);
|
||||
IGraphics::CFreeformItem ItemF = IGraphics::CFreeformItem(
|
||||
x+w, y+h,
|
||||
x+w-r+Ca1*r, y+h+(1-Sa1)*r,
|
||||
x+w-r+Ca3*r, y+h+(1-Sa3)*r,
|
||||
x+w-r+Ca2*r, y+h+(1-Sa2)*r);
|
||||
x + w, y + h,
|
||||
x + w - r + Ca1 * r, y + h + (1 - Sa1) * r,
|
||||
x + w - r + Ca3 * r, y + h + (1 - Sa3) * r,
|
||||
x + w - r + Ca2 * r, y + h + (1 - Sa2) * r);
|
||||
Graphics()->QuadsDrawFreeform(&ItemF, 1);
|
||||
}
|
||||
}
|
||||
|
||||
Graphics()->SetColor4(ColorTopLeft, ColorTopRight, ColorBottomLeft, ColorBottomRight);
|
||||
IGraphics::CQuadItem ItemQ = IGraphics::CQuadItem(x+r, y+r, w-r*2, h-r*2); // center
|
||||
IGraphics::CQuadItem ItemQ = IGraphics::CQuadItem(x + r, y + r, w - r * 2, h - r * 2); // center
|
||||
Graphics()->QuadsDrawTL(&ItemQ, 1);
|
||||
Graphics()->SetColor4(ColorTopLeft, ColorTopRight, ColorTopLeft, ColorTopRight);
|
||||
ItemQ = IGraphics::CQuadItem(x+r, y, w-r*2, r); // top
|
||||
ItemQ = IGraphics::CQuadItem(x + r, y, w - r * 2, r); // top
|
||||
Graphics()->QuadsDrawTL(&ItemQ, 1);
|
||||
Graphics()->SetColor4(ColorBottomLeft, ColorBottomRight, ColorBottomLeft, ColorBottomRight);
|
||||
ItemQ = IGraphics::CQuadItem(x+r, y+h-r, w-r*2, r); // bottom
|
||||
ItemQ = IGraphics::CQuadItem(x + r, y + h - r, w - r * 2, r); // bottom
|
||||
Graphics()->QuadsDrawTL(&ItemQ, 1);
|
||||
Graphics()->SetColor4(ColorTopLeft, ColorTopLeft, ColorBottomLeft, ColorBottomLeft);
|
||||
ItemQ = IGraphics::CQuadItem(x, y+r, r, h-r*2); // left
|
||||
ItemQ = IGraphics::CQuadItem(x, y + r, r, h - r * 2); // left
|
||||
Graphics()->QuadsDrawTL(&ItemQ, 1);
|
||||
Graphics()->SetColor4(ColorTopRight, ColorTopRight, ColorBottomRight, ColorBottomRight);
|
||||
ItemQ = IGraphics::CQuadItem(x+w-r, y+r, r, h-r*2); // right
|
||||
ItemQ = IGraphics::CQuadItem(x + w - r, y + r, r, h - r * 2); // right
|
||||
Graphics()->QuadsDrawTL(&ItemQ, 1);
|
||||
|
||||
if(!(Corners&1))
|
||||
if(!(Corners & 1))
|
||||
{
|
||||
Graphics()->SetColor(ColorTopLeft.r, ColorTopLeft.g, ColorTopLeft.b, ColorTopLeft.a);
|
||||
IGraphics::CQuadItem ItemQ = IGraphics::CQuadItem(x, y, r, r); // TL
|
||||
Graphics()->QuadsDrawTL(&ItemQ, 1);
|
||||
}
|
||||
if(!(Corners&2))
|
||||
if(!(Corners & 2))
|
||||
{
|
||||
Graphics()->SetColor(ColorTopRight.r, ColorTopRight.g, ColorTopRight.b, ColorTopRight.a);
|
||||
IGraphics::CQuadItem ItemQ = IGraphics::CQuadItem(x+w, y, -r, r); // TR
|
||||
IGraphics::CQuadItem ItemQ = IGraphics::CQuadItem(x + w, y, -r, r); // TR
|
||||
Graphics()->QuadsDrawTL(&ItemQ, 1);
|
||||
}
|
||||
if(!(Corners&4))
|
||||
if(!(Corners & 4))
|
||||
{
|
||||
Graphics()->SetColor(ColorBottomLeft.r, ColorBottomLeft.g, ColorBottomLeft.b, ColorBottomLeft.a);
|
||||
IGraphics::CQuadItem ItemQ = IGraphics::CQuadItem(x, y+h, r, -r); // BL
|
||||
IGraphics::CQuadItem ItemQ = IGraphics::CQuadItem(x, y + h, r, -r); // BL
|
||||
Graphics()->QuadsDrawTL(&ItemQ, 1);
|
||||
}
|
||||
if(!(Corners&8))
|
||||
if(!(Corners & 8))
|
||||
{
|
||||
Graphics()->SetColor(ColorBottomRight.r, ColorBottomRight.g, ColorBottomRight.b, ColorBottomRight.a);
|
||||
IGraphics::CQuadItem ItemQ = IGraphics::CQuadItem(x+w, y+h, -r, -r); // BR
|
||||
IGraphics::CQuadItem ItemQ = IGraphics::CQuadItem(x + w, y + h, -r, -r); // BR
|
||||
Graphics()->QuadsDrawTL(&ItemQ, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int CRenderTools::CreateRoundRectQuadContainer(float x, float y, float w, float h, float r, int Corners)
|
||||
{
|
||||
int ContainerIndex = Graphics()->CreateQuadContainer();
|
||||
|
@ -447,11 +446,10 @@ void CRenderTools::DrawUIRect4(const CUIRect *r, vec4 ColorTopLeft, vec4 ColorTo
|
|||
Graphics()->TextureClear();
|
||||
|
||||
Graphics()->QuadsBegin();
|
||||
DrawRoundRectExt4(r->x,r->y,r->w,r->h,ColorTopLeft,ColorTopRight,ColorBottomLeft,ColorBottomRight,Rounding, Corners);
|
||||
DrawRoundRectExt4(r->x, r->y, r->w, r->h, ColorTopLeft, ColorTopRight, ColorBottomLeft, ColorBottomRight, Rounding, Corners);
|
||||
Graphics()->QuadsEnd();
|
||||
}
|
||||
|
||||
|
||||
void CRenderTools::DrawCircle(float x, float y, float r, int Segments)
|
||||
{
|
||||
IGraphics::CFreeformItem Array[32];
|
||||
|
|
|
@ -110,9 +110,9 @@ MACRO_CONFIG_COL(UiColor, ui_color, 0xE4A046AF, CFGFLAG_CLIENT|CFGFLAG_SAVE|CFGF
|
|||
MACRO_CONFIG_INT(UiColorizePing, ui_colorize_ping, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Highlight ping")
|
||||
MACRO_CONFIG_INT(UiColorizeGametype, ui_colorize_gametype, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Highlight gametype")
|
||||
|
||||
MACRO_CONFIG_STR(UiDemoSelected, ui_demo_selected, 256, "", CFGFLAG_CLIENT|CFGFLAG_SAVE, "Selected demo file")
|
||||
MACRO_CONFIG_INT(UiCloseWindowAfterChangingSetting, ui_close_window_after_changing_setting, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Close window after changing setting")
|
||||
MACRO_CONFIG_INT(UiUnreadNews, ui_unread_news, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Whether there is unread news")
|
||||
MACRO_CONFIG_STR(UiDemoSelected, ui_demo_selected, 256, "", CFGFLAG_CLIENT | CFGFLAG_SAVE, "Selected demo file")
|
||||
MACRO_CONFIG_INT(UiCloseWindowAfterChangingSetting, ui_close_window_after_changing_setting, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Close window after changing setting")
|
||||
MACRO_CONFIG_INT(UiUnreadNews, ui_unread_news, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Whether there is unread news")
|
||||
|
||||
MACRO_CONFIG_INT(GfxNoclip, gfx_noclip, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Disable clipping")
|
||||
|
||||
|
@ -137,8 +137,8 @@ MACRO_CONFIG_INT(ClDummyFire, cl_dummy_fire, 0, 0, 1, CFGFLAG_CLIENT, "Whether d
|
|||
MACRO_CONFIG_INT(ClDummyHook, cl_dummy_hook, 0, 0, 1, CFGFLAG_CLIENT, "Whether dummy is hooking")
|
||||
|
||||
// start menu
|
||||
MACRO_CONFIG_INT(ClShowStartMenuImages, cl_show_start_menu_images, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show start menu images")
|
||||
MACRO_CONFIG_INT(ClSkipStartMenu, cl_skip_start_menu, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Skip the start menu")
|
||||
MACRO_CONFIG_INT(ClShowStartMenuImages, cl_show_start_menu_images, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show start menu images")
|
||||
MACRO_CONFIG_INT(ClSkipStartMenu, cl_skip_start_menu, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Skip the start menu")
|
||||
|
||||
// server
|
||||
MACRO_CONFIG_INT(SvWarmup, sv_warmup, 0, 0, 0, CFGFLAG_SERVER, "Number of seconds to do warmup before round starts")
|
||||
|
|
Loading…
Reference in a new issue