From 3c9b61fddcf381fa278f8223fe88e5bf4eca4db6 Mon Sep 17 00:00:00 2001 From: avolkov Date: Wed, 29 Jan 2003 20:23:12 +0000 Subject: [PATCH] commond decoders for OpenAL and MixSDL git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@597 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/sound/Makeinfo | 4 ++-- sc2/src/sc2code/libs/sound/mixsdl/Makeinfo | 1 - sc2/src/sc2code/libs/sound/mixsdl/sound.h | 2 +- sc2/src/sc2code/libs/sound/openal/Makeinfo | 1 - sc2/src/sc2code/libs/sound/openal/sound.c | 8 +++++++- sc2/src/sc2code/libs/sound/openal/sound.h | 3 ++- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/sc2/src/sc2code/libs/sound/Makeinfo b/sc2/src/sc2code/libs/sound/Makeinfo index 80b26e1cc..68fba1263 100644 --- a/sc2/src/sc2code/libs/sound/Makeinfo +++ b/sc2/src/sc2code/libs/sound/Makeinfo @@ -1,8 +1,8 @@ if [ "$uqm_SOUNDMODULE" = openal ]; then - uqm_SUBDIRS="openal" + uqm_SUBDIRS="openal decoders" uqm_CFLAGS="$uqm_CFLAGS -DSOUNDMODULE_OPENAL" elif [ "$uqm_SOUNDMODULE" = mixsdl ]; then - uqm_SUBDIRS="mixsdl" + uqm_SUBDIRS="mixsdl decoders" uqm_CFLAGS="$uqm_CFLAGS -DSOUNDMODULE_MIXSDL" else uqm_SUBDIRS="sdl" diff --git a/sc2/src/sc2code/libs/sound/mixsdl/Makeinfo b/sc2/src/sc2code/libs/sound/mixsdl/Makeinfo index f2794db19..1811dc16a 100644 --- a/sc2/src/sc2code/libs/sound/mixsdl/Makeinfo +++ b/sc2/src/sc2code/libs/sound/mixsdl/Makeinfo @@ -1,2 +1 @@ -uqm_SUBDIRS="decoders" uqm_CFILES="mixer.c sound.c music.c sfx.c stream.c trackplayer.c" diff --git a/sc2/src/sc2code/libs/sound/mixsdl/sound.h b/sc2/src/sc2code/libs/sound/mixsdl/sound.h index aec025261..54ffe2685 100644 --- a/sc2/src/sc2code/libs/sound/mixsdl/sound.h +++ b/sc2/src/sc2code/libs/sound/mixsdl/sound.h @@ -23,7 +23,7 @@ #include "libs/sound/sndintrn.h" #include "libs/sound/sound_common.h" #include "mixer.h" -#include "decoders/decoder.h" +#include "libs/sound/decoders/decoder.h" #define FIRST_SFX_SOURCE 0 diff --git a/sc2/src/sc2code/libs/sound/openal/Makeinfo b/sc2/src/sc2code/libs/sound/openal/Makeinfo index 5ffe530c0..e8b0932ce 100644 --- a/sc2/src/sc2code/libs/sound/openal/Makeinfo +++ b/sc2/src/sc2code/libs/sound/openal/Makeinfo @@ -1,2 +1 @@ -uqm_SUBDIRS="decoders" uqm_CFILES="music.c sfx.c sound.c stream.c trackplayer.c" diff --git a/sc2/src/sc2code/libs/sound/openal/sound.c b/sc2/src/sc2code/libs/sound/openal/sound.c index d265e34a2..4869aa54c 100644 --- a/sc2/src/sc2code/libs/sound/openal/sound.c +++ b/sc2/src/sc2code/libs/sound/openal/sound.c @@ -34,6 +34,12 @@ int TFB_InitSound (int driver, int flags) { int i; + TFB_DecoderFormats formats = + { + MIX_IS_BIG_ENDIAN, MIX_WANT_BIG_ENDIAN, + AL_FORMAT_MONO8, AL_FORMAT_STEREO8, + AL_FORMAT_MONO16, AL_FORMAT_STEREO16 + }; fprintf (stderr, "Initializing OpenAL.\n"); atexit (TFB_UninitSound); @@ -67,7 +73,7 @@ TFB_InitSound (int driver, int flags) //fprintf (stderr, " extensions: %s\n", alGetString (AL_EXTENSIONS)); fprintf (stderr, "Initializing sound decoders.\n"); - SoundDecoder_Init (flags); + SoundDecoder_Init (flags, &formats); fprintf (stderr, "Sound decoders initialized.\n"); alListenerfv (AL_POSITION, listenerPos); diff --git a/sc2/src/sc2code/libs/sound/openal/sound.h b/sc2/src/sc2code/libs/sound/openal/sound.h index 03dad57f4..60c431462 100644 --- a/sc2/src/sc2code/libs/sound/openal/sound.h +++ b/sc2/src/sc2code/libs/sound/openal/sound.h @@ -31,7 +31,8 @@ #include "libs/strings/strintrn.h" #include "libs/sound/sndintrn.h" #include "libs/sound/sound_common.h" -#include "decoders/decoder.h" +#include "mixer.h" +#include "libs/sound/decoders/decoder.h" #define FIRST_SFX_SOURCE 0