MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / parseFloatFormat

Function parseFloatFormat

src/common/ParseColor.cpp:112–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110//============================================================================//
111
112static bool parseFloatFormat(const char* str, fvec4& color) {
113 fvec4 tmp(1.0f, 1.0f, 1.0f, 1.0f);
114 const int count = sscanf(str, "%f %f %f %f", &tmp.r, &tmp.g, &tmp.b, &tmp.a);
115 switch (count) {
116 case 3: { color.rgb() = tmp.rgb(); return true; }
117 case 4: { color = tmp; return true; }
118 }
119 return false;
120}
121
122
123//============================================================================//

Callers 1

parseColorCStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected