Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3236 for code


Ignore:
Timestamp:
Jun 28, 2009, 1:42:54 PM (15 years ago)
Author:
rgrieder
Message:

Fixed a bug in SoundManager: Construction, destruction and construction again failed due to a static variable that now is a member.

Location:
code/branches/core4/src/orxonox/sound
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/orxonox/sound/SoundManager.cc

    r3196 r3236  
    3939{
    4040    SoundManager* SoundManager::singletonRef_s = NULL;
    41     ALCdevice* SoundManager::device_s = NULL;
    4241
    4342    /**
     
    4948        singletonRef_s = this;
    5049
     50        this->device_ = NULL;
    5151        this->soundavailable_ = true;
    5252        if(!alutInitWithoutContext(NULL,NULL))
     
    5757        else
    5858        {
    59             if(SoundManager::device_s == NULL)
    60             {
    61                 COUT(3) << "Sound: OpenAL: Open sound device..." << std::endl;
    62                 SoundManager::device_s = alcOpenDevice(NULL);
    63             }
     59            assert(this->device_ == NULL);
     60            COUT(3) << "Sound: OpenAL: Open sound device..." << std::endl;
     61            this->device_ = alcOpenDevice(NULL);
    6462
    65             if(SoundManager::device_s == NULL)
     63            if(this->device_ == NULL)
    6664            {
    6765                COUT(2) << "Sound: OpenAL: Could not open sound device" << std::endl;
     
    7169            {
    7270                COUT(3) << "Sound: OpenAL: Sound device opened" << std::endl;
    73                 this->context_ = alcCreateContext(SoundManager::device_s, NULL);
     71                this->context_ = alcCreateContext(this->device_, NULL);
    7472                if(this->context_ == NULL)
    7573                {
     
    9997
    10098        alcDestroyContext(this->context_);
    101         alcCloseDevice(SoundManager::device_s);
     99        alcCloseDevice(this->device_);
    102100        alutExit();
    103101    }
  • code/branches/core4/src/orxonox/sound/SoundManager.h

    r3196 r3236  
    5555
    5656    private:
    57         static ALCdevice* device_s;
     57        ALCdevice* device_;
    5858        ALCcontext* context_;
    5959        std::list<SoundBase*> soundlist_;
Note: See TracChangeset for help on using the changeset viewer.