1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 09:15:38 +00:00

reduces virtual function calls in a hotspot of cache retrieval (#3100)

* chunkmanager.cpp static_cast [ci skip]

* groundcover.cpp static_cast [ci skip]

* Update objectpaging.cpp

objectpaging.cpp static_cast [ci skip]
This commit is contained in:
Bo Svensson 2021-09-10 15:58:57 +00:00 committed by GitHub
parent 01a8998e3b
commit ac72f3d636
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -184,7 +184,7 @@ namespace MWRender
osg::ref_ptr<osg::Object> obj = mCache->getRefFromObjectCache(id);
if (obj)
return obj->asNode();
return static_cast<osg::Node*>(obj.get());
else
{
InstanceMap instances;

View file

@ -77,7 +77,7 @@ namespace MWRender
osg::ref_ptr<osg::Object> obj = mCache->getRefFromObjectCache(id);
if (obj)
return obj->asNode();
return static_cast<osg::Node*>(obj.get());
else
{
osg::ref_ptr<osg::Node> node = createChunk(size, center, activeGrid, viewPoint, compile);

View file

@ -45,7 +45,7 @@ osg::ref_ptr<osg::Node> ChunkManager::getChunk(float size, const osg::Vec2f& cen
ChunkId id = std::make_tuple(center, lod, lodFlags);
osg::ref_ptr<osg::Object> obj = mCache->getRefFromObjectCache(id);
if (obj)
return obj->asNode();
return static_cast<osg::Node*>(obj.get());
else
{
osg::ref_ptr<osg::Node> node = createChunk(size, center, lod, lodFlags, compile);