diff --git a/Pilot_Episode/Hud.h b/Pilot_Episode/Hud.h index 6c2b9ec..af7ee5d 100644 --- a/Pilot_Episode/Hud.h +++ b/Pilot_Episode/Hud.h @@ -24,27 +24,27 @@ void draw_hud(SpriteHandler& sh, + "]"; sh.write_buffer(life_str, 0, hud_c, Color::Cyan); //sh.write_buffer(std::to_string(health), 5, 5, Color::Black); - hud_c += 1 + life_str.size(); + hud_c += 1 + static_cast(life_str.size()); std::string alt_str = "Alt: "; plane_data::alt_px = ground_level - plane_data::y_pos + 13*pix_ar2; plane_data::alt_ft = std::round(plane_data::alt_px*pix_to_ft); - plane_data::alt_km = std::round(plane_data::alt_px*pix_to_m/1e3); + plane_data::alt_km = std::round(plane_data::alt_px*pix_to_m/1e3f); alt_str += std::to_string(static_cast(plane_data::alt_ft)); alt_str += " ft,"; sh.write_buffer(alt_str, 0, hud_c, Color::Cyan); - hud_c += 1 + alt_str.size(); + hud_c += 1 + static_cast(alt_str.size()); std::string gnd_speed_str = "Gnd Speed: "; const float ftps_to_knots = 1.f/1.68780986f; const float pixps_to_knots = pix_to_ft*ftps_to_knots; gnd_speed_str += std::to_string(math::roundI(std::sqrt(math::sq(plane_data::x_vel) + math::sq(plane_data::z_vel))*pixps_to_knots)); gnd_speed_str += " kn,"; sh.write_buffer(gnd_speed_str, 0, hud_c, Color::Cyan); - hud_c += 1 + gnd_speed_str.size(); + hud_c += 1 + static_cast(gnd_speed_str.size()); std::string speed_str = "Speed: "; speed_str += std::to_string(math::roundI(std::sqrt(math::sq(plane_data::x_vel) + math::sq(plane_data::y_vel) + math::sq(plane_data::z_vel))*pixps_to_knots)); speed_str += " kn, "; sh.write_buffer(speed_str, 0, hud_c, Color::Cyan); - hud_c += 1 + speed_str.size(); + hud_c += 1 + static_cast(speed_str.size()); std::string score_str = "Score: "; score_str += std::to_string(score); sh.write_buffer(score_str, 0, hud_c, Color::Cyan);