mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Get rid of trailing whitespaces
This commit is contained in:
parent
1a103081b8
commit
09552a6d9f
|
@ -1,18 +1,18 @@
|
||||||
FreeType = {
|
FreeType = {
|
||||||
basepath = PathDir(ModuleFilename()),
|
basepath = PathDir(ModuleFilename()),
|
||||||
|
|
||||||
OptFind = function (name, required)
|
OptFind = function (name, required)
|
||||||
local check = function(option, settings)
|
local check = function(option, settings)
|
||||||
option.value = false
|
option.value = false
|
||||||
option.use_pkgconfig = false
|
option.use_pkgconfig = false
|
||||||
option.use_winlib = 0
|
option.use_winlib = 0
|
||||||
option.lib_path = nil
|
option.lib_path = nil
|
||||||
|
|
||||||
if family ~= "windows" and ExecuteSilent("pkg-config freetype2") == 0 then
|
if family ~= "windows" and ExecuteSilent("pkg-config freetype2") == 0 then
|
||||||
option.value = true
|
option.value = true
|
||||||
option.use_pkgconfig = true
|
option.use_pkgconfig = true
|
||||||
end
|
end
|
||||||
|
|
||||||
if platform == "win32" then
|
if platform == "win32" then
|
||||||
option.value = true
|
option.value = true
|
||||||
option.use_winlib = 32
|
option.use_winlib = 32
|
||||||
|
@ -21,15 +21,15 @@ FreeType = {
|
||||||
option.use_winlib = 64
|
option.use_winlib = 64
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local apply = function(option, settings)
|
local apply = function(option, settings)
|
||||||
-- include path
|
-- include path
|
||||||
settings.cc.includes:Add(FreeType.basepath .. "/include")
|
settings.cc.includes:Add(FreeType.basepath .. "/include")
|
||||||
|
|
||||||
if option.use_pkgconfig == true then
|
if option.use_pkgconfig == true then
|
||||||
settings.cc.flags:Add("`pkg-config freetype2 --cflags`")
|
settings.cc.flags:Add("`pkg-config freetype2 --cflags`")
|
||||||
settings.link.flags:Add("`pkg-config freetype2 --libs`")
|
settings.link.flags:Add("`pkg-config freetype2 --libs`")
|
||||||
|
|
||||||
elseif option.use_winlib > 0 then
|
elseif option.use_winlib > 0 then
|
||||||
if option.use_winlib == 32 then
|
if option.use_winlib == 32 then
|
||||||
settings.link.libpath:Add(FreeType.basepath .. "/lib32")
|
settings.link.libpath:Add(FreeType.basepath .. "/lib32")
|
||||||
|
@ -39,13 +39,13 @@ FreeType = {
|
||||||
settings.link.libs:Add("freetype")
|
settings.link.libs:Add("freetype")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local save = function(option, output)
|
local save = function(option, output)
|
||||||
output:option(option, "value")
|
output:option(option, "value")
|
||||||
output:option(option, "use_pkgconfig")
|
output:option(option, "use_pkgconfig")
|
||||||
output:option(option, "use_winlib")
|
output:option(option, "use_winlib")
|
||||||
end
|
end
|
||||||
|
|
||||||
local display = function(option)
|
local display = function(option)
|
||||||
if option.value == true then
|
if option.value == true then
|
||||||
if option.use_pkgconfig == true then return "using pkg-config" end
|
if option.use_pkgconfig == true then return "using pkg-config" end
|
||||||
|
@ -60,7 +60,7 @@ FreeType = {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local o = MakeOption(name, 0, check, save, display)
|
local o = MakeOption(name, 0, check, save, display)
|
||||||
o.Apply = apply
|
o.Apply = apply
|
||||||
o.include_path = nil
|
o.include_path = nil
|
||||||
|
|
|
@ -144,7 +144,7 @@ void CFetcher::FetchFile(CFetchTask *pTask)
|
||||||
curl_easy_setopt(m_pHandle, CURLOPT_PROGRESSDATA, pTask);
|
curl_easy_setopt(m_pHandle, CURLOPT_PROGRESSDATA, pTask);
|
||||||
curl_easy_setopt(m_pHandle, CURLOPT_PROGRESSFUNCTION, &CFetcher::ProgressCallback);
|
curl_easy_setopt(m_pHandle, CURLOPT_PROGRESSFUNCTION, &CFetcher::ProgressCallback);
|
||||||
curl_easy_setopt(m_pHandle, CURLOPT_NOSIGNAL, 1L);
|
curl_easy_setopt(m_pHandle, CURLOPT_NOSIGNAL, 1L);
|
||||||
|
|
||||||
dbg_msg("fetcher", "downloading %s", pTask->m_aDest);
|
dbg_msg("fetcher", "downloading %s", pTask->m_aDest);
|
||||||
pTask->m_State = CFetchTask::STATE_RUNNING;
|
pTask->m_State = CFetchTask::STATE_RUNNING;
|
||||||
int ret = curl_easy_perform(m_pHandle);
|
int ret = curl_easy_perform(m_pHandle);
|
||||||
|
|
|
@ -74,7 +74,7 @@ void CUpdater::FetchFile(const char *pFile, const char *pDestPath)
|
||||||
CFetchTask *Task = new CFetchTask(false);
|
CFetchTask *Task = new CFetchTask(false);
|
||||||
m_pFetcher->QueueAdd(Task, aBuf, aPath, -2, this, &CUpdater::CompletionCallback, &CUpdater::ProgressCallback);
|
m_pFetcher->QueueAdd(Task, aBuf, aPath, -2, this, &CUpdater::CompletionCallback, &CUpdater::ProgressCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUpdater::MoveFile(const char *pFile)
|
void CUpdater::MoveFile(const char *pFile)
|
||||||
{
|
{
|
||||||
char aBuf[256];
|
char aBuf[256];
|
||||||
|
|
|
@ -17,7 +17,7 @@ class CBackground : public CComponent
|
||||||
int64 m_LastLoad;
|
int64 m_LastLoad;
|
||||||
|
|
||||||
//to avoid memory leak when switching to %current%
|
//to avoid memory leak when switching to %current%
|
||||||
IEngineMap *m_pBackgroundMap;
|
IEngineMap *m_pBackgroundMap;
|
||||||
CLayers *m_pBackgroundLayers;
|
CLayers *m_pBackgroundLayers;
|
||||||
CMapImages *m_pBackgroundImages;
|
CMapImages *m_pBackgroundImages;
|
||||||
|
|
||||||
|
|
|
@ -559,7 +559,7 @@ void CGhost::OnMessage(int MsgType, void *pRawMsg)
|
||||||
int FinishedPos = pFinished - pMsg->m_pMessage;
|
int FinishedPos = pFinished - pMsg->m_pMessage;
|
||||||
if (!pFinished || FinishedPos == 0 || FinishedPos >= (int)sizeof(aName))
|
if (!pFinished || FinishedPos == 0 || FinishedPos >= (int)sizeof(aName))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
str_copy(aName, pMsg->m_pMessage, FinishedPos + 1);
|
str_copy(aName, pMsg->m_pMessage, FinishedPos + 1);
|
||||||
|
|
||||||
// prepare values and state for saving
|
// prepare values and state for saving
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
class CMapImages : public CComponent
|
class CMapImages : public CComponent
|
||||||
{
|
{
|
||||||
friend class CBackground;
|
friend class CBackground;
|
||||||
|
|
||||||
int m_aTextures[64];
|
int m_aTextures[64];
|
||||||
int m_Count;
|
int m_Count;
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ void CMapLayers::OnRender()
|
||||||
float y0 = (pGroup->m_ClipY - Points[1]) / (Points[3]-Points[1]);
|
float y0 = (pGroup->m_ClipY - Points[1]) / (Points[3]-Points[1]);
|
||||||
float x1 = ((pGroup->m_ClipX+pGroup->m_ClipW) - Points[0]) / (Points[2]-Points[0]);
|
float x1 = ((pGroup->m_ClipX+pGroup->m_ClipW) - Points[0]) / (Points[2]-Points[0]);
|
||||||
float y1 = ((pGroup->m_ClipY+pGroup->m_ClipH) - Points[1]) / (Points[3]-Points[1]);
|
float y1 = ((pGroup->m_ClipY+pGroup->m_ClipH) - Points[1]) / (Points[3]-Points[1]);
|
||||||
|
|
||||||
if(x1 < 0.0f || x0 > 1.0f || y1 < 0.0f || y0 > 1.0f)
|
if(x1 < 0.0f || x0 > 1.0f || y1 < 0.0f || y0 > 1.0f)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
class CMapLayers : public CComponent
|
class CMapLayers : public CComponent
|
||||||
{
|
{
|
||||||
friend class CBackground;
|
friend class CBackground;
|
||||||
|
|
||||||
CLayers *m_pLayers; // todo refactor: maybe remove it and access it through client*
|
CLayers *m_pLayers; // todo refactor: maybe remove it and access it through client*
|
||||||
int m_Type;
|
int m_Type;
|
||||||
int m_CurrentLocalTick;
|
int m_CurrentLocalTick;
|
||||||
|
|
|
@ -385,7 +385,7 @@ int CMenus::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrS
|
||||||
else
|
else
|
||||||
aInputing[s_AtIndex + i] = Text[i];
|
aInputing[s_AtIndex + i] = Text[i];
|
||||||
}
|
}
|
||||||
//s_AtIndex = s_AtIndex+FillCharLen;
|
//s_AtIndex = s_AtIndex+FillCharLen;
|
||||||
pDisplayStr = aInputing;
|
pDisplayStr = aInputing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ void CRaceDemo::OnMessage(int MsgType, void *pRawMsg)
|
||||||
int FinishedPos = pFinished - pMsg->m_pMessage;
|
int FinishedPos = pFinished - pMsg->m_pMessage;
|
||||||
if (!pFinished || FinishedPos == 0 || FinishedPos >= (int)sizeof(aName))
|
if (!pFinished || FinishedPos == 0 || FinishedPos >= (int)sizeof(aName))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// store the name
|
// store the name
|
||||||
str_copy(aName, pMsg->m_pMessage, FinishedPos + 1);
|
str_copy(aName, pMsg->m_pMessage, FinishedPos + 1);
|
||||||
|
|
||||||
|
|
|
@ -19,22 +19,22 @@ class CRaceDemo : public CComponent
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int m_RaceState;
|
int m_RaceState;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
RACE_NONE = 0,
|
RACE_NONE = 0,
|
||||||
RACE_STARTED,
|
RACE_STARTED,
|
||||||
RACE_FINISHED,
|
RACE_FINISHED,
|
||||||
};
|
};
|
||||||
|
|
||||||
CRaceDemo();
|
CRaceDemo();
|
||||||
|
|
||||||
virtual void OnReset();
|
virtual void OnReset();
|
||||||
virtual void OnStateChange(int NewState, int OldState);
|
virtual void OnStateChange(int NewState, int OldState);
|
||||||
virtual void OnRender();
|
virtual void OnRender();
|
||||||
virtual void OnShutdown();
|
virtual void OnShutdown();
|
||||||
virtual void OnMessage(int MsgType, void *pRawMsg);
|
virtual void OnMessage(int MsgType, void *pRawMsg);
|
||||||
|
|
||||||
void CheckDemo();
|
void CheckDemo();
|
||||||
void SaveDemo(const char* pDemo);
|
void SaveDemo(const char* pDemo);
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,7 +48,7 @@ void CLineInput::Editing(const char *pString, int Cursor)
|
||||||
m_DisplayStr[m_CursorPos + i] = Texting[i];
|
m_DisplayStr[m_CursorPos + i] = Texting[i];
|
||||||
}
|
}
|
||||||
m_FakeLen = str_length(m_DisplayStr);
|
m_FakeLen = str_length(m_DisplayStr);
|
||||||
m_FakeCursorPos = m_CursorPos + Cursor + 1;
|
m_FakeCursorPos = m_CursorPos + Cursor + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLineInput::Add(const char *pString)
|
void CLineInput::Add(const char *pString)
|
||||||
|
|
|
@ -2790,7 +2790,7 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIDs, int *
|
||||||
((pProps[i].m_Value >> s_aShift[1])&0xff)/255.0f,
|
((pProps[i].m_Value >> s_aShift[1])&0xff)/255.0f,
|
||||||
((pProps[i].m_Value >> s_aShift[2])&0xff)/255.0f,
|
((pProps[i].m_Value >> s_aShift[2])&0xff)/255.0f,
|
||||||
1.0f);
|
1.0f);
|
||||||
|
|
||||||
static int s_ColorPicker, s_ColorPickerID;
|
static int s_ColorPicker, s_ColorPickerID;
|
||||||
if(DoButton_ColorPicker(&s_ColorPicker, &ColorBox, &Color))
|
if(DoButton_ColorPicker(&s_ColorPicker, &ColorBox, &Color))
|
||||||
{
|
{
|
||||||
|
@ -3808,7 +3808,7 @@ void CEditor::RenderFileDialog()
|
||||||
aPath[0] = 0;
|
aPath[0] = 0;
|
||||||
str_format(aBuf, sizeof(aBuf), "Current path: %s", aPath);
|
str_format(aBuf, sizeof(aBuf), "Current path: %s", aPath);
|
||||||
UI()->DoLabel(&PathBox, aBuf, 10.0f, -1, -1);
|
UI()->DoLabel(&PathBox, aBuf, 10.0f, -1, -1);
|
||||||
|
|
||||||
if(m_FileDialogStorageType == IStorage::TYPE_SAVE)
|
if(m_FileDialogStorageType == IStorage::TYPE_SAVE)
|
||||||
{
|
{
|
||||||
// filebox
|
// filebox
|
||||||
|
@ -3829,11 +3829,11 @@ void CEditor::RenderFileDialog()
|
||||||
FileBox.VSplitRight(250, &FileBox, 0);
|
FileBox.VSplitRight(250, &FileBox, 0);
|
||||||
CUIRect ClearBox;
|
CUIRect ClearBox;
|
||||||
FileBox.VSplitRight(15, &FileBox, &ClearBox);
|
FileBox.VSplitRight(15, &FileBox, &ClearBox);
|
||||||
|
|
||||||
static float s_SearchBoxID = 0;
|
static float s_SearchBoxID = 0;
|
||||||
UI()->DoLabel(&FileBoxLabel, "Search:", 10.0f, -1, -1);
|
UI()->DoLabel(&FileBoxLabel, "Search:", 10.0f, -1, -1);
|
||||||
DoEditBox(&s_SearchBoxID, &FileBox, m_aFileDialogSearchText, sizeof(m_aFileDialogSearchText), 10.0f, &s_SearchBoxID,false,CUI::CORNER_L);
|
DoEditBox(&s_SearchBoxID, &FileBox, m_aFileDialogSearchText, sizeof(m_aFileDialogSearchText), 10.0f, &s_SearchBoxID,false,CUI::CORNER_L);
|
||||||
|
|
||||||
// clearSearchbox button
|
// clearSearchbox button
|
||||||
{
|
{
|
||||||
static int s_ClearButton = 0;
|
static int s_ClearButton = 0;
|
||||||
|
@ -5334,8 +5334,8 @@ void CEditor::Reset(bool CreateDefault)
|
||||||
m_UndoRunning = false;
|
m_UndoRunning = false;
|
||||||
|
|
||||||
m_ShowEnvelopePreview = 0;
|
m_ShowEnvelopePreview = 0;
|
||||||
m_ShiftBy = 1;
|
m_ShiftBy = 1;
|
||||||
|
|
||||||
m_Map.m_Modified = false;
|
m_Map.m_Modified = false;
|
||||||
m_Map.m_UndoModified = 0;
|
m_Map.m_UndoModified = 0;
|
||||||
m_LastUndoUpdateTime = time_get();
|
m_LastUndoUpdateTime = time_get();
|
||||||
|
|
|
@ -753,7 +753,7 @@ public:
|
||||||
void Reset(bool CreateDefault=true);
|
void Reset(bool CreateDefault=true);
|
||||||
int Save(const char *pFilename);
|
int Save(const char *pFilename);
|
||||||
int Load(const char *pFilename, int StorageType);
|
int Load(const char *pFilename, int StorageType);
|
||||||
int Append(const char *pFilename, int StorageType);
|
int Append(const char *pFilename, int StorageType);
|
||||||
void LoadCurrentMap();
|
void LoadCurrentMap();
|
||||||
void Render();
|
void Render();
|
||||||
|
|
||||||
|
|
|
@ -1597,7 +1597,7 @@ int CEditor::PopupColorPicker(CEditor *pEditor, CUIRect View)
|
||||||
if(pEditor->UI()->DoPickerLogic(&pEditor->ms_SVPicker, &SVPicker, &X, &Y))
|
if(pEditor->UI()->DoPickerLogic(&pEditor->ms_SVPicker, &SVPicker, &X, &Y))
|
||||||
{
|
{
|
||||||
hsv.y = X/SVPicker.w;
|
hsv.y = X/SVPicker.w;
|
||||||
hsv.z = 1.0f - Y/SVPicker.h;
|
hsv.z = 1.0f - Y/SVPicker.h;
|
||||||
}
|
}
|
||||||
|
|
||||||
// hue slider
|
// hue slider
|
||||||
|
@ -1637,7 +1637,7 @@ int CEditor::PopupColorPicker(CEditor *pEditor, CUIRect View)
|
||||||
|
|
||||||
if(pEditor->UI()->DoPickerLogic(&pEditor->ms_HuePicker, &HuePicker, &X, &Y))
|
if(pEditor->UI()->DoPickerLogic(&pEditor->ms_HuePicker, &HuePicker, &X, &Y))
|
||||||
{
|
{
|
||||||
hsv.x = 1.0f - Y/HuePicker.h;
|
hsv.x = 1.0f - Y/HuePicker.h;
|
||||||
}
|
}
|
||||||
|
|
||||||
pEditor->ms_PickerColor = hsv;
|
pEditor->ms_PickerColor = hsv;
|
||||||
|
|
|
@ -114,7 +114,7 @@ void CLayers::InitBackground(class IMap *pMap)
|
||||||
m_pMap = pMap;
|
m_pMap = pMap;
|
||||||
m_pMap->GetType(MAPITEMTYPE_GROUP, &m_GroupsStart, &m_GroupsNum);
|
m_pMap->GetType(MAPITEMTYPE_GROUP, &m_GroupsStart, &m_GroupsNum);
|
||||||
m_pMap->GetType(MAPITEMTYPE_LAYER, &m_LayersStart, &m_LayersNum);
|
m_pMap->GetType(MAPITEMTYPE_LAYER, &m_LayersStart, &m_LayersNum);
|
||||||
|
|
||||||
//following is here to prevent crash using standard map as background
|
//following is here to prevent crash using standard map as background
|
||||||
m_pTeleLayer = 0;
|
m_pTeleLayer = 0;
|
||||||
m_pSpeedupLayer = 0;
|
m_pSpeedupLayer = 0;
|
||||||
|
@ -152,8 +152,7 @@ void CLayers::InitBackground(class IMap *pMap)
|
||||||
m_pGameGroup->m_ClipW = 0;
|
m_pGameGroup->m_ClipW = 0;
|
||||||
m_pGameGroup->m_ClipH = 0;
|
m_pGameGroup->m_ClipH = 0;
|
||||||
}
|
}
|
||||||
|
//We don't care about tile layers.
|
||||||
//We don't care about tile layers.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -665,7 +665,7 @@ void CCharacter::RemoveNinja()
|
||||||
m_Ninja.m_CurrentMoveTime = 0;
|
m_Ninja.m_CurrentMoveTime = 0;
|
||||||
m_aWeapons[WEAPON_NINJA].m_Got = false;
|
m_aWeapons[WEAPON_NINJA].m_Got = false;
|
||||||
m_Core.m_ActiveWeapon = m_LastWeapon;
|
m_Core.m_ActiveWeapon = m_LastWeapon;
|
||||||
|
|
||||||
SetWeapon(m_Core.m_ActiveWeapon);
|
SetWeapon(m_Core.m_ActiveWeapon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2124,7 +2124,7 @@ void CCharacter::GiveWeapon(int Weapon, bool Remove)
|
||||||
GiveNinja();
|
GiveNinja();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Remove)
|
if (Remove)
|
||||||
{
|
{
|
||||||
if (GetActiveWeapon()== Weapon)
|
if (GetActiveWeapon()== Weapon)
|
||||||
|
|
Loading…
Reference in a new issue