Ignore:
Timestamp:
02/06/17 21:13:58 (8 years ago)
Author:
epyon
Message:
  • fixes in handle store
  • removal of get_handle
  • indices instead of handles
  • efficient handle store clears
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sdl/sdl_audio.cc

    r454 r543  
    111111nv::sdl::audio::~audio()
    112112{
    113         while ( m_sounds.size() > 0 )
    114                 release( m_sounds.get_handle(0) );
     113        for ( auto& s : m_sounds )
     114                release( &s );
    115115        Mix_CloseAudio();
    116116        // TODO: should we do it here?
     
    121121{
    122122        sound_info* info = m_sounds.get( a_sound );
     123        release( info );
     124        m_sounds.destroy( a_sound );
     125}
     126
     127void nv::sdl::audio::release( sound_info* info )
     128{
    123129        if ( info )
    124         {
    125130                Mix_FreeChunk( static_cast<Mix_Chunk*>( info->sdl_sound ) );
    126                 m_sounds.destroy( a_sound );
    127         }
    128131}
    129132
Note: See TracChangeset for help on using the changeset viewer.