Commit Graph

99 Commits (8050b17162fac71de5807e310daaf3be2414d3d6)

Author SHA1 Message Date
Giel van Schijndel ae18d97e54 Don't depend on OpenAL and Vorbis when compiling with --disable-sound
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6542 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-11 14:34:38 +00:00
Buginator c5c02052d6 Add Hack from ticket:115
Forces window XP users to also use a software device for openAL.  (already the default for the other platforms & vista).  This allows 256 sources, instead of 16.
Note: *this is windows specific* and will not affect the other platforms.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6223 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-26 17:10:42 +00:00
Giel van Schijndel ceeb8780c7 Explain the "funny" iteration used to iterate over OpenAL devices
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6199 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-22 17:19:43 +00:00
Buginator 48eacfbc3d Dump out available devices available for openAL in the PrintOpenALVersion() function.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6196 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-21 18:40:05 +00:00
Buginator 21fdab0117 Modify debug output to specify the 'real' directory that physfs is using for the file in question.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5958 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 20:00:54 +00:00
Giel van Schijndel 37c6aa9fd6 Make sure to clean up the sound streams as well in function sound_ShutdownLibrary()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5884 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-28 20:12:47 +00:00
Giel van Schijndel 19b72f1ce5 * Use alGetError() instead of sound_GetError() to clear error codes (the latter will also dump a debug message to LOG_SOUND)
* Remove some redundant debug(LOG_NEVER calls (they're preceded by a sound_GetError() call which will already dump that info)
 * Improve some comments
 * Log sound errors to LOG_SOUND, not to LOG_NEVER
 * In sound_DestroyStream make sure to bail out when we fail to retrieve the buffer count (as that could cause memory over-allocation)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5860 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-24 12:41:10 +00:00
Buginator 82966293ad Fixes a openAL case where we didn't check if a openAL call failed or not.
(NOTE, this is really a temp fix, so it don't crash/cause more openAL errors. The sound code need a rewrite to correctly fix this problem)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5853 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-23 19:44:00 +00:00
Giel van Schijndel a293a90e76 * Rename audio_Get3DPlayerPos to audio_GetPlayerPos and change it to return a Vector3f instead
* Rename audio_Get3DPlayerRotAboutVerticalAxis to audio_GetPlayerOrientation and change it to return two Vector3f's with a forward and upward pointing vector in it (which can be directly used by OpenAL)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5763 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-03 17:51:43 +00:00
Per Inge Mathisen d7eabccb74 Comment out alIsSource assert
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5532 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 18:46:53 +00:00
Giel van Schijndel 623044cf7c Add some debug messages when failing to create an AUDIO_STREAM in sound_PlayStreamWithBuf
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5467 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 15:47:27 +00:00
Per Inge Mathisen 1f831ebd3d Add beginnings of self-test to openal and general audio subsystems.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5456 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 19:07:42 +00:00
Per Inge Mathisen ee6452eb64 Revert r5426. It will not work quite like that, since the pointers refer
to a list in audio.c. The horror! The horror!


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5428 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-08 18:24:42 +00:00
Per Inge Mathisen 74aeca0093 Change current_queue_sample to a pointer to an AUDIO_SAMPLE instead of
an integer value. This fixes the problem of AL_INVALID being used for
invalid values, while it is really a perfectly valid ID for a sample.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5426 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-08 17:45:33 +00:00
Per Inge Mathisen 4d1d5b4c11 Add an error check to patch #1082: Fix AL_INVALID_NAME bug, to catch the
currently impossible case of the sample not being in the active list.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5425 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-08 17:11:58 +00:00
Per Inge Mathisen 22d4eb3fe1 patch #1082: Fix AL_INVALID_NAME bug, sans one no good assert.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5422 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-08 16:12:14 +00:00
Per Inge Mathisen 925c3daced Quick fix for crash if --nosound is used together with a soundtrack file
(which is now created by default). Someone should look more carefully at 
this code.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5262 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-18 16:29:10 +00:00
Giel van Schijndel 5828b26a10 * Add functions for changing the volume of an already created AUDIO_STREAM: sound_GetStreamVolume and sound_SetStreamVolume
* Use these functions in cdaudio.c to change the volume of the currently playing AUDIO_STREAM in function sound_SetMusicVolume

This fixes bug #11579 ("Music volume slider dont work")


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5101 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-13 14:01:25 +00:00
Giel van Schijndel 44986c3473 * Make sure to actually set the volume of an AUDIO_STREAM we're creating
* Indentation fixes


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5100 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-13 13:50:08 +00:00
Giel van Schijndel 4a17aeeec7 * Delete unused and empty function StartTacticalScroll()
* Mark the parameters for several functions as WZ_DECL_UNUSED (for those functions that require the parameter as part of their interface)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4701 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-20 17:17:50 +00:00
Giel van Schijndel 359efe39ac Const fix
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4402 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 23:09:32 +00:00
Dennis Schridde 10f2ccfd56 TRUE->true, FALSE->false (except in scripts)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4311 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 16:51:17 +00:00
Giel van Schijndel 8d15dc2ba1 * Log a warning when we've just decoded an empty OggVorbis track
* On DEBUG builds free() the memory associated with that track and return NULL (which __will__ cause program termination if it occurs)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4254 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 16:14:28 +00:00
Dennis Schridde da462b4511 More float specialisation and generic cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3937 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 12:42:42 +00:00
Giel van Schijndel 7c204a47ac Change file-specific comment in Doxygen comment
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3631 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-01 21:56:02 +00:00
Giel van Schijndel 6e74be4df9 Use C linkage for frameresource.h and debug.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3629 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-01 21:26:37 +00:00
Giel van Schijndel 2b59e6840d Add a Doxygen parameter description to sound_PlayStreamWithBuf for fileHandle, volume, onFinished and user_data
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3596 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-29 13:05:38 +00:00
Dennis Schridde 06a3b11a62 Revert r3588. I already did that in r3586.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3591 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-28 00:51:21 +00:00
Giel van Schijndel 7cf72b6fea #include <math.h> and "lib/framework/math-help.h" where required
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3588 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-28 00:29:19 +00:00
Dennis Schridde 9f9c417240 Include lots of forgotten math.h and roundf() is included in C99.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3586 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-28 00:22:02 +00:00
Giel van Schijndel 024c8c1c10 Add function sound_PlayStreamWithBuf to allow specifying custom buffer counts and sizes to use for a stream
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3582 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-27 23:32:55 +00:00
Giel van Schijndel 6d99a49ef4 Use the sound_.*Stream functions to implement the cdAudio aka playlist code instead of custom crafted code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3580 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-27 22:31:16 +00:00
Giel van Schijndel f880720628 Implement sound_StopStream, sound_PauseStream and sound_ResumeStream for stopping, pausing and resuming of playing streams initially created with sound_PlayStream
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3578 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-27 21:33:10 +00:00
Giel van Schijndel 6de5602631 * Make sound_PlayStream and audio_PlayStream return a AUDIO_STREAM* pointer instead of a bool
This pointer can later on be used to stop, pause & resume playing of the given stream


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3577 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-27 21:28:35 +00:00
Giel van Schijndel 30d837ec90 * Allow compilation on MSVC again
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3285 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-31 21:55:02 +00:00
Giel van Schijndel 3d245df0f9 * Provide an implementation of sound_PlayStream
* Modify audio_PlayStream's prototype to match sound_PlayStream's implementation & prototype
 * In cdspan_PlayInGameAudio use sasprintf instead of a statically sized array and snprintf
 * Add some Doxygen comments

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3276 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-31 15:16:59 +00:00
Giel van Schijndel db3d933791 * Add a new cheat/debug-command "showsamples"
* This command will cause the amount of samples in the sound library's queues & lists to be constantly displayed (until turned off) on screen

Patch #887 by Buginator


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3107 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-19 20:17:54 +00:00
Giel van Schijndel 29139cc6da * Fix crashes due to failing to call the callback when sounds are removed from the queue/list
Part of patch #887 by Buginator


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3105 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-18 23:25:32 +00:00
Giel van Schijndel eba3731a93 * Put some duplicated code for destroying sound samples in function sound_DestroyIteratedSample
* If in sound_Update() we encounter an error simply destroy the current sample we're working on


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3066 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-15 20:49:02 +00:00
Giel van Schijndel 8fcd2410be * Apply the last bit of patch #884 by Buginator (openal_track.c)
* Make sure that sound_GetError and sound_GetDeviceError are useable in WZ_NOSOUND builds as well


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3053 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-14 15:11:59 +00:00
Giel van Schijndel d179c09f17 * Fix some errors in openal_track.c; part of patch #884 by Buginator
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3052 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-14 12:13:23 +00:00
Giel van Schijndel 22f762a3c3 * Prevent a linker error when compiling with -DWZ_NOUSOUND (sound_RemoveActiveSample was used but not defined)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3050 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-14 11:43:15 +00:00
Giel van Schijndel 992ee8583a * Fix yet another bug introduced in r3047 (the game would hang in an infinite loop because of failing to increase the iterators)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3049 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-13 23:54:28 +00:00
Giel van Schijndel ff44e8c84c * Fix a bug introduced in r3047 (segfault due to failing to check for a NULL pointer)
* Apply patch #879 by Buginator (refactored by me to use less handcrafted code, and more functions instead)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3048 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-13 23:47:46 +00:00
Giel van Schijndel 99c55dbf74 * Try to encapsulate knowledge about AUDIO_SAMPLE's internal representation in openal_track.c (i.e. don't use it in client code!)
* Look at sound_StopSample specifically
 * Use a function to manipulate the linked list of audio samples (i.e. get rid of duplicated code)
 * Allow printing of OpenAL vendor, version, renderer and extensions data on multiple debug "channels" to reduce code duplication
 * Add openal_error.[ch] for error detection (and producing debug messages for them!)
 * Add TOSTRING and AT_MACRO macros to macros.h
 * Get rid of some super-nested if-branches where one of them would return (so we don't actually need an else-branch because the function is left anyway)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3047 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-13 23:16:03 +00:00
Giel van Schijndel a44aa48f00 * Don't use a C99 variably sized struct member to store the filename of a track (instead a plain pointer will be used)
* Make sure to check for a NULL pointer __before__ passing it to strlen
 * Allow the loading of a track (in sound_LoadTrackFromFile), even if GetLastResourceFilename() returns a NULL pointer


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2889 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-26 15:16:51 +00:00
Per Inge Mathisen eeefdc0af0 Do not crash if filename to sound is not set. Modified version of patch #855 by Buginator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2853 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-22 18:35:03 +00:00
Giel van Schijndel 533e7e92bf * Use spaces for line-out purposes (rather than tabs)
* Tune down the volume of the oil-pumps, power-spikes and power hums a bit, to make them less dominant (and annoying) (from patch #822 by Buginator)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2681 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-02 22:37:20 +00:00
Giel van Schijndel a316f10a0e * Don't save the volume with user volume preferences applied (instead save the track-volume so recomputing will be possible)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2680 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-02 22:19:06 +00:00
Per Inge Mathisen ec232d7e0f Actually use audio.cfg configuration of sound volume. Patch by Buginator in patch #822
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2677 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-02 18:47:22 +00:00