-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathweatherWindow.cpp
33 lines (28 loc) · 1.03 KB
/
weatherWindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <imgui.h>
#include "mapgen/WeatherManager.hpp"
#include "mapgen/WeatherWindow.hpp"
WeatherWindow::WeatherWindow(sf::RenderWindow *w, MapGenerator* m) : window(w), mapgen(m) {}
//TODO: apply weather change to mapgen
void WeatherWindow::draw(WeatherManager* weather, Painter* painter) {
if (ImGui::SliderFloat("Wind angle", &weather->windAngle, 0.f, 360.f)) {
weather->calcHumidity(mapgen->map->regions);
weather->calcTemp(mapgen->map->regions);
painter->invalidate(true);
}
if (ImGui::SliderFloat("Wind force", &weather->windForce, 0.f, 1.f)) {
weather->calcHumidity(mapgen->map->regions);
weather->calcTemp(mapgen->map->regions);
painter->invalidate(true);
}
if (ImGui::Checkbox("Wind", &painter->wind)) {
painter->invalidate();
}
ImGui::SameLine(120);
if (ImGui::Checkbox("Humidity", &painter->hum)) {
painter->invalidate();
}
ImGui::SameLine(220);
if (ImGui::Checkbox("Temp", &painter->temp)) {
painter->invalidate();
}
}