Commit graph

332 commits

Author SHA1 Message Date
Yamagi Burmeister
47707a728e Use Windows headers on Windows 2012-06-11 10:18:44 +02:00
Yamagi Burmeister
e8eea857e4 Fix another buffer overflow, this time when writing the config.cfg
This overflow is a problem on all platforms but manifested itself
especially on a german Windows XP due to it's long profile path.
2012-06-10 18:45:14 +02:00
Yamagi Burmeister
d8e35b82c7 Reformat the sound system code
caedes and some other people will probably kill me for this, but I'm the
idiot who has to maintain the code. And that's much easier if it's in a
readable und writeable state.
2012-06-06 11:13:07 +02:00
Yamagi Burmeister
51cc3369b1 Provide an optimized case for mixing 16 bit / 2 chan sound
With sound quality "high" nearly all sound is provided as 16 bit PCM
with 2 channels. Since most players use this setting, provide an optimed
case for it. This should also solve the cracking due to overshot
soundbuffers, which was especially noticeable on Windows. This changes
only effects the old SDL soundbackend and not OpenAL.
2012-06-06 10:34:36 +02:00
Yamagi Burmeister
15400b2133 Use memset() instead of array magic 2012-06-06 10:02:55 +02:00
Yamagi Burmeister
272b897919 Reformat snd_mix.c 2012-06-06 09:58:06 +02:00
Yamagi Burmeister
5d272eeab8 strsep() is a FreeBSDism. Switch over to strtok(). 2012-06-04 10:53:55 +02:00
Yamagi Burmeister
9823a23a91 Initialize sounds[] to avoid garbage branch conditions down below 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
35e5bbb48b Convert rand(), crand() and frand() to randk(), crandk() and frandk() 2012-06-04 09:13:29 +02:00
Yamagi Burmeister
edae2b0473 Change atof() to strtod() 2012-06-04 09:13:28 +02:00
Yamagi Burmeister
e9c90e16a9 Change atoi() to strtol() 2012-06-04 09:13:28 +02:00
Yamagi Burmeister
0aa75f8704 Explicit cast 2012-06-04 09:13:28 +02:00
Yamagi Burmeister
32fe0ba21f Prevent a buffer overflow. 2012-06-01 18:13:30 +02:00
Yamagi Burmeister
0e1520d29a Remove dead code and assignments 2012-06-01 17:05:40 +02:00
Yamagi Burmeister
e9605e8a8b Use AL_BUFFERS_QUEUED at stream shutdown. 2012-05-26 12:03:01 +02:00
Yamagi Burmeister
492b7c1a2b Convert whitespace indentation to tabs 2012-05-26 12:00:48 +02:00
Yamagi Burmeister
28c4edfd69 Clear buffers before deleting the sources
This fixes a very long lasting shutdown procedure which made it look
like Quake II freezed. Especially on slow machines it was a problem.
2012-05-26 11:37:47 +02:00
Daniel Gibson
62d76b3d40 Fix segfault when s_openal=0 but USE_OPENAL=1
If the game was compiled with openal support (USE_OPENAL is defined),
but it's disabled via cvar (set s_openal 0) there could be segfaults
when calls to openal where done anyway, because the check
if(sound_started == SS_OAL) was forgotten.
This is fixed now.
2012-05-17 14:47:05 +02:00
Yamagi Burmeister
5bf1ee670d Fix s_show when OpenAL is used 2012-05-12 15:11:17 +02:00
Yamagi Burmeister
aff51633d0 Add a sanity check against buffer overflows to S_BuildSoundList 2012-05-12 14:46:13 +02:00
Yamagi Burmeister
4a414b588e Fix a buffer overflow in AL_AddLoopSounds
This fixes a crash in mine4.bsp and most likely some other problems.
The bug was reported by "mxmvasilyev0 [at] gmail [dot] com" and tracked
as Github issue #1.
2012-05-12 14:42:15 +02:00
Yamagi Burmeister
b6325d7858 Remove unused variables and dead code (patch submitted by Christoph
Mallon)
2012-04-30 10:02:58 +02:00
Christoph Mallon
ab034114b4 Whitespace fixes. 2012-04-30 08:25:59 +02:00
Daniel Gibson
31f9af817f Last fixes and cleanups for OpenAL support
* New license header in snd_al.c
* README fixes
* Fix printing of used OpenAL device
* Cleanup in snd_al.c
2012-04-28 15:44:14 +00:00
Yamagi Burmeister
c62e5ac85b - Implement AL_UnqueueRawSamples() and use it to stop the Vorbis playback
imediatly
- Increase Vorbis buffers to 64. 24 were to few
2012-04-27 14:06:08 +00:00
Yamagi Burmeister
2b6389a471 Filter sound samples (not the music) when under water 2012-04-27 13:55:45 +00:00
Yamagi Burmeister
1a0b4ebad5 Do not set / enable / show the s_openal CVAR if the binary is build
without OpenAL support. OpenAL is enabled in the default Makefile and if
it's disabled, it's shown at startup.
2012-04-27 12:00:22 +00:00
Yamagi Burmeister
a388254252 Fix a missmerge 2012-04-25 10:09:16 +00:00
Yamagi Burmeister
2c3c203097 Merge out new options framework from the trunk 2012-04-25 09:57:17 +00:00
Yamagi Burmeister
03015a686b Hide music playback from CD behind CDA 2012-04-25 08:53:25 +00:00
Yamagi Burmeister
9d60a5de6a Hide OGG/Vorbis support under OGG 2012-04-25 08:24:38 +00:00
Yamagi Burmeister
f836cef4c4 Rename qal_api.c to unix/qal.c and qal_api.h to unix/header/qal.h.
Both files are platform dependend and won't work on non unixoid
platforms.
2012-04-24 14:20:01 +00:00
Yamagi Burmeister
bf6d491af3 - Refactor AL_SoundInfo() into the platform dependent
QAL_SoundInfo().
- Use QAL_SoundInfo() to print the OpenAL infos 
  at startup and by the "soundinfo" command.
