mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-27 21:45:16 +01:00
* fix(render): old assets drawn as 26.05 drew them: metal, sun highlight, tonemapping, sun scale, diffuse colour The shader changes since 26.05.2 were made for PBR-authored assets; the assets in the game data were tuned for 26.05, and none of them is authored for the new combine. - Metal keeps its diffuse term as far as its reflection mask is low (metal_diffuse_loss = metalic * reflectivity). Assets marking metal in the specgloss with a low mask went almost black (the gold EN63A-031); a full mask is drawn as before. - The direct sun highlight is tinted by the albedo again, for dielectrics too. Old assets tuned param_specular / specgloss R with that multiply; untinted, dark glossy plastic broke into white glints along edges (Impuls fronts) and speckles on cab desks (SA132). - ACES instead of AgX: AgX with its look crushed the dark end, a night scene lost half its brightness and the ground beside the track went black. - SUN_DIFFUSE_SCALE 2.5 again (1.5 dimmed the moon at night as well). - The Diffuse colour of submodels and shapes scales the light as it is, as in 26.05, not raised to 2.2: that took a quarter off the default 0.8 of every scenery shape and more off the ~64 000 textured submodels with a darker Diffuse. Checked on screenshots of 10 vehicles by day (Ultra preset) and from cabs at night against the 26.05.2 shaders on the same executable. No game data changes. * feat(render): the headlight beam spread sideways, gfx.headlights.beamwidth (default 1.7) The projected beam texture lit the track and the ballast, and the ground beside them only with its dark edge (24-45 against 116 on the ballast close ahead, nearly 0 further on), so at night only the ballast showed. The beam is spread sideways around its middle by gfx.headlights.beamwidth: at 1.7 the ground gets most of the light of the ballast, the brightness along the track stays as it was. 1 draws the narrow beam of 26.05; range 1-4. The value reaches the shaders as HEADLIGHT_BEAM_WIDTH, written with the classic locale so that a decimal comma can't break the glsl; the shader validator compiles them with and without the spread. The key is written to the log with the other settings. * fix(render): the sunless specgloss shader combines metal as apply_lights does * fix(render): an untextured submodel takes its linearised colour as the texture again, as 26.05 did mat_colored.frag gave apply_lights() a white base, so the albedo of a Map: none submodel was its diffuse colour c, where 26.05.2 drew c^2.2 * c. A dark grey came out tens of times lighter: on the road vehicles of pctga the tyres (25-40 grey) 60-165x, the glass 23x, whole untextured cars (a4, golf, passat, ka, arosa) 1.5-3x. With the linearised colour as the texture a grey matches 26.05 in the ambient and the sun; a saturated colour is up to a third darker in the sun, as 26.05 scaled the sun by the value of the colour, not by the colour. * fix(render): the sun highlight is tinted by the texture alone, as 26.05 drew it
460 lines
22 KiB
C++
460 lines
22 KiB
C++
/*
|
|
This Source Code Form is subject to the
|
|
terms of the Mozilla Public License, v.
|
|
2.0. If a copy of the MPL was not
|
|
distributed with this file, You can
|
|
obtain one at
|
|
http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "utilities/Classes.h"
|
|
#include "vehicle/Camera.h"
|
|
#include "utilities/Float3d.h"
|
|
#include "rendering/light.h"
|
|
#include "utilities/utilities.h"
|
|
#include "utilities/motiontelemetry.h"
|
|
#include <map>
|
|
#include <optional>
|
|
|
|
#ifdef WITH_UART
|
|
#include "utilities/uart.h"
|
|
#endif
|
|
#ifdef WITH_ZMQ
|
|
#include "input/zmq_input.h"
|
|
#endif
|
|
|
|
struct global_settings {
|
|
// members
|
|
// data items
|
|
// TODO: take these out of the settings
|
|
|
|
std::chrono::steady_clock::time_point startTimestamp;
|
|
|
|
/// <summary>
|
|
/// Mapa z watkami w formacie <std::string nazwa, std::thread watek>
|
|
/// </summary>
|
|
std::map<std::string, std::thread> threads = {};
|
|
bool shiftState{ false }; //m7todo: brzydko
|
|
bool ctrlState{ false };
|
|
bool altState{ false };
|
|
// Simulation randomness, never used for anything security related: no keys, tokens or
|
|
// credentials come out of these. Reproducibility is a requirement here, which is why both
|
|
// are plain mt19937 -- the run's seed can be written down and passed on, and it travels in
|
|
// server_hello so that every client in a session replays the same sequence. A generator
|
|
// that cannot be seeded to a known state would break both of those.
|
|
std::mt19937 random_engine; // NOSONAR shared run seed, kept in sync across the network
|
|
std::mt19937 local_random_engine; // NOSONAR re-seeded from a true random source in init_modes,
|
|
// drives purely local cosmetics (sound pitch, editor placement)
|
|
bool ready_to_load{ false };
|
|
std::time_t starting_timestamp = 0; // starting time, in local timezone
|
|
uint32_t random_seed = 0;
|
|
TCamera pCamera; // parametry kamery
|
|
TCamera pDebugCamera;
|
|
std::array<glm::dvec3, 10> FreeCameraInit; // pozycje kamery
|
|
std::array<glm::vec3, 10> FreeCameraInitAngle;
|
|
int iCameraLast{ -1 };
|
|
int iSlowMotion{ 0 }; // info o malym FPS: 0-OK, 1-wyłączyć multisampling, 3-promień 1.5km, 7-1km
|
|
basic_light DayLight;
|
|
float SunAngle{ 0.f }; // angle of the sun relative to horizon
|
|
int trainThreads{0};
|
|
double fLuminance{ 1.0 }; // jasność światła do automatycznego zapalania // TODO: Why double?
|
|
double fTimeAngleDeg{ 0.0 }; // godzina w postaci kąta
|
|
float fClockAngleDeg[ 6 ]; // kąty obrotu cylindrów dla zegara cyfrowego
|
|
std::string LastGLError;
|
|
float ZoomFactor{ 1.f }; // determines current camera zoom level. TODO: move it to the renderer
|
|
bool CabWindowOpen{ false }; // controls sound attenuation between cab and outside
|
|
bool ControlPicking{ true }; // indicates controls pick mode is active
|
|
bool DLFont{ false }; // switch indicating presence of basic font
|
|
bool bActive{ true }; // czy jest aktywnym oknem
|
|
int iPause{ 0 }; // globalna pauza ruchu: b0=start,b1=klawisz,b2=tło,b3=lagi,b4=wczytywanie
|
|
float AirTemperature{ 15.f };
|
|
std::string asCurrentSceneryPath{ "scenery/" };
|
|
std::string asCurrentTexturePath{ paths::textures };
|
|
std::string asCurrentDynamicPath;
|
|
int CurrentMaxTextureSize{ 4096 };
|
|
bool UpdateMaterials{ true };
|
|
// settings
|
|
// filesystem
|
|
bool bLoadTraction{ true };
|
|
bool bSmoothTraction{ true };
|
|
bool CreateSwitchTrackbeds{ true };
|
|
bool Frogs{ false }; // whether the rails are cut where they cross other rails into frogs, wing rails and check rails; off, they're laid whole as before
|
|
std::string szTexturesTGA{ ".tga" }; // lista tekstur od TGA
|
|
std::string szTexturesDDS{ ".dds" }; // lista tekstur od DDS
|
|
std::string szDefaultExt{ szTexturesDDS };
|
|
std::string SceneryFile;
|
|
std::string local_start_vehicle{ "EU07-424" };
|
|
std::string editor_enter_vehicle; // vehicle placed in the editor, to be entered when the driving goes on
|
|
bool editor_session{ false }; // scenery was opened for editing (-edit): loader keeps track of scenery layers and hands over to the editor
|
|
// integration test mode (--test, eu07/maszyna#541); the limits can be set in the scenery's config block (test.*)
|
|
struct test_settings {
|
|
bool enabled{ false };
|
|
double timeout{ 3600.0 }; // [s] of simulation time; no result by then fails the test
|
|
double standstill{ 300.0 }; // [s] the tested trains standing still this long ends the test; 0 = never
|
|
bool pass_on_standstill{ false }; // the standstill end passes the test instead of failing it
|
|
bool fail_if_stop_overran{ true }; // a train passing a signal at stop ends the test as failed; with false it's only logged
|
|
bool no_movement_before_pass{ true }; // a pass waits until the tested trains stand still; with false it ends the test at once
|
|
std::vector<std::string> vehicles; // test.vehicle: the trains under test are the consists of these; none = every vehicle
|
|
bool timeout_from_command_line{ false }; // --test-timeout given, the scenery doesn't override it
|
|
std::optional<double> wall_timeout; // [s] of real time since the start; none = test.timeout + time for the loading, 0 = no limit
|
|
bool wall_timeout_from_command_line{ false }; // --test-wall-timeout given, the scenery doesn't override it
|
|
};
|
|
test_settings test;
|
|
bool editor_tracks{ false }; // F3 track workspace: draw and pick tracks without the scenery draw-range cap
|
|
int iConvertModels{ 0 }; // tworzenie plików binarnych
|
|
int iConvertIndexRange{ 1000 }; // range of duplicate vertex scan
|
|
bool file_binary_terrain{ true }; // enable binary terrain (de)serialization
|
|
int file_binary_terrain_checksum{ 1 }; // check of a binary terrain file (.btf) against its text: 0 = none, 1 = length of the text, 2 = length and checksum
|
|
bool file_binary_terrain_state{true};
|
|
int file_binary_terrain_skipped{0}; // number of terrain includes left out by the parser during the current scenery load
|
|
// logs
|
|
bool priorityLoadText3D{false}; // ladowanie T3D priorytetowo
|
|
int iWriteLogEnabled{ 3 }; // maska bitowa: 1-zapis do pliku, 2-okienko, 4-nazwy torów
|
|
bool MultipleLogs{ false };
|
|
// the dump written when the simulator crashes (Windows): a small one by default, with the stacks, the threads, the
|
|
// modules, the memory the stacks point to and the modules' data. "crashdump.full yes" writes all the memory of the
|
|
// simulator instead, as large as the memory it took
|
|
bool CrashDumpFull{ false };
|
|
// the black box of the session (blackbox_doc.md): "blackbox yes" writes it whatever the physics logs, "blackbox no"
|
|
// never, and with no entry it is written along with the physics logs
|
|
std::optional<bool> BlackBox;
|
|
bool ShowSystemConsole{ false }; // toggle visibility of the OS console window with log output
|
|
unsigned int DisabledLogTypes{ 0 };
|
|
bool ParserLogIncludes{ true };
|
|
// simulation
|
|
bool RealisticControlMode{ false }; // controls ability to steer the vehicle from outside views
|
|
bool bEnableTraction{ true };
|
|
float fFriction{ 1.f }; // mnożnik tarcia - KURS90
|
|
float FrictionWeatherFactor{ 1.f };
|
|
bool bLiveTraction{ true };
|
|
float Overcast{ 0.1f }; // NOTE: all this weather stuff should be moved elsewhere
|
|
glm::vec3 FogColor = { 0.6f, 0.7f, 0.8f };
|
|
float fFogEnd{ 7500 };
|
|
float fTurbidity{ 128 };
|
|
std::string Season{}; // season of the year, based on simulation date
|
|
std::string Weather{ "cloudy:" }; // current weather
|
|
std::string Period{}; // time of the day, based on sun position
|
|
bool FullPhysics{ true }; // full calculations performed for each simulation step
|
|
bool bnewAirCouplers{ true };
|
|
float fMoveLight{ 0.f }; // numer dnia w roku albo -1
|
|
bool FakeLight{ false }; // toggle between fixed and dynamic daylight
|
|
double fTimeSpeed{ 1.0 }; // przyspieszenie czasu, zmienna do testów
|
|
double default_timespeed { 1.0 }; // timescale loaded from config
|
|
double fLatitudeDeg{ 52.0 }; // szerokość geograficzna
|
|
float ScenarioTimeOverride{ std::numeric_limits<float>::quiet_NaN() }; // requested scenario start time
|
|
float ScenarioTimeOffset{ 0.f }; // time shift (in hours) applied to train timetables
|
|
bool ScenarioTimeCurrent{ false }; // automatic time shift to match scenario time with local clock
|
|
bool bInactivePause{ true }; // automatyczna pauza, gdy okno nieaktywne
|
|
int iSlowMotionMask{ -1 }; // maska wyłączanych właściwości
|
|
bool bHideConsole{ false }; // hunter-271211: ukrywanie konsoli
|
|
bool bRollFix{ true }; // czy wykonać przeliczanie przechyłki
|
|
bool bJoinEvents{ false }; // czy grupować eventy o tych samych nazwach
|
|
int iHiddenEvents{ 1 }; // czy łączyć eventy z torami poprzez nazwę toru
|
|
bool AITrainman{ true }; // virtual assistant performing consist coupling/decoupling and other maintenance tasks
|
|
bool AIBrakeSettingCw1{ true }; // ai.brakesetting.cw1: the AI wagon inspector sets the brakes (G/P/R/Mg) by the instruction Cw-1, no: as before eu07/maszyna#350
|
|
// ui
|
|
int PythonScreenUpdateRate{ 200 }; // delay between python-based screen updates, in milliseconds
|
|
int iTextMode{ 0 }; // tryb pracy wyświetlacza tekstowego
|
|
glm::vec4 UITextColor{ glm::vec4( 225.f / 255.f, 225.f / 255.f, 225.f / 255.f, 1.f ) }; // base color of UI text
|
|
float UIBgOpacity{ 0.94f }; // opacity of ui windows
|
|
std::string asLang{ "pl" }; // domyślny język - http://tools.ietf.org/html/bcp47
|
|
// gfx
|
|
glm::ivec2 window_size; // main window size in platform-specific virtual pixels
|
|
glm::ivec2 cursor_pos; // cursor position in platform-specific virtual pixels
|
|
glm::ivec2 fb_size; // main window framebuffer size
|
|
float ShakingMultiplierBF {1.f}; // mnożnik bujania kamera przod/tyl
|
|
float ShakingMultiplierRL {1.f}; // mnożnik bujania kamera lewo/prawo
|
|
float ShakingMultiplierUD {1.f}; // mnożnik bujania kamera gora/dol
|
|
float fDistanceFactor{ 1.f }; // baza do przeliczania odległości dla LoD
|
|
float targetfps{ 0.0f };
|
|
bool bFullScreen{ false };
|
|
bool VSync{ false };
|
|
bool bWireFrame{ false };
|
|
bool bAdjustScreenFreq{ true };
|
|
float BaseDrawRange{ 2500.f };
|
|
int DynamicLightCount{ 7 };
|
|
bool ScaleSpecularValues{ true };
|
|
std::string GfxRenderer{ "default" };
|
|
bool LegacyRenderer{ false };
|
|
bool NvRenderer{ false };
|
|
bool BasicRenderer{ false };
|
|
bool RenderShadows{ true };
|
|
bool applicationQuitOrder{false};
|
|
int RenderCabShadowsRange{ 0 };
|
|
struct shadowtune_t {
|
|
unsigned int map_size{ 2048 };
|
|
float range{ 250.f };
|
|
} shadowtune;
|
|
struct reflectiontune_t {
|
|
double update_interval{ 300.0 };
|
|
int fidelity{ 0 }; // 0: sections, 1: +static models, 2: +vehicles
|
|
float range_instances{ 750.f };
|
|
float range_vehicles{ 250.f };
|
|
} reflectiontune;
|
|
bool bUseVBO{ true }; // czy jest VBO w karcie graficznej (czy użyć)
|
|
float AnisotropicFiltering{ 8.f }; // requested level of anisotropic filtering. TODO: move it to renderer object
|
|
float FieldOfView{ 45.f }; // vertical field of view for the camera. TODO: move it to the renderer
|
|
bool EditorOrtho{ false };
|
|
float EditorOrthoExtent{ 150.f };
|
|
int EditorOrthoTracks{ 0 }; // the railway in the top view of the editor: 0 whole, 1 without the ballast, 2 the rails alone
|
|
// the free camera of the editor: its speed set in the View menu, the Ctrl multiplier of it, and in the top view whether it goes as far
|
|
// as the view reaches, so the map moves across the screen as fast zoomed in as out
|
|
bool EditorCameraOn{ false }; // the editor is on: its camera goes by the settings below
|
|
double EditorCameraSpeed{ 1.0 };
|
|
double EditorCameraFast{ 30.0 };
|
|
bool EditorCameraZoomed{ false };
|
|
GLint iMaxTextureSize{ 4096 }; // maksymalny rozmiar tekstury
|
|
GLint iMaxCabTextureSize{ 4096 }; // largest allowed texture in vehicle cab
|
|
int iMultisampling{ 2 }; // tryb antyaliasingu: 0=brak,1=2px,2=4px,3=8px,4=16px
|
|
float SplineFidelity{ 1.f }; // determines segment size during conversion of splines to geometry
|
|
float SleeperDistance{ 250.f }; // max distance (in meters) at which per-track sleeper models are still drawn; 0 disables sleeper rendering entirely
|
|
std::string Sleepers3D; // model of the sleepers and switch timbers laid where the simulator makes the ballast; empty: none
|
|
std::string Sleepers3DPlain { "quark/podklad1" }; // model of the sleepers of a track running alone, those of Sleepers3D being the timbers of switches and crossings; empty: the timbers there too
|
|
std::string Sleepers3DPlainSkin { "quark/podklad_betonowy1" };
|
|
bool Sleepers3DBed { true }; // whether the ballast is laid under the tracks with 3D sleepers
|
|
float Sleepers3DPlainSeat { 0.24f }; // how high the rails sit on the plain sleeper above the origin of its model; below 0: on its top
|
|
bool Smoke{ true }; // toggles smoke simulation and visualization
|
|
float SmokeFidelity{ 1.f }; // determines amount of generated smoke particles
|
|
bool ResourceSweep{ true }; // gfx resource garbage collection
|
|
bool ResourceMove{ false }; // gfx resources are moved between cpu and gpu side instead of sending a copy
|
|
bool gfx_texture_streaming{ false }; // data of dds textures is read by worker threads, the rest of the loading doesn't wait for it
|
|
float gfx_texture_releasedistance{ 0.f }; // gl textures of vehicles farther than this many draw ranges are released. 0 = off
|
|
bool compress_tex{ true }; // all textures are compressed on gpu side
|
|
std::string asSky{ "1" };
|
|
float fFpsAverage{ 0.f }; // oczekiwana wartosć FPS
|
|
float fFpsDeviation{ 5.f }; // odchylenie standardowe FPS
|
|
double fFpsMin{ 30.0 }; // dolna granica FPS, przy której promień scenerii będzie zmniejszany
|
|
double fFpsMax{ 65.0 }; // górna granica FPS, przy której promień scenerii będzie zwiększany
|
|
// audio
|
|
bool bSoundEnabled{ true };
|
|
float AudioVolume{ 1.f };
|
|
float DefaultRadioVolume{ 0.75f };
|
|
float VehicleVolume{ 1.0f };
|
|
float EnvironmentPositionalVolume{ 1.0f };
|
|
float EnvironmentAmbientVolume{ 1.0f };
|
|
int audio_max_sources = 30;
|
|
std::string AudioRenderer;
|
|
bool AudioAsyncLoad{ false }; // sound files are decoded by worker threads
|
|
// input
|
|
float fMouseXScale{ 1.5f };
|
|
float fMouseYScale{ 0.2f };
|
|
int iFeedbackMode{ 1 }; // tryb pracy informacji zwrotnej
|
|
int iFeedbackPort{ 0 }; // dodatkowy adres dla informacji zwrotnych
|
|
bool InputGamepad{ true }; // whether gamepad support is enabled
|
|
bool InputMouse{ true }; // whether control pick mode can be activated
|
|
double fBrakeStep { 1.0 }; // krok zmiany hamulca innych niż FV4a dla klawiszy [Num3] i [Num9]
|
|
double brake_speed { 3.0 }; // prędkość przesuwu hamulca dla FV4a
|
|
// parametry kalibracyjne wejść z pulpitu
|
|
double fCalibrateIn[ 6 ][ 6 ] = {
|
|
{ 0, 0, 0, 0, 0, 0 },
|
|
{ 0, 0, 0, 0, 0, 0 },
|
|
{ 0, 0, 0, 0, 0, 0 },
|
|
{ 0, 0, 0, 0, 0, 0 },
|
|
{ 0, 0, 0, 0, 0, 0 },
|
|
{ 0, 0, 0, 0, 0, 0 } };
|
|
// parametry kalibracyjne wyjść dla pulpitu
|
|
double fCalibrateOut[ 7 ][ 6 ] = {
|
|
{ 0, 1, 0, 0, 0, 0 },
|
|
{ 0, 1, 0, 0, 0, 0 },
|
|
{ 0, 1, 0, 0, 0, 0 },
|
|
{ 0, 1, 0, 0, 0, 0 },
|
|
{ 0, 1, 0, 0, 0, 0 },
|
|
{ 0, 1, 0, 0, 0, 0 },
|
|
{ 0, 1, 0, 0, 0, 0 } };
|
|
// wartości maksymalne wyjść dla pulpitu
|
|
double fCalibrateOutMax[ 7 ] = {
|
|
0, 0, 0, 0, 0, 0, 0 };
|
|
int iCalibrateOutDebugInfo{ -1 }; // numer wyjścia kalibrowanego dla którego wyświetlać informacje podczas kalibracji
|
|
int iPoKeysPWM[ 7 ] = { 0, 1, 2, 3, 4, 5, 6 }; // numery wejść dla PWM
|
|
#ifdef WITH_UART
|
|
uart_input::conf_t uart_conf;
|
|
std::map<std::string, bool *> uartfeatures_map = {
|
|
{"main", &uart_conf.mainenable},
|
|
{"scnd", &uart_conf.scndenable},
|
|
{"train", &uart_conf.trainenable},
|
|
{"local", &uart_conf.localenable},
|
|
{"radiovolume", &uart_conf.radiovolumeenable},
|
|
{"radiochannel", &uart_conf.radiochannelenable},
|
|
{"dynamicbrake", &uart_conf.dynamicenable},
|
|
};
|
|
#endif
|
|
#ifdef WITH_ZMQ
|
|
std::string zmq_address;
|
|
#endif
|
|
// multiplayer
|
|
int iMultiplayer{ 0 }; // blokada działania niektórych eventów na rzecz kominikacji
|
|
bool bIsolatedTrainName{ false }; //wysyłanie zajęcia odcinka izolowanego z nazwą pociągu
|
|
// other
|
|
std::string AppName{ "MaSzyna" };
|
|
std::string asVersion; // z opisem
|
|
motiontelemetry::conf_t motiontelemetry_conf;
|
|
std::string screenshot_dir;
|
|
bool loading_log = false;
|
|
bool dds_upper_origin = false;
|
|
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;
|
|
bool gui_trainingdefault = false;
|
|
|
|
std::string extcam_cmd;
|
|
std::string extcam_rec;
|
|
glm::ivec2 extcam_res{800, 600};
|
|
|
|
std::chrono::duration<float> minframetime {0.0f};
|
|
std::string fullscreen_monitor;
|
|
bool fullscreen_windowed{ false };
|
|
|
|
bool python_enabled = true;
|
|
bool python_mipmaps = true;
|
|
bool python_displaywindows = false;
|
|
bool python_threadedupload = true;
|
|
bool python_vsync = true;
|
|
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;
|
|
int gfx_framebuffer_height = -1;
|
|
bool gfx_shadowmap_enabled = true;
|
|
bool gfx_envmap_enabled = true;
|
|
bool gfx_postfx_motionblur_enabled = true;
|
|
float gfx_postfx_motionblur_shutter = 0.01f;
|
|
GLenum gfx_postfx_motionblur_format = GL_RG16F;
|
|
GLenum gfx_format_color = GL_RGB16F;
|
|
GLenum gfx_format_depth = GL_DEPTH_COMPONENT32F;
|
|
bool gfx_postfx_chromaticaberration_enabled = true;
|
|
bool gfx_skippipeline = false;
|
|
bool gfx_extraeffects = true;
|
|
bool gfx_shadergamma = false;
|
|
bool gfx_usegles = false;
|
|
std::string gfx_angleplatform;
|
|
bool gfx_gldebug = false;
|
|
bool vr = false;
|
|
std::string vr_backend;
|
|
|
|
float gfx_distance_factor_max { 3.f };
|
|
float gfx_shadow_angle_min { -0.2f };
|
|
int gfx_shadow_rank_cutoff { 3 };
|
|
// how many times wider sideways the headlight beam is spread than its texture: at 1.7 the ground beside the track gets
|
|
// most of the light of the ballast; 1 draws the narrow beam of 26.05
|
|
float gfx_headlights_beamwidth { 1.7f };
|
|
|
|
float ui_fontsize = 13.0f;
|
|
float ui_scale = 1.0f;
|
|
bool ui_viewports = true; // panels of the ui can be dragged out of the simulator window, into windows of their own
|
|
|
|
float map_highlight_distance = 3000.0f;
|
|
|
|
std::string exec_on_exit;
|
|
std::string prepend_scn;
|
|
bool gfx_postfx_ssao_enabled {false};
|
|
|
|
struct extraviewport_config {
|
|
std::string monitor;
|
|
|
|
int width, height;
|
|
float draw_range;
|
|
|
|
viewport_proj_config projection;
|
|
};
|
|
std::vector<extraviewport_config> extra_viewports;
|
|
|
|
struct pythonviewport_config {
|
|
std::string surface;
|
|
|
|
std::string monitor;
|
|
glm::ivec2 size;
|
|
|
|
glm::vec2 offset;
|
|
glm::vec2 scale;
|
|
};
|
|
std::vector<pythonviewport_config> python_viewports;
|
|
|
|
struct headtrack_config {
|
|
std::string joy;
|
|
|
|
bool magic_window = false;
|
|
|
|
glm::ivec3 move_axes;
|
|
glm::vec3 move_mul;
|
|
|
|
glm::ivec3 rot_axes;
|
|
glm::vec3 rot_mul;
|
|
};
|
|
headtrack_config headtrack_conf;
|
|
|
|
glm::vec3 viewport_move;
|
|
glm::mat3 viewport_rotate;
|
|
|
|
bool map_manualswitchcontrol = false;;
|
|
|
|
std::vector<std::pair<std::string, std::string>> network_servers;
|
|
std::optional<std::pair<std::string, std::string>> network_client;
|
|
float desync = 0.0f;
|
|
|
|
std::unordered_map<int, std::string> trainset_overrides;
|
|
|
|
float m_skysaturationcorrection{ 1.65f };
|
|
float m_skyhuecorrection{ 0.5f };
|
|
|
|
// methods
|
|
void LoadIniFile( std::string asFileName );
|
|
void FinalizeConfig();
|
|
void ConfigParse(cParser &parser);
|
|
bool ConfigParseGeneral(cParser& Parser, const std::string& token);
|
|
bool ConfigParseAudio(cParser& Parser, const std::string& token);
|
|
bool ConfigParseGraphics(cParser& Parser, const std::string& token);
|
|
bool ConfigParseInput(cParser& Parser, const std::string& token);
|
|
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);
|
|
bool ConfigParseTest(cParser& Parser, std::string_view Token);
|
|
bool ConfigParse_gfx( cParser &parser, std::string_view const Token );
|
|
// sends basic content of the class in legacy (text) format to provided stream
|
|
void
|
|
export_as_text( std::ostream &Output ) const;
|
|
template <typename Type_>
|
|
void
|
|
export_as_text( std::ostream &Output, std::string const Key, Type_ const &Value ) const;
|
|
};
|
|
|
|
template <typename Type_>
|
|
void
|
|
global_settings::export_as_text( std::ostream &Output, std::string const Key, Type_ const &Value ) const {
|
|
|
|
Output << Key << " " << Value << "\n";
|
|
}
|
|
|
|
template <>
|
|
void
|
|
global_settings::export_as_text( std::ostream &Output, std::string const Key, std::string const &Value ) const;
|
|
|
|
template <>
|
|
void
|
|
global_settings::export_as_text( std::ostream &Output, std::string const Key, bool const &Value ) const;
|
|
|
|
extern global_settings& GetGlobalSettings();
|
|
|
|
#define Global (GetGlobalSettings())
|