aboutsummaryrefslogtreecommitdiff
path: root/Source/Support.cpp
diff options
context:
space:
mode:
authorrelnev <relnev@5198baeb-e213-0410-be47-fc2ff85ca46f>2003-01-19 06:15:46 +0000
committerrelnev <relnev@5198baeb-e213-0410-be47-fc2ff85ca46f>2003-01-19 06:15:46 +0000
commit2aad6d943fef9f494f335799606b679279fe3f82 (patch)
treedd184564ed94726c2b9cc44c562ef9cf63a0edda /Source/Support.cpp
parentf76c38d20c4ff64d8081ff1d7d04c2623e06fca5 (diff)
downloadblackshades-2aad6d943fef9f494f335799606b679279fe3f82.tar.gz
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
Diffstat (limited to 'Source/Support.cpp')
-rw-r--r--Source/Support.cpp11
1 files changed, 9 insertions, 2 deletions
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, &current_section);
+ long ret = ov_read(&vf, buf, 1024, endian, 2, 1,
+ &current_section);
if (ret == 0) {
/* end of file */