Get rid of trailing whitespaces

This commit is contained in:
Learath2 2017-02-21 19:10:08 +03:00
parent 1a103081b8
commit 09552a6d9f
17 changed files with 37 additions and 38 deletions

View file

@ -1,18 +1,18 @@
FreeType = {
basepath = PathDir(ModuleFilename()),
OptFind = function (name, required)
OptFind = function (name, required)
local check = function(option, settings)
option.value = false
option.use_pkgconfig = false
option.use_winlib = 0
option.lib_path = nil
if family ~= "windows" and ExecuteSilent("pkg-config freetype2") == 0 then
option.value = true
option.use_pkgconfig = true
end
if platform == "win32" then
option.value = true
option.use_winlib = 32
@ -21,15 +21,15 @@ FreeType = {
option.use_winlib = 64
end
end
local apply = function(option, settings)
-- include path
settings.cc.includes:Add(FreeType.basepath .. "/include")
if option.use_pkgconfig == true then
settings.cc.flags:Add("`pkg-config freetype2 --cflags`")
settings.link.flags:Add("`pkg-config freetype2 --libs`")
elseif option.use_winlib > 0 then
if option.use_winlib == 32 then
settings.link.libpath:Add(FreeType.basepath .. "/lib32")
@ -39,13 +39,13 @@ FreeType = {
settings.link.libs:Add("freetype")
end
end
local save = function(option, output)
output:option(option, "value")
output:option(option, "use_pkgconfig")
output:option(option, "use_winlib")
end
local display = function(option)
if option.value == true then
if option.use_pkgconfig == true then return "using pkg-config" end
@ -60,7 +60,7 @@ FreeType = {
end
end
end
local o = MakeOption(name, 0, check, save, display)
o.Apply = apply
o.include_path = nil

View file

@ -144,7 +144,7 @@ void CFetcher::FetchFile(CFetchTask *pTask)
curl_easy_setopt(m_pHandle, CURLOPT_PROGRESSDATA, pTask);
curl_easy_setopt(m_pHandle, CURLOPT_PROGRESSFUNCTION, &CFetcher::ProgressCallback);
curl_easy_setopt(m_pHandle, CURLOPT_NOSIGNAL, 1L);
dbg_msg("fetcher", "downloading %s", pTask->m_aDest);
pTask->m_State = CFetchTask::STATE_RUNNING;
int ret = curl_easy_perform(m_pHandle);

View file

@ -74,7 +74,7 @@ void CUpdater::FetchFile(const char *pFile, const char *pDestPath)
CFetchTask *Task = new CFetchTask(false);
m_pFetcher->QueueAdd(Task, aBuf, aPath, -2, this, &CUpdater::CompletionCallback, &CUpdater::ProgressCallback);
}
void CUpdater::MoveFile(const char *pFile)
{
char aBuf[256];

View file

@ -17,7 +17,7 @@ class CBackground : public CComponent
int64 m_LastLoad;
//to avoid memory leak when switching to %current%
IEngineMap *m_pBackgroundMap;
IEngineMap *m_pBackgroundMap;
CLayers *m_pBackgroundLayers;
CMapImages *m_pBackgroundImages;

View file

@ -559,7 +559,7 @@ void CGhost::OnMessage(int MsgType, void *pRawMsg)
int FinishedPos = pFinished - pMsg->m_pMessage;
if (!pFinished || FinishedPos == 0 || FinishedPos >= (int)sizeof(aName))
return;
str_copy(aName, pMsg->m_pMessage, FinishedPos + 1);
// prepare values and state for saving

View file

@ -7,7 +7,7 @@
class CMapImages : public CComponent
{
friend class CBackground;
int m_aTextures[64];
int m_Count;

View file

@ -150,7 +150,7 @@ void CMapLayers::OnRender()
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 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)
continue;

View file

@ -7,7 +7,7 @@
class CMapLayers : public CComponent
{
friend class CBackground;
CLayers *m_pLayers; // todo refactor: maybe remove it and access it through client*
int m_Type;
int m_CurrentLocalTick;

View file

@ -385,7 +385,7 @@ int CMenus::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrS
else
aInputing[s_AtIndex + i] = Text[i];
}
//s_AtIndex = s_AtIndex+FillCharLen;
//s_AtIndex = s_AtIndex+FillCharLen;
pDisplayStr = aInputing;
}
}

View file

@ -117,7 +117,7 @@ void CRaceDemo::OnMessage(int MsgType, void *pRawMsg)
int FinishedPos = pFinished - pMsg->m_pMessage;
if (!pFinished || FinishedPos == 0 || FinishedPos >= (int)sizeof(aName))
return;
// store the name
str_copy(aName, pMsg->m_pMessage, FinishedPos + 1);

View file

@ -19,22 +19,22 @@ class CRaceDemo : public CComponent
public:
int m_RaceState;
enum
{
RACE_NONE = 0,
RACE_STARTED,
RACE_FINISHED,
};
CRaceDemo();
virtual void OnReset();
virtual void OnStateChange(int NewState, int OldState);
virtual void OnRender();
virtual void OnShutdown();
virtual void OnMessage(int MsgType, void *pRawMsg);
void CheckDemo();
void SaveDemo(const char* pDemo);
};

View file

@ -48,7 +48,7 @@ void CLineInput::Editing(const char *pString, int Cursor)
m_DisplayStr[m_CursorPos + i] = Texting[i];
}
m_FakeLen = str_length(m_DisplayStr);
m_FakeCursorPos = m_CursorPos + Cursor + 1;
m_FakeCursorPos = m_CursorPos + Cursor + 1;
}
void CLineInput::Add(const char *pString)

