Commit Graph

109 Commits (da88cb87abf3dd150867df8d54d97cb06059536b)

Author SHA1 Message Date
Buginator 0aff0b46cf Add a new debug flag type, LOG_FATAL.
This is used to differentiate LOG_ERROR (which is a *non* fatal error, but a error none the less) and fatal errors which result in program termination with no *visible* output (on windows/macs) on our end because of the crappy GUI functions so we usually dump it to stderr.txt and there is no clue that the program had to exit for whatever reason.

Hopefully, this will be helpful to windows people so they can differentiate between *our* exit/abort routines, and crashes that occur in drivers which look exactly the same since they get dumped back to the desktop with no visible clue why.

LOG_FATAL is *always* on in both debug & release builds.

On LOG_FATAL debug lines, on windows, we now throw up a modal dialog box with the current error message.  At this time, this only happens when we have a error, and we use abort() right after the error, which makes it fatal.

That explains why this touches ~60 files :)


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8320 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-22 16:19:51 +01:00
Buginator 1f4e8a08ab Add openAL extensions, remove openAL attributes from Crash Dump info. Attributes were not useful.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8241 4a71c877-e1ca-e34f-864e-861f7616d084
2009-10-10 14:49:23 +02:00
Buginator 2c03546f87 partial revert of r5763
Clean up and fix 3D sound.
We now have true 3D sound that works correctly.

See ticket:920 for more information about the revert.

fixes ticket:220


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8098 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-28 22:21:01 +02:00
Christian Ohm 5accd8f706 Commit the cleaned up version of Buginator's sound patch. Closes #770.
This fixes the removal of unused sources, which didn't work correctly before.
The number of sources is still not limited, but the number of sounds used
concurrently is much lower now.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8010 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-27 19:07:09 +02:00
Buginator 2f92b730ad Fix a typo in sound_SetObjectPosition() to use (...x,y,z) instead of (...x,x,x)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7903 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-27 19:06:53 +02:00
Buginator 27bdf48197 slight cleanup of r7738
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7739 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-16 22:28:35 +02:00
Buginator 1ccb1487de Create a new function, addDumpInfo(), to be used to add custom information to the crash dump report file.
Currently, we query openAL & openGL vendor/version info.
This should give us more descriptive crash reports on the user's hardware.


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7738 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-16 22:28:34 +02:00
Gerard Krol 71bc279c9e Fix some spelling errors in debug messages and comments. Patch by Paul Wise <pabs3>.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6832 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-11 11:51:40 +00:00
Dennis Schridde aac41748dc Bump copyright
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6617 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 18:01:48 +00:00
Dennis Schridde cbbc58d1e9 Move files which extend a c std library header to a filename of similar name
Extension functions dealing with ...
 * strings are in string_ext.h
 * stdio (namely printf variants) are in stdio_ext.h
 * math are in math_ext.h

These headers are no longer included by frame.h

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6613 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 17:23:09 +00:00
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