Commit graph

16355 commits

Author SHA1 Message Date
Christoph Oelckers
b0d38adb25 - made the sound resolving a virtual method
This way the player sounds can be done in the proper place without infesting the core.

# Conflicts:
#	src/sound/s_doomsound.cpp
2020-01-06 14:50:46 +01:00
alexey.lysiuk
a7796b8ffb - fixed debugger visualization for FSoundID 2020-01-06 14:38:54 +01:00
alexey.lysiuk
179c4dd238 - rewrote test for occupied sound channel without special types
https://forum.zdoom.org/viewtopic.php?t=66613
2020-01-06 14:38:39 +01:00
alexey.lysiuk
3c157a4f2c - restored stopping of channel by new sound
If source actor/sector/polyobject is playing something on the selected channel, stop it before playing a new sound

https://forum.zdoom.org/viewtopic.php?t=66613
2020-01-06 14:38:37 +01:00
alexey.lysiuk
ea85cd18dd - remove redundant call to SoundRenderer::UpdateSounds()
At that point SoundEngine::StopAllChannels() did this already
2020-01-06 14:38:35 +01:00
alexey.lysiuk
da7515c0ce - moved sound engine cleanup calls to own function
https://forum.zdoom.org/viewtopic.php?t=66605#p1127457
2020-01-06 14:38:33 +01:00
alexey.lysiuk
9b2054ad4d - fixed crash when exiting before sound engine initialization
https://forum.zdoom.org/viewtopic.php?t=66605
2020-01-06 14:38:30 +01:00
alexey.lysiuk
fbe696935d - removed redundant call to S_StopAllChannels()
It's the first thing that S_ClearSoundData() does anyway
2020-01-06 14:38:28 +01:00
Magnus Norddahl
bd80a16312 Fix include error 2020-01-06 14:32:33 +01:00
Christoph Oelckers
6c4a6def62 - cleaned the includes of the sound backend code of unwanted content.
Also simplified the sound init decision making. With FMod gone there is no reason to be pedantic here. Even the check of snd_backend for the Null device could be omitted here, its only realistic use is '-nosound'.

# Conflicts:
#	src/sound/s_environment.cpp
2020-01-06 13:55:51 +01:00
Christoph Oelckers
fb42e6d92e - separated reverb data and reverb editor.
Again, isolating the part that is game independent from parts that are specific to GZDoom.
2020-01-06 13:45:37 +01:00
Christoph Oelckers
8adf2c34cd - continued refactoring on sound code.
The game independent part of the code has been mostly isolated.

# Conflicts:
#	src/sound/s_doomsound.cpp
#	src/sound/s_sound.cpp
#	src/sound/s_sound.h

# Conflicts:
#	src/sound/s_sound.cpp
2020-01-06 13:45:19 +01:00
Christoph Oelckers
89bffd17bc - reduced the dependency of the sound system on game state.
Many of the simple wrappers have been moved to a separate file and the sound source handling has been abstracted.
This is only the first phase, the work is not complete yet.
Also changed the license of the sound code to BSD after verifying that this code bears no similarity to id's original sound code anymore, save for a few function names (which are due to be refactored out anyway.)

# Conflicts:
#	src/sound/s_sound.cpp
#	src/sound/s_sound.h
2020-01-06 13:35:40 +01:00
Christoph Oelckers
3501ffd743 - started separating the sound engine code from game dependent parts.
First step: Split the header. Todo: Abstract listener and sound source specifics out of the sound engine.
2020-01-06 13:35:38 +01:00
alexey.lysiuk
2535b4ef63 - pass master volume to ZMusic library on startup
MIDI devices that don't output music through the sound system (like WinMM) ignored master volume setting