- Implement printing of all available OpenAL
  devices at startup and by the "soundinfo"
  command.
2012-04-24 14:07:33 +00:00
Yamagi Burmeister
79c137254a Rework qal_api.c and qal_api.h:
- Reformat to match "our" coding style
- Unroll all unreadable macros
- Remove the use of goto
2012-04-24 13:22:05 +00:00
Yamagi Burmeister
479aae4a9c *gna* This \n got lost on the way 2012-04-23 13:57:36 +00:00
Yamagi Burmeister
90d0811185 Delete all OpenAL sources at shutdown 2012-04-23 13:55:25 +00:00
Yamagi Burmeister
134878e996 - Some more minor style cleanup
- Much improved startup log messages
2012-04-23 13:44:12 +00:00
Yamagi Burmeister
678e50bf8d Raise the volume of a positioned sample by 384 instead of 255 when using
OpenAL. This makes them much more distinguishable from the background
music.
2012-04-23 13:23:47 +00:00
Yamagi Burmeister
3bce2a212a - Use a better way to calculate the number of buffers
used by OGG/Vorbis. 24 buffers are enough for smooth
  and stutter free playback and ensure, that OGG_Stop()
  is effective nearly immediately.
- Change C99 comments to C89, since snd_vorbis.c is
  a C89 file. Caedes will beat me for this :/
2012-04-23 07:59:39 +00:00
Daniel Gibson
3d7013e12b Fix: Cvar_Get needs a string as default value, not an int.. 2012-04-22 20:28:41 +00:00
Daniel Gibson
8bfc61b564 Introduce s_openal to enable/disable OpenAL
And fix possible dangling else problem in that code
2012-04-22 20:27:02 +00:00
Daniel Gibson
efd85a76c6 Updated paintedtime in OpenAL mode so shotgun sounds right
probably fixes other issues as well.
2012-04-22 20:14:56 +00:00
Daniel Gibson
65914b342d Allow DMA/SDL sound in OGG_Stream when compiling with USE_OPENAL 2012-04-22 17:59:03 +00:00
Yamagi Burmeister
e388a425b4 Enable OGG/Vorbis playback in OpenAL mode. 2012-04-22 17:50:15 +00:00
Daniel Gibson
04fd7f2cda OpenAL Streaming Sound stuff
from zeq2, but adapted/stripped down for our needs.

