Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2015, 10:25:42 PM (9 years ago)
Author:
landauf
Message:

replace 'NULL' by 'nullptr'

Location:
code/branches/cpp11_v2/src/orxonox/sound
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/orxonox/sound/AmbientSound.cc

    r10624 r10765  
    9393            const std::string& path = "ambient/" + mood + '/' + this->ambientSource_;
    9494            shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path);
    95             if (fileInfo != NULL)
     95            if (fileInfo != nullptr)
    9696            {
    9797                orxout(user_info) << "Loading ambient sound " << path << "..." << endl; // TODO: make this output internal if we implement sound streaming
  • code/branches/cpp11_v2/src/orxonox/sound/BaseSound.cc

    r10624 r10765  
    6666            this->stop();
    6767        // Release buffer
    68         if (this->soundBuffer_ != NULL)
     68        if (this->soundBuffer_ != nullptr)
    6969        {
    7070            assert(GameMode::playsSound());
     
    8484    {
    8585        this->state_ = Playing;
    86         if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING && this->soundBuffer_ != NULL)
     86        if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING && this->soundBuffer_ != nullptr)
    8787        {
    8888            if (!alIsSource(this->audioSource_))
     
    151151            orxout(internal_warning, context::sound) << "Setting source parameters to 0 failed: "
    152152                                                     << SoundManager::getALErrorString(error) << endl;
    153         assert(this->soundBuffer_ != NULL);
     153        assert(this->soundBuffer_ != nullptr);
    154154        alSourcei(this->audioSource_, AL_BUFFER, this->soundBuffer_->getBuffer());
    155155        if (ALuint error = alGetError())
     
    209209        }
    210210
    211         if (this->soundBuffer_ != NULL)
     211        if (this->soundBuffer_ != nullptr)
    212212        {
    213213            if (this->soundBuffer_->getFilename() == source)
     
    233233        // Get new sound buffer
    234234        this->soundBuffer_ = SoundManager::getInstance().getSoundBuffer(this->source_);
    235         if (this->soundBuffer_ == NULL)
     235        if (this->soundBuffer_ == nullptr)
    236236            return;
    237237
  • code/branches/cpp11_v2/src/orxonox/sound/SoundBuffer.cc

    r8858 r10765  
    4545    {
    4646        if (this->filename_.empty())
    47             ThrowException(General, "SoundBuffer construction: fileInfo was NULL");
     47            ThrowException(General, "SoundBuffer construction: fileInfo was nullptr");
    4848
    4949        // Get resource info
    5050        shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename);
    51         if (fileInfo == NULL)
     51        if (fileInfo == nullptr)
    5252        {
    5353            orxout(internal_error, context::sound) << "Sound file '" << filename << "' not found" << endl;
     
    138138        vorbisCallbacks.seek_func  = &seekVorbis;
    139139        vorbisCallbacks.tell_func  = &tellVorbis;
    140         vorbisCallbacks.close_func = NULL;
     140        vorbisCallbacks.close_func = nullptr;
    141141
    142142        OggVorbis_File vf;
    143         int ret = ov_open_callbacks(dataStream.get(), &vf, NULL, 0, vorbisCallbacks);
     143        int ret = ov_open_callbacks(dataStream.get(), &vf, nullptr, 0, vorbisCallbacks);
    144144        if (ret < 0)
    145145        {
  • code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc

    r10624 r10765  
    8383            ThrowException(InitialisationAborted, "Sound: Not loading at all");
    8484#if !defined(ORXONOX_PLATFORM_APPLE)
    85         if (!alutInitWithoutContext(NULL, NULL))
     85        if (!alutInitWithoutContext(nullptr, nullptr))
    8686            ThrowException(InitialisationFailed, "Sound Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError()));
    8787        Loki::ScopeGuard alutExitGuard = Loki::MakeGuard(&alutExit);
     
    9090/*
    9191        // Get list of available sound devices and display them
    92         const char* devices = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
     92        const char* devices = alcGetString(nullptr, ALC_DEVICE_SPECIFIER);
    9393        char* device = new char[strlen(devices)+1];
    9494        strcpy(device, devices);
     
    110110        this->device_ = alcOpenDevice(renderDevice.c_str());
    111111*/
    112         this->device_ = alcOpenDevice(NULL);
    113         if (this->device_ == NULL)
     112        this->device_ = alcOpenDevice(nullptr);
     113        if (this->device_ == nullptr)
    114114            ThrowException(InitialisationFailed, "Sound Error: Could not open sound device.");
    115115        Loki::ScopeGuard closeDeviceGuard = Loki::MakeGuard(&alcCloseDevice, this->device_);
    116116
    117117        // Create sound context and make it the currently used one
    118         this->context_ = alcCreateContext(this->device_, NULL);
    119         if (this->context_ == NULL)
     118        this->context_ = alcCreateContext(this->device_, nullptr);
     119        if (this->context_ == nullptr)
    120120            ThrowException(InitialisationFailed, "Sound Error: Could not create ALC context");
    121121        Loki::ScopeGuard desroyContextGuard = Loki::MakeGuard(&alcDestroyContext, this->context_);
     
    189189
    190190        // Relieve context to destroy it
    191         if (!alcMakeContextCurrent(NULL))
     191        if (!alcMakeContextCurrent(nullptr))
    192192            orxout(internal_error, context::sound) << "Could not unset ALC context" << endl;
    193193        alcDestroyContext(this->context_);
     
    350350    void SoundManager::registerAmbientSound(AmbientSound* newAmbient)
    351351    {
    352         if (newAmbient != NULL && !this->bDestructorCalled_)
     352        if (newAmbient != nullptr && !this->bDestructorCalled_)
    353353        {
    354354            for (AmbientList::const_iterator it = this->ambientSounds_.begin(); it != this->ambientSounds_.end(); ++it)
     
    373373    void SoundManager::unregisterAmbientSound(AmbientSound* oldAmbient)
    374374    {
    375         if (oldAmbient == NULL || ambientSounds_.empty() || this->bDestructorCalled_)
     375        if (oldAmbient == nullptr || ambientSounds_.empty() || this->bDestructorCalled_)
    376376            return;
    377377
     
    405405    void SoundManager::pauseAmbientSound(AmbientSound* ambient)
    406406    {
    407         if (ambient != NULL)
     407        if (ambient != nullptr)
    408408        {
    409409            for (AmbientList::iterator it = this->ambientSounds_.begin(); it != this->ambientSounds_.end(); ++it)
  • code/branches/cpp11_v2/src/orxonox/sound/SoundStreamer.cc

    r8858 r10765  
    4545        vorbisCallbacks.seek_func  = &seekVorbis;
    4646        vorbisCallbacks.tell_func  = &tellVorbis;
    47         vorbisCallbacks.close_func = NULL;
     47        vorbisCallbacks.close_func = nullptr;
    4848
    4949        OggVorbis_File vf;
    50         int ret = ov_open_callbacks(dataStream.get(), &vf, NULL, 0, vorbisCallbacks);
     50        int ret = ov_open_callbacks(dataStream.get(), &vf, nullptr, 0, vorbisCallbacks);
    5151        if (ret < 0)
    5252        {
Note: See TracChangeset for help on using the changeset viewer.