X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2Fopenal_wrapper.cpp;h=be2a72a409c8907189c3f72508f43dc75af230c6;hb=67882279de8557e5bd2749bc64b1a6e573225ce9;hp=dc40cac65796a124d03992cac470316abd47733c;hpb=c62522f90f5dc405505af885e00c8134f17d8c88;p=lugaru.git diff --git a/Source/openal_wrapper.cpp b/Source/openal_wrapper.cpp index dc40cac..be2a72a 100644 --- a/Source/openal_wrapper.cpp +++ b/Source/openal_wrapper.cpp @@ -298,6 +298,12 @@ int F_API OPENAL_PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *d static void *decode_to_pcm(const char *_fname, ALenum &format, ALsizei &size, ALuint &freq) { +#ifdef __POWERPC__ + const int bigendian = 1; +#else + const int bigendian = 0; +#endif + // !!! FIXME: if it's not Ogg, we don't have a decoder. I'm lazy. :/ char *fname = (char *) alloca(strlen(_fname) + 16); strcpy(fname, _fname); @@ -355,7 +361,7 @@ static void *decode_to_pcm(const char *_fname, ALenum &format, ALsizei &size, AL long rc = 0; size_t allocated = 64 * 1024; retval = (ALubyte *) malloc(allocated); - while ( (rc = ov_read(&vf, buf, sizeof (buf), 0, 2, 1, &bitstream)) != 0 ) + while ( (rc = ov_read(&vf, buf, sizeof (buf), bigendian, 2, 1, &bitstream)) != 0 ) { if (rc > 0) {