16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 00:49:19 +02:00
Commit Graph

3019 Commits

Author SHA1 Message Date
maj00r
7fd98374e9 feat: follow audio output device changes (reopen on disconnect)
OpenAL does not re-route on its own, so unplugging the active output device
(e.g. headphones) mid-game left the sim silent until restart. Poll ALC_CONNECTED
(ALC_EXT_disconnect) at ~1 Hz and, when the device is lost, reopen playback on
the current default output via alcReopenDeviceSOFT, preserving the context and
all sources. Tokens are declared locally since the bundled AL headers ship no
alext.h; the entry point is resolved at runtime, so this is a no-op (with a log
warning) on OpenAL Soft builds too old to provide ALC_SOFT_reopen_device.
2026-07-03 22:12:55 +02:00
maj00r
2ffff9193f fix: correct listener orientation broken by GLM aligned gentypes
Enabling GLM_FORCE_DEFAULT_ALIGNED_GENTYPES makes glm::vec3 16 bytes (padded),
but the listener orientation was passed to alListenerfv as
reinterpret_cast<ALfloat const *>(glm::vec3[2]). With the padding the six
floats OpenAL reads are at.x, at.y, at.z, PAD, up.x, up.y - the 'up' vector is
taken from padding garbage, corrupting the listener basis (right = at x up) and
swapping left/right of every positional sound.

Build the 6 floats explicitly instead of reinterpreting a padded vec3 array.
2026-07-03 21:49:43 +02:00
565aeb0c70 Merge pull request #125 from MaSzyna-EU07/hotfix/std_clamp
Hotfix/std clamp
2026-07-02 09:58:30 +02:00
0207c3f53c Merge pull request #128 from dos1/first-frame-pause
drivermode: Make sure to draw the first frame before pausing
2026-07-02 09:58:05 +02:00
e3ccdd98ab Merge pull request #127 from dos1/randomseed
Initialize random seed early in the init sequence
2026-07-02 09:57:46 +02:00
d1129c4f77 Merge pull request #126 from dos1/loadingscreen
Loading screen improvements
2026-07-02 09:57:27 +02:00
Sebastian Krzyszkowiak
f8339d9bfb drivermode: Make sure to draw the first frame before pausing
Otherwise the screen stays empty when the game is launched paused.
2026-07-02 09:37:07 +02:00
Sebastian Krzyszkowiak
86e91b187a scenarioloaderuilayer: Make the bottom gradient smoother
Since gamma factor is used, we need more than 256 steps to make
the gradient smooth.
2026-07-02 06:49:52 +02:00
Sebastian Krzyszkowiak
8b47d2af51 scenarioloaderuilayer: Scale the loading screen to the window size 2026-07-02 06:49:52 +02:00
Sebastian Krzyszkowiak
c98441d1aa Initialize random seed early in the init sequence
Network client will overwrite the seed if necessary.
2026-07-02 03:14:54 +02:00
maj00r
5fce417a51 fix: guard Random/LocalRandom against inverted min>max bounds
std::uniform_real/int_distribution has UB when min>max. The old "fancy Random"
used interpolate(a,b,t) which tolerated a>b; the migration to
std::uniform_real_distribution did not, and only one inverted call site was
fixed by hand. Swap the bounds inside Random()/Random(int)/LocalRandom() so
every call site is safe, and reorder the two inverted literal calls in
Driver.cpp (fActionTime buzzer / departure delay) for readability.
2026-07-02 00:37:52 +02:00
maj00r
03bfbb1345 fix: restore min>max tolerance lost in clamp->std::clamp migration
The dumb3d->glm / utilities-simplification refactor replaced the old custom
clamp() (which tolerated Lo>Hi, returning the upper bound) with std::clamp,
where inverted bounds are undefined behaviour. Only a few sites were patched
afterwards, by hand, with std::minmax plumbing (incl. a stray `static` inside
a per-axle loop). Others silently produced wrong results in the AI braking /
acceleration path.

