18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 14:07:06 +01:00

Merge MaSzyna-EU07/maszyna master into feat/vat-people

master as of 9fecba82: the test mode (--test, null renderer), the AI braking
and passenger stops, the ESt3 brake, the SOD lamp, the 401Da oil pump lamp,
smoke of vehicles taken off the tracks, text displays with national
characters, the scenario picker drag and drop, the log written to the end of
the closing, unit and scenario tests, and the small fixes.

How the conflicts went:
- the OpenGL 3.3 and legacy renderers stay removed; what master changed in
  them is carried over where this branch has a counterpart: the opaque
  characters of text displays in scene_walk::Render_text(). The instancing
  range of master is covered by the instance records of this branch, the
  sizes of the sun and the moon are its own.
- test mode: the null backend picked in select_gfx_backend(), the window
  hidden, no crash gui; settings of the removed renderers left out.
- materials: the matte and tinted copies of this branch (the tint in the
  slot of the weathering), made again on a change of the season or the
  weather (update_variants), before the track blends.
- tracks: this branch's Segment, Track and TrackUneven, with master's
  replaced_shake(), uneven_underway(), rail_joints_moved(),
  switch_followers() and the editor's add_followers(); tributary and unknown
  track types stay as this branch loads them.
- the log service stops by StopLogService(), the exit paths of EU07.cpp too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
This commit is contained in:
lcddisplay
2026-11-08 21:17:00 +01:00
230 changed files with 15522 additions and 821 deletions
+31 -1
View File
@@ -21,6 +21,7 @@ http://mozilla.org/MPL/2.0/.
#include "scene/scenelayers.h"
#include "simulation/simulation.h"
#include "utilities/Globals.h"
#include "utilities/Logs.h"
#include "utilities/translation.h"
#include "utilities/utilities.h"
#include "world/Track.h"
@@ -174,6 +175,20 @@ void label(screen_projection const &Projection, glm::dvec3 const &Point, std::st
drawlist->AddText(ImVec2(at.x + 12.f, at.y), IM_COL32(255, 255, 255, 235), Text.c_str());
}
// the first line of the file of the turntable controls, which tells it from the files of the scenery made by hand
char const *const kControlsHeader{"// made by the scenery editor on each save: T turns each turntable to its next position, Shift+T to the previous one"};
// true if the file is one of the turntable controls the editor writes
bool controls_file(std::string const &Path)
{
std::ifstream input{Path, std::ios_base::binary};
std::string first;
std::getline(input, first);
if (false == first.empty() && first.back() == '\r')
first.pop_back();
return first == kControlsHeader;
}
} // namespace
bool editor_mode::scan_turntables(bool const Wait)
@@ -1215,7 +1230,7 @@ bool editor_mode::turntable_controls(std::vector<std::string> &Rootstatements)
auto const exists{std::filesystem::exists(path, error)};
if (tables == 0 && false == exists)
return false;
auto const content{"// made by the scenery editor on each save: T turns each turntable to its next position, Shift+T to the previous one\r\n" + text.str()};
auto const content{std::string{kControlsHeader} + "\r\n" + text.str()};
std::string current;
{
std::ifstream input{path, std::ios_base::binary};
@@ -1226,6 +1241,21 @@ bool editor_mode::turntable_controls(std::vector<std::string> &Rootstatements)
std::ofstream output{path, std::ios_base::binary | std::ios_base::trunc};
output << content;
}
// the controls written for this scenery under another name, the file it was copied from, give way to these: with both
// included each turntable would have its events twice. their files stay on the disk, for the scenery they were made for
for (std::size_t handle = 1; handle <= scene::Layers.size(); ++handle)
{
auto const layer{static_cast<scene::layer_handle>(handle)};
if (false == scene::Layers.listed(layer) || scene::Layers.layer(layer).removed)
continue;
auto name{scene::Layers.layer(layer).name};
std::replace(name.begin(), name.end(), '\\', '/');
auto const lower{ToLower(name)};
if (lower == ToLower(file) || lower.ends_with("/" + ToLower(file)) || false == lower.ends_with("_obrotnice.scm"))
continue;
if (controls_file(Global.asCurrentSceneryPath + scene::Layers.layer(layer).name) && scene::Layers.remove(layer))
WriteLog("Editor: " + name + " left out of the scenery, the turntable controls are in " + file + " now");
}
auto included{m_turntable_included};
for (std::size_t handle = 1; handle <= scene::Layers.size() && false == included; ++handle)
{