308 Commits

Author SHA1 Message Date
Alayan
e9a75f6c52 Fix #3678
Don't play drive-on sound from materials when the game state is paused.
2024-05-08 17:40:48 +02:00
Alayan
99868d5897 Fix #5026
The SFX manager and SFXOpenAL would check if SFXs are enabled before pausing (looping) sound effects, so disabling SFXs in the options would fail to stop looping SFxs.

Furthermore, 'OnSoundEnabledBack' would pause all looping SFXs. This commit checks for the pause status of the World (if applicable) to decide if the looping SFXs should be immediately resumed (networking) or not (real pause).

Also clean some comments and move some code around.

This patch doesn't address sound resuming when going from the pause menu to the options in networked mode, whereas it doesn't in a normal race. This is what caused the bug to trigger in the first place, but it's very minor by itself and the design of the SFX code could have triggered other future issues too.
2024-05-08 17:21:39 +02:00
Alayan
2a903271aa Fix #4844 2023-11-24 16:13:12 +01:00
Benau
ed6d7578a5 Avoid queue size race condition 2022-04-27 11:01:53 +08:00
Benau
96cd140c62 Avoid getListenerPos race condition 2022-04-26 12:42:11 +08:00
Benau
68240b5d2d Avoid getWorld race condition 2022-04-26 12:26:29 +08:00
Benau
4a93bea962 Fix MSVC 2015 build 2022-03-12 16:43:32 +08:00
David Carlier
9fb568eaa7 widening a bit smart pointers usage considering xml data. 2022-03-12 07:43:13 +00:00
Benau
037efe60fb Try to fix missing music after switching
m_current_music assignment should be done in sfx thread if music is on
2021-08-19 09:50:23 +08:00
Benau
a1c099cc1c Fix clearCurrentMusic so it really stops current music 2021-08-19 09:15:43 +08:00
Benau
3ee940b242 Fix possbile null buffer 2021-05-20 15:13:29 +08:00
Benau
be7b46f7d9 Fix missing initialization of some sound buffer 2021-05-15 00:03:06 +08:00
Benau
8e885d15ac Calculate duration from the original buffer size
MojoAL use SDL_AudioCVT internally which doubles the size
2021-05-14 23:58:59 +08:00
Benau
ec02331c73 Use MojoAL instead of OpenAL for Apple
Because OpenAL in iOS is broken at the moment
2021-05-14 23:51:24 +08:00
Mary
d9b8b7acad Support for Nintendo Switch (#4491)
* WIP support for Nintendo Switch

* OpenAL is usable

* Remove some debug code, add manual crash when DEBUG_NXLINK is on

* Remove more debug logs

* Support touch, account name detection, language detection. Remove resolution settings

* Stylistic changes

* SFXManager: update on main thread

* Add build script, remove crypto.hpp changes, disable opengl recorder on switch

* make: use sudo where needed, libs=>lib, portlib=>portlibs

* make: build harfbuzz with freetype

* main: remove DEBUG_NXLINK

* socket_address: this comment is no longer relevant

* Fix indentation in SDL, remove extra debug logs from InputManager

* InputManager: make log debug, not info

* CMakeLists: add mbedtls include dirs on switch

* main: deinitialize stuff

* main_loop: fix format
2021-03-04 09:23:23 +08:00
Richard Qian
0db8d50359 More configurable music (loop end support, different race result music) (#4445)
* Allow setting [again] track reverse mode via command line

* Make composer field in music information files optional

* Add support for loop end of music

* Remove print statements used for checking current music play time

* Support playing different music on race results screen

Also make them configurable in stk_config.xml

* Allow configuring grand prix win/lose and feature unlocked music in stk_config.xml

* Fix coding indentation style

* Fix warning when scrolling track screenshots in grand prix results

* Display the rank a player kart finishes in if not in 1st place
2020-12-21 02:14:52 +01:00
Benau
9157fb43f0 Use std::thread, std::mutex and std::condition_variable everywhere 2020-04-11 11:01:18 +08:00
Benau
e6deaabcf1 Use std::atomic enum for SFXStatus 2020-02-28 19:53:13 +08:00
Benau
a2f72a0d13 Avoid including sfx_manager.hpp inside kart properties header 2020-02-28 19:53:08 +08:00
Benau
f37a5ee5d3 Only use sound and music in main process 2020-02-28 19:52:54 +08:00
Benau
6a3e606c2d Turn race manager into a singleton get for 2 processes 2020-02-28 09:42:44 +08:00
David Carlier
c9c4149139 slighty less C code proposal 2020-02-08 16:59:25 +00:00
David Carlier
7951d1a92d Reducing significantly build warning on MacOS
OpenGL deprecated APIs, gl/gl3 inclusion, OpenAL deprecated API.
Implementing process path for the crash reporter.
2020-01-12 07:28:15 +00:00
Benau
b09aec6b3f Remove Dmitry Marakasov changes for his disagreement 2020-01-07 00:08:09 +08:00
Alayan
a3a7b5f8fd Fix #3596 2019-10-23 00:30:43 +02:00
Benau
f56cf03b6a Fix AL_INVALID_NAME when exit pause menu with fast music on 2019-10-11 21:40:00 +08:00
Benau
a1e4bbc3c1 Fix fading in and out when switching to fast music 2019-10-11 19:21:58 +08:00
Benau
5cc5780f28 Add download assets screen for mobile stk 2019-07-24 01:33:12 +08:00
Benau
c5452cda64 Allow karts with custom engine sfx 2019-07-01 01:50:29 +08:00
Benau
31caa7e056 Make all fopen utf8 path aware 2019-06-28 21:05:50 +08:00
Benau
a56343b7e3 Clean up headers
Remove special RTL handling as it will be done when texting shaping
2019-06-15 13:52:28 +08:00
Reiner Herrmann
07b6a16000 Fix several spelling/grammar errors (#3951)
found by lintian
2019-06-04 19:04:18 -04:00
Benau
ebf95ee958 Use monotonic clock to avoid system time changes 2019-05-06 15:17:19 +08:00
Benau
0f2bf9e899 Fix compiler warning 2018-11-08 15:41:08 +08:00
Benau
189b90b2c5 Convert more getRealTime to getRealTimeMs 2018-11-08 01:37:21 +08:00
Benau
866df61527 Make isPlaying of music thread safe 2018-11-08 01:00:17 +08:00
Deve
dd7380f569 Fixed server_only compilation 2018-08-19 00:19:31 +02:00
Deve
9b9785e8ec Add a possibility to disable sound in commandline 2018-08-18 23:34:54 +02:00
Benau
21842f78d8 Fix leaking dummy sfx buffer 2018-07-07 10:56:11 +08:00
Benau
622f46d95a Properly use the ENABLE_SOUND flag 2018-07-07 10:43:05 +08:00
Benau
02fea1ee43 Disable sound code in server only build and rename the flag 2018-07-07 09:48:43 +08:00
hiker
5a07739786 Prevented a crash when aborting STK (audio thread is not shut down
in this case, but is getting deleted - but the audio thread might
still try to insert an update event during that time).
2018-02-07 08:22:19 +11:00
Benau
88e15147b8 Merge remote-tracking branch 'origin/win-64bit' 2017-10-17 00:55:22 +08:00
Deve
04cc5bb62c Make sure that music pointers are always null when deleted 2017-09-13 21:11:12 +02:00
auria.mg
cb2295c738 Improve kart audio refactor, see #2921 2017-09-02 22:35:41 -04:00
auria.mg
663c7aacaf Tweak kart audio code to use fewer OpenAL sources (see #2921). Seems to work well, though I need to take a closer look to make it thread-safe 2017-09-02 22:00:37 -04:00
hiker
4440c7e40a Added error check for alDeleteSource. 2017-08-30 17:46:07 +10:00
hiker
f3d56b37df Merge branch 'master' into win-64bit 2017-08-16 17:29:57 +10:00
hiker
0acda38987 Add profiling events to sfx manager, but they are commented out
by default (using preprocessor directives), since they are typically
not useful.
2017-08-08 16:44:55 +10:00
Deve
c06ea3447d Revert "Move loadSfx to the SFXManager thread"
This reverts commit ce426d82cc.
2017-04-09 09:29:25 +02:00