mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Apply clang-format to code base
This commit is contained in:
parent
f37d0be806
commit
ddb0522bbf
2199 changed files with 118692 additions and 114392 deletions
|
@ -7,25 +7,19 @@
|
|||
namespace Resource
|
||||
{
|
||||
|
||||
MultiObjectCache::MultiObjectCache()
|
||||
{
|
||||
MultiObjectCache::MultiObjectCache() {}
|
||||
|
||||
}
|
||||
|
||||
MultiObjectCache::~MultiObjectCache()
|
||||
{
|
||||
|
||||
}
|
||||
MultiObjectCache::~MultiObjectCache() {}
|
||||
|
||||
void MultiObjectCache::removeUnreferencedObjectsInCache()
|
||||
{
|
||||
std::vector<osg::ref_ptr<osg::Object> > objectsToRemove;
|
||||
std::vector<osg::ref_ptr<osg::Object>> objectsToRemove;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_objectCacheMutex);
|
||||
|
||||
// Remove unreferenced entries from object cache
|
||||
ObjectCacheMap::iterator oitr = _objectCache.begin();
|
||||
while(oitr != _objectCache.end())
|
||||
while (oitr != _objectCache.end())
|
||||
{
|
||||
if (oitr->second->referenceCount() <= 1)
|
||||
{
|
||||
|
@ -49,7 +43,7 @@ namespace Resource
|
|||
_objectCache.clear();
|
||||
}
|
||||
|
||||
void MultiObjectCache::addEntryToObjectCache(const std::string &filename, osg::Object *object)
|
||||
void MultiObjectCache::addEntryToObjectCache(const std::string& filename, osg::Object* object)
|
||||
{
|
||||
if (!object)
|
||||
{
|
||||
|
@ -60,7 +54,7 @@ namespace Resource
|
|||
_objectCache.insert(std::make_pair(filename, object));
|
||||
}
|
||||
|
||||
osg::ref_ptr<osg::Object> MultiObjectCache::takeFromObjectCache(const std::string &fileName)
|
||||
osg::ref_ptr<osg::Object> MultiObjectCache::takeFromObjectCache(const std::string& fileName)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_objectCacheMutex);
|
||||
ObjectCacheMap::iterator found = _objectCache.find(fileName);
|
||||
|
@ -74,13 +68,11 @@ namespace Resource
|
|||
}
|
||||
}
|
||||
|
||||
void MultiObjectCache::releaseGLObjects(osg::State *state)
|
||||
void MultiObjectCache::releaseGLObjects(osg::State* state)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_objectCacheMutex);
|
||||
|
||||
for(ObjectCacheMap::iterator itr = _objectCache.begin();
|
||||
itr != _objectCache.end();
|
||||
++itr)
|
||||
for (ObjectCacheMap::iterator itr = _objectCache.begin(); itr != _objectCache.end(); ++itr)
|
||||
{
|
||||
osg::Object* object = itr->second.get();
|
||||
object->releaseGLObjects(state);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue