Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/Resource.cc

    r9675 r11071  
    5858        DataStreamListPtr resources(new Ogre::DataStreamList());
    5959        const Ogre::StringVector& groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
    60         for (Ogre::StringVector::const_iterator it = groups.begin(); it != groups.end(); ++it)
     60        for (const std::string& group : groups)
    6161        {
    62             DataStreamListPtr temp = Ogre::ResourceGroupManager::getSingleton().openResources(pattern, *it);
     62            DataStreamListPtr temp = Ogre::ResourceGroupManager::getSingleton().openResources(pattern, group);
    6363            resources->insert(resources->end(), temp->begin(), temp->end());
    6464        }
     
    7979    }
    8080
    81     shared_ptr<ResourceInfo> Resource::getInfo(const std::string& name)
     81    std::shared_ptr<ResourceInfo> Resource::getInfo(const std::string& name)
    8282    {
    8383        std::string group;
     
    8888        catch (const Ogre::Exception&)
    8989        {
    90             return shared_ptr<ResourceInfo>();
     90            return std::shared_ptr<ResourceInfo>();
    9191        }
    9292        Ogre::FileInfoListPtr infos = Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo(group, name);
     
    9595            if (it->filename == name)
    9696            {
    97                 shared_ptr<ResourceInfo> ptr(new ResourceInfo());
     97                std::shared_ptr<ResourceInfo> ptr(std::make_shared<ResourceInfo>());
    9898                ptr->filename = name;
    9999                ptr->path = it->path;
     
    102102                ptr->size = it->uncompressedSize;
    103103#if OGRE_VERSION >= 0x010800
    104                 if (dynamic_cast<const Ogre::FileSystemArchive*>(it->archive) != NULL)
     104                if (dynamic_cast<const Ogre::FileSystemArchive*>(it->archive) != nullptr)
    105105#else
    106                 if (dynamic_cast<Ogre::FileSystemArchive*>(it->archive) != NULL)
     106                if (dynamic_cast<Ogre::FileSystemArchive*>(it->archive) != nullptr)
    107107#endif
    108108                {
     
    114114            }
    115115        }
    116         return shared_ptr<ResourceInfo>();
     116        return std::shared_ptr<ResourceInfo>();
    117117    }
    118118
     
    121121        StringVectorPtr resourceNames(new Ogre::StringVector());
    122122        const Ogre::StringVector& groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
    123         for (Ogre::StringVector::const_iterator it = groups.begin(); it != groups.end(); ++it)
     123        for (const std::string& group : groups)
    124124        {
    125             StringVectorPtr temp = Ogre::ResourceGroupManager::getSingleton().findResourceNames(*it, pattern);
     125            StringVectorPtr temp = Ogre::ResourceGroupManager::getSingleton().findResourceNames(group, pattern);
    126126            resourceNames->insert(resourceNames->end(), temp->begin(), temp->end());
    127127        }
Note: See TracChangeset for help on using the changeset viewer.