16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 18:19:19 +02:00

Merge pull request #109 from docentYT/fix-compilation-warnings

Fix compilation warnings
This commit is contained in:
2026-06-16 11:14:25 +02:00
committed by GitHub
23 changed files with 53 additions and 51 deletions

View File

@@ -597,7 +597,7 @@ void driver_mode::update_camera(double const Deltatime)
}
else
{
if (false == FreeFlyModeFlag)
if (false == FreeFlyModeFlag && simulation::Train)
{
// reset cached view angle in the cab
simulation::Train->pMechViewAngle = {Camera.Angle.x, Camera.Angle.y};

View File

@@ -29,6 +29,7 @@ http://mozilla.org/MPL/2.0/.
#include "rendering/renderer.h"
#include "utilities/Logs.h"
#include "widgets/vehicleparams.h"
#include "utilities/U8.h"
#define DRIVER_HINT_CONTENT
#include "application/driverhints.h"
@@ -390,7 +391,7 @@ timetable_panel::update() {
}
else {
// header
m_tablelines.emplace_back( "┌─────┬────────────────────────────────────┬─────────┬─────┐", Global.UITextColor );
m_tablelines.emplace_back(U8("┌─────┬────────────────────────────────────┬─────────┬─────┐"), Global.UITextColor);
TMTableLine const *tableline;
for( int i = table.StationStart; i <= table.StationCount; ++i ) {
@@ -422,11 +423,11 @@ timetable_panel::update() {
auto const arrival { (
tableline->Ah >= 0 ?
std::to_string( int( 100 + tableline->Ah ) ).substr( 1, 2 ) + ":" + to_minutes_str( tableline->Am, true, 3 ) :
"" ) };
U8("") ) };
auto const departure { (
tableline->Dh >= 0 ?
std::to_string( int( 100 + tableline->Dh ) ).substr( 1, 2 ) + ":" + to_minutes_str( tableline->Dm, true, 3 ) :
"" ) };
U8("") ) };
auto const candepart { (
( table.StationStart < table.StationIndex )
&& ( i < table.StationIndex )
@@ -445,25 +446,25 @@ timetable_panel::update() {
candepart ? colors::uitextgreen : // czas minął i odjazd był, to nazwa stacji będzie na zielono
isatpassengerstop ? colors::uitextorange :
Global.UITextColor ) };
auto const trackcount{ ( tableline->TrackNo == 1 ? "" : "" ) };
std::string const trackcount{ ( tableline->TrackNo == 1 ? U8("") : U8("" )) };
m_tablelines.emplace_back(
( "" + vmax + "" + station + trackcount + arrival + "" + traveltime + "" ),
( U8("") + vmax + U8("") + station + trackcount + arrival + U8("") + traveltime + U8("") ),
linecolor );
m_tablelines.emplace_back(
( "│ │ " + location + tableline->StationWare + trackcount + departure + " │ │" ),
( U8("│ │ ") + location + tableline->StationWare + trackcount + departure + U8(" │ │") ),
linecolor );
// divider/footer
if( i < table.StationCount ) {
auto const *nexttableline { tableline + 1 };
std::string const vmaxnext{ ( tableline->vmax == nexttableline->vmax ? "│ ├" : "├─────┼" ) };
auto const trackcountnext{ ( nexttableline->TrackNo == 1 ? "" : "" ) };
std::string const vmaxnext{ ( tableline->vmax == nexttableline->vmax ? U8("│ ├") : U8("├─────┼") ) };
auto const trackcountnext{ ( nexttableline->TrackNo == 1 ? U8("") : U8("") ) };
m_tablelines.emplace_back(
vmaxnext + "────────────────────────────────────" + trackcountnext + "─────────┼─────┤",
vmaxnext + U8("────────────────────────────────────") + trackcountnext + U8("─────────┼─────┤"),
Global.UITextColor );
}
else {
m_tablelines.emplace_back(
"└─────┴────────────────────────────────────┴─────────┴─────┘",
U8("└─────┴────────────────────────────────────┴─────────┴─────┘"),
Global.UITextColor );
}
}
@@ -1537,6 +1538,7 @@ bool debug_panel::render_section_developer()
m_input.vehicle->MoverParameters->reload_FIZ(); // reload fiz
}
ImGui::PopStyleColor();
return true;
}
bool

View File

@@ -100,9 +100,6 @@ private:
bool render_section( std::vector<text_line> const &Lines );
bool render_section_scenario();
bool render_section_eventqueue();
#ifdef WITH_UART
bool render_section_uart();
#endif
bool render_section_settings();
bool render_section_developer();
// members

View File

@@ -202,7 +202,7 @@ void scenarioloader_ui::render_()
// Gradient at the lower half of the screen
if (!Global.NvRenderer)
{
const auto tex = reinterpret_cast<ImTextureID>(m_gradient_overlay_tex);
const ImTextureID tex = (ImTextureID)(intptr_t)m_gradient_overlay_tex; // See https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples#example-for-opengl-users
draw_list->AddImage(tex, ImVec2(0, Global.window_size.y / 2), ImVec2(Global.window_size.x, Global.window_size.y), ImVec2(0, 0), ImVec2(1, 1));
}