made some functions const

This commit is contained in:
Choupom 2012-01-27 19:46:22 +01:00 committed by oy
parent f8939534c7
commit 93943acced
2 changed files with 7 additions and 7 deletions

View file

@ -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)

View file

@ -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];