https://forum.zdoom.org/viewtopic.php?t=66510
2020-01-06 01:32:08 +01:00
alexey.lysiuk
e5bb66eb4f - removed unused code from serializer 2020-01-06 01:32:05 +01:00
Christoph Oelckers
a92f71917a - apply the ZMusic mutex a bit more finely grained.
It should only guard the critical parts, like calling Stop() but can let Update and IsPlaying method work unhindered otherwise.
2020-01-06 01:30:55 +01:00
alexey.lysiuk
80a20d1b8c - fixed playback of gzip compressed music
https://forum.zdoom.org/viewtopic.php?t=66157
2020-01-06 01:30:53 +01:00
alexey.lysiuk
505902b141 - fixed selection of system MIDI device on startup
https://forum.zdoom.org/viewtopic.php?t=66150
2020-01-06 01:30:51 +01:00
alexey.lysiuk
79b39648d7 - fixed compilation of Cocoa backend with 10.9 SDK
src/posix/cocoa/i_video.mm:68:31: error: property 'delegate' not found on object of type 'id'
src/posix/cocoa/st_console.mm:464:37: error: property 'delegate' not found on object of type 'id'
2020-01-06 01:30:50 +01:00
Christoph Oelckers
5544e50ca4 - fixed: ZMusic_Close may not lock the mutex because it will delete it.
Here the calling code must ensure that the music object won't be accessible anymore before it gets deleted.
2020-01-06 01:30:47 +01:00
Christoph Oelckers
2498fbf2b7 - Moved all music related synchronization to the top level
Most of the synchronization was too deep in the implementation so that it did not guard everything it needed.

Now each song has precisely one mutex which must be locked for all access to its internals - this is done in the public ZMusic interface
2020-01-06 01:30:45 +01:00
Christoph Oelckers
6b098107ce - ZMusic interface refactoring.
Use global functions instead of the class interface which exposed too many implementation details.
2020-01-06 01:30:43 +01:00
alexey.lysiuk
baa613ff62 - added dynamic loading of FluidSynth 2.x 2020-01-06 01:11:20 +01:00
alexey.lysiuk
af321b36a1 - updated Cocoa backend to follow single exit point workflow 2020-01-06 01:11:06 +01:00
alexey.lysiuk
2b4a071b81 - deleted leftovers of exit refactoring 2020-01-06 01:11:04 +01:00
alexey.lysiuk
f144af949b - return null instead of throwing exception if CD playback isn't supported
The game should switching to MIDI music on platforms without CD playback support
It was impossible to start Hexen on platforms other than Windows
2020-01-06 01:11:02 +01:00
alexey.lysiuk
14b07ee45f - cleanup SDL fatal error reporting
Output error text to terminal if SDL message box cannot be shown
Removed wrong "No IWAD found" message
2020-01-06 01:10:59 +01:00
alexey.lysiuk
ad07c6fcdb - fixed potential crashes in Linux crash reporter
Do not access various global objects at early stage of initialization and late stage of shutdown

# Conflicts:
#	src/posix/sdl/i_main.cpp

# Conflicts:
#	src/posix/sdl/i_main.cpp
2020-01-06 01:08:16 +01:00
alexey.lysiuk
b5d2cc4778 - call SDL_Quit() from main() instead of atexit()
This should help with crash reporting during SDL shutdown
2020-01-06 00:55:51 +01:00
alexey.lysiuk
a5d3be2569 - fixed crash on exiting from IWAD selector
https://forum.zdoom.org/viewtopic.php?t=66073
2020-01-06 00:55:49 +01:00
alexey.lysiuk
6c78556c09 - restored command line arguments initialization in SDL backend 2020-01-06 00:55:47 +01:00
drfrag
cfeacc485b - Try to fix compilation on non windows platforms.
# Conflicts:
#	src/d_main.cpp
2020-01-06 00:51:04 +01:00
alexey.lysiuk
f334400d48 - fixed compilation of POSIX targets
src/posix/cocoa/i_main.mm:152:2: error: use of undeclared identifier 'ShutdownJoysticks'
src/posix/sdl/i_system.cpp:128:3: error: ‘I_FatalError_Gtk’ was not declared in this scope
src/posix/sdl/st_start.cpp:329:8: error: ‘CExitEvent’ was not declared in this scope
2020-01-06 00:48:14 +01:00
drfrag
bda11c6401 - Fixed compilation.
# Conflicts:
#	src/win32/win32video.cpp
2020-01-06 00:46:30 +01:00
Christoph Oelckers
191b958791 - the big cleanup of the exit cleanup is done!
atterm is gone and only a few system-side functions use atexit.
All game side cleanup is performed in D_DoomMain now.

