mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 13:39:18 +02:00
engine-powered compressor sound pitch adjustment, model node angles, global settings export and diagnostics, departure permit sound enhancement, radio channel selection ai logic enhancement, door permission ai logic fix
This commit is contained in:
247
Globals.cpp
247
Globals.cpp
@@ -656,10 +656,11 @@ global_settings::ConfigParse(cParser &Parser) {
|
||||
Parser >> token;
|
||||
auto const priority { token };
|
||||
PythonScreenUpdateRate = (
|
||||
priority == "normal" ? 200 :
|
||||
priority == "lower" ? 500 :
|
||||
priority == "lowest" ? 1000 :
|
||||
priority == "off" ? 0 :
|
||||
200 );
|
||||
stol_def( priority, 200 ) );
|
||||
}
|
||||
else if( token == "python.updatetime" )
|
||||
{
|
||||
@@ -954,4 +955,246 @@ global_settings::ConfigParse(cParser &Parser) {
|
||||
#ifdef _WIN32
|
||||
Console::ModeSet(iFeedbackMode, iFeedbackPort); // tryb pracy konsoli sterowniczej
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
global_settings::export_as_text( std::ostream &Output ) const {
|
||||
|
||||
export_as_text( Output, "sceneryfile", SceneryFile );
|
||||
export_as_text( Output, "humanctrlvehicle", local_start_vehicle );
|
||||
export_as_text( Output, "fieldofview", FieldOfView );
|
||||
export_as_text( Output, "width", iWindowWidth );
|
||||
export_as_text( Output, "height", iWindowHeight );
|
||||
export_as_text( Output, "heightbase", fDistanceFactor );
|
||||
export_as_text( Output, "targetfps", targetfps );
|
||||
export_as_text( Output, "basedrawrange", BaseDrawRange );
|
||||
export_as_text( Output, "fullscreen", bFullScreen );
|
||||
export_as_text( Output, "fullscreenmonitor", fullscreen_monitor );
|
||||
export_as_text( Output, "vsync", VSync );
|
||||
// NOTE: values are changed dynamically during simulation. cache initial settings and export instead
|
||||
if( FreeFlyModeFlag ) {
|
||||
Output
|
||||
<< "freefly yes "
|
||||
<< FreeCameraInit[ 0 ].x << " "
|
||||
<< FreeCameraInit[ 0 ].y << " "
|
||||
<< FreeCameraInit[ 0 ].z << "\n";
|
||||
}
|
||||
else {
|
||||
export_as_text( Output, "freefly", FreeFlyModeFlag );
|
||||
}
|
||||
export_as_text( Output, "wireframe", bWireFrame );
|
||||
export_as_text( Output, "debugmode", DebugModeFlag );
|
||||
export_as_text( Output, "soundenabled", bSoundEnabled );
|
||||
export_as_text( Output, "sound.openal.renderer", AudioRenderer );
|
||||
export_as_text( Output, "sound.volume", AudioVolume );
|
||||
export_as_text( Output, "sound.volume.radio", RadioVolume );
|
||||
export_as_text( Output, "physicslog", WriteLogFlag );
|
||||
export_as_text( Output, "fullphysics", FullPhysics );
|
||||
export_as_text( Output, "debuglog", iWriteLogEnabled );
|
||||
export_as_text( Output, "multiplelogs", MultipleLogs );
|
||||
export_as_text( Output, "logs.filter", DisabledLogTypes );
|
||||
Output
|
||||
<< "mousescale "
|
||||
<< fMouseXScale << " "
|
||||
<< fMouseYScale << "\n";
|
||||
export_as_text( Output, "mousecontrol", InputMouse );
|
||||
export_as_text( Output, "enabletraction", bEnableTraction );
|
||||
export_as_text( Output, "loadtraction", bLoadTraction );
|
||||
export_as_text( Output, "friction", fFriction );
|
||||
export_as_text( Output, "livetraction", bLiveTraction );
|
||||
export_as_text( Output, "skyenabled", asSky );
|
||||
export_as_text( Output, "defaultext", szDefaultExt );
|
||||
export_as_text( Output, "newaircouplers", bnewAirCouplers );
|
||||
export_as_text( Output, "anisotropicfiltering", AnisotropicFiltering );
|
||||
export_as_text( Output, "usevbo", bUseVBO );
|
||||
export_as_text( Output, "feedbackmode", iFeedbackMode );
|
||||
export_as_text( Output, "feedbackport", iFeedbackPort );
|
||||
export_as_text( Output, "multiplayer", iMultiplayer );
|
||||
export_as_text( Output, "maxtexturesize", iMaxTextureSize );
|
||||
export_as_text( Output, "maxcabtexturesize", iMaxCabTextureSize );
|
||||
export_as_text( Output, "movelight", fMoveLight );
|
||||
export_as_text( Output, "dynamiclights", DynamicLightCount );
|
||||
if( std::isnormal( ScenarioTimeOverride ) ) {
|
||||
export_as_text( Output, "scenario.time.override", ScenarioTimeOverride );
|
||||
}
|
||||
export_as_text( Output, "scenario.time.offset", ScenarioTimeOffset );
|
||||
export_as_text( Output, "scenario.time.current", ScenarioTimeCurrent );
|
||||
export_as_text( Output, "scenario.weather.temperature", AirTemperature );
|
||||
export_as_text( Output, "scalespeculars", ScaleSpecularValues );
|
||||
export_as_text( Output, "gfxrenderer", GfxRenderer );
|
||||
export_as_text( Output, "shadows", RenderShadows );
|
||||
Output
|
||||
<< "shadowtune "
|
||||
<< shadowtune.map_size << " "
|
||||
<< 0 << " "
|
||||
<< shadowtune.range << " "
|
||||
<< 0 << "\n";
|
||||
export_as_text( Output, "gfx.shadows.cab.range", RenderCabShadowsRange );
|
||||
export_as_text( Output, "gfx.smoke", Smoke );
|
||||
export_as_text( Output, "gfx.smoke.fidelity", SmokeFidelity );
|
||||
export_as_text( Output, "smoothtraction", bSmoothTraction );
|
||||
export_as_text( Output, "splinefidelity", SplineFidelity );
|
||||
export_as_text( Output, "rendercab", render_cab );
|
||||
export_as_text( Output, "createswitchtrackbeds", CreateSwitchTrackbeds );
|
||||
export_as_text( Output, "gfx.resource.sweep", ResourceSweep );
|
||||
export_as_text( Output, "gfx.resource.move", ResourceMove );
|
||||
export_as_text( Output, "gfx.reflections.framerate", 1.0 / ReflectionUpdateInterval );
|
||||
export_as_text( Output, "timespeed", fTimeSpeed );
|
||||
export_as_text( Output, "multisampling", iMultisampling );
|
||||
export_as_text( Output, "latitude", fLatitudeDeg );
|
||||
export_as_text( Output, "convertmodels", iConvertModels + ( iConvertModels > 0 ? 128 : 0 ) );
|
||||
export_as_text( Output, "file.binary.terrain", file_binary_terrain );
|
||||
export_as_text( Output, "inactivepause", bInactivePause );
|
||||
export_as_text( Output, "slowmotion", iSlowMotionMask );
|
||||
export_as_text( Output, "hideconsole", bHideConsole );
|
||||
export_as_text( Output, "rollfix", bRollFix );
|
||||
export_as_text( Output, "fpsaverage", fFpsAverage );
|
||||
export_as_text( Output, "fpsdeviation", fFpsDeviation );
|
||||
for( auto idx = 0; idx < 6; ++idx ) {
|
||||
Output
|
||||
<< "calibrate5din "
|
||||
<< idx << " "
|
||||
<< fCalibrateIn[ idx ][ 0 ] << " "
|
||||
<< fCalibrateIn[ idx ][ 1 ] << " "
|
||||
<< fCalibrateIn[ idx ][ 2 ] << " "
|
||||
<< fCalibrateIn[ idx ][ 3 ] << " "
|
||||
<< fCalibrateIn[ idx ][ 4 ] << " "
|
||||
<< fCalibrateIn[ idx ][ 5 ] << "\n";
|
||||
}
|
||||
for( auto idx = 0; idx < 6; ++idx ) {
|
||||
Output
|
||||
<< "calibrate5dout "
|
||||
<< idx << " "
|
||||
<< fCalibrateOut[ idx ][ 0 ] << " "
|
||||
<< fCalibrateOut[ idx ][ 1 ] << " "
|
||||
<< fCalibrateOut[ idx ][ 2 ] << " "
|
||||
<< fCalibrateOut[ idx ][ 3 ] << " "
|
||||
<< fCalibrateOut[ idx ][ 4 ] << " "
|
||||
<< fCalibrateOut[ idx ][ 5 ] << "\n";
|
||||
}
|
||||
Output
|
||||
<< "calibrateoutmaxvalues "
|
||||
<< fCalibrateOutMax[ 0 ] << " "
|
||||
<< fCalibrateOutMax[ 1 ] << " "
|
||||
<< fCalibrateOutMax[ 2 ] << " "
|
||||
<< fCalibrateOutMax[ 3 ] << " "
|
||||
<< fCalibrateOutMax[ 4 ] << " "
|
||||
<< fCalibrateOutMax[ 5 ] << " "
|
||||
<< fCalibrateOutMax[ 6 ] << "\n";
|
||||
export_as_text( Output, "calibrateoutdebuginfo", iCalibrateOutDebugInfo );
|
||||
for( auto idx = 0; idx < 7; ++idx ) {
|
||||
Output
|
||||
<< "pwm "
|
||||
<< idx << " "
|
||||
<< iPoKeysPWM[ idx ] << "\n";
|
||||
}
|
||||
export_as_text( Output, "brakestep", fBrakeStep );
|
||||
export_as_text( Output, "joinduplicatedevents", bJoinEvents );
|
||||
export_as_text( Output, "hiddenevents", iHiddenEvents );
|
||||
export_as_text( Output, "pause", ( iPause & 1 ) != 0 );
|
||||
export_as_text( Output, "lang", asLang );
|
||||
export_as_text( Output, "python.updatetime", PythonScreenUpdateRate );
|
||||
Output
|
||||
<< "uitextcolor "
|
||||
<< UITextColor.r * 255 << " "
|
||||
<< UITextColor.g * 255 << " "
|
||||
<< UITextColor.b * 255 << "\n";
|
||||
export_as_text( Output, "ui.bg.opacity", UIBgOpacity );
|
||||
export_as_text( Output, "input.gamepad", InputGamepad );
|
||||
#ifdef WITH_UART
|
||||
if( uart_conf.enable ) {
|
||||
Output
|
||||
<< "uart "
|
||||
<< uart_conf.port << " "
|
||||
<< uart_conf.baud << " "
|
||||
<< uart_conf.updatetime << "\n";
|
||||
}
|
||||
Output
|
||||
<< "uarttune "
|
||||
<< uart_conf.mainbrakemin << " "
|
||||
<< uart_conf.mainbrakemax << " "
|
||||
<< uart_conf.localbrakemin << " "
|
||||
<< uart_conf.localbrakemax << " "
|
||||
<< uart_conf.tankmax << " "
|
||||
<< uart_conf.tankuart << " "
|
||||
<< uart_conf.pipemax << " "
|
||||
<< uart_conf.pipeuart << " "
|
||||
<< uart_conf.brakemax << " "
|
||||
<< uart_conf.brakeuart << " "
|
||||
<< uart_conf.hvmax << " "
|
||||
<< uart_conf.hvuart << " "
|
||||
<< uart_conf.currentmax << " "
|
||||
<< uart_conf.currentuart << " "
|
||||
<< uart_conf.lvmax << " "
|
||||
<< uart_conf.lvuart << "\n";
|
||||
export_as_text( Output, "uarttachoscale", uart_conf.tachoscale );
|
||||
Output
|
||||
<< "uartfeature "
|
||||
<< uart_conf.mainenable << " "
|
||||
<< uart_conf.scndenable << " "
|
||||
<< uart_conf.trainenable << " "
|
||||
<< uart_conf.localenable << "\n";
|
||||
export_as_text( Output, "uartdebug", uart_conf.debug );
|
||||
#endif
|
||||
#ifdef USE_EXTCAM_CAMERA
|
||||
export_as_text( Output, "extcam.cmd", extcam_cmd );
|
||||
export_as_text( Output, "extcam.rec", extcam_rec );
|
||||
Output
|
||||
<< "extcam.res "
|
||||
<< extcam_res.x << " "
|
||||
<< extcam_res.y << "\n";
|
||||
#endif
|
||||
export_as_text( Output, "compresstex", compress_tex );
|
||||
export_as_text( Output, "gfx.framebuffer.width", gfx_framebuffer_width );
|
||||
export_as_text( Output, "gfx.framebuffer.height", gfx_framebuffer_height );
|
||||
export_as_text( Output, "gfx.framebuffer.fidelity", gfx_framebuffer_fidelity );
|
||||
export_as_text( Output, "gfx.shadowmap.enabled", gfx_shadowmap_enabled );
|
||||
// TODO: export fpslimit
|
||||
export_as_text( Output, "randomseed", Global.random_seed );
|
||||
export_as_text( Output, "gfx.envmap.enabled", gfx_envmap_enabled );
|
||||
export_as_text( Output, "gfx.postfx.motionblur.enabled", gfx_postfx_motionblur_enabled );
|
||||
export_as_text( Output, "gfx.postfx.motionblur.shutter", gfx_postfx_motionblur_shutter );
|
||||
// TODO: export gfx_postfx_motionblur_format
|
||||
export_as_text( Output, "gfx.postfx.chromaticaberration.enabled", gfx_postfx_chromaticaberration_enabled );
|
||||
// TODO: export gfx_format_color
|
||||
// TODO: export gfx_format_depth
|
||||
export_as_text( Output, "gfx.skiprendering", gfx_skiprendering );
|
||||
export_as_text( Output, "gfx.skippipeline", gfx_skippipeline );
|
||||
export_as_text( Output, "gfx.extraeffects", gfx_extraeffects );
|
||||
export_as_text( Output, "python.enabled", python_enabled );
|
||||
export_as_text( Output, "python.threadedupload", python_threadedupload );
|
||||
export_as_text( Output, "python.uploadmain", python_uploadmain );
|
||||
export_as_text( Output, "python.mipmaps", python_mipmaps );
|
||||
for( auto const &server : network_servers ) {
|
||||
Output
|
||||
<< "network.server "
|
||||
<< server.first << " " << server.second << "\n";
|
||||
}
|
||||
if( false == network_client->first.empty() ) {
|
||||
Output
|
||||
<< "network.client "
|
||||
<< network_client->first << " " << network_client->second << "\n";
|
||||
}
|
||||
export_as_text( Output, "execonexit", exec_on_exit );
|
||||
}
|
||||
|
||||
template <>
|
||||
void
|
||||
global_settings::export_as_text( std::ostream &Output, std::string const Key, std::string const &Value ) const {
|
||||
|
||||
if( Value.empty() ) { return; }
|
||||
|
||||
if( Value.find( ' ' ) != std::string::npos ) {
|
||||
Output << Key << " \"" << Value << "\"\n";
|
||||
}
|
||||
else {
|
||||
Output << Key << " " << Value << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void
|
||||
global_settings::export_as_text( std::ostream &Output, std::string const Key, bool const &Value ) const {
|
||||
|
||||
Output << Key << " " << ( Value ? "yes" : "no" ) << "\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user