18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 20:54:59 +01:00

Merge remote-tracking branch 'origin/master' into fix/freight-brake-setting-cw1

# Conflicts:
#	utilities/Globals.cpp
This commit is contained in:
jerrrrycho
2026-11-11 08:01:56 +01:00
70 changed files with 11421 additions and 369 deletions

View File

@@ -85,6 +85,7 @@ enum class TCommandType
cm_SectionVelocity, //ograniczenie prędkości na odcinku
cm_ShuntVelocity, // prędkość manewrowa na semaforze
cm_SetProximityVelocity, // informacja wstępna o ograniczeniu
cm_PointVelocity, // ograniczenie dla czoła w punkcie podaną odległość za komórką, odczytane przy jej minięciu
cm_ChangeDirection,
cm_PassengerStopPoint,
cm_OutsideStation,

View File

@@ -72,6 +72,14 @@ void global_settings::FinalizeConfig()
python_enabled = false;
#endif
#ifndef WITH_WASM
wasm_enabled = false;
#endif
#ifndef WITH_LUA
luascreens_enabled = false;
#endif
#ifdef _WIN32
Console::ModeSet(iFeedbackMode, iFeedbackPort);
#endif
@@ -530,6 +538,12 @@ bool global_settings::ConfigParseSimulation(cParser& Parser, const std::string&
return true;
}
if (token == "blackbox")
{
ParseOne(Parser, BlackBox);
return true;
}
if (token == "fullphysics")
{
ParseOne(Parser, FullPhysics);
@@ -817,6 +831,16 @@ bool global_settings::ConfigParseSimulation(cParser& Parser, const std::string&
return true;
}
if (token == "couplerphysics")
{
// yes: the player's train and the trains it closes in on, all: every train
std::string scope;
ParseOne(Parser, scope, 1);
coupler_physics_all = scope == "all";
coupler_physics = coupler_physics_all || scope == "yes" || scope == "true" || scope == "1";
return true;
}
if (token == "controlcoupling.enginecheck")
{
ParseOne(Parser, control_coupling_engine_check, 1);
@@ -883,6 +907,42 @@ bool global_settings::ConfigParseUI(cParser& Parser, const std::string& token)
return false;
}
bool global_settings::ConfigParseScriptScreens(cParser& Parser, std::string_view const token)
{
if (token == "luascreens.enabled")
{
ParseOne(Parser, luascreens_enabled, 1);
return true;
}
if (token == "wasm.enabled")
{
ParseOne(Parser, wasm_enabled, 1);
return true;
}
// wasm.cabframes and wasm.externalframes: the first names of the keys, from before the Lua screens
if (token == "screens.cabframes" || token == "wasm.cabframes")
{
ParseOneClamped(Parser, screens_cabframes, 1, 1000);
return true;
}
if (token == "screens.externalframes" || token == "wasm.externalframes")
{
ParseOneClamped(Parser, screens_externalframes, 1, 1000);
return true;
}
if (token == "screens.gpupost")
{
ParseOne(Parser, screens_gpupost, 1);
return true;
}
return false;
}
bool global_settings::ConfigParsePython(cParser& Parser, const std::string& token)
{
if (token == "python.enabled")
@@ -1379,6 +1439,9 @@ void global_settings::ConfigParse(cParser& Parser)
if (ConfigParsePython(Parser, token))
continue;
if (ConfigParseScriptScreens(Parser, token))
continue;
if (ConfigParseNetwork(Parser, token))
continue;
@@ -1631,6 +1694,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "sound.volume.ambient", EnvironmentAmbientVolume );
export_as_text( Output, "sound.asyncload", AudioAsyncLoad );
export_as_text( Output, "physicslog", WriteLogFlag );
export_as_text( Output, "blackbox", BlackBox );
export_as_text( Output, "fullphysics", FullPhysics );
export_as_text( Output, "debuglog", iWriteLogEnabled );
export_as_text( Output, "multiplelogs", MultipleLogs );
@@ -1666,6 +1730,11 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "scenario.weather.temperature", AirTemperature );
export_as_text( Output, "ai.trainman", AITrainman );
export_as_text( Output, "controlcoupling.enginecheck", control_coupling_engine_check );
std::string couplerphysics { coupler_physics ? "yes" : "no" };
if( coupler_physics_all ) {
couplerphysics = "all";
}
export_as_text( Output, "couplerphysics", couplerphysics );
export_as_text( Output, "ai.brakesetting.cw1", AIBrakeSettingCw1 );
export_as_text( Output, "scalespeculars", ScaleSpecularValues );
export_as_text( Output, "gfxrenderer", GfxRenderer );
@@ -1847,6 +1916,11 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "python.threadedupload", python_threadedupload );
export_as_text( Output, "python.uploadmain", python_uploadmain );
export_as_text( Output, "python.mipmaps", python_mipmaps );
export_as_text( Output, "luascreens.enabled", luascreens_enabled );
export_as_text( Output, "wasm.enabled", wasm_enabled );
export_as_text( Output, "screens.cabframes", screens_cabframes );
export_as_text( Output, "screens.externalframes", screens_externalframes );
export_as_text( Output, "screens.gpupost", screens_gpupost );
export_as_text( Output, "async.trainThreads", trainThreads );
for( auto const &server : network_servers ) {
Output

View File

@@ -112,6 +112,7 @@ struct global_settings {
bool priorityLoadText3D{false}; // ladowanie T3D priorytetowo
int iWriteLogEnabled{ 3 }; // maska bitowa: 1-zapis do pliku, 2-okienko, 4-nazwy torów
bool MultipleLogs{ false };
bool BlackBox{ true }; // with the physics logs on, the black box of the session is written as well (blackbox_doc.md)
bool ShowSystemConsole{ false }; // toggle visibility of the OS console window with log output
unsigned int DisabledLogTypes{ 0 };
bool ParserLogIncludes{ true };
@@ -276,6 +277,12 @@ struct global_settings {
bool captureonstart = true;
bool render_cab = true;
bool crash_damage = true;
// the physical model of the couplings (McZapkie/couplerphysics.h): progressive buffers and draw gear with hysteresis,
// the play of the coupling, its yield and breaking; the legacy model of TMoverParameters::CouplerForce() without it.
// it covers the player's train and the trains it closes in on (vehicle_table::update_coupler_physics()), or every
// train with coupler_physics_all
bool coupler_physics = false;
bool coupler_physics_all = false;
bool control_coupling_engine_check = true; // no multiple-unit control between electric and diesel traction vehicles (eu07/maszyna#520)
bool gui_defaultwindows = true;
bool gui_showtranscripts = true;
@@ -297,6 +304,11 @@ struct global_settings {
bool python_sharectx = true;
bool python_uploadmain = true;
std::chrono::duration<float> python_minframetime {0.01f};
bool luascreens_enabled{true}; // screens drawn by Lua scripts (luascreen:, luadestinationsign: in the .mmd)
bool wasm_enabled{true}; // screens drawn by WebAssembly modules (wasmscreen:, wasmdestinationsign: in the .mmd)
int screens_cabframes{4}; // the script screens in the cab are refreshed every so many rendered frames
int screens_externalframes{30}; // the script screens outside the cab (destination signs) are refreshed every so many rendered frames
bool screens_gpupost{true}; // the post-processing of the script screens (image:led_post, image:resize) on the gpu, when the renderer can
bool gfx_skiprendering = false;
int gfx_framebuffer_width = -1;
@@ -391,6 +403,7 @@ struct global_settings {
bool ConfigParseSimulation(cParser& Parser, const std::string& token);
bool ConfigParseUI(cParser& Parser, const std::string& token);
bool ConfigParsePython(cParser& Parser, const std::string& token);
bool ConfigParseScriptScreens(cParser& Parser, std::string_view token);
bool ConfigParseNetwork(cParser& Parser, const std::string& token);
bool ConfigParseHardware(cParser& Parser, const std::string& token);
bool ConfigParseDebug(cParser& Parser, const std::string& token);