mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
made some functions const
This commit is contained in:
parent
f8939534c7
commit
93943acced
|
@ -307,20 +307,20 @@ int CSkins::FindSkinPart(int Part, const char *pName)
|
|||
return -1;
|
||||
}
|
||||
|
||||
vec3 CSkins::GetColorV3(int v)
|
||||
vec3 CSkins::GetColorV3(int v) const
|
||||
{
|
||||
float Dark = DARKEST_COLOR_LGT/255.0f;
|
||||
return HslToRgb(vec3(((v>>16)&0xff)/255.0f, ((v>>8)&0xff)/255.0f, Dark+(v&0xff)/255.0f*(1.0f-Dark)));
|
||||
}
|
||||
|
||||
vec4 CSkins::GetColorV4(int v, bool UseAlpha)
|
||||
vec4 CSkins::GetColorV4(int v, bool UseAlpha) const
|
||||
{
|
||||
vec3 r = GetColorV3(v);
|
||||
float Alpha = UseAlpha ? ((v>>24)&0xff)/255.0f : 1.0f;
|
||||
return vec4(r.r, r.g, r.b, Alpha);
|
||||
}
|
||||
|
||||
int CSkins::GetTeamColor(int UseCustomColors, int PartColor, int Team, int Part)
|
||||
int CSkins::GetTeamColor(int UseCustomColors, int PartColor, int Team, int Part) const
|
||||
{
|
||||
static const int s_aTeamColors[3] = {12895054, 65387, 10223467};
|
||||
if(!UseCustomColors)
|
||||
|
|
|
@ -47,10 +47,6 @@ public:
|
|||
|
||||
void OnInit();
|
||||
|
||||
vec3 GetColorV3(int v);
|
||||
vec4 GetColorV4(int v, bool UseAlpha);
|
||||
int GetTeamColor(int UseCustomColors, int PartColor, int Team, int Part);
|
||||
|
||||
int Num();
|
||||
int NumSkinPart(int Part);
|
||||
const CSkin *Get(int Index);
|
||||
|
@ -58,6 +54,10 @@ public:
|
|||
const CSkinPart *GetSkinPart(int Part, int Index);
|
||||
int FindSkinPart(int Part, const char *pName);
|
||||
|
||||
vec3 GetColorV3(int v) const;
|
||||
vec4 GetColorV4(int v, bool UseAlpha) const;
|
||||
int GetTeamColor(int UseCustomColors, int PartColor, int Team, int Part) const;
|
||||
|
||||
private:
|
||||
int m_ScanningPart;
|
||||
sorted_array<CSkinPart> m_aaSkinParts[NUM_SKINPARTS];
|
||||
|
|
Loading…
Reference in a new issue