MCPcopy Create free account
hub / github.com/ddnet/ddnet / NormalizeColorComponent

Function NormalizeColorComponent

src/engine/client/graphics_threaded.cpp:812–815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

810}
811
812static unsigned char NormalizeColorComponent(float ColorComponent)
813{
814 return (unsigned char)(std::clamp(ColorComponent, 0.0f, 1.0f) * 255.0f + 0.5f); // +0.5f to round to nearest
815}
816
817void CGraphics_Threaded::SetColorVertex(const CColorVertex *pArray, size_t Num)
818{

Callers 3

SetColorVertexMethod · 0.85
SetColorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected