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:
parent
01a8998e3b
commit
ac72f3d636
3 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue