/////////////////////////////////////////////////////// Get the snowcap terrain color for the given elevation and moisture. ///////////////////////////////////////////////////////
| 175 | /// |
| 176 | //////////////////////////////////////////////////////////// |
| 177 | sf::Color getSnowcapTerrainColor(float elevation, float moisture) |
| 178 | { |
| 179 | const sf::Color highlandsColor = getHighlandsTerrainColor(elevation, moisture); |
| 180 | |
| 181 | const sf::Color color = sf::Color::White; |
| 182 | |
| 183 | const float factor = std::min((elevation - snowcapHeight) / 0.05f, 1.f); |
| 184 | |
| 185 | return colorFromFloats(highlandsColor.r * (1.f - factor) + color.r * factor, |
| 186 | highlandsColor.g * (1.f - factor) + color.g * factor, |
| 187 | highlandsColor.b * (1.f - factor) + color.b * factor); |
| 188 | } |
| 189 | |
| 190 | |
| 191 | //////////////////////////////////////////////////////////// |
no test coverage detected