MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / BloodColorFromString

Method BloodColorFromString

Source/Graphics/graphics.cpp:1934–1951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1932}
1933
1934vec3 GraphicsConfig::BloodColorFromString(const std::string& blood_color_str) {
1935 vec3 blood_color(0.5f, 0.0f, 0.0f);
1936 {
1937 int num_chars = blood_color_str.length();
1938 blood_color[0] = (float)atof(&blood_color_str[0]);
1939 int which_num = 1;
1940 for (int i = 0; i < num_chars - 1; ++i) {
1941 if (blood_color_str[i] == ' ') {
1942 blood_color[which_num] = (float)atof(&blood_color_str[i + 1]);
1943 ++which_num;
1944 if (which_num > 2) {
1945 break;
1946 }
1947 }
1948 }
1949 }
1950 return blood_color;
1951}

Callers

nothing calls this directly

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected