Changeset 8122 in orxonox.OLD for branches/osx/src/lib/sound
- Timestamp:
- Jun 2, 2006, 5:46:11 PM (19 years ago)
- Location:
- branches/osx/src/lib/sound
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/osx/src/lib/sound/ogg_player.cc
r7737 r8122 31 31 32 32 #include "debug.h" 33 34 #ifdef HAVE_SDL_SDL_H 35 36 #include <SDL/SDL.h> 37 #include <SDL/SDL_endian.h> 38 39 #else 40 41 #include <SDL.h> 42 #include <SDL_endian.h> 43 44 #endif 33 45 34 46 namespace OrxSound … … 151 163 bool OggPlayer::play() 152 164 { 153 if (!(this->state & OggPlayer::FileOpened))165 /*if (!(this->state & OggPlayer::FileOpened)) 154 166 return false; 155 167 … … 161 173 if (this->musicThreadID == NULL) 162 174 return ((this->musicThreadID = SDL_CreateThread(OggPlayer::musicThread, (void*)this)) != NULL); 163 return true; 175 return true;*/ 164 176 } 165 177 … … 374 386 if(size == 0) 375 387 return false; 376 388 /*#ifdef SDL_BIG_ENDIAN 389 int cnt = wavLength/2; 390 Uint16* wavBufferAsShorts = ( Uint16* )wavBuffer; 391 for ( int i = 0; i < cnt; ++i, ++wavBufferAsShorts ) 392 *wavBufferAsShorts = SDL_Swap16( *wavBufferAsShorts ); 393 #endif*/ 377 394 alBufferData(buffer, format, pcm, size, vorbisInfo->rate); 378 395 if (DEBUG_LEVEL >= 3) -
branches/osx/src/lib/sound/sound_buffer.cc
r7460 r8122 22 22 #include "sdlincl.h" 23 23 #include <cassert> 24 24 #ifdef HAVE_SDL_SDL_H 25 #include <SDL/SDL.h> 26 #include <SDL/SDL_endian.h> 27 #else 28 #include <SDL.h> 29 #include <SDL_endian.h> 30 #endif 25 31 namespace OrxSound 26 32 { … … 67 73 return false; 68 74 } 69 70 alBufferData(this->bufferID, SoundBuffer::sdlAudioSpecToAlFormat(&wavSpec), wavBuffer, wavLength, wavSpec.freq); 75 #ifdef SDL_BIG_ENDIAN 76 if ( !( wavSpec.format == AUDIO_U8 || wavSpec.format == AUDIO_S8 ) ) { 77 int cnt = wavLength/2; 78 Uint16* wavBufferAsShorts = ( Uint16* )wavBuffer; 79 for ( int i = 0; i < cnt; ++i, ++wavBufferAsShorts ) 80 *wavBufferAsShorts = SDL_Swap16( *wavBufferAsShorts ); 81 } 82 #endif 83 alBufferData(this->bufferID, SoundBuffer::sdlAudioSpecToAlFormat(&wavSpec), 84 wavBuffer, wavLength, wavSpec.freq); 85 71 86 SDL_FreeWAV(wavBuffer); 72 87 if (SoundEngine::checkError("Could not load Wave file", __LINE__)) -
branches/osx/src/lib/sound/sound_source.cc
r7729 r8122 153 153 if (DEBUG_LEVEL >= 3) 154 154 SoundEngine::checkError("Play Source", __LINE__); 155 155 156 } 156 157
Note: See TracChangeset
for help on using the changeset viewer.