add gfx.weather.get_current, get_current_data, get_fall_intencity

This commit is contained in:
MihailRis
2025-02-28 05:23:29 +03:00
parent 4d5b450145
commit a152237f26
3 changed files with 40 additions and 3 deletions
+5 -1
View File
@@ -37,6 +37,8 @@ struct EngineSettings;
struct Weather {
WeatherPreset a {};
WeatherPreset b {};
std::string nameA;
std::string nameB;
float t = 1.0f;
float speed = 0.0f;
@@ -47,11 +49,13 @@ struct Weather {
a.intensity = 1.0f - t;
}
void change(WeatherPreset preset, float time) {
void change(WeatherPreset preset, float time, std::string name="") {
std::swap(a, b);
std::swap(nameA, nameB);
b = std::move(preset);
t = 0.0f;
speed = 1.0f / glm::max(time, 1.e-5f);
nameB = std::move(name);
update(0.0f);
}