# Conflicts:
#	src/CMakeLists.txt
#	src/atterm.cpp
#	src/atterm.h
#	src/d_main.cpp
#	src/dobjtype.cpp
#	src/g_mapinfo.cpp
#	src/g_statusbar/sbarinfo.cpp
#	src/gamedata/g_mapinfo.h
#	src/i_net.cpp
#	src/p_setup.cpp
#	src/posix/cocoa/i_video.mm
#	src/posix/sdl/hardware.cpp
#	src/posix/sdl/i_main.cpp
#	src/r_utility.cpp
#	src/rendering/v_video.cpp
#	src/sound/s_advsound.cpp
#	src/sound/s_sound.cpp
#	src/swrenderer/r_swcolormaps.cpp
#	src/win32/hardware.cpp
#	src/win32/i_input.cpp

# Conflicts:
#	src/CMakeLists.txt
#	src/i_net.cpp
#	src/posix/sdl/i_system.cpp
#	src/r_utility.cpp
#	src/win32/i_system.cpp
2020-01-05 23:57:44 +01:00
drfrag
5b31393b90 - Fixed compilation.
# Conflicts:
#	src/win32/st_start.cpp
2020-01-05 21:19:07 +01:00
Christoph Oelckers
7221068d68 - fixed compilation on Windows. 2020-01-05 21:14:00 +01:00
Christoph Oelckers
9ee1c88760 replaced all 'exit's with an ExitEvent exception
The main exits are initiated from code that cannot filter this back to D_DoomMain easily so the exception is the only way to get there.

The 3 main points of exit are:

* quit/exit CCMD
* quitting the menu through ST_Endoom
* receiving a quit message on the main window.

# Conflicts:
#	src/posix/cocoa/st_start.mm
2020-01-05 21:13:56 +01:00
Christoph Oelckers
7a307ff8a9 - don't exit from within a window proc.
This should be handled by the message pump evaluating WM_QUIT which is how Windows suggests this to be done.
2020-01-05 21:12:23 +01:00
Christoph Oelckers
dd47803906 - missed one exit. 2020-01-05 21:12:20 +01:00
Christoph Oelckers
abd98688e1 - refactored the exit calls out of the networking code
These ones were particularly bad examples of misusing the exit handlers by temporarily installing one themselves and then calling exit to clean stuff up.

Now they just return an error code to D_DoomMain to perform a regular exit.
2020-01-05 21:12:18 +01:00
Christoph Oelckers
f52c217234 - moved all exception handling out of the backends
The main catch is now in D_DoomMain, only calling platform specific functions to handle the output for the error.

As a nice side effect, -norun can now be done without an exception, just by exiting D_DoomMain with a special exit code.

# Conflicts:
#	src/win32/i_main.cpp
2020-01-05 21:12:16 +01:00
Christoph Oelckers
e8332b299e - consolidated I_FatalError functions
This also removes the handling from thr Posix backend and will not compile on non-Windows.
2020-01-05 21:09:36 +01:00
Christoph Oelckers
f84c0790ea - consolidated the 3 I_Error implementations
Debug output is now being handled by the respective interface functions, not by the Windows I_Error itself.
2020-01-05 21:09:34 +01:00
alexey.lysiuk
fe76293f2d - handled differences of values returned by fluid_settings_...() functions
FluidSynth 1.x: these functions return 1 on success and 0 otherwise
FluidSynth 2.x: these functions return  FLUID_OK (0) on success and FLUID_FAILED (-1) otherwise
2020-01-05 21:09:31 +01:00
alexey.lysiuk
d7f0da033d - fixed setting of FluidSynth reverb and chorus 2020-01-05 21:09:29 +01:00
alexey.lysiuk
922eb28ca2 - fixed compilation with old versions of Xcode
libraries/zmusic/mididevices/music_fluidsynth_mididevice.cpp:628:3: error: use of undeclared identifier 'free'
2020-01-05 21:08:03 +01:00
alexey.lysiuk
9d49e33a80 - cleaned POSIX compiler arguments for libraries
Removed omission of frame pointers as it makes crash reports much less useful
Modified warning flags to hide annoying reports for external code
2020-01-05 21:08:01 +01:00
alexey.lysiuk
4c099300ca - implemented str(n)icmp function definitions via CMake macro 2020-01-05 21:07:58 +01:00