Add a safe_clamp() helper (normalizes inverted bounds) and use it ONLY where
Lo<=Hi cannot be proven at compile time (config min/max pairs, sign-dependent
expressions, container underflow). Sites with constant bounds or [0, x>=0]
keep std::clamp. Remove the manual std::minmax workarounds and rewrite the
damaged-track jolt code value-first.
2026-07-02 00:37:52 +02:00
80c3feac03 Merge branch 'master' of https://github.com/MaSzyna-EU07/maszyna 2026-06-30 23:35:46 +02:00
4867f60a65 parser: keep UTF-8 multibyte chars intact when lowercasing tokens 2026-06-30 23:35:33 +02:00
d60841944d Merge pull request #124 from xwizard/refactor/user-config-path
refactor: extract user_config_path() helper
2026-06-30 22:35:53 +02:00
jerrrrycho
49c43444d5 reformat: remove redundant parentheses 2026-06-30 22:24:14 +02:00
Mateusz Włodarczyk
fe603f15eb refactor: extract user_config_path() helper
Consolidates platform-specific config-directory logic (APPDATA on Windows,
~/Library/Application Support on macOS, ~/.config on Linux) into a single
user_config_path(filename) function in utilities/utilities.{cpp,h}, removing
copy-pasted #ifdef blocks from application.cpp, editor/editorSettings.cpp,
input/{keyboard,gamepad,drivermouse,uart}input.cpp.
2026-06-30 21:30:36 +02:00
jerrrrycho
d85096f64d reformat: remove redundant parentheses 2026-06-30 21:19:46 +02:00
7c88907f6b Update README.md with new badges 2026-06-30 20:41:08 +02:00
92626db147 Merge pull request #122 from dos1/picking
drivermode: Allow to (un)set picking mode by combining Alt with Shift/Ctrl
2026-06-30 09:24:43 +02:00
56d14b8b08 Merge pull request #120 from dos1/agx-fixups
AgX fixups
2026-06-30 09:23:31 +02:00
Sebastian Krzyszkowiak
2f187b470f drivermode: Allow to (un)set picking mode by combining Alt with Shift/Ctrl
Pressing Alt toggles picking mode. This is fine for keyboard and mouse usage,
but some use cases, such as disabling picking mode when a finger is placed
on a thumbstick and enabling it back when it's lifted, require finer control.
Allow to always enable picking mode when pressing Alt with Shift, and to always
disable picking mode when pressing Alt with Ctrl.
2026-06-30 06:14:43 +02:00
Sebastian Krzyszkowiak
40c21bd4ba skydome: Adjust for external tonemapping
Skydome was applying its own tonemapping to look good. Get rid of it and
adjust color corrections to look good with a HDR pipeline.
2026-06-30 05:47:57 +02:00
Sebastian Krzyszkowiak
fdc9ea7099 opengl33renderer: Brighten up the clouds
With tonemapping, clouds need to stand out above 1.0 to reach proper
white levels.

Note that this should get disabled if tonemapping isn't used, in case
it's made properly configurable in the future.
2026-06-30 05:42:55 +02:00
Sebastian Krzyszkowiak
f2a7cc4f98 opengl33renderer: Adjust sun intensity based on overcast 2026-06-30 01:56:39 +02:00
Sebastian Krzyszkowiak
b323d78c34 light_common: Adjust ambient and sun diffuse scale
Sun needs some oomph.
2026-06-30 01:37:47 +02:00
Sebastian Krzyszkowiak
473eae53d2 tonemapping: Reduce saturation boost in AgX
1.4 is quite extreme with our textures. Boost it up, but not as much.
2026-06-30 00:21:40 +02:00
Sebastian Krzyszkowiak
321edfcf10 tonemapping: Fix up AgX application
We're supposed to output linear values there, as sRGB transfer function
gets applied either by GL framebuffer or FBOUT later on.

min_ev and max_ev also need to be adjusted, as they're tweaked for
a pipeline with exposure compensation. The current values lead to a very
washed-out image, which was "hidden" by subsequently applying gamma twice.
It may make sense to revisit these values in the future to better match
the rendering pipeline.
2026-06-30 00:20:38 +02:00
116eed6100 Merge pull request #119 from dos1/skydome-summit
skydome: Limit desaturation at the top
2026-06-29 23:56:28 +02:00
c39732a272 Merge pull request #116 from dos1/external-cam-speed
Allow to speed up external camera movement with Ctrl key
2026-06-29 23:55:01 +02:00
d6f067fa65 Merge pull request #117 from dos1/keyboard-mod-release
Remember which modifiers were present on key press and use them on key release
2026-06-29 23:54:12 +02:00
Sebastian Krzyszkowiak
b46c8c76f3 skydome: Limit desaturation at the top
Prevents a gray circle from forming at the dome's summit.
2026-06-29 23:53:36 +02:00
3d8be4345e Merge pull request #118 from dos1/cmake-suffix
cmake: Allow to disable date & git hash suffix in executable name
2026-06-29 23:52:12 +02:00
Sebastian Krzyszkowiak
84b3de6088 cmake: Allow to disable date & git hash suffix in executable name 2026-06-29 23:32:38 +02:00
Sebastian Krzyszkowiak
6435c3d850 Remember which modifiers were present on key press and use them on key release
This fixes an issue where a triggered command stays indefinitely active
when the user releases the modifier before releasing the triggering key.
2026-06-29 23:21:21 +02:00
Sebastian Krzyszkowiak
15c666a7ef Allow to speed up external camera movement with Ctrl key
Shift isn't used as that would affect joystick controls and we
probably should discourage the user from roaming around in external
cam mode too much, so they won't forget that they're not in regular
free fly out of the cab.
2026-06-29 23:12:52 +02:00
bb69986962 Merge pull request #115 from dos1/time-fix-overcast
widgets: time: Pass overcast to user_command::settemperature
2026-06-29 16:01:14 +02:00
Sebastian Krzyszkowiak
77a455919c widgets: time: Pass overcast to user_command::settemperature
Both setweather and settemperature expect overcast as their second
parameter. Passing zero to settemperature always overwrites whatever
gets passed to setweather.
2026-06-29 15:52:30 +02:00
d8dd59b5d0 Merge branch 'master' of https://github.com/MaSzyna-EU07/maszyna 2026-06-29 15:28:50 +02:00
jerrrrycho
7a32e7e9ab Merge pull request #113 from MaSzyna-EU07/refactor-nullptr
refactor: replace null with nullptr
2026-06-29 13:40:06 +02:00
jerrrrycho
bf147dd155 refactor: replace null with nullptr 2026-06-29 02:48:25 +02:00
31bebf6088 Add python fallback for cp1250 characters and utf8 compativility 2026-06-28 02:41:47 +02:00
b46a1d8cbf Change deprecated Py_SetPythonHome to PyConfig 2026-06-27 16:13:54 +02:00
0154df4b3e Merge remote-tracking branch 'remotes/origin/Editor-Python3.14' 2026-06-27 15:17:58 +02:00
b94b90f122 Merge remote-tracking branch 'remotes/origin/opengl-instancing' 2026-06-27 15:17:31 +02:00
b0bb2c9c42 Fix autodetect python directory 2026-06-27 15:15:11 +02:00
c88a9b870c Improved specular and glosiness 2026-06-27 14:41:10 +02:00
d21cd54f89 AGX tonemapping 2026-06-27 14:39:33 +02:00
16c94f8e19 Merge remote-tracking branch 'origin/feature/python314' into Editor-Python3.14 2026-06-18 18:22:38 +02:00
75461eaf86 World Streaming Part 1 2026-06-18 18:18:02 +02:00