From 286f31b75cdb34ea0338f1186b92cf4bb63a73ef Mon Sep 17 00:00:00 2001 From: milek7 Date: Fri, 23 Oct 2020 01:23:48 +0200 Subject: [PATCH] bugfixes --- Texture.cpp | 2 +- driveruipanels.cpp | 3 +-- launcher/scenery_list.cpp | 6 ++---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Texture.cpp b/Texture.cpp index 699cdf60..b375fe14 100644 --- a/Texture.cpp +++ b/Texture.cpp @@ -348,7 +348,7 @@ void opengl_texture::load_STBI() data.resize(x * y * 4); memcpy(&data[0], image, data.size()); - delete image; + free(image); data_format = GL_RGBA; data_components = (n == 4 ? GL_RGBA : GL_RGB); diff --git a/driveruipanels.cpp b/driveruipanels.cpp index 1ccab536..5b1ca4fe 100644 --- a/driveruipanels.cpp +++ b/driveruipanels.cpp @@ -762,7 +762,7 @@ debug_panel::update_section_vehicle( std::vector &Output ) { std::snprintf( m_buffer.data(), m_buffer.size(), - STR_C("Brakes:\n train: %.2f, independent: %.2f, mode: %d, delay: %s, load flag: %d\nBrake cylinder pressures:\n train: %.2f, independent: %.2f, status: 0x%.2x\nPipe pressures:\n brake: %.2f (hat: %.2f), main: %.2f, control: %.2f\nTank pressures:\n auxiliary: %.2f, main: %.2f, control: %.2f"), + STR_C("Brakes:\n train: %.2f (mode: %d, delay: %s, load flag: %d)\n independent: %.2f (%.2f), manual: %.2f, spring: %.2f\nBrake cylinder pressures:\n train: %.2f, independent: %.2f, status: 0x%.2x\nPipe pressures:\n brake: %.2f (hat: %.2f), main: %.2f, control: %.2f\nTank pressures:\n auxiliary: %.2f, main: %.2f, control: %.2f"), // brakes mover.fBrakeCtrlPos, mover.BrakeOpModeFlag, @@ -1313,7 +1313,6 @@ debug_panel::render_section_settings() { if( ImGui::SliderFloat( ( to_string( static_cast( Global.EnvironmentAmbientVolume * 100 ) ) + "%###volumeambient" ).c_str(), &Global.EnvironmentAmbientVolume, 0.0f, 1.0f, "Ambient sounds" ) ) { audio::event_volume_change = true; } - ImGui::PushStyleColor( ImGuiCol_Text, { Global.UITextColor.r, Global.UITextColor.g, Global.UITextColor.b, Global.UITextColor.a } ); return true; } diff --git a/launcher/scenery_list.cpp b/launcher/scenery_list.cpp index abce158a..e65c646c 100644 --- a/launcher/scenery_list.cpp +++ b/launcher/scenery_list.cpp @@ -235,11 +235,9 @@ void ui::scenerylist_panel::draw_summary_tooltip(const dynamic_desc &dyn_desc) ImGui::TextUnformatted(STR_C("Coupling:")); - for (int i = 1; i <= 0x100; i <<= 1) { - bool dummy = true; - + for (int i = 1; i <= 0x100; i <<= 1) { if (dyn_desc.coupling & i) - ImGui::Text("+ %s", Translations.coupling_name(i).c_str(), &dummy); + ImGui::Text("+ %s", Translations.coupling_name(i).c_str()); } }