Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8775 in orxonox.OLD for branches/terrain/src/lib/sound


Ignore:
Timestamp:
Jun 25, 2006, 11:30:59 AM (19 years ago)
Author:
ponder
Message:
  • Applied a small change to sounrd_buffer and ogg_player in order to load the buffers correctly on big endian systems.
  • Did a lot of cleanup for the terrain rendering system. Added destructors and constructors.
  • The cameras clip-space has to be set to a very large range to display the skybox. The maximum clip distance for the terrain needs to be smaller.
Location:
branches/terrain/src/lib/sound
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/terrain/src/lib/sound/ogg_player.cc

    r8362 r8775  
    399399    if(size == 0)
    400400      return false;
    401 /*#ifdef SDL_BIG_ENDIAN
    402                         int cnt = wavLength/2;
    403                         Uint16* wavBufferAsShorts = ( Uint16* )wavBuffer;
    404                         for ( int i = 0; i < cnt; ++i, ++wavBufferAsShorts )
    405                                 *wavBufferAsShorts = SDL_Swap16( *wavBufferAsShorts );
    406 #endif*/
     401#ifdef SDL_BIG_ENDIAN
     402        int cnt = OGG_PLAYER_BUFFER_SIZE/2;
     403        Uint16* wavBufferAsShorts = ( Uint16* )pcm;
     404        for ( int i = 0; i < cnt; ++i, ++wavBufferAsShorts )
     405                *wavBufferAsShorts = SDL_Swap16( *wavBufferAsShorts );
     406#endif
    407407    alBufferData(buffer, format, pcm, size, vorbisInfo->rate);
    408408    if (DEBUG_LEVEL >= 3)
  • branches/terrain/src/lib/sound/sound_buffer.cc

    r8619 r8775  
    7676    }
    7777#if SDL_BYTEORDER == SDL_BIG_ENDIAN
    78                 if ( !( wavSpec.format == AUDIO_U8 || wavSpec.format == AUDIO_S8 ) ) {
    79                         int cnt = wavLength/2;
    80                         Uint16* wavBufferAsShorts = ( Uint16* )wavBuffer;
    81                         for ( int i = 0; i < cnt; ++i, ++wavBufferAsShorts )
    82                                 *wavBufferAsShorts = SDL_Swap16( *wavBufferAsShorts );
    83                 }
     78        if ( !( wavSpec.format == AUDIO_U8 || wavSpec.format == AUDIO_S8 ) ) {
     79                int cnt = wavLength/2;
     80                Uint16* wavBufferAsShorts = ( Uint16* )wavBuffer;
     81                for ( int i = 0; i < cnt; ++i, ++wavBufferAsShorts )
     82                        *wavBufferAsShorts = SDL_Swap16( *wavBufferAsShorts );
     83        }
    8484#endif
    8585    alBufferData(this->bufferID, SoundBuffer::sdlAudioSpecToAlFormat(&wavSpec),
Note: See TracChangeset for help on using the changeset viewer.