View file

@ -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[2])&0xff)/255.0f,
1.0f);
static int s_ColorPicker, s_ColorPickerID;
if(DoButton_ColorPicker(&s_ColorPicker, &ColorBox, &Color))
{
@ -3808,7 +3808,7 @@ void CEditor::RenderFileDialog()
aPath[0] = 0;
str_format(aBuf, sizeof(aBuf), "Current path: %s", aPath);
UI()->DoLabel(&PathBox, aBuf, 10.0f, -1, -1);
if(m_FileDialogStorageType == IStorage::TYPE_SAVE)
{
// filebox
@ -3829,11 +3829,11 @@ void CEditor::RenderFileDialog()
FileBox.VSplitRight(250, &FileBox, 0);
CUIRect ClearBox;
FileBox.VSplitRight(15, &FileBox, &ClearBox);
static float s_SearchBoxID = 0;
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);
// clearSearchbox button
{
static int s_ClearButton = 0;
@ -5334,8 +5334,8 @@ void CEditor::Reset(bool CreateDefault)
m_UndoRunning = false;
m_ShowEnvelopePreview = 0;
m_ShiftBy = 1;
m_ShiftBy = 1;
m_Map.m_Modified = false;
m_Map.m_UndoModified = 0;
m_LastUndoUpdateTime = time_get();

View file

@ -753,7 +753,7 @@ public:
void Reset(bool CreateDefault=true);
int Save(const char *pFilename);
int Load(const char *pFilename, int StorageType);
int Append(const char *pFilename, int StorageType);
int Append(const char *pFilename, int StorageType);
void LoadCurrentMap();
void Render();

View file

@ -1597,7 +1597,7 @@ int CEditor::PopupColorPicker(CEditor *pEditor, CUIRect View)
if(pEditor->UI()->DoPickerLogic(&pEditor->ms_SVPicker, &SVPicker, &X, &Y))
{
hsv.y = X/SVPicker.w;
hsv.z = 1.0f - Y/SVPicker.h;
hsv.z = 1.0f - Y/SVPicker.h;
}
// hue slider
@ -1637,7 +1637,7 @@ int CEditor::PopupColorPicker(CEditor *pEditor, CUIRect View)
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;

View file

@ -114,7 +114,7 @@ void CLayers::InitBackground(class IMap *pMap)
m_pMap = pMap;
m_pMap->GetType(MAPITEMTYPE_GROUP, &m_GroupsStart, &m_GroupsNum);
m_pMap->GetType(MAPITEMTYPE_LAYER, &m_LayersStart, &m_LayersNum);
//following is here to prevent crash using standard map as background
m_pTeleLayer = 0;
m_pSpeedupLayer = 0;
@ -152,8 +152,7 @@ void CLayers::InitBackground(class IMap *pMap)
m_pGameGroup->m_ClipW = 0;
m_pGameGroup->m_ClipH = 0;
}
//We don't care about tile layers.
//We don't care about tile layers.
}
}
}

View file

@ -665,7 +665,7 @@ void CCharacter::RemoveNinja()
m_Ninja.m_CurrentMoveTime = 0;
m_aWeapons[WEAPON_NINJA].m_Got = false;
m_Core.m_ActiveWeapon = m_LastWeapon;
SetWeapon(m_Core.m_ActiveWeapon);
}
@ -2124,7 +2124,7 @@ void CCharacter::GiveWeapon(int Weapon, bool Remove)
GiveNinja();
return;
}
if (Remove)
{
if (GetActiveWeapon()== Weapon)