Videos work (for me), music does not (yet)
2012-04-22 15:59:18 +00:00
Daniel Gibson
6384b850f1 Remove redundancy 2012-04-22 15:57:59 +00:00
Daniel Gibson
f4d5040a73 Add OpenAL stuff to Makefile, make it compile and work (no streaming sound yet)
It works \o/
It's still hacky so it needs more work.
And streaming sound (OGG music, sound from videos) is still missing.
2012-04-22 00:24:50 +00:00
Daniel Gibson
7e0a44825e OpenAL support, from Q2Pro
Copied and adapted (hopefully) all relevant code from Q2Pro.
Did some small refactorings when needed.

Still TODO:
* Adapt Makefile
* OGG support when using OpenAL
* A cvar that switches between OpenAL and DMA/SDL
* Actually compiling and testing this stuff ;)
2012-04-15 02:58:01 +00:00
Yamagi Burmeister
2b2e996dda Make windowed_mouse CVAR_USERINFO 2012-03-08 11:33:58 +00:00
Yamagi Burmeister
d87328293c Add a CHANGELOG entry 2012-02-27 11:33:32 +00:00
Daniel Gibson
b70dc11672 - Fix memory leaks in the server start menu by not
creating the maplist each time it's called, but
  preserve it across several calls.

- Fix M_PushMenu a second time by taking a corner
  case into account when the requested menu is 
  opened and on the stack but not on top.
2012-02-26 20:21:40 +00:00
Daniel Gibson
32377a6b57 Fix crash when opening menu twice via hotkeys
Now this closes the menu again, faking toggling behaviour
2012-02-26 18:58:48 +00:00
Yamagi Burmeister
d511ed7b03 Add 1280x960. This is the "native" resolution for 19" 4:3 CRTs. 2011-10-15 16:27:19 +00:00
Yamagi Burmeister
07ed4c8b5a Make the client and server IPv6 aware 2011-10-15 16:18:26 +00:00
Yamagi Burmeister
75e9f6cf85 Prevent a deadlock when trying to open the menu while connecting 2011-10-13 14:01:40 +00:00
Yamagi Burmeister
77de60f274 Fix a rare crash by nullpointer 2011-10-13 13:16:59 +00:00
Yamagi Burmeister
13d1ab9bc1 Add 1440x900 and 1920x1080 resolutions 2011-10-10 08:37:35 +00:00
Yamagi Burmeister
d4a60e7b77 - Add yq2.cfg to the code, an example to stuff/ and metion it in the
README
- Rename tools/ to stuff/
2011-10-09 17:55:10 +00:00
Yamagi Burmeister
0aa45e9736 Fix some warnings with clang 2011-06-27 14:40:16 +00:00
Yamagi Burmeister
bff20f6b7c Nächter Soundpatch von Ozkan:
- Adds a "float volume" argument to snd_dma.c:S_RawSamples()
	so that ogg can use it too
  - That S_RawSamples now has a volume argument, the
    cinematics now honor the volume adjustment instead of 
    playing at full volume all the time even if volume is
	zeroed                                                                               
  - Moves endianism handling from S_RawSamples to codec
    level                                                         
  - Fixes an issue of S_RawSamples with 8 bit stereo samples
	(not seen/tested with q2 but with my uhexen2)
  - Other minor adjustments
2010-12-20 09:56:37 +00:00
Yamagi Burmeister
f5f5c0d2ca Korrigiere Endianism im Vorbis-Code 2010-12-03 09:45:49 +00:00
Yamagi Burmeister
4b6c561acc Erweitere Vorbis-Unterstützung:
- Support für Big-Endian Pamps (läuft yQ2 auf sowas überhaupt?)
 - Unterstützung für 22khz Vorbis-Dateien (ermöglicht es die
   Wave-Dateien aus den Pags in Vorbis zu konvertieren, wenn man denn
   drauf steht.)
 - Unterstützung für Mono-Dateien (Sinnvoll für Handhelds)

