Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/libraries/core/CoreConfig.cc

    r11052 r11054  
    3535#include "core/Language.h"
    3636#include "core/ApplicationPaths.h"
     37
     38#include <random>
    3739
    3840namespace orxonox
     
    106108    {
    107109        // Inform listeners
    108         ObjectList<DevModeListener>::iterator it = ObjectList<DevModeListener>::begin();
    109         for (; it != ObjectList<DevModeListener>::end(); ++it)
    110             it->devModeChanged(bDevMode_);
     110        for (DevModeListener* listener : ObjectList<DevModeListener>())
     111            listener->devModeChanged(bDevMode_);
    111112    }
    112113
     
    129130        if (!bInitialized && this->bInitRandomNumberGenerator_)
    130131        {
    131             srand(static_cast<unsigned int>(time(0)));
     132            std::random_device rnddev;
     133            rndseed(rnddev());
     134            //Keep the old seeding around because people will probably still use the old functions
     135            srand(rnddev());
    132136            rand();
    133137            bInitialized = true;
     
    137141    void CoreConfig::updateLastLevelTimestamp()
    138142    {
    139         ModifyConfigValue(lastLevelTimestamp_, set, static_cast<long long>(time(NULL)));
     143        ModifyConfigValue(lastLevelTimestamp_, set, static_cast<long long>(time(nullptr)));
    140144    }
    141145
    142146    void CoreConfig::updateOgreConfigTimestamp()
    143147    {
    144         ModifyConfigValue(ogreConfigTimestamp_, set, static_cast<long long>(time(NULL)));
     148        ModifyConfigValue(ogreConfigTimestamp_, set, static_cast<long long>(time(nullptr)));
    145149    }
    146150
Note: See TracChangeset for help on using the changeset viewer.