Commit 38bd1e7c authored by Kevin Balz's avatar Kevin Balz
Browse files

static cast

parent aed25283
Pipeline #3232 passed with stage
in 1 minute and 52 seconds
...@@ -30,7 +30,7 @@ namespace phase_shifter::ui { ...@@ -30,7 +30,7 @@ namespace phase_shifter::ui {
{ {
_timeLeft -= dt; _timeLeft -= dt;
auto state = _beat_system.beat_state(); auto state = _beat_system.beat_state();
int max_bars = (int) (_max_distance / (bar_speed * state.avg_beat_time) + 1); int max_bars = static_cast<int>(_max_distance / (bar_speed * state.avg_beat_time) + 1);
if(state.beat && _beats < max_bars) { if(state.beat && _beats < max_bars) {
_beats++; _beats++;
} }
...@@ -67,7 +67,7 @@ namespace phase_shifter::ui { ...@@ -67,7 +67,7 @@ namespace phase_shifter::ui {
ImGui::PushStyleColor(ImGuiCol_Border, "#00000000"_imcolor.Value); // Hide Border ImGui::PushStyleColor(ImGuiCol_Border, "#00000000"_imcolor.Value); // Hide Border
ImVec2 cursor = ImGui::GetCursorScreenPos(); ImVec2 cursor = ImGui::GetCursorScreenPos();
auto beat_state = _beat_system.beat_state(); auto beat_state = _beat_system.beat_state();
int max_bars = (int) (_max_distance / (bar_speed * beat_state.avg_beat_time) + 1); int max_bars = static_cast<int>(_max_distance / (bar_speed * beat_state.avg_beat_time) + 1);
auto line_offset = bar_speed * beat_state.avg_beat_time; auto line_offset = bar_speed * beat_state.avg_beat_time;
auto start_offset = (max_bars - _beats) * line_offset; auto start_offset = (max_bars - _beats) * line_offset;
ImGui::BeginChild("Line", {viewport.z, 90}, true); ImGui::BeginChild("Line", {viewport.z, 90}, true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment