mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Mark parameters as const
when possible
According to cppchecker's `constParameter` error: ``` src\engine\gfx\image_manipulation.cpp:7:58: style: Parameter 'pSrc' can be declared as pointer to const [constParameter] static void Dilate(int w, int h, int BPP, unsigned char *pSrc, unsigned char *pDest, unsigned char AlphaThreshold = TW_DILATE_ALPHA_THRESHOLD) ^ src\engine\gfx\image_manipulation.cpp:58:67: style: Parameter 'pSrc' can be declared as pointer to const [constParameter] static void CopyColorValues(int w, int h, int BPP, unsigned char *pSrc, unsigned char *pDest) ^ src\engine\shared\network_conn.cpp:241:42: style: Parameter 'Addr' can be declared as reference to const [constParameter] void CNetConnection::DirectInit(NETADDR &Addr, SECURITY_TOKEN SecurityToken, SECURITY_TOKEN Token, bool Sixup) ^ src\base\system.cpp:4060:71: style: Parameter 'random' can be declared as pointer to const [constParameter] void generate_password(char *buffer, unsigned length, unsigned short *random, unsigned random_length) ^ src\engine\client\backend\vulkan\backend_vulkan.cpp:263:38: style: Parameter 'AllocatedMemory' can be declared as reference to const [constParameter] void Free(SMemoryHeapQueueElement &AllocatedMemory) ^ src\engine\client\backend\vulkan\backend_vulkan.cpp:1708:47: style: Parameter 'ImgExtent' can be declared as reference to const [constParameter] static size_t ImageMipLevelCount(VkExtent3D &ImgExtent) ^ src\engine\client\backend\vulkan\backend_vulkan.cpp:2801:29: style: Parameter 'Image' can be declared as reference to const [constParameter] void ImageBarrier(VkImage &Image, size_t MipMapBase, size_t MipMapCount, size_t LayerBase, size_t LayerCount, VkFormat Format, VkImageLayout OldLayout, VkImageLayout NewLayout) ^ src\engine\client\backend\vulkan\backend_vulkan.cpp:6495:46: style: Parameter 'ExecBuffer' can be declared as reference to const [constParameter] void Cmd_Clear(SRenderCommandExecuteBuffer &ExecBuffer, const CCommandBuffer::SCommand_Clear *pCommand) ^ src\game\client\components\skins.cpp:83:72: style: Parameter 'pImg' can be declared as pointer to const [constParameter] static void CheckMetrics(CSkin::SSkinMetricVariable &Metrics, uint8_t *pImg, int ImgWidth, int ImgX, int ImgY, int CheckWidth, int CheckHeight) ^ src\game\client\prediction\entities\character.h:106:37: style: Parameter 'pNewInput' can be declared as pointer to const [constParameter] void SetInput(CNetObj_PlayerInput *pNewInput) ^ src\game\client\prediction\gameworld.cpp:245:106: style: Parameter 'pNotThis' can be declared as pointer to const [constParameter] CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, CCharacter *pNotThis, int CollideWith, class CCharacter *pThisOnly) ^ src\game\client\prediction\gameworld.cpp:245:151: style: Parameter 'pThisOnly' can be declared as pointer to const [constParameter] CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, CCharacter *pNotThis, int CollideWith, class CCharacter *pThisOnly) ^ src\game\client\prediction\gameworld.cpp:283:116: style: Parameter 'pNotThis' can be declared as pointer to const [constParameter] std::list<class CCharacter *> CGameWorld::IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, class CEntity *pNotThis) ^ src\game\client\ui.cpp:522:180: style: Parameter 'pReadCursor' can be declared as pointer to const [constParameter] void CUI::DoLabel(CUIElement::SUIElementRect &RectEl, const CUIRect *pRect, const char *pText, float Size, int Align, const SLabelProperties &LabelProps, int StrLen, CTextCursor *pReadCursor) ^ src\game\client\ui_scrollregion.cpp:23:86: style: Parameter 'pParams' can be declared as pointer to const [constParameter] void CScrollRegion::Begin(CUIRect *pClipRect, vec2 *pOutOffset, CScrollRegionParams *pParams) ^ src\game\server\scoreworker.h:239:29: style: Parameter 'aTimeCp' can be declared as const array [constParameter] void Set(float Time, float aTimeCp[NUM_CHECKPOINTS]) ^ src\game\server\score.cpp:135:80: style: Parameter 'aTimeCp' can be declared as const array [constParameter] void CScore::SaveScore(int ClientID, float Time, const char *pTimestamp, float aTimeCp[NUM_CHECKPOINTS], bool NotEligible) ^ src\game\server\teeinfo.cpp:40:57: style: Parameter 'pUseCustomColors' can be declared as pointer to const [constParameter] CTeeInfo::CTeeInfo(const char *apSkinPartNames[6], int *pUseCustomColors, int *pSkinPartColors) ^ src\game\server\teeinfo.cpp:40:80: style: Parameter 'pSkinPartColors' can be declared as pointer to const [constParameter] CTeeInfo::CTeeInfo(const char *apSkinPartNames[6], int *pUseCustomColors, int *pSkinPartColors) ^ ```
This commit is contained in:
parent
2115c12282
commit
98706d79d4
|
@ -4057,7 +4057,7 @@ int secure_random_uninit()
|
|||
#endif
|
||||
}
|
||||
|
||||
void generate_password(char *buffer, unsigned length, unsigned short *random, unsigned random_length)
|
||||
void generate_password(char *buffer, unsigned length, const unsigned short *random, unsigned random_length)
|
||||
{
|
||||
static const char VALUES[] = "ABCDEFGHKLMNPRSTUVWXYZabcdefghjkmnopqt23456789";
|
||||
static const size_t NUM_VALUES = sizeof(VALUES) - 1; // Disregard the '\0'.
|
||||
|
|
|
@ -2430,7 +2430,7 @@ int kill_process(PROCESS process);
|
|||
random - Pointer to a randomly-initialized array of shorts.
|
||||
random_length - Length of the short array.
|
||||
*/
|
||||
void generate_password(char *buffer, unsigned length, unsigned short *random, unsigned random_length);
|
||||
void generate_password(char *buffer, unsigned length, const unsigned short *random, unsigned random_length);
|
||||
|
||||
/*
|
||||
Function: secure_random_init
|
||||
|
|
|
@ -260,7 +260,7 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase
|
|||
}
|
||||
}
|
||||
|
||||
void Free(SMemoryHeapQueueElement &AllocatedMemory)
|
||||
void Free(const SMemoryHeapQueueElement &AllocatedMemory)
|
||||
{
|
||||
bool ContinueFree = true;
|
||||
SMemoryHeapQueueElement ThisEl = AllocatedMemory;
|
||||
|
@ -1705,7 +1705,7 @@ protected:
|
|||
return floor(log2(maximum(Width, maximum(Height, Depth)))) + 1;
|
||||
}
|
||||
|
||||
static size_t ImageMipLevelCount(VkExtent3D &ImgExtent)
|
||||
static size_t ImageMipLevelCount(const VkExtent3D &ImgExtent)
|
||||
{
|
||||
return ImageMipLevelCount(ImgExtent.width, ImgExtent.height, ImgExtent.depth);
|
||||
}
|
||||
|
@ -2798,7 +2798,7 @@ protected:
|
|||
vkBindImageMemory(m_VKDevice, Image, ImageMem.m_BufferMem.m_Mem, ImageMem.m_HeapData.m_OffsetToAlign);
|
||||
}
|
||||
|
||||
void ImageBarrier(VkImage &Image, size_t MipMapBase, size_t MipMapCount, size_t LayerBase, size_t LayerCount, VkFormat Format, VkImageLayout OldLayout, VkImageLayout NewLayout)
|
||||
void ImageBarrier(const VkImage &Image, size_t MipMapBase, size_t MipMapCount, size_t LayerBase, size_t LayerCount, VkFormat Format, VkImageLayout OldLayout, VkImageLayout NewLayout)
|
||||
{
|
||||
VkCommandBuffer MemCommandBuffer = GetMemoryCommandBuffer();
|
||||
|
||||
|
@ -6492,7 +6492,7 @@ public:
|
|||
ExecBuffer.m_EstimatedRenderCallCount = 0;
|
||||
}
|
||||
|
||||
void Cmd_Clear(SRenderCommandExecuteBuffer &ExecBuffer, const CCommandBuffer::SCommand_Clear *pCommand)
|
||||
void Cmd_Clear(const SRenderCommandExecuteBuffer &ExecBuffer, const CCommandBuffer::SCommand_Clear *pCommand)
|
||||
{
|
||||
if(ExecBuffer.m_ClearColorInRenderThread)
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#define TW_DILATE_ALPHA_THRESHOLD 10
|
||||
|
||||
static void Dilate(int w, int h, int BPP, unsigned char *pSrc, unsigned char *pDest, unsigned char AlphaThreshold = TW_DILATE_ALPHA_THRESHOLD)
|
||||
static void Dilate(int w, int h, int BPP, const unsigned char *pSrc, unsigned char *pDest, unsigned char AlphaThreshold = TW_DILATE_ALPHA_THRESHOLD)
|
||||
{
|
||||
int ix, iy;
|
||||
const int aDirX[] = {0, -1, 1, 0};
|
||||
|
@ -55,7 +55,7 @@ static void Dilate(int w, int h, int BPP, unsigned char *pSrc, unsigned char *pD
|
|||
}
|
||||
}
|
||||
|
||||
static void CopyColorValues(int w, int h, int BPP, unsigned char *pSrc, unsigned char *pDest)
|
||||
static void CopyColorValues(int w, int h, int BPP, const unsigned char *pSrc, unsigned char *pDest)
|
||||
{
|
||||
int m = 0;
|
||||
for(int y = 0; y < h; y++)
|
||||
|
|
|
@ -288,7 +288,7 @@ public:
|
|||
void SetTimedOut(const NETADDR *pAddr, int Sequence, int Ack, SECURITY_TOKEN SecurityToken, CStaticRingBuffer<CNetChunkResend, NET_CONN_BUFFERSIZE> *pResendBuffer, bool Sixup);
|
||||
|
||||
// anti spoof
|
||||
void DirectInit(NETADDR &Addr, SECURITY_TOKEN SecurityToken, SECURITY_TOKEN Token, bool Sixup);
|
||||
void DirectInit(const NETADDR &Addr, SECURITY_TOKEN SecurityToken, SECURITY_TOKEN Token, bool Sixup);
|
||||
void SetUnknownSeq() { m_UnknownSeq = true; }
|
||||
void SetSequence(int Sequence) { m_Sequence = Sequence; }
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ void CNetConnection::Disconnect(const char *pReason)
|
|||
Reset();
|
||||
}
|
||||
|
||||
void CNetConnection::DirectInit(NETADDR &Addr, SECURITY_TOKEN SecurityToken, SECURITY_TOKEN Token, bool Sixup)
|
||||
void CNetConnection::DirectInit(const NETADDR &Addr, SECURITY_TOKEN SecurityToken, SECURITY_TOKEN Token, bool Sixup)
|
||||
{
|
||||
Reset();
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ int CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void CheckMetrics(CSkin::SSkinMetricVariable &Metrics, uint8_t *pImg, int ImgWidth, int ImgX, int ImgY, int CheckWidth, int CheckHeight)
|
||||
static void CheckMetrics(CSkin::SSkinMetricVariable &Metrics, const uint8_t *pImg, int ImgWidth, int ImgX, int ImgY, int CheckWidth, int CheckHeight)
|
||||
{
|
||||
int MaxY = -1;
|
||||
int MinY = CheckHeight + 1;
|
||||
|
|
|
@ -103,7 +103,7 @@ public:
|
|||
void SetNinjaActivationTick(int ActivationTick) { m_Core.m_Ninja.m_ActivationTick = ActivationTick; }
|
||||
void SetNinjaCurrentMoveTime(int CurrentMoveTime) { m_Core.m_Ninja.m_CurrentMoveTime = CurrentMoveTime; }
|
||||
int GetCID() { return m_ID; }
|
||||
void SetInput(CNetObj_PlayerInput *pNewInput)
|
||||
void SetInput(const CNetObj_PlayerInput *pNewInput)
|
||||
{
|
||||
m_LatestInput = m_Input = *pNewInput;
|
||||
// it is not allowed to aim in the center
|
||||
|
|
|
@ -242,7 +242,7 @@ void CGameWorld::Tick()
|
|||
}
|
||||
|
||||
// TODO: should be more general
|
||||
CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, CCharacter *pNotThis, int CollideWith, class CCharacter *pThisOnly)
|
||||
CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, const CCharacter *pNotThis, int CollideWith, const CCharacter *pThisOnly)
|
||||
{
|
||||
// Find other players
|
||||
float ClosestLen = distance(Pos0, Pos1) * 100.0f;
|
||||
|
@ -280,7 +280,7 @@ CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, v
|
|||
return pClosest;
|
||||
}
|
||||
|
||||
std::list<class CCharacter *> CGameWorld::IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, class CEntity *pNotThis)
|
||||
std::list<class CCharacter *> CGameWorld::IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, const CEntity *pNotThis)
|
||||
{
|
||||
std::list<CCharacter *> listOfChars;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
CEntity *FindFirst(int Type);
|
||||
CEntity *FindLast(int Type);
|
||||
int FindEntities(vec2 Pos, float Radius, CEntity **ppEnts, int Max, int Type);
|
||||
CCharacter *IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, CCharacter *pNotThis = nullptr, int CollideWith = -1, CCharacter *pThisOnly = nullptr);
|
||||
CCharacter *IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, const CCharacter *pNotThis = nullptr, int CollideWith = -1, const CCharacter *pThisOnly = nullptr);
|
||||
void InsertEntity(CEntity *pEntity, bool Last = false);
|
||||
void RemoveEntity(CEntity *pEntity);
|
||||
void RemoveCharacter(CCharacter *pChar);
|
||||
|
@ -44,7 +44,7 @@ public:
|
|||
|
||||
// DDRace
|
||||
void ReleaseHooked(int ClientID);
|
||||
std::list<CCharacter *> IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, CEntity *pNotThis = nullptr);
|
||||
std::list<CCharacter *> IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, const CEntity *pNotThis = nullptr);
|
||||
|
||||
int m_GameTick;
|
||||
int m_GameTickSpeed;
|
||||
|
|
|
@ -519,7 +519,7 @@ void CUI::DoLabel(const CUIRect *pRect, const char *pText, float Size, int Align
|
|||
DoTextLabel(pRect->x, pRect->y, pRect->w, pRect->h, pText, Size, Align, LabelProps);
|
||||
}
|
||||
|
||||
void CUI::DoLabel(CUIElement::SUIElementRect &RectEl, const CUIRect *pRect, const char *pText, float Size, int Align, const SLabelProperties &LabelProps, int StrLen, CTextCursor *pReadCursor)
|
||||
void CUI::DoLabel(CUIElement::SUIElementRect &RectEl, const CUIRect *pRect, const char *pText, float Size, int Align, const SLabelProperties &LabelProps, int StrLen, const CTextCursor *pReadCursor)
|
||||
{
|
||||
float AlignedSize = 0;
|
||||
float MaxCharacterHeightInLine = 0;
|
||||
|
@ -581,7 +581,7 @@ void CUI::DoLabel(CUIElement::SUIElementRect &RectEl, const CUIRect *pRect, cons
|
|||
RectEl.m_Cursor = Cursor;
|
||||
}
|
||||
|
||||
void CUI::DoLabelStreamed(CUIElement::SUIElementRect &RectEl, float x, float y, float w, float h, const char *pText, float Size, int Align, float MaxWidth, int AlignVertically, bool StopAtEnd, int StrLen, CTextCursor *pReadCursor)
|
||||
void CUI::DoLabelStreamed(CUIElement::SUIElementRect &RectEl, float x, float y, float w, float h, const char *pText, float Size, int Align, float MaxWidth, int AlignVertically, bool StopAtEnd, int StrLen, const CTextCursor *pReadCursor)
|
||||
{
|
||||
bool NeedsRecreate = false;
|
||||
bool ColorChanged = RectEl.m_TextColor != TextRender()->GetTextColor() || RectEl.m_TextOutlineColor != TextRender()->GetTextOutlineColor();
|
||||
|
@ -637,7 +637,7 @@ void CUI::DoLabelStreamed(CUIElement::SUIElementRect &RectEl, float x, float y,
|
|||
TextRender()->RenderTextContainer(RectEl.m_UITextContainer, ColorText, ColorTextOutline);
|
||||
}
|
||||
|
||||
void CUI::DoLabelStreamed(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::DoLabelStreamed(CUIElement::SUIElementRect &RectEl, const CUIRect *pRect, const char *pText, float Size, int Align, float MaxWidth, int AlignVertically, bool StopAtEnd, int StrLen, const CTextCursor *pReadCursor)
|
||||
{
|
||||
DoLabelStreamed(RectEl, pRect->x, pRect->y, pRect->w, pRect->h, pText, Size, Align, MaxWidth, AlignVertically, StopAtEnd, StrLen, pReadCursor);
|
||||
}
|
||||
|
|
|
@ -343,9 +343,9 @@ public:
|
|||
float DoTextLabel(float x, float y, float w, float h, const char *pText, float Size, int Align, const SLabelProperties &LabelProps = {});
|
||||
void DoLabel(const CUIRect *pRect, const char *pText, float Size, int Align, const SLabelProperties &LabelProps = {});
|
||||
|
||||
void DoLabel(CUIElement::SUIElementRect &RectEl, const CUIRect *pRect, const char *pText, float Size, int Align, const SLabelProperties &LabelProps, int StrLen = -1, class CTextCursor *pReadCursor = nullptr);
|
||||
void DoLabelStreamed(CUIElement::SUIElementRect &RectEl, float x, float y, float w, float h, const char *pText, float Size, int Align, float MaxWidth = -1, int AlignVertically = 1, bool StopAtEnd = false, int StrLen = -1, class CTextCursor *pReadCursor = nullptr);
|
||||
void DoLabelStreamed(CUIElement::SUIElementRect &RectEl, const CUIRect *pRect, const char *pText, float Size, int Align, float MaxWidth = -1, int AlignVertically = 1, bool StopAtEnd = false, int StrLen = -1, class CTextCursor *pReadCursor = nullptr);
|
||||
void DoLabel(CUIElement::SUIElementRect &RectEl, const CUIRect *pRect, const char *pText, float Size, int Align, const SLabelProperties &LabelProps, int StrLen = -1, const CTextCursor *pReadCursor = nullptr);
|
||||
void DoLabelStreamed(CUIElement::SUIElementRect &RectEl, float x, float y, float w, float h, const char *pText, float Size, int Align, float MaxWidth = -1, int AlignVertically = 1, bool StopAtEnd = false, int StrLen = -1, const CTextCursor *pReadCursor = nullptr);
|
||||
void DoLabelStreamed(CUIElement::SUIElementRect &RectEl, const CUIRect *pRect, const char *pText, float Size, int Align, float MaxWidth = -1, int AlignVertically = 1, bool StopAtEnd = false, int StrLen = -1, const CTextCursor *pReadCursor = nullptr);
|
||||
|
||||
bool DoEditBox(const void *pID, const CUIRect *pRect, char *pStr, unsigned StrSize, float FontSize, float *pOffset, bool Hidden = false, int Corners = IGraphics::CORNER_ALL, const SUIExEditBoxProperties &Properties = {});
|
||||
bool DoClearableEditBox(const void *pID, const void *pClearID, const CUIRect *pRect, char *pStr, unsigned StrSize, float FontSize, float *pOffset, bool Hidden = false, int Corners = IGraphics::CORNER_ALL, const SUIExEditBoxProperties &Properties = {});
|
||||
|
|
|
@ -20,7 +20,7 @@ CScrollRegion::CScrollRegion()
|
|||
m_Params = CScrollRegionParams();
|
||||
}
|
||||
|
||||
void CScrollRegion::Begin(CUIRect *pClipRect, vec2 *pOutOffset, CScrollRegionParams *pParams)
|
||||
void CScrollRegion::Begin(CUIRect *pClipRect, vec2 *pOutOffset, const CScrollRegionParams *pParams)
|
||||
{
|
||||
if(pParams)
|
||||
m_Params = *pParams;
|
||||
|
|
|
@ -111,7 +111,7 @@ public:
|
|||
};
|
||||
|
||||
CScrollRegion();
|
||||
void Begin(CUIRect *pClipRect, vec2 *pOutOffset, CScrollRegionParams *pParams = nullptr);
|
||||
void Begin(CUIRect *pClipRect, vec2 *pOutOffset, const CScrollRegionParams *pParams = nullptr);
|
||||
void End();
|
||||
bool AddRect(const CUIRect &Rect, bool ShouldScrollHere = false); // returns true if the added rect is visible (not clipped)
|
||||
void ScrollHere(EScrollOption Option = SCROLLHERE_KEEP_IN_VIEW);
|
||||
|
|
|
@ -339,8 +339,7 @@ void CGameWorld::SwapClients(int Client1, int Client2)
|
|||
}
|
||||
|
||||
// TODO: should be more general
|
||||
//CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2& NewPos, CEntity *pNotThis)
|
||||
CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, CCharacter *pNotThis, int CollideWith, class CCharacter *pThisOnly)
|
||||
CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, const CCharacter *pNotThis, int CollideWith, const CCharacter *pThisOnly)
|
||||
{
|
||||
// Find other players
|
||||
float ClosestLen = distance(Pos0, Pos1) * 100.0f;
|
||||
|
@ -378,7 +377,7 @@ CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, v
|
|||
return pClosest;
|
||||
}
|
||||
|
||||
CCharacter *CGameWorld::ClosestCharacter(vec2 Pos, float Radius, CEntity *pNotThis)
|
||||
CCharacter *CGameWorld::ClosestCharacter(vec2 Pos, float Radius, const CEntity *pNotThis)
|
||||
{
|
||||
// Find other players
|
||||
float ClosestRange = Radius * 2;
|
||||
|
@ -404,7 +403,7 @@ CCharacter *CGameWorld::ClosestCharacter(vec2 Pos, float Radius, CEntity *pNotTh
|
|||
return pClosest;
|
||||
}
|
||||
|
||||
std::list<class CCharacter *> CGameWorld::IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, class CEntity *pNotThis)
|
||||
std::list<class CCharacter *> CGameWorld::IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, const CEntity *pNotThis)
|
||||
{
|
||||
std::list<CCharacter *> listOfChars;
|
||||
|
||||
|
|
|
@ -88,8 +88,7 @@ public:
|
|||
Returns:
|
||||
Returns a pointer to the closest hit or NULL of there is no intersection.
|
||||
*/
|
||||
//CCharacter *IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, class CEntity *pNotThis = 0);
|
||||
CCharacter *IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, CCharacter *pNotThis = 0, int CollideWith = -1, CCharacter *pThisOnly = 0);
|
||||
CCharacter *IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, const CCharacter *pNotThis = nullptr, int CollideWith = -1, const CCharacter *pThisOnly = nullptr);
|
||||
/*
|
||||
Function: ClosestCharacter
|
||||
Finds the closest CCharacter to a specific point.
|
||||
|
@ -97,12 +96,12 @@ public:
|
|||
Arguments:
|
||||
Pos - The center position.
|
||||
Radius - How far off the CCharacter is allowed to be
|
||||
ppNotThis - Entity to ignore
|
||||
pNotThis - Entity to ignore
|
||||
|
||||
Returns:
|
||||
Returns a pointer to the closest CCharacter or NULL if no CCharacter is close enough.
|
||||
*/
|
||||
CCharacter *ClosestCharacter(vec2 Pos, float Radius, CEntity *ppNotThis);
|
||||
CCharacter *ClosestCharacter(vec2 Pos, float Radius, const CEntity *pNotThis);
|
||||
|
||||
/*
|
||||
Function: InsertEntity
|
||||
|
@ -163,7 +162,7 @@ public:
|
|||
Returns:
|
||||
Returns list with all Characters on line.
|
||||
*/
|
||||
std::list<CCharacter *> IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, class CEntity *pNotThis = 0);
|
||||
std::list<CCharacter *> IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, const CEntity *pNotThis = nullptr);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -132,7 +132,7 @@ void CScore::MapInfo(int ClientID, const char *pMapName)
|
|||
ExecPlayerThread(CScoreWorker::MapInfo, "map info", ClientID, pMapName, 0);
|
||||
}
|
||||
|
||||
void CScore::SaveScore(int ClientID, float Time, const char *pTimestamp, float aTimeCp[NUM_CHECKPOINTS], bool NotEligible)
|
||||
void CScore::SaveScore(int ClientID, float Time, const char *pTimestamp, const float aTimeCp[NUM_CHECKPOINTS], bool NotEligible)
|
||||
{
|
||||
CConsole *pCon = (CConsole *)GameServer()->Console();
|
||||
if(pCon->m_Cheated || NotEligible)
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
void MapInfo(int ClientID, const char *pMapName);
|
||||
void MapVote(int ClientID, const char *pMapName);
|
||||
void LoadPlayerData(int ClientID, const char *pName = "");
|
||||
void SaveScore(int ClientID, float Time, const char *pTimestamp, float aTimeCp[NUM_CHECKPOINTS], bool NotEligible);
|
||||
void SaveScore(int ClientID, float Time, const char *pTimestamp, const float aTimeCp[NUM_CHECKPOINTS], bool NotEligible);
|
||||
|
||||
void SaveTeamScore(int *pClientIDs, unsigned int Size, float Time, const char *pTimestamp);
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ public:
|
|||
BestTimeCp = 0;
|
||||
}
|
||||
|
||||
void Set(float Time, float aTimeCp[NUM_CHECKPOINTS])
|
||||
void Set(float Time, const float aTimeCp[NUM_CHECKPOINTS])
|
||||
{
|
||||
m_BestTime = Time;
|
||||
for(int i = 0; i < NUM_CHECKPOINTS; i++)
|
||||
|
|
|
@ -38,7 +38,7 @@ CTeeInfo::CTeeInfo(const char *pSkinName, int UseCustomColor, int ColorBody, int
|
|||
m_ColorFeet = ColorFeet;
|
||||
}
|
||||
|
||||
CTeeInfo::CTeeInfo(const char *apSkinPartNames[6], int *pUseCustomColors, int *pSkinPartColors)
|
||||
CTeeInfo::CTeeInfo(const char *apSkinPartNames[6], const int *pUseCustomColors, const int *pSkinPartColors)
|
||||
{
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
CTeeInfo(const char *pSkinName, int UseCustomColor, int ColorBody, int ColorFeet);
|
||||
|
||||
// This constructor will assume all arrays are of length 6
|
||||
CTeeInfo(const char *apSkinPartNames[6], int *pUseCustomColors, int *pSkinPartColors);
|
||||
CTeeInfo(const char *apSkinPartNames[6], const int *pUseCustomColors, const int *pSkinPartColors);
|
||||
|
||||
void FromSixup();
|
||||
void ToSixup();
|
||||
|
|
Loading…
Reference in a new issue