Linux OpenAL fixes (music plays now as stereo)

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@308 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2002-12-04 02:08:31 +00:00
parent 95ef96c00b
commit 61cfe75f82
4 changed files with 6 additions and 7 deletions
+1
View File
@@ -1,4 +1,5 @@
0.2: 0.2:
- Linux OpenAL fixes (music plays now as stereo)
- Fuel giveaway bug fixed, from steve@blckknght.org - Fuel giveaway bug fixed, from steve@blckknght.org
- Starmap fuel range calculator and actual consumption matches now - Starmap fuel range calculator and actual consumption matches now
- Collision detection is now pixel-perfect (fixes Sa-Matra, BUTT missile, etc) - Collision detection is now pixel-perfect (fixes Sa-Matra, BUTT missile, etc)
-2
View File
@@ -37,8 +37,6 @@ Glitches (don't crash the game, medium priority):
though. though.
- OpenAL sound code problems: - OpenAL sound code problems:
- Some unimplemented functions (for oscilloscope and dialogue seeking) - Some unimplemented functions (for oscilloscope and dialogue seeking)
- Linux OpenAL implementation sucks, so for now we are using SDL_mixer
on that platform.
- Volume levels aren't maybe exactly as they should - Volume levels aren't maybe exactly as they should
- Crashes if no audio device available - Crashes if no audio device available
- Color table transformations are very slow. - Color table transformations are very slow.
+2 -2
View File
@@ -156,7 +156,7 @@ _GetMusicData (FILE *fp, DWORD length)
} }
fprintf (stderr, "_GetMusicData(): loading %s\n", filename); fprintf (stderr, "_GetMusicData(): loading %s\n", filename);
if (((*pmus)->decoder = SoundDecoder_Load (filename, 16384)) == 0) if (((*pmus)->decoder = SoundDecoder_Load (filename, 4096)) == 0)
{ {
fprintf (stderr, "_GetMusicData(): couldn't load %s\n", filename); fprintf (stderr, "_GetMusicData(): couldn't load %s\n", filename);
@@ -169,7 +169,7 @@ _GetMusicData (FILE *fp, DWORD length)
fprintf (stderr, " decoder: %s, rate %d format %x\n", (*pmus)->decoder->decoder_info, fprintf (stderr, " decoder: %s, rate %d format %x\n", (*pmus)->decoder->decoder_info,
(*pmus)->decoder->frequency, (*pmus)->decoder->format); (*pmus)->decoder->frequency, (*pmus)->decoder->format);
(*pmus)->num_buffers = 16; (*pmus)->num_buffers = 64;
(*pmus)->buffer = (ALuint *) HMalloc (sizeof (ALuint) * (*pmus)->num_buffers); (*pmus)->buffer = (ALuint *) HMalloc (sizeof (ALuint) * (*pmus)->num_buffers);
alGenBuffers ((*pmus)->num_buffers, (*pmus)->buffer); alGenBuffers ((*pmus)->num_buffers, (*pmus)->buffer);
} }
+3 -3
View File
@@ -21,7 +21,7 @@
#include "sound.h" #include "sound.h"
#if 0 && !defined (WIN32) // && !defined (MacOS and BEOS too) #if !defined (WIN32) // && !defined (MacOS and BeOS too)
#include <AL/alext.h> #include <AL/alext.h>
#endif #endif
@@ -53,7 +53,7 @@ PlayStream (TFB_SoundSample *sample, ALuint source, ALboolean looping)
if (decoded_bytes == 0) if (decoded_bytes == 0)
break; break;
#if 0 && !defined (WIN32) // && !defined (MacOS and BeOS too) #if !defined (WIN32) // && !defined (MacOS and BeOS too)
// *nix OpenAL implementation has to handle stereo data differently to avoid mixing it to mono // *nix OpenAL implementation has to handle stereo data differently to avoid mixing it to mono
if (sample->decoder->format == AL_FORMAT_STEREO8 || if (sample->decoder->format == AL_FORMAT_STEREO8 ||
@@ -219,7 +219,7 @@ StreamDecoderTaskFunc (void *data)
if (decoded_bytes > 0) if (decoded_bytes > 0)
{ {
#if 0 && !defined (WIN32) // && !defined (MacOS and BeOS too) #if !defined (WIN32) // && !defined (MacOS and BeOS too)
// *nix OpenAL implementation has to handle stereo data differently to avoid mixing it to mono // *nix OpenAL implementation has to handle stereo data differently to avoid mixing it to mono
if (soundSource[i].sample->decoder->format == AL_FORMAT_STEREO8 || if (soundSource[i].sample->decoder->format == AL_FORMAT_STEREO8 ||