Patch von: Ozkan Sezer
2010-11-30 10:28:20 +00:00
Yamagi Burmeister
b282f41093 Begrenze cl_maxfps per Default auf 95 2010-11-27 11:56:50 +00:00
Yamagi Burmeister
e57aba66c1 Man sollte strncmp() auch richtig anwenden 2010-11-27 11:19:59 +00:00
Yamagi Burmeister
8af8dd1559 Stoppe Ogg-Playback, wenn Track 0 gefordert wird 2010-11-27 10:45:09 +00:00
Yamagi Burmeister
ff360644fc Löse das Verzeichnis client/console auf 2010-11-25 15:32:39 +00:00
Yamagi Burmeister
b859cec1e2 Löse das Verzeichnis client/input auf 2010-11-25 15:28:41 +00:00
Yamagi Burmeister
491386e243 Entferne einige Tasten aus der Wiederholungssperre 2010-11-18 16:13:00 +00:00
Yamagi Burmeister
aa9877826c Unnütze Variable entfernt 2010-11-16 11:43:06 +00:00
Yamagi Burmeister
e98ad4b925 Entferne ein unnötiges Anpassen von s_khz 2010-11-01 15:54:56 +00:00
Yamagi Burmeister
758d82fe4c Deregistriere ogg_init und ogg-shutdown 2010-11-01 15:48:01 +00:00
Yamagi Burmeister
66ac4643cb Überarbeite das Sound-Menü 2010-10-28 06:28:11 +00:00
Yamagi Burmeister
f0fa091fde s_khz per Default auf 44 2010-10-28 05:57:13 +00:00
Yamagi Burmeister
7c6551dc0f Einen kleinen Bug gefixt, der zu Soundclipping führte 2010-10-28 05:56:20 +00:00
Yamagi Burmeister
44b65d8ab2 Simple Kommandovervollständigung für die Konsole 2010-10-27 13:12:20 +00:00
Yamagi Burmeister
6db456587c Schreibe das Hardwaregamma auf X11 um :) 2010-10-25 15:57:39 +00:00
Yamagi Burmeister
8b3002b1dd Benenne alle r_ CVAR in gl_ um 2010-10-24 08:50:01 +00:00
Yamagi Burmeister
fa23a3e516 Ein Versuch Screenshots zu ermöglichen ohne den halben Client in den
Renderer linken zu müssen
2010-10-23 09:52:39 +00:00
Yamagi Burmeister
0677833560 Fixe die gemeinsamen Symbole von Client und Refresh 2010-10-23 06:54:05 +00:00
Yamagi Burmeister
ca1f64c016 Behebe das Problem, dass CL_Shutdown() rekursiv ein weiteres Mal
aufgerufen wird. Danke an caedes für das entgödeln.
2010-10-19 16:21:02 +00:00
Yamagi Burmeister
09c87ea0cc Reformatiere die Startup Ausgabe 2010-10-19 13:34:08 +00:00
Yamagi Burmeister
0e7a9957e9 Löse qgl/ und vid/ auf 2010-10-19 09:17:18 +00:00
Yamagi Burmeister
5af05f7d81 Repariere die Cursortasten im Menü 2010-10-19 09:03:27 +00:00
Yamagi Burmeister
7edacb5638 - Reiße das Clipboard raus, funktionierte eh nicht
- Entferne weiteren toten Code
2010-10-19 08:34:59 +00:00
Yamagi Burmeister
010aa5b498 Ein neues Inputsystem in SDL. Das ist alles noch sehr Alpha... 2010-10-19 07:14:05 +00:00
Yamagi Burmeister
d65849f64d Überarbeite refresh.c 2010-10-18 14:56:30 +00:00
Yamagi Burmeister
1ad221b667 Räume posix.c und system.c auf und fixe einige Abartigkeiten 2010-10-18 13:04:28 +00:00
Yamagi Burmeister
785af02361 Selten spielte nach "load" OGG nicht. Das ist nun repariert 2010-10-14 07:58:35 +00:00
Yamagi Burmeister
e69506dd19 Stoppe Musik bei disconnect 2010-10-14 07:33:20 +00:00
Yamagi Burmeister
7ebccb34d4 - Formatiere Code neu
- Einige Änderungen für mehr Robustheit
- Vereinfache Code und reiße überflüssigen Müll raus
2010-10-14 06:59:42 +00:00
Yamagi Burmeister
ebe4cb1b45 - Formatiere Code neu
- Vereinfache Code
2010-10-14 06:29:53 +00:00
Yamagi Burmeister
90101b4dec - Formatiere Code neu
- Vereinfache Code
2010-10-14 06:23:35 +00:00
Yamagi Burmeister
a8a61f0234 - Vereinfache Code
- Reformatiere
2010-10-14 06:14:35 +00:00
Yamagi Burmeister
2b405405dc - Formatiere neu
- Vereinfache Code
2010-10-14 06:08:10 +00:00
Yamagi Burmeister
dc930150cf Und noch ein paar Dinge mehr am Sound gemacht 2010-10-13 18:00:39 +00:00
Yamagi Burmeister
f20f8bddf4 Einige fixes für das Soundsystem 2010-10-13 17:07:29 +00:00
Yamagi Burmeister
67ef502a93 - Reduce sounds to 96
- Increase com_maxfps to 120
2010-10-01 16:11:00 +00:00
Yamagi Burmeister
c2e06a2682 - qcommon.h -> header/common.h
- qfiles.h -> header/files.h
2010-09-01 08:45:26 +00:00
Yamagi Burmeister
cabcc18e97 Entferne das caedes 2010-07-13 19:48:46 +00:00
Yamagi Burmeister
c483dc2c26 Yamagi Q2 Credits 2010-07-13 19:00:16 +00:00
Yamagi Burmeister
0c020c4ee4 Intelligentere Deafults:
rate 8000 ist mehr als ausreichend bei allem, was kein Modem mehr ist.
s_mixahead 0.14 ist besser als 0.2, außer man will ein leichtes soundlag
cl_maxfps auf 60. Das reicht und verhindert bugs
2010-07-13 18:42:12 +00:00
Yamagi Burmeister
b554afa486 Headerguqards für den Client 2010-07-13 18:30:43 +00:00
Yamagi Burmeister
787686a976 Dateiheader neu formatiert und "particles.h" entfernt 2010-07-13 18:19:42 +00:00
Yamagi Burmeister
6fd3a53119 Die Reste vom Joystick entfernt 2010-07-13 18:04:07 +00:00
Yamagi Burmeister
185063f1a9 Voice over Network weitergehend kommentiert 2010-07-13 08:54:23 +00:00
Yamagi Burmeister
c8927b0cee Mehr Sounds 2010-07-13 08:48:09 +00:00
Yamagi Burmeister
afc0a66495 Noch mehr Kommandobackups für shcnelle Maschinen 2010-07-13 08:46:25 +00:00
Yamagi Burmeister
f16ba343cc s_primary war windows only 2010-07-13 08:44:06 +00:00
Yamagi Burmeister
517e0f366c Besser 128 CMD-Backups 2010-06-22 16:06:04 +00:00
Yamagi Burmeister
0c961f00bf CL_ParseMuzzleFlash* zu CL_AddMuzzleFlash* umbenannt 2010-06-22 15:38:09 +00:00
Yamagi Burmeister
7841c910ca Die letzten Header neu formatiert und in Sachen Komponenten aufgeräumt 2010-06-22 15:33:23 +00:00
Yamagi Burmeister
65230953f0 Erster Schritt im Aufräumen des Headers 2010-06-19 19:58:06 +00:00
Yamagi Burmeister
33cae7f36a console.h in ein eigenes Verzeichnis 2010-06-19 19:24:58 +00:00
Yamagi Burmeister
8fc77edad0 qmenu.h in ein eigenes Verzeichnis 2010-06-19 19:21:16 +00:00
Yamagi Burmeister
b73a9c782c Die Input-Header in ein eigenes Verzeichnis 2010-06-19 19:18:14 +00:00
Yamagi Burmeister
9c8a60bba6 keys.c -> keyboard.c 2010-06-19 19:14:38 +00:00
Yamagi Burmeister
c81863ef71 snd_local.h -> header/local.h 2010-06-19 19:10:31 +00:00
Yamagi Burmeister
3007608a22 Benenne snd_ogg.c in snd_vorbis.c um 2010-06-19 19:06:37 +00:00
Yamagi Burmeister
82b038590d Die Sound-Header in ein eigenes verzeichnis 2010-06-19 19:04:39 +00:00
Yamagi Burmeister
8925af9878 Den Wave-Code in eine eigene Datei 2010-06-19 18:59:33 +00:00
Yamagi Burmeister
1c7ef236f9 sound.h reformatiert 2010-06-19 18:54:45 +00:00
Yamagi Burmeister
01e870b794 snd_loc.h umbenannt zu snd_local.h 2010-06-19 18:51:28 +00:00
Yamagi Burmeister
fe587b7148 weitere Dateien des Soundsystems neu formatiert und kommentiert 2010-06-19 17:04:32 +00:00
Yamagi Burmeister
0c4a7d291f snd_dma überarbeitet was die Kommentare und die Formatierung betrifft 2010-06-19 08:47:14 +00:00
Yamagi Burmeister
2d6df87745 Das Menü-System in Sachen Formatierung und Kommentaren aufgeräumt 2010-06-19 08:15:18 +00:00
Yamagi Burmeister
17db361754 das client seitige input-system neu kommentiert und formatiert 2010-06-19 07:35:36 +00:00
Yamagi Burmeister
a80fc2949c Die Konsole in Sachen Formatierung und Kommentaren aufgeräumt 2010-06-19 07:15:35 +00:00
Yamagi Burmeister
179b5d541c cl_inv.c -> cl_inventory.c 2010-06-18 19:49:58 +00:00
Yamagi Burmeister
e1d165b942 Einige Kommentare wieder ein (by caedes) 2010-06-18 19:47:24 +00:00
Yamagi Burmeister
4c6be8421a Zwei Kommentare wieder rein 2010-06-18 18:07:56 +00:00
Yamagi Burmeister
0afa0b8fef Eine Funktion von cl_view.c nach cl_screen.c verschoben 2010-06-18 16:50:27 +00:00
Yamagi Burmeister
852de0452d cl_tent.c zu cl_tempentities.c umbenannt 2010-06-18 16:47:10 +00:00
Yamagi Burmeister
d32f2e60a3 - cl_scrn.c zu cl_screen.c umbenannt
- Einen Header für cl_tent.c
2010-06-18 16:45:44 +00:00
Yamagi Burmeister
cfb7b19620 Einen Header für cl_scrn.c 2010-06-18 16:41:26 +00:00
Yamagi Burmeister
b517aa921a cl_pred.c in cl_prediction.c umbenannt 2010-06-18 16:37:12 +00:00
Yamagi Burmeister
d76da3b2ed cl_pred.c einen Header verpasst 2010-06-18 16:36:15 +00:00
Yamagi Burmeister
d7900e6333 Den Download-Kram aus cl_parse.c nach cl_download.c 2010-06-18 16:34:07 +00:00
Yamagi Burmeister
974aeeea41 cl_newfx.c auf andere Dateien verteilt und entfernt 2010-06-18 16:28:25 +00:00
Yamagi Burmeister
ca2cbd5da6 Den Autodownload-Code in eine eigene Datei 2010-06-18 16:15:33 +00:00
Yamagi Burmeister
286f180e08 Den generischen Netzwerkkram in eine eigene Datei 2010-06-18 16:07:51 +00:00
Yamagi Burmeister
7f27895864 - cl_stereo* endgültig entfernt
- Heute funktionieren TCP-Stacks meist
2010-06-18 15:52:39 +00:00
Yamagi Burmeister
8731796ce1 Ein Dateiheader und die ungenutzten cl_stereo* cvar raus 2010-06-18 15:47:54 +00:00
Yamagi Burmeister
0598956e3e Und noch einen Dateiheader 2010-06-18 15:44:38 +00:00
Yamagi Burmeister
01233dc151 Einen Dateiheader 2010-06-18 15:43:38 +00:00
Yamagi Burmeister
ca7d174d57 Benenne cl_fx.c nach cl_effects.c um 2010-06-18 15:41:29 +00:00
Yamagi Burmeister
04a2137f81 Verschiebe die Partikel aus cl_fx.c nach cl_particles.c 2010-06-18 15:38:54 +00:00
Yamagi Burmeister
5708130e49 Verschiebe generisches Lichthandling aus cl_fx.c in eine eigene Datei 2010-06-18 15:27:55 +00:00
Yamagi Burmeister
0f8b8df645 cl_ents.c nach cl_entities.c umbenannt 2010-06-18 15:16:31 +00:00
Yamagi Burmeister
a9e5b055c2 Einen Dateiheader 2010-06-18 15:14:54 +00:00
Yamagi Burmeister
600c232d1c Entity-Parsing nach cl_parse.c verschoben 2010-06-18 15:12:58 +00:00