From 2aad6d943fef9f494f335799606b679279fe3f82 Mon Sep 17 00:00:00 2001 From: relnev Date: Sun, 19 Jan 2003 06:15:46 +0000 Subject: added endian check to ogg decode, since openal seems to expect native order git-svn-id: svn://svn.icculus.org/blackshades/trunk@93 5198baeb-e213-0410-be47-fc2ff85ca46f --- Source/Support.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Source/Support.cpp') diff --git a/Source/Support.cpp b/Source/Support.cpp index c48d1b3..6785848 100644 --- a/Source/Support.cpp +++ b/Source/Support.cpp @@ -288,7 +288,13 @@ void LoadOGG_CFH(char *filename, ALenum *format, void **wave, int asize; int err; int eof; - + +#if BYTE_ORDER == BIG_ENDIAN + const int endian = 1; +#else + const int endian = 0; +#endif + /* try to find the real file (and place it in filename1) */ fix_filename(filename, filename1); @@ -332,7 +338,8 @@ void LoadOGG_CFH(char *filename, ALenum *format, void **wave, buf = (char *)wave1; while(!eof) { - long ret = ov_read(&vf, buf, 1024, 0, 2, 1, ¤t_section); + long ret = ov_read(&vf, buf, 1024, endian, 2, 1, + ¤t_section); if (ret == 0) { /* end of file */ -- cgit v1.2.3