18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 08:55:22 +01:00

Merge origin/staging (b9737fe7) into feat/simulation-snapshot

Conflicts:
- CMakeLists.txt: CORE_SOURCES kept both, simulation/simulationsnapshot.cpp and simulationsnapshotmover.cpp (this branch) and vehicle/aiwire.cpp (staging, cf94a39e from #357).
- application/application.cpp: kept both includes, simulation/simulationsnapshotworld.h (this branch) and utilities/physicslog.h (staging, d6c35935 from #408).

McZapkie/hamulce.h merged without a conflict. With 4a52b5af (#366) TSt113 no longer has a CP of its own, so TSt113::pressures() lists the inherited CP twice (TH14K1::pressures() and its own emplace_back); saving and loading it twice gives the same value, left as it is.
This commit is contained in:
jerrrrycho
2026-11-20 03:53:22 +01:00
76 changed files with 3524 additions and 274 deletions
+26 -3
View File
@@ -35,6 +35,7 @@ http://mozilla.org/MPL/2.0/.
#include "version_info.h"
#include "simulation/simulationtest.h"
#include "simulation/simulationsnapshotworld.h"
#include "utilities/physicslog.h"
#include <chrono>
#include <format>
#include <vector>
@@ -393,10 +394,14 @@ int eu07_application::init(int Argc, char *Argv[])
ErrorLog("Failed to initialize glfw!");
return result;
}
if (needs_ogl() && (result = init_ogl()) != 0)
if (needs_ogl())
{
ErrorLog("Failed to initialize ogl!");
return result;
result = init_ogl();
if (result != 0)
{
ErrorLog("Failed to initialize ogl!");
return result;
}
}
if (crashreport_is_pending() && false == Global.test.enabled)
@@ -746,6 +751,9 @@ void eu07_application::exit()
track_sleepers::stop_background();
step("the black box");
simulation::Blackbox.close();
step("the physics logs");
// what is kept of them, the black box's written last, waited for a second at most: the rest is dropped
PhysicsLogs.stop();
step("the modes");
for (auto &mode : m_modes)
mode.reset();
@@ -1354,6 +1362,21 @@ int eu07_application::init_settings(int Argc, char *Argv[])
simulation::apply_test_mode_settings();
}
// a renderer this build doesn't have gets the full one: the starter writes the words of every build it knows
// ("vulkan" for the vulkan builds), and any word not known here used to start the legacy renderer.
// "simpleshader" and "off" of the older starters keep the legacy one they always had
auto const &renderer{Global.GfxRenderer};
auto const known{renderer == "default" || renderer == "legacy" || renderer == "simple" || renderer == "null" || renderer == "simpleshader" ||
renderer == "off" || (renderer == "experimental" && gfx_renderer_factory::get_instance()->has_backend(renderer))};
if (false == known)
{
WriteLog("gfxrenderer \"" + renderer + "\" isn't in this build, the full renderer is used instead");
Global.GfxRenderer = "default";
Global.NvRenderer = false;
Global.LegacyRenderer = false;
Global.BasicRenderer = false;
}
return 0;
}