Commit graph

11 commits

Author SHA1 Message Date
Daniel Gibson
954ff88759 Properly pause sounds when entering menu, fixes #330
Otherwise especially looped sounds continue playing while the menu
is open, especially noticeable when opening the menu while firing
the chaingun (the whirring sound continues playing).
2021-04-27 20:08:59 +02:00
Daniel Gibson
13ac657ebf Make deleting listenerSlot in idSoundWorldLocal::Shutdown() work
the problem was that the sources were still associated to it, because
they get deleted after the listenerSlot: the sources get freed in
idSoundSystemLocal::Shutdown() which is called by
idCommonLocal::ShutdownGame() in line 3217,
while the listenerSlot is deleted via idSessionLocal::Shutdown()
-> delete sw/rw -> idSoundWorldLocal::~idSoundWorldLocal()
-> idSoundWorldLocal::Shutdown() - and idSessionLocal::Shutdown() is
called in idCommonLocal::ShutdownGame() line 3211, before the other.

I'm not gonna mess with the order of deleting things in ShutdownGame(),
but it's sufficient to unassociate the effect slot from the source
when destroying the emitters in idSoundWorldLocal::Shutdown(),
by adding a call for that to idSoundChannel::ALStop() - and destroying
the emitters before deleting listenerSlot.

Before this fix, with ALSOFT_LOGLEVEL=3 you got the following warning:
  (WW) Error generated on context 0x5578fce2a280, code 0xa004,
  "Deleting in-use effect slot 1"
Thanks for openal-soft's KittyCat for pointing this out!
2021-04-12 19:17:12 +02:00
Yamagi Burmeister
4a6327d87a Fix entering the menu or saving the game stopping some sounds.
If an OpenAL source runs out of samples it transisions into state
AL_STOPPED. That happens if we're entering the menu (which switches
to another soundworld) and when saving the game (because the game
blocks for some milliseconds). Work around this by adding a new
field 'stopped' to the channel state and use that to determine if
a sound was stopped. And not AL_STOPPED like before.
2018-08-19 16:58:44 +02:00
dhewg
736ec20d4d Untangle the epic precompiled.h mess
Don't include the lazy precompiled.h everywhere, only what's
required for the compilation unit.
platform.h needs to be included instead to provide all essential
defines and types.
All includes use the relative path to the neo or the game
specific root.
Move all idlib related includes from idlib/Lib.h to precompiled.h.
precompiled.h still exists for the MFC stuff in tools/.
Add some missing header guards.
2011-12-19 23:21:47 +01:00
dhewg
18f9793732 Get rid of the intenal useOpenAL
Useless now, there is only OpenAL.
2011-12-14 18:24:06 +01:00
dhewg
3f5c14ef5f Fix -Wunused-but-set-variable warnings
variable set but not used

Removes some CollisionModel code under _DEBUG which was probably a
leftover, since it was completely useless (its done later anyways).
2011-12-10 15:36:04 +01:00
dhewg
e4771f3a5f Fix -Wunused-variable warnings
unused variable
2011-12-10 15:36:03 +01:00
dhewg
120d560722 Fix -Wconversion-null warnings
converting to non-pointer type ‘int’ from NULL
2011-12-10 15:36:00 +01:00
dhewg
79ad905e05 Fix all whitespace errors
Excluding 3rd party files.
2011-12-10 15:35:54 +01:00
dhewg
ff493f6847 Fix quoting in GPL headers 2011-12-10 15:34:48 +01:00
Timothee 'TTimo' Besset
fb1609f554 hello world 2011-11-22 15:28:15 -06:00