Skip to content

Commit

Permalink
Hud.h:
Browse files Browse the repository at this point in the history
* Fixing misc conversion warnings in windows.
  • Loading branch information
razterizer committed Oct 1, 2024
1 parent b63023c commit bed1be6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Pilot_Episode/Hud.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@ void draw_hud(SpriteHandler<NR, NC>& 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<int>(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<int>(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<int>(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<int>(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<int>(speed_str.size());
std::string score_str = "Score: ";
score_str += std::to_string(score);
sh.write_buffer(score_str, 0, hud_c, Color::Cyan);
Expand Down

0 comments on commit bed1be6

Please sign in to comment.