Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8293 in orxonox.OLD for trunk/src/lib/sound


Ignore:
Timestamp:
Jun 8, 2006, 11:11:37 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the osX-branche back here
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/osx . -r7763:HEAD

conflicts resolved, and everything is working as expected (or at least i hope so :) )

Location:
trunk/src/lib/sound
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/sound/ogg_player.cc

    r7849 r8293  
    3131
    3232#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
    3345
    3446namespace OrxSound
     
    151163  bool OggPlayer::play()
    152164  {
    153     if (!(this->state & OggPlayer::FileOpened))
     165    /*if (!(this->state & OggPlayer::FileOpened))
    154166      return false;
    155167
     
    161173    if (this->musicThreadID == NULL)
    162174      return ((this->musicThreadID = SDL_CreateThread(OggPlayer::musicThread, (void*)this)) != NULL);
    163     return true;
     175    return true;*/
    164176  }
    165177
     
    385397    if(size == 0)
    386398      return false;
    387 
     399/*#ifdef SDL_BIG_ENDIAN
     400                        int cnt = wavLength/2;
     401                        Uint16* wavBufferAsShorts = ( Uint16* )wavBuffer;
     402                        for ( int i = 0; i < cnt; ++i, ++wavBufferAsShorts )
     403                                *wavBufferAsShorts = SDL_Swap16( *wavBufferAsShorts );
     404#endif*/
    388405    alBufferData(buffer, format, pcm, size, vorbisInfo->rate);
    389406    if (DEBUG_LEVEL >= 3)
  • trunk/src/lib/sound/sound_buffer.cc

    r7460 r8293  
    2222#include "sdlincl.h"
    2323#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
    2531namespace OrxSound
    2632{
     
    6773      return false;
    6874    }
    69 
    70     alBufferData(this->bufferID, SoundBuffer::sdlAudioSpecToAlFormat(&wavSpec), wavBuffer, wavLength, wavSpec.freq);
     75#if SDL_BYTEORDER == 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                       
    7186    SDL_FreeWAV(wavBuffer);
    7287    if (SoundEngine::checkError("Could not load Wave file", __LINE__))
Note: See TracChangeset for help on using the changeset viewer.