mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
Enable readability-inconsistent-declaration-parameter-name
This commit is contained in:
parent
7aac8b5386
commit
bc78ba57b9
|
@ -42,6 +42,7 @@ Checks: >
|
||||||
readability-qualified-auto,
|
readability-qualified-auto,
|
||||||
readability-container-size-empty,
|
readability-container-size-empty,
|
||||||
readability-delete-null-pointer,
|
readability-delete-null-pointer,
|
||||||
|
readability-inconsistent-declaration-parameter-name,
|
||||||
performance-*,
|
performance-*,
|
||||||
-performance-no-int-to-ptr,
|
-performance-no-int-to-ptr,
|
||||||
HeaderFilterRegex: 'src/.*'
|
HeaderFilterRegex: 'src/.*'
|
||||||
|
|
|
@ -155,7 +155,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T, typename F>
|
template<typename T, typename F>
|
||||||
T color_cast(const F &f) = delete;
|
T color_cast(const F&) = delete;
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline ColorHSLA color_cast(const ColorRGBA &rgb)
|
inline ColorHSLA color_cast(const ColorRGBA &rgb)
|
||||||
|
|
|
@ -1873,14 +1873,14 @@ int str_utf8_to_skeleton(const char *str, int *buf, int buf_len);
|
||||||
Compares two strings for visual appearance.
|
Compares two strings for visual appearance.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
a - String to compare.
|
str1 - String to compare.
|
||||||
b - String to compare.
|
str2 - String to compare.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
0 if the strings are confusable.
|
0 if the strings are confusable.
|
||||||
!=0 otherwise.
|
!=0 otherwise.
|
||||||
*/
|
*/
|
||||||
int str_utf8_comp_confusable(const char *a, const char *b);
|
int str_utf8_comp_confusable(const char *str1, const char *str2);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Function: str_utf8_tolower
|
Function: str_utf8_tolower
|
||||||
|
@ -1978,13 +1978,13 @@ const char *str_utf8_skip_whitespaces(const char *str);
|
||||||
the string in-place.
|
the string in-place.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
str - Pointer to the string.
|
param - Pointer to the string.
|
||||||
|
|
||||||
Remarks:
|
Remarks:
|
||||||
- The strings are treated as zero-terminated strings.
|
- The strings are treated as zero-terminated strings.
|
||||||
- The string is modified in-place.
|
- The string is modified in-place.
|
||||||
*/
|
*/
|
||||||
void str_utf8_trim_right(char *str);
|
void str_utf8_trim_right(char *param);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Function: str_utf8_rewind
|
Function: str_utf8_rewind
|
||||||
|
|
|
@ -361,7 +361,7 @@ void CGhostLoader::Close()
|
||||||
m_File = 0;
|
m_File = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGhostLoader::GetGhostInfo(const char *pFilename, CGhostInfo *pInfo, const char *pMap, SHA256_DIGEST MapSha256, unsigned MapCrc)
|
bool CGhostLoader::GetGhostInfo(const char *pFilename, CGhostInfo *pGhostInfo, const char *pMap, SHA256_DIGEST MapSha256, unsigned MapCrc)
|
||||||
{
|
{
|
||||||
CGhostHeader Header;
|
CGhostHeader Header;
|
||||||
mem_zero(&Header, sizeof(Header));
|
mem_zero(&Header, sizeof(Header));
|
||||||
|
@ -395,7 +395,7 @@ bool CGhostLoader::GetGhostInfo(const char *pFilename, CGhostInfo *pInfo, const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*pInfo = Header.ToGhostInfo();
|
*pGhostInfo = Header.ToGhostInfo();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,20 +83,20 @@ void CDbConnectionPool::RegisterDatabase(std::unique_ptr<IDbConnection> pDatabas
|
||||||
|
|
||||||
void CDbConnectionPool::Execute(
|
void CDbConnectionPool::Execute(
|
||||||
FRead pFunc,
|
FRead pFunc,
|
||||||
std::unique_ptr<const ISqlData> pThreadData,
|
std::unique_ptr<const ISqlData> pSqlRequestData,
|
||||||
const char *pName)
|
const char *pName)
|
||||||
{
|
{
|
||||||
m_aTasks[FirstElem++].reset(new CSqlExecData(pFunc, std::move(pThreadData), pName));
|
m_aTasks[FirstElem++].reset(new CSqlExecData(pFunc, std::move(pSqlRequestData), pName));
|
||||||
FirstElem %= sizeof(m_aTasks) / sizeof(m_aTasks[0]);
|
FirstElem %= sizeof(m_aTasks) / sizeof(m_aTasks[0]);
|
||||||
m_NumElem.Signal();
|
m_NumElem.Signal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbConnectionPool::ExecuteWrite(
|
void CDbConnectionPool::ExecuteWrite(
|
||||||
FWrite pFunc,
|
FWrite pFunc,
|
||||||
std::unique_ptr<const ISqlData> pThreadData,
|
std::unique_ptr<const ISqlData> pSqlRequestData,
|
||||||
const char *pName)
|
const char *pName)
|
||||||
{
|
{
|
||||||
m_aTasks[FirstElem++].reset(new CSqlExecData(pFunc, std::move(pThreadData), pName));
|
m_aTasks[FirstElem++].reset(new CSqlExecData(pFunc, std::move(pSqlRequestData), pName));
|
||||||
FirstElem %= sizeof(m_aTasks) / sizeof(m_aTasks[0]);
|
FirstElem %= sizeof(m_aTasks) / sizeof(m_aTasks[0]);
|
||||||
m_NumElem.Signal();
|
m_NumElem.Signal();
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ void DilateImage(unsigned char *pImageBuff, int w, int h, int BPP);
|
||||||
void DilateImageSub(unsigned char *pImageBuff, int w, int h, int BPP, int x, int y, int sw, int sh);
|
void DilateImageSub(unsigned char *pImageBuff, int w, int h, int BPP, int x, int y, int sw, int sh);
|
||||||
|
|
||||||
// returned pointer is allocated with malloc
|
// returned pointer is allocated with malloc
|
||||||
uint8_t *ResizeImage(const uint8_t *pImgData, int Width, int Height, int NewWidth, int NewHeight, int BPP);
|
uint8_t *ResizeImage(const uint8_t *pImageData, int Width, int Height, int NewWidth, int NewHeight, int BPP);
|
||||||
|
|
||||||
int HighestBit(int OfVar);
|
int HighestBit(int OfVar);
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,7 @@ public:
|
||||||
int UnbanByRange(const CNetRange *pRange);
|
int UnbanByRange(const CNetRange *pRange);
|
||||||
int UnbanByIndex(int Index);
|
int UnbanByIndex(int Index);
|
||||||
void UnbanAll();
|
void UnbanAll();
|
||||||
bool IsBanned(const NETADDR *pAddr, char *pBuf, unsigned BufferSize) const;
|
bool IsBanned(const NETADDR *pOrigAddr, char *pBuf, unsigned BufferSize) const;
|
||||||
|
|
||||||
static void ConBan(class IConsole::IResult *pResult, void *pUser);
|
static void ConBan(class IConsole::IResult *pResult, void *pUser);
|
||||||
static void ConBanRange(class IConsole::IResult *pResult, void *pUser);
|
static void ConBanRange(class IConsole::IResult *pResult, void *pUser);
|
||||||
|
|
|
@ -88,8 +88,8 @@ public:
|
||||||
int GetDataUpdates(int Index) const { return m_aSnapshotDataUpdates[Index]; }
|
int GetDataUpdates(int Index) const { return m_aSnapshotDataUpdates[Index]; }
|
||||||
void SetStaticsize(int ItemType, int Size);
|
void SetStaticsize(int ItemType, int Size);
|
||||||
const CData *EmptyDelta() const;
|
const CData *EmptyDelta() const;
|
||||||
int CreateDelta(class CSnapshot *pFrom, class CSnapshot *pTo, void *pData);
|
int CreateDelta(class CSnapshot *pFrom, class CSnapshot *pTo, void *pDstData);
|
||||||
int UnpackDelta(class CSnapshot *pFrom, class CSnapshot *pTo, const void *pData, int DataSize);
|
int UnpackDelta(class CSnapshot *pFrom, class CSnapshot *pTo, const void *pSrcData, int DataSize);
|
||||||
};
|
};
|
||||||
|
|
||||||
// CSnapshotStorage
|
// CSnapshotStorage
|
||||||
|
|
|
@ -18,7 +18,7 @@ public:
|
||||||
CAnimKeyframe *GetFrontFoot() { return &m_FrontFoot; };
|
CAnimKeyframe *GetFrontFoot() { return &m_FrontFoot; };
|
||||||
CAnimKeyframe *GetAttach() { return &m_Attach; };
|
CAnimKeyframe *GetAttach() { return &m_Attach; };
|
||||||
void Set(CAnimation *pAnim, float Time);
|
void Set(CAnimation *pAnim, float Time);
|
||||||
void Add(CAnimation *pAdded, float Time, float Amount);
|
void Add(CAnimation *pAnim, float Time, float Amount);
|
||||||
|
|
||||||
static CAnimState *GetIdle();
|
static CAnimState *GetIdle();
|
||||||
};
|
};
|
||||||
|
|
|
@ -181,16 +181,16 @@ void CEmoticon::OnRender()
|
||||||
Graphics()->WrapNormal();
|
Graphics()->WrapNormal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEmoticon::Emote(int Emoticon)
|
void CEmoticon::Emote(int Emote)
|
||||||
{
|
{
|
||||||
CNetMsg_Cl_Emoticon Msg;
|
CNetMsg_Cl_Emoticon Msg;
|
||||||
Msg.m_Emoticon = Emoticon;
|
Msg.m_Emoticon = Emote;
|
||||||
Client()->SendPackMsgActive(&Msg, MSGFLAG_VITAL);
|
Client()->SendPackMsgActive(&Msg, MSGFLAG_VITAL);
|
||||||
|
|
||||||
if(g_Config.m_ClDummyCopyMoves)
|
if(g_Config.m_ClDummyCopyMoves)
|
||||||
{
|
{
|
||||||
CMsgPacker Msg(NETMSGTYPE_CL_EMOTICON, false);
|
CMsgPacker Msg(NETMSGTYPE_CL_EMOTICON, false);
|
||||||
Msg.AddInt(Emoticon);
|
Msg.AddInt(Emote);
|
||||||
Client()->SendMsg(!g_Config.m_ClDummy, &Msg, MSGFLAG_VITAL);
|
Client()->SendMsg(!g_Config.m_ClDummy, &Msg, MSGFLAG_VITAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ class CMapImages : public CComponent
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CMapImages();
|
CMapImages();
|
||||||
CMapImages(int ImageSize);
|
CMapImages(int TextureSize);
|
||||||
|
|
||||||
IGraphics::CTextureHandle Get(int Index) const { return m_aTextures[Index]; }
|
IGraphics::CTextureHandle Get(int Index) const { return m_aTextures[Index]; }
|
||||||
int Num() const { return m_Count; }
|
int Num() const { return m_Count; }
|
||||||
|
@ -75,7 +75,7 @@ public:
|
||||||
IGraphics::CTextureHandle GetOverlayTop();
|
IGraphics::CTextureHandle GetOverlayTop();
|
||||||
IGraphics::CTextureHandle GetOverlayCenter();
|
IGraphics::CTextureHandle GetOverlayCenter();
|
||||||
|
|
||||||
void SetTextureScale(int Size);
|
void SetTextureScale(int Scale);
|
||||||
int GetTextureScale();
|
int GetTextureScale();
|
||||||
|
|
||||||
void ChangeEntitiesPath(const char *pPath);
|
void ChangeEntitiesPath(const char *pPath);
|
||||||
|
|
|
@ -180,18 +180,18 @@ void CSounds::Enqueue(int Channel, int SetId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSounds::PlayAndRecord(int Chn, int SetId, float Vol, vec2 Pos)
|
void CSounds::PlayAndRecord(int Channel, int SetId, float Vol, vec2 Pos)
|
||||||
{
|
{
|
||||||
CNetMsg_Sv_SoundGlobal Msg;
|
CNetMsg_Sv_SoundGlobal Msg;
|
||||||
Msg.m_SoundID = SetId;
|
Msg.m_SoundID = SetId;
|
||||||
Client()->SendPackMsgActive(&Msg, MSGFLAG_NOSEND | MSGFLAG_RECORD);
|
Client()->SendPackMsgActive(&Msg, MSGFLAG_NOSEND | MSGFLAG_RECORD);
|
||||||
|
|
||||||
Play(Chn, SetId, Vol);
|
Play(Channel, SetId, Vol);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSounds::Play(int Chn, int SetId, float Vol)
|
void CSounds::Play(int Channel, int SetId, float Vol)
|
||||||
{
|
{
|
||||||
if(Chn == CHN_MUSIC && !g_Config.m_SndMusic)
|
if(Channel == CHN_MUSIC && !g_Config.m_SndMusic)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int SampleId = GetSampleId(SetId);
|
int SampleId = GetSampleId(SetId);
|
||||||
|
@ -199,15 +199,15 @@ void CSounds::Play(int Chn, int SetId, float Vol)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int Flags = 0;
|
int Flags = 0;
|
||||||
if(Chn == CHN_MUSIC)
|
if(Channel == CHN_MUSIC)
|
||||||
Flags = ISound::FLAG_LOOP;
|
Flags = ISound::FLAG_LOOP;
|
||||||
|
|
||||||
Sound()->Play(Chn, SampleId, Flags);
|
Sound()->Play(Channel, SampleId, Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSounds::PlayAt(int Chn, int SetId, float Vol, vec2 Pos)
|
void CSounds::PlayAt(int Channel, int SetId, float Vol, vec2 Pos)
|
||||||
{
|
{
|
||||||
if(Chn == CHN_MUSIC && !g_Config.m_SndMusic)
|
if(Channel == CHN_MUSIC && !g_Config.m_SndMusic)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int SampleId = GetSampleId(SetId);
|
int SampleId = GetSampleId(SetId);
|
||||||
|
@ -215,10 +215,10 @@ void CSounds::PlayAt(int Chn, int SetId, float Vol, vec2 Pos)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int Flags = 0;
|
int Flags = 0;
|
||||||
if(Chn == CHN_MUSIC)
|
if(Channel == CHN_MUSIC)
|
||||||
Flags = ISound::FLAG_LOOP;
|
Flags = ISound::FLAG_LOOP;
|
||||||
|
|
||||||
Sound()->PlayAt(Chn, SampleId, Flags, Pos.x, Pos.y);
|
Sound()->PlayAt(Channel, SampleId, Flags, Pos.x, Pos.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSounds::Stop(int SetId)
|
void CSounds::Stop(int SetId)
|
||||||
|
@ -232,24 +232,24 @@ void CSounds::Stop(int SetId)
|
||||||
Sound()->Stop(pSet->m_aSounds[i].m_Id);
|
Sound()->Stop(pSet->m_aSounds[i].m_Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
ISound::CVoiceHandle CSounds::PlaySample(int Chn, int SampleId, float Vol, int Flags)
|
ISound::CVoiceHandle CSounds::PlaySample(int Channel, int SampleId, float Vol, int Flags)
|
||||||
{
|
{
|
||||||
if((Chn == CHN_MUSIC && !g_Config.m_SndMusic) || SampleId == -1)
|
if((Channel == CHN_MUSIC && !g_Config.m_SndMusic) || SampleId == -1)
|
||||||
return ISound::CVoiceHandle();
|
return ISound::CVoiceHandle();
|
||||||
|
|
||||||
if(Chn == CHN_MUSIC)
|
if(Channel == CHN_MUSIC)
|
||||||
Flags |= ISound::FLAG_LOOP;
|
Flags |= ISound::FLAG_LOOP;
|
||||||
|
|
||||||
return Sound()->Play(Chn, SampleId, Flags);
|
return Sound()->Play(Channel, SampleId, Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
ISound::CVoiceHandle CSounds::PlaySampleAt(int Chn, int SampleId, float Vol, vec2 Pos, int Flags)
|
ISound::CVoiceHandle CSounds::PlaySampleAt(int Channel, int SampleId, float Vol, vec2 Pos, int Flags)
|
||||||
{
|
{
|
||||||
if((Chn == CHN_MUSIC && !g_Config.m_SndMusic) || SampleId == -1)
|
if((Channel == CHN_MUSIC && !g_Config.m_SndMusic) || SampleId == -1)
|
||||||
return ISound::CVoiceHandle();
|
return ISound::CVoiceHandle();
|
||||||
|
|
||||||
if(Chn == CHN_MUSIC)
|
if(Channel == CHN_MUSIC)
|
||||||
Flags |= ISound::FLAG_LOOP;
|
Flags |= ISound::FLAG_LOOP;
|
||||||
|
|
||||||
return Sound()->PlayAt(Chn, SampleId, Flags, Pos.x, Pos.y);
|
return Sound()->PlayAt(Channel, SampleId, Flags, Pos.x, Pos.y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -500,7 +500,7 @@ public:
|
||||||
|
|
||||||
class CTeamsCore m_Teams;
|
class CTeamsCore m_Teams;
|
||||||
|
|
||||||
int IntersectCharacter(vec2 Pos0, vec2 Pos1, vec2 &NewPos, int ownID);
|
int IntersectCharacter(vec2 HookPos, vec2 NewPos, vec2 &NewPos2, int ownID);
|
||||||
|
|
||||||
virtual int GetLastRaceTick();
|
virtual int GetLastRaceTick();
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ public:
|
||||||
bool m_IsLocal;
|
bool m_IsLocal;
|
||||||
|
|
||||||
CTeamsCore *TeamsCore();
|
CTeamsCore *TeamsCore();
|
||||||
bool Freeze(int Time);
|
bool Freeze(int Seconds);
|
||||||
bool Freeze();
|
bool Freeze();
|
||||||
bool UnFreeze();
|
bool UnFreeze();
|
||||||
void GiveAllWeapons();
|
void GiveAllWeapons();
|
||||||
|
|
|
@ -21,7 +21,7 @@ public:
|
||||||
vec2 Pos,
|
vec2 Pos,
|
||||||
vec2 Dir,
|
vec2 Dir,
|
||||||
int Span,
|
int Span,
|
||||||
bool Freeeze,
|
bool Freeze,
|
||||||
bool Explosive,
|
bool Explosive,
|
||||||
float Force,
|
float Force,
|
||||||
int SoundImpact,
|
int SoundImpact,
|
||||||
|
|
|
@ -287,9 +287,9 @@ CTuningParams *CGameWorld::Tuning()
|
||||||
return &m_Core.m_Tuning[g_Config.m_ClDummy];
|
return &m_Core.m_Tuning[g_Config.m_ClDummy];
|
||||||
}
|
}
|
||||||
|
|
||||||
CEntity *CGameWorld::GetEntity(int ID, int EntType)
|
CEntity *CGameWorld::GetEntity(int ID, int EntityType)
|
||||||
{
|
{
|
||||||
for(CEntity *pEnt = m_apFirstEntityTypes[EntType]; pEnt; pEnt = pEnt->m_pNextTypeEntity)
|
for(CEntity *pEnt = m_apFirstEntityTypes[EntityType]; pEnt; pEnt = pEnt->m_pNextTypeEntity)
|
||||||
if(pEnt->m_ID == ID)
|
if(pEnt->m_ID == ID)
|
||||||
return pEnt;
|
return pEnt;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -476,34 +476,34 @@ void CRenderTools::DrawRoundRect(float x, float y, float w, float h, float r)
|
||||||
DrawRoundRectExt(x, y, w, h, r, 0xf);
|
DrawRoundRectExt(x, y, w, h, r, 0xf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRenderTools::DrawUIRect(const CUIRect *r, ColorRGBA Color, int Corners, float Rounding)
|
void CRenderTools::DrawUIRect(const CUIRect *pRect, ColorRGBA Color, int Corners, float Rounding)
|
||||||
{
|
{
|
||||||
Graphics()->TextureClear();
|
Graphics()->TextureClear();
|
||||||
|
|
||||||
// TODO: FIX US
|
// TODO: FIX US
|
||||||
Graphics()->QuadsBegin();
|
Graphics()->QuadsBegin();
|
||||||
Graphics()->SetColor(Color);
|
Graphics()->SetColor(Color);
|
||||||
DrawRoundRectExt(r->x, r->y, r->w, r->h, Rounding * UI()->Scale(), Corners);
|
DrawRoundRectExt(pRect->x, pRect->y, pRect->w, pRect->h, Rounding * UI()->Scale(), Corners);
|
||||||
Graphics()->QuadsEnd();
|
Graphics()->QuadsEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRenderTools::DrawUIRect4(const CUIRect *r, vec4 ColorTopLeft, vec4 ColorTopRight, vec4 ColorBottomLeft, vec4 ColorBottomRight, int Corners, float Rounding)
|
void CRenderTools::DrawUIRect4(const CUIRect *pRect, vec4 ColorTopLeft, vec4 ColorTopRight, vec4 ColorBottomLeft, vec4 ColorBottomRight, int Corners, float Rounding)
|
||||||
{
|
{
|
||||||
Graphics()->TextureClear();
|
Graphics()->TextureClear();
|
||||||
|
|
||||||
Graphics()->QuadsBegin();
|
Graphics()->QuadsBegin();
|
||||||
DrawRoundRectExt4(r->x, r->y, r->w, r->h, ColorTopLeft, ColorTopRight, ColorBottomLeft, ColorBottomRight, Rounding, Corners);
|
DrawRoundRectExt4(pRect->x, pRect->y, pRect->w, pRect->h, ColorTopLeft, ColorTopRight, ColorBottomLeft, ColorBottomRight, Rounding, Corners);
|
||||||
Graphics()->QuadsEnd();
|
Graphics()->QuadsEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRenderTools::DrawUIRect4NoRounding(const CUIRect *r, vec4 ColorTopLeft, vec4 ColorTopRight, vec4 ColorBottomLeft, vec4 ColorBottomRight)
|
void CRenderTools::DrawUIRect4NoRounding(const CUIRect *pRect, vec4 ColorTopLeft, vec4 ColorTopRight, vec4 ColorBottomLeft, vec4 ColorBottomRight)
|
||||||
{
|
{
|
||||||
Graphics()->TextureClear();
|
Graphics()->TextureClear();
|
||||||
|
|
||||||
Graphics()->QuadsBegin();
|
Graphics()->QuadsBegin();
|
||||||
|
|
||||||
Graphics()->SetColor4(ColorTopLeft, ColorTopRight, ColorBottomLeft, ColorBottomRight);
|
Graphics()->SetColor4(ColorTopLeft, ColorTopRight, ColorBottomLeft, ColorBottomRight);
|
||||||
IGraphics::CQuadItem ItemQ = IGraphics::CQuadItem(r->x, r->y, r->w, r->h);
|
IGraphics::CQuadItem ItemQ = IGraphics::CQuadItem(pRect->x, pRect->y, pRect->w, pRect->h);
|
||||||
Graphics()->QuadsDrawTL(&ItemQ, 1);
|
Graphics()->QuadsDrawTL(&ItemQ, 1);
|
||||||
|
|
||||||
Graphics()->QuadsEnd();
|
Graphics()->QuadsEnd();
|
||||||
|
|
|
@ -129,11 +129,11 @@ public:
|
||||||
// DDRace
|
// DDRace
|
||||||
|
|
||||||
void RenderTeleOverlay(CTeleTile *pTele, int w, int h, float Scale, float Alpha = 1.0f);
|
void RenderTeleOverlay(CTeleTile *pTele, int w, int h, float Scale, float Alpha = 1.0f);
|
||||||
void RenderSpeedupOverlay(CSpeedupTile *pTele, int w, int h, float Scale, float Alpha = 1.0f);
|
void RenderSpeedupOverlay(CSpeedupTile *pSpeedup, int w, int h, float Scale, float Alpha = 1.0f);
|
||||||
void RenderSwitchOverlay(CSwitchTile *pSwitch, int w, int h, float Scale, float Alpha = 1.0f);
|
void RenderSwitchOverlay(CSwitchTile *pSwitch, int w, int h, float Scale, float Alpha = 1.0f);
|
||||||
void RenderTuneOverlay(CTuneTile *pTune, int w, int h, float Scale, float Alpha = 1.0f);
|
void RenderTuneOverlay(CTuneTile *pTune, int w, int h, float Scale, float Alpha = 1.0f);
|
||||||
void RenderTelemap(CTeleTile *pTele, int w, int h, float Scale, ColorRGBA Color, int RenderFlags);
|
void RenderTelemap(CTeleTile *pTele, int w, int h, float Scale, ColorRGBA Color, int RenderFlags);
|
||||||
void RenderSpeedupmap(CSpeedupTile *pTele, int w, int h, float Scale, ColorRGBA Color, int RenderFlags);
|
void RenderSpeedupmap(CSpeedupTile *pSpeedup, int w, int h, float Scale, ColorRGBA Color, int RenderFlags);
|
||||||
void RenderSwitchmap(CSwitchTile *pSwitch, int w, int h, float Scale, ColorRGBA Color, int RenderFlags);
|
void RenderSwitchmap(CSwitchTile *pSwitch, int w, int h, float Scale, ColorRGBA Color, int RenderFlags);
|
||||||
void RenderTunemap(CTuneTile *pTune, int w, int h, float Scale, ColorRGBA Color, int RenderFlags);
|
void RenderTunemap(CTuneTile *pTune, int w, int h, float Scale, ColorRGBA Color, int RenderFlags);
|
||||||
};
|
};
|
||||||
|
|
|
@ -204,11 +204,11 @@ float CUIRect::Scale() const
|
||||||
return g_Config.m_UiScale / 100.0f;
|
return g_Config.m_UiScale / 100.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUI::ClipEnable(const CUIRect *r)
|
void CUI::ClipEnable(const CUIRect *pRect)
|
||||||
{
|
{
|
||||||
float XScale = Graphics()->ScreenWidth() / Screen()->w;
|
float XScale = Graphics()->ScreenWidth() / Screen()->w;
|
||||||
float YScale = Graphics()->ScreenHeight() / Screen()->h;
|
float YScale = Graphics()->ScreenHeight() / Screen()->h;
|
||||||
Graphics()->ClipEnable((int)(r->x * XScale), (int)(r->y * YScale), (int)(r->w * XScale), (int)(r->h * YScale));
|
Graphics()->ClipEnable((int)(pRect->x * XScale), (int)(pRect->y * YScale), (int)(pRect->w * XScale), (int)(pRect->h * YScale));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUI::ClipDisable()
|
void CUI::ClipDisable()
|
||||||
|
@ -507,14 +507,14 @@ float CUI::DoTextLabel(float x, float y, float w, float h, const char *pText, fl
|
||||||
return tw;
|
return tw;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUI::DoLabel(const CUIRect *r, const char *pText, float Size, int Align, float MaxWidth, int AlignVertically, CTextCursor *pSelCursor)
|
void CUI::DoLabel(const CUIRect *pRect, const char *pText, float Size, int Align, float MaxWidth, int AlignVertically, CTextCursor *pSelCursor)
|
||||||
{
|
{
|
||||||
DoTextLabel(r->x, r->y, r->w, r->h, pText, Size, Align, MaxWidth, AlignVertically, false, pSelCursor);
|
DoTextLabel(pRect->x, pRect->y, pRect->w, pRect->h, pText, Size, Align, MaxWidth, AlignVertically, false, pSelCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUI::DoLabelScaled(const CUIRect *r, const char *pText, float Size, int Align, float MaxWidth, int AlignVertically)
|
void CUI::DoLabelScaled(const CUIRect *pRect, const char *pText, float Size, int Align, float MaxWidth, int AlignVertically)
|
||||||
{
|
{
|
||||||
DoLabel(r, pText, Size * Scale(), Align, MaxWidth, AlignVertically);
|
DoLabel(pRect, pText, Size * Scale(), Align, MaxWidth, AlignVertically);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUI::DoLabel(CUIElement::SUIElementRect &RectEl, const CUIRect *pRect, const char *pText, float Size, int Align, float MaxWidth, int AlignVertically, bool StopAtEnd, int StrLen, CTextCursor *pReadCursor)
|
void CUI::DoLabel(CUIElement::SUIElementRect &RectEl, const CUIRect *pRect, const char *pText, float Size, int Align, float MaxWidth, int AlignVertically, bool StopAtEnd, int StrLen, CTextCursor *pReadCursor)
|
||||||
|
|
|
@ -1352,7 +1352,7 @@ void CEditor::DoSoundSource(CSoundSource *pSource, int Index)
|
||||||
Graphics()->QuadsDraw(&QuadItem, 1);
|
Graphics()->QuadsDraw(&QuadItem, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEditor::DoQuad(CQuad *q, int Index)
|
void CEditor::DoQuad(CQuad *pQuad, int Index)
|
||||||
{
|
{
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -1365,7 +1365,7 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
||||||
};
|
};
|
||||||
|
|
||||||
// some basic values
|
// some basic values
|
||||||
void *pID = &q->m_aPoints[4]; // use pivot addr as id
|
void *pID = &pQuad->m_aPoints[4]; // use pivot addr as id
|
||||||
static array<array<CPoint>> s_lRotatePoints;
|
static array<array<CPoint>> s_lRotatePoints;
|
||||||
static int s_Operation = OP_NONE;
|
static int s_Operation = OP_NONE;
|
||||||
static float s_RotateAngle = 0;
|
static float s_RotateAngle = 0;
|
||||||
|
@ -1373,8 +1373,8 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
||||||
float wy = UI()->MouseWorldY();
|
float wy = UI()->MouseWorldY();
|
||||||
|
|
||||||
// get pivot
|
// get pivot
|
||||||
float CenterX = fx2f(q->m_aPoints[4].x);
|
float CenterX = fx2f(pQuad->m_aPoints[4].x);
|
||||||
float CenterY = fx2f(q->m_aPoints[4].y);
|
float CenterY = fx2f(pQuad->m_aPoints[4].y);
|
||||||
|
|
||||||
float dx = (CenterX - wx) / m_WorldZoom;
|
float dx = (CenterX - wx) / m_WorldZoom;
|
||||||
float dy = (CenterY - wy) / m_WorldZoom;
|
float dy = (CenterY - wy) / m_WorldZoom;
|
||||||
|
@ -1417,13 +1417,13 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
||||||
else
|
else
|
||||||
y = (int)((wy - (LineDistance / 2) * m_GridFactor) / (LineDistance * m_GridFactor)) * (LineDistance * m_GridFactor);
|
y = (int)((wy - (LineDistance / 2) * m_GridFactor) / (LineDistance * m_GridFactor)) * (LineDistance * m_GridFactor);
|
||||||
|
|
||||||
q->m_aPoints[4].x = f2fx(x);
|
pQuad->m_aPoints[4].x = f2fx(x);
|
||||||
q->m_aPoints[4].y = f2fx(y);
|
pQuad->m_aPoints[4].y = f2fx(y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
q->m_aPoints[4].x = f2fx(wx);
|
pQuad->m_aPoints[4].x = f2fx(wx);
|
||||||
q->m_aPoints[4].y = f2fx(wy);
|
pQuad->m_aPoints[4].y = f2fx(wy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(s_Operation == OP_MOVE_ALL)
|
else if(s_Operation == OP_MOVE_ALL)
|
||||||
|
@ -1445,8 +1445,8 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
||||||
else
|
else
|
||||||
y = (int)((wy - (LineDistance / 2) * m_GridFactor) / (LineDistance * m_GridFactor)) * (LineDistance * m_GridFactor);
|
y = (int)((wy - (LineDistance / 2) * m_GridFactor) / (LineDistance * m_GridFactor)) * (LineDistance * m_GridFactor);
|
||||||
|
|
||||||
int OffsetX = f2fx(x) - q->m_aPoints[4].x;
|
int OffsetX = f2fx(x) - pQuad->m_aPoints[4].x;
|
||||||
int OffsetY = f2fx(y) - q->m_aPoints[4].y;
|
int OffsetY = f2fx(y) - pQuad->m_aPoints[4].y;
|
||||||
|
|
||||||
for(int i = 0; i < m_lSelectedQuads.size(); ++i)
|
for(int i = 0; i < m_lSelectedQuads.size(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -1460,8 +1460,8 @@ void CEditor::DoQuad(CQuad *q, int Index)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int OffsetX = f2fx(wx) - q->m_aPoints[4].x;
|
int OffsetX = f2fx(wx) - pQuad->m_aPoints[4].x;
|
||||||
int OffsetY = f2fx(wy) - q->m_aPoints[4].y;
|
int OffsetY = f2fx(wy) - pQuad->m_aPoints[4].y;
|
||||||
|
|
||||||
for(int i = 0; i < m_lSelectedQuads.size(); ++i)
|
for(int i = 0; i < m_lSelectedQuads.size(); ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -976,7 +976,7 @@ public:
|
||||||
|
|
||||||
void RenderGrid(CLayerGroup *pGroup);
|
void RenderGrid(CLayerGroup *pGroup);
|
||||||
|
|
||||||
void UiInvokePopupMenu(void *pID, int Flags, float X, float Y, float W, float H, int (*pfnFunc)(CEditor *pEditor, CUIRect Rect, void *pContext), void *pExtra = 0);
|
void UiInvokePopupMenu(void *pID, int Flags, float X, float Y, float W, float H, int (*pfnFunc)(CEditor *pEditor, CUIRect Rect, void *pContext), void *pContext = 0);
|
||||||
void UiDoPopupMenu();
|
void UiDoPopupMenu();
|
||||||
bool UiPopupExists(void *pID);
|
bool UiPopupExists(void *pID);
|
||||||
bool UiPopupOpen();
|
bool UiPopupOpen();
|
||||||
|
|
|
@ -186,7 +186,7 @@ public:
|
||||||
|
|
||||||
void FillAntibot(CAntibotCharacterData *pData);
|
void FillAntibot(CAntibotCharacterData *pData);
|
||||||
void Pause(bool Pause);
|
void Pause(bool Pause);
|
||||||
bool Freeze(int Time);
|
bool Freeze(int Seconds);
|
||||||
bool Freeze();
|
bool Freeze();
|
||||||
bool UnFreeze();
|
bool UnFreeze();
|
||||||
void GiveAllWeapons();
|
void GiveAllWeapons();
|
||||||
|
|
|
@ -25,7 +25,7 @@ public:
|
||||||
|
|
||||||
virtual void Reset();
|
virtual void Reset();
|
||||||
virtual void Tick();
|
virtual void Tick();
|
||||||
virtual void Snap(int snapping_client);
|
virtual void Snap(int SnappingClient);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CDraggerTeam
|
class CDraggerTeam
|
||||||
|
|
|
@ -15,7 +15,7 @@ public:
|
||||||
vec2 Pos,
|
vec2 Pos,
|
||||||
vec2 Dir,
|
vec2 Dir,
|
||||||
int Span,
|
int Span,
|
||||||
bool Freeeze,
|
bool Freeze,
|
||||||
bool Explosive,
|
bool Explosive,
|
||||||
float Force,
|
float Force,
|
||||||
int SoundImpact,
|
int SoundImpact,
|
||||||
|
|
|
@ -145,7 +145,7 @@ public:
|
||||||
|
|
||||||
// DDRace
|
// DDRace
|
||||||
|
|
||||||
bool GetNearestAirPos(vec2 Pos, vec2 ColPos, vec2 *pOutPos);
|
bool GetNearestAirPos(vec2 Pos, vec2 PrevPos, vec2 *pOutPos);
|
||||||
bool GetNearestAirPosPlayer(vec2 PlayerPos, vec2 *OutPos);
|
bool GetNearestAirPosPlayer(vec2 PlayerPos, vec2 *OutPos);
|
||||||
|
|
||||||
int m_Number;
|
int m_Number;
|
||||||
|
|
|
@ -197,7 +197,7 @@ public:
|
||||||
void CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam, int64_t Mask);
|
void CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam, int64_t Mask);
|
||||||
void CreateHammerHit(vec2 Pos, int64_t Mask = -1);
|
void CreateHammerHit(vec2 Pos, int64_t Mask = -1);
|
||||||
void CreatePlayerSpawn(vec2 Pos, int64_t Mask = -1);
|
void CreatePlayerSpawn(vec2 Pos, int64_t Mask = -1);
|
||||||
void CreateDeath(vec2 Pos, int Who, int64_t Mask = -1);
|
void CreateDeath(vec2 Pos, int ClientID, int64_t Mask = -1);
|
||||||
void CreateSound(vec2 Pos, int Sound, int64_t Mask = -1);
|
void CreateSound(vec2 Pos, int Sound, int64_t Mask = -1);
|
||||||
void CreateSoundGlobal(int Sound, int Target = -1);
|
void CreateSoundGlobal(int Sound, int Target = -1);
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
// network
|
// network
|
||||||
void CallVote(int ClientID, const char *aDesc, const char *aCmd, const char *pReason, const char *aChatmsg, const char *pSixupDesc = 0);
|
void CallVote(int ClientID, const char *pDesc, const char *pCmd, const char *pReason, const char *pChatmsg, const char *pSixupDesc = 0);
|
||||||
void SendChatTarget(int To, const char *pText, int Flags = CHAT_SIX | CHAT_SIXUP);
|
void SendChatTarget(int To, const char *pText, int Flags = CHAT_SIX | CHAT_SIXUP);
|
||||||
void SendChatTeam(int Team, const char *pText);
|
void SendChatTeam(int Team, const char *pText);
|
||||||
void SendChat(int ClientID, int Team, const char *pText, int SpamProtectionClientID = -1, int Flags = CHAT_SIX | CHAT_SIXUP);
|
void SendChat(int ClientID, int Team, const char *pText, int SpamProtectionClientID = -1, int Flags = CHAT_SIX | CHAT_SIXUP);
|
||||||
|
|
|
@ -131,7 +131,7 @@ public:
|
||||||
virtual void Snap(int SnappingClient);
|
virtual void Snap(int SnappingClient);
|
||||||
|
|
||||||
//spawn
|
//spawn
|
||||||
virtual bool CanSpawn(int Team, vec2 *pPos);
|
virtual bool CanSpawn(int Team, vec2 *pOutPos);
|
||||||
|
|
||||||
virtual void DoTeamChange(class CPlayer *pPlayer, int Team, bool DoChatMsg = true);
|
virtual void DoTeamChange(class CPlayer *pPlayer, int Team, bool DoChatMsg = true);
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
int GetTeam() const { return m_Team; };
|
int GetTeam() const { return m_Team; };
|
||||||
int GetCID() const { return m_ClientID; };
|
int GetCID() const { return m_ClientID; };
|
||||||
int GetClientVersion() const;
|
int GetClientVersion() const;
|
||||||
bool SetTimerType(int NewType);
|
bool SetTimerType(int TimerType);
|
||||||
|
|
||||||
void Tick();
|
void Tick();
|
||||||
void PostTick();
|
void PostTick();
|
||||||
|
|
|
@ -129,7 +129,7 @@ public:
|
||||||
static bool HandleSaveError(int Result, int ClientID, CGameContext *pGameContext);
|
static bool HandleSaveError(int Result, int ClientID, CGameContext *pGameContext);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CCharacter *MatchCharacter(int ClientID, int SaveID, bool KeepCurrentWeakStrong);
|
CCharacter *MatchCharacter(int ClientID, int SaveID, bool KeepCurrentCharacter);
|
||||||
|
|
||||||
IGameController *m_pController;
|
IGameController *m_pController;
|
||||||
|
|
||||||
|
|
|
@ -158,19 +158,19 @@ void CScore::SaveScore(int ClientID, float Time, const char *pTimestamp, float C
|
||||||
m_pPool->ExecuteWrite(CScoreWorker::SaveScore, std::move(Tmp), "save score");
|
m_pPool->ExecuteWrite(CScoreWorker::SaveScore, std::move(Tmp), "save score");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CScore::SaveTeamScore(int *aClientIDs, unsigned int Size, float Time, const char *pTimestamp)
|
void CScore::SaveTeamScore(int *pClientIDs, unsigned int Size, float Time, const char *pTimestamp)
|
||||||
{
|
{
|
||||||
CConsole *pCon = (CConsole *)GameServer()->Console();
|
CConsole *pCon = (CConsole *)GameServer()->Console();
|
||||||
if(pCon->m_Cheated)
|
if(pCon->m_Cheated)
|
||||||
return;
|
return;
|
||||||
for(unsigned int i = 0; i < Size; i++)
|
for(unsigned int i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
if(GameServer()->m_apPlayers[aClientIDs[i]]->m_NotEligibleForFinish)
|
if(GameServer()->m_apPlayers[pClientIDs[i]]->m_NotEligibleForFinish)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto Tmp = std::unique_ptr<CSqlTeamScoreData>(new CSqlTeamScoreData());
|
auto Tmp = std::unique_ptr<CSqlTeamScoreData>(new CSqlTeamScoreData());
|
||||||
for(unsigned int i = 0; i < Size; i++)
|
for(unsigned int i = 0; i < Size; i++)
|
||||||
str_copy(Tmp->m_aaNames[i], Server()->ClientName(aClientIDs[i]), sizeof(Tmp->m_aaNames[i]));
|
str_copy(Tmp->m_aaNames[i], Server()->ClientName(pClientIDs[i]), sizeof(Tmp->m_aaNames[i]));
|
||||||
Tmp->m_Size = Size;
|
Tmp->m_Size = Size;
|
||||||
Tmp->m_Time = Time;
|
Tmp->m_Time = Time;
|
||||||
str_copy(Tmp->m_aTimestamp, pTimestamp, sizeof(Tmp->m_aTimestamp));
|
str_copy(Tmp->m_aTimestamp, pTimestamp, sizeof(Tmp->m_aTimestamp));
|
||||||
|
|
|
@ -91,7 +91,7 @@ public:
|
||||||
|
|
||||||
// returns nullptr if successful, error string if failed
|
// returns nullptr if successful, error string if failed
|
||||||
const char *SetCharacterTeam(int ClientID, int Team);
|
const char *SetCharacterTeam(int ClientID, int Team);
|
||||||
void CheckTeamFinished(int ClientID);
|
void CheckTeamFinished(int Team);
|
||||||
|
|
||||||
void ChangeTeamState(int Team, int State);
|
void ChangeTeamState(int Team, int State);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue