Merge pull request #646 from heinrich5991/pr_ddnet_brace_style

Fix the brace style in some places
This commit is contained in:
Dennis Felsing 2017-03-09 13:31:21 +01:00 committed by GitHub
commit 761c3c9be1
6 changed files with 44 additions and 27 deletions

View file

@ -2090,7 +2090,8 @@ void CClient::ProcessServerPacketDummy(CNetChunk *pPacket)
void CClient::ResetMapDownload()
{
if(m_pMapdownloadTask){
if(m_pMapdownloadTask)
{
delete m_pMapdownloadTask;
m_pMapdownloadTask = NULL;
}
@ -2120,7 +2121,8 @@ void CClient::FinishMapDownload()
m_MapdownloadTotalsize = prev;
SendMapRequest();
}
else{
else
{
if(m_MapdownloadFile)
io_close(m_MapdownloadFile);
ResetMapDownload();
@ -3073,11 +3075,14 @@ void CClient::Con_Play(IConsole::IResult *pResult, void *pUserData)
void CClient::Con_DemoPlay(IConsole::IResult *pResult, void *pUserData)
{
CClient *pSelf = (CClient *)pUserData;
if(pSelf->m_DemoPlayer.IsPlaying()){
if(pSelf->m_DemoPlayer.BaseInfo()->m_Paused){
if(pSelf->m_DemoPlayer.IsPlaying())
{
if(pSelf->m_DemoPlayer.BaseInfo()->m_Paused)
{
pSelf->m_DemoPlayer.Unpause();
}
else{
else
{
pSelf->m_DemoPlayer.Pause();
}
}

View file

@ -108,7 +108,8 @@ void CFetcher::FetchFile(CFetchTask *pTask)
IOHANDLE File = io_open(aPath, IOFLAG_WRITE);
if(!File){
if(!File)
{
dbg_msg("fetcher", "i/o error, cannot open file: %s", pTask->m_aDest);
pTask->m_State = CFetchTask::STATE_ERROR;
return;

View file

@ -211,8 +211,10 @@ void CUpdater::PerformUpdate()
const char *aLastFile;
aLastFile = "";
for(map<string, bool>::reverse_iterator it = m_FileJobs.rbegin(); it != m_FileJobs.rend(); ++it){
if(it->second){
for(map<string, bool>::reverse_iterator it = m_FileJobs.rbegin(); it != m_FileJobs.rend(); ++it)
{
if(it->second)
{
aLastFile = it->first.c_str();
break;
}

View file

@ -74,8 +74,8 @@ public:
char aLineBuf[1024*2];
char aEscapeBuf[1024*2];
#define MACRO_CONFIG_INT(Name,ScriptName,def,min,max,flags,desc) if((flags)&CFGFLAG_SAVE){ str_format(aLineBuf, sizeof(aLineBuf), "%s %i", #ScriptName, g_Config.m_##Name); WriteLine(aLineBuf); }
#define MACRO_CONFIG_STR(Name,ScriptName,len,def,flags,desc) if((flags)&CFGFLAG_SAVE){ EscapeParam(aEscapeBuf, g_Config.m_##Name, sizeof(aEscapeBuf)); str_format(aLineBuf, sizeof(aLineBuf), "%s \"%s\"", #ScriptName, aEscapeBuf); WriteLine(aLineBuf); }
#define MACRO_CONFIG_INT(Name,ScriptName,def,min,max,flags,desc) if((flags)&CFGFLAG_SAVE) { str_format(aLineBuf, sizeof(aLineBuf), "%s %i", #ScriptName, g_Config.m_##Name); WriteLine(aLineBuf); }
#define MACRO_CONFIG_STR(Name,ScriptName,len,def,flags,desc) if((flags)&CFGFLAG_SAVE) { EscapeParam(aEscapeBuf, g_Config.m_##Name, sizeof(aEscapeBuf)); str_format(aLineBuf, sizeof(aLineBuf), "%s \"%s\"", #ScriptName, aEscapeBuf); WriteLine(aLineBuf); }
#include "config_variables.h"

View file

@ -772,7 +772,8 @@ void CChat::OnRender()
TextRender()->TextColor(0.7f, 0.7f, 1.0f, Blend); // blue
else if(m_aLines[r].m_NameColor == TEAM_SPECTATORS)
TextRender()->TextColor(0.75f, 0.5f, 0.75f, Blend); // spectator
else if(m_aLines[r].m_NameColor == 2){
else if(m_aLines[r].m_NameColor == 2)
{
vec3 rgb = HslToRgb(vec3(g_Config.m_ClMessageFriendHue / 255.0f, g_Config.m_ClMessageFriendSat / 255.0f, g_Config.m_ClMessageFriendLht / 255.0f));
TextRender()->TextColor(rgb.r, rgb.g, rgb.b, Blend);
}

View file

@ -1408,7 +1408,8 @@ void CMenus::RenderSettingsHUD(CUIRect MainView)
UI()->DoLabelScaled(&Label, Localize("System message"), 16.0f, -1);
{
static int s_DefaultButton = 0;
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button))
{
vec3 HSL = RgbToHsl(vec3(1.0f, 1.0f, 0.5f)); // default values
g_Config.m_ClMessageSystemHue = HSL.h;
g_Config.m_ClMessageSystemSat = HSL.s;
@ -1459,12 +1460,13 @@ void CMenus::RenderSettingsHUD(CUIRect MainView)
UI()->DoLabelScaled(&Label, Localize("Highlighted message"), 16.0f, -1);
{
static int s_DefaultButton = 0;
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){
vec3 HSL = RgbToHsl(vec3(1.0f, 0.5f, 0.5f)); // default values
g_Config.m_ClMessageHighlightHue = HSL.h;
g_Config.m_ClMessageHighlightSat = HSL.s;
g_Config.m_ClMessageHighlightLht = HSL.l;
}
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button))
{
vec3 HSL = RgbToHsl(vec3(1.0f, 0.5f, 0.5f)); // default values
g_Config.m_ClMessageHighlightHue = HSL.h;
g_Config.m_ClMessageHighlightSat = HSL.s;
g_Config.m_ClMessageHighlightLht = HSL.l;
}
}
Right.HSplitTop(20.0f, &Button, &Right);
Button.VSplitLeft(15.0f, 0, &Button);
@ -1516,7 +1518,8 @@ void CMenus::RenderSettingsHUD(CUIRect MainView)
UI()->DoLabelScaled(&Label, Localize("Team message"), 16.0f, -1);
{
static int s_DefaultButton = 0;
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button))
{
vec3 HSL = RgbToHsl(vec3(0.65f, 1.0f, 0.65f)); // default values
g_Config.m_ClMessageTeamHue = HSL.h;
g_Config.m_ClMessageTeamSat = HSL.s;
@ -1568,10 +1571,11 @@ void CMenus::RenderSettingsHUD(CUIRect MainView)
UI()->DoLabelScaled(&Label, "Friend message", 16.0f, -1);
{
static int s_DefaultButton = 0;
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){
g_Config.m_ClMessageFriendHue = 0;
g_Config.m_ClMessageFriendSat = 255;
g_Config.m_ClMessageFriendLht = 145;
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button))
{
g_Config.m_ClMessageFriendHue = 0;
g_Config.m_ClMessageFriendSat = 255;
g_Config.m_ClMessageFriendLht = 145;
}
}
@ -1632,7 +1636,8 @@ void CMenus::RenderSettingsHUD(CUIRect MainView)
UI()->DoLabelScaled(&Label, Localize("Normal message"), 16.0f, -1);
{
static int s_DefaultButton = 0;
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button))
{
vec3 HSL = RgbToHsl(vec3(1.0f, 1.0f, 1.0f)); // default values
g_Config.m_ClMessageHue = HSL.h;
g_Config.m_ClMessageSat = HSL.s;
@ -1688,7 +1693,8 @@ void CMenus::RenderSettingsHUD(CUIRect MainView)
UI()->DoLabelScaled(&Label, Localize("Inner color"), 16.0f, -1);
{
static int s_DefaultButton = 0;
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button))
{
vec3 HSL = RgbToHsl(vec3(0.5f, 0.5f, 1.0f)); // default values
g_Config.m_ClLaserInnerHue = HSL.h;
g_Config.m_ClLaserInnerSat = HSL.s;
@ -1723,7 +1729,8 @@ void CMenus::RenderSettingsHUD(CUIRect MainView)
UI()->DoLabelScaled(&Label, Localize("Outline color"), 16.0f, -1);
{
static int s_DefaultButton = 0;
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){
if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button))
{
vec3 HSL = RgbToHsl(vec3(0.075f, 0.075f, 0.25f)); // default values
g_Config.m_ClLaserOutlineHue = HSL.h;
g_Config.m_ClLaserOutlineSat = HSL.s;
@ -2083,7 +2090,8 @@ void CMenus::RenderSettingsDDNet(CUIRect MainView)
}
else if(State >= IUpdater::GETTING_MANIFEST && State < IUpdater::NEED_RESTART)
str_format(aBuf, sizeof(aBuf), Localize("Updating..."));
else if(State == IUpdater::NEED_RESTART){
else if(State == IUpdater::NEED_RESTART)
{
str_format(aBuf, sizeof(aBuf), Localize("DDNet Client updated!"));
m_NeedRestartUpdate = true;
}