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

20 Commits

Author SHA1 Message Date
maj00r
3d6c45cd00 audio: use native OpenAL Soft typedefs, drop local token fallbacks
Now that ref/openal ships a current alext.h, include it and use the real
LPALC*SOFT / ALCEVENTPROCTYPESOFT typedefs instead of hand-rolled function
pointer types and #define'd ALC_* tokens. The event callback is marked
ALC_APIENTRY + noexcept to match ALCEVENTPROCTYPESOFT. No behaviour change.
2026-07-04 15:33:32 +02:00
maj00r
6b97268014 audio: follow output-device changes event-driven (ALC_SOFT_system_events)
Replace the ~1 Hz poll (which relied on alcGetString(DEFAULT_ALL_DEVICES),
whose value OpenAL caches and does not refresh on re-plug) with an
alcEventCallbackSOFT handler for DEFAULT_DEVICE_CHANGED / DEVICE_REMOVED. The
callback (possibly off-thread) just flags the change; update() reopens playback
on the new default on the main thread. Now both unplugging and re-plugging the
output are followed. Falls back to the ALC_CONNECTED poll when system_events is
unavailable, and only chases the default when no device is pinned.
2026-07-04 15:22:33 +02:00
maj00r
82a0cb8b6f audio: log the real OpenAL Soft library version
ALC_MAJOR/MINOR_VERSION only report the OpenAL API spec level (always 1.1),
which is misleading. Additionally log alGetString(AL_VERSION) (e.g.
"1.1 ALSOFT 1.24.2") once a context is current, and relabel the spec line.
2026-07-03 22:28:17 +02:00
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
jerrrrycho
d85096f64d reformat: remove redundant parentheses 2026-06-30 21:19:46 +02:00
jerrrrycho
bf147dd155 refactor: replace null with nullptr 2026-06-29 02:48:25 +02:00
Mateusz Włodarczyk
dd412894bb Add macOS ARM64 build support
Three small source tweaks that let the OpenGL renderer build and run
on Apple Silicon without affecting the Windows/Linux paths:

- stdafx.h: use GLM_FORCE_NEON on ARM64 instead of GLM_FORCE_AVX2.
  AVX2 pulls <immintrin.h>, which clang on ARM64 rejects because
  the x86 intrinsics are unimplemented.
- utilities/utilities.cpp: provide an Apple libc++ fallback for
  Now() using localtime_r + strftime, since
  std::chrono::current_zone() is not yet implemented there.
- audio/audio.h: prefer Khronos-style <AL/al.h> headers when they
  are on the include path (brew openal-soft) and fall back to the
  deprecated Apple OpenAL.framework's <OpenAL/al.h> only otherwise.
2026-05-19 10:45:18 +02:00
docentYT
ca699d117f Remove not needed includes 2026-05-02 14:40:31 +02:00
docentYT
3628eb0fc3 Replace interpolate with std::lerp and glm::mix 2026-05-02 01:31:38 +02:00
docentYT
d1f16411a1 Replace clamp with std::clamp 2026-05-01 22:14:29 +02:00
docentYT
ec1dfae953 Replace starts_with and ends_with with string class methods 2026-05-01 17:31:11 +02:00
docentYT
ca839652bf Use the sq function to force constexpr expressions for numeric literals and enhance readability 2026-04-28 13:23:14 +02:00
docentYT
623c4f827e Remove not needed casts, variables and switch from double precission to float precission for some angle vectors 2026-04-28 00:51:17 +02:00
docentYT
cba106e22e Use glm::length2 instead of glm::length where possible 2026-04-27 23:27:08 +02:00
docentYT
fae68642bc use glm instead of Math3D in vehicle
WARNING: Model rotation is broken
2026-04-27 13:07:38 +02:00
docentYT
aa24c55d2d Change Math3D::vector3 to glm::dvec3 in TCamera class 2026-04-26 18:12:47 +02:00
jerrrrycho
9f43dca48b refactor: create paths namespace instead of global variables 2026-03-15 11:55:30 +01:00
copilot-swe-agent[bot]
7e49aa8740 Rewrite #includes to use explicit subdirectory paths
Co-authored-by: Hirek193 <23196899+Hirek193@users.noreply.github.com>
2026-03-14 19:16:48 +00:00
copilot-swe-agent[bot]
0531086bb9 Reorganize source files into logical subdirectories
Co-authored-by: Hirek193 <23196899+Hirek193@users.noreply.github.com>
2026-03-14 19:01:57 +00:00