mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-25 03:40:40 +00:00
comply by elsid review
Signed-off-by: Bret Curtis <psi29a@gmail.com>
This commit is contained in:
parent
ce505a9bb3
commit
cf439581e1
@ -45,7 +45,7 @@ namespace MWRender
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& getModel(int type, const std::string& id, const MWWorld::ESMStore& store)
|
std::string getModel(int type, const std::string& id, const MWWorld::ESMStore& store)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
@ -57,7 +57,8 @@ namespace MWRender
|
|||||||
return store.get<ESM::Door>().searchStatic(id)->mModel;
|
return store.get<ESM::Door>().searchStatic(id)->mModel;
|
||||||
case ESM::REC_CONT:
|
case ESM::REC_CONT:
|
||||||
return store.get<ESM::Container>().searchStatic(id)->mModel;
|
return store.get<ESM::Container>().searchStatic(id)->mModel;
|
||||||
default: throw std::exception();
|
default:
|
||||||
|
return std::string();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,7 +341,7 @@ namespace MWRender
|
|||||||
auto emplaced = nodes.emplace(cnode, InstanceList());
|
auto emplaced = nodes.emplace(cnode, InstanceList());
|
||||||
if (emplaced.second)
|
if (emplaced.second)
|
||||||
{
|
{
|
||||||
const_cast<osg::Node*>(cnode.get())->accept(analyzeVisitor);
|
const_cast<osg::Node*>(cnode.get())->accept(analyzeVisitor); // const-trickery required because there is no const version of NodeVisitor
|
||||||
emplaced.first->second.mAnalyzeResult = analyzeVisitor.retrieveResult();
|
emplaced.first->second.mAnalyzeResult = analyzeVisitor.retrieveResult();
|
||||||
}
|
}
|
||||||
emplaced.first->second.mInstances.push_back(&ref);
|
emplaced.first->second.mInstances.push_back(&ref);
|
||||||
@ -410,8 +411,9 @@ namespace MWRender
|
|||||||
|
|
||||||
group->getBound();
|
group->getBound();
|
||||||
group->setNodeMask(Mask_Static);
|
group->setNodeMask(Mask_Static);
|
||||||
|
osg::UserDataContainer* udc = group->getOrCreateUserDataContainer();
|
||||||
group->getOrCreateUserDataContainer()->addUserObject(templateRefs);
|
udc->addUserObject(templateRefs);
|
||||||
|
udc->addUserObject(mergeGroup); // for ICO ref counting
|
||||||
|
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,6 @@ namespace MWRender
|
|||||||
|
|
||||||
osg::ref_ptr<osg::Node> createChunk(float size, const osg::Vec2f& center, const osg::Vec3f& viewPoint, bool compile);
|
osg::ref_ptr<osg::Node> createChunk(float size, const osg::Vec2f& center, const osg::Vec3f& viewPoint, bool compile);
|
||||||
|
|
||||||
virtual void setExpiryDelay(double expiryDelay) override { mExpiryDelay = 0.5f; }
|
|
||||||
|
|
||||||
virtual unsigned int getNodeMask() override;
|
virtual unsigned int getNodeMask() override;
|
||||||
|
|
||||||
void enableObject(const ESM::RefNum & refnum, bool enabled);
|
void enableObject(const ESM::RefNum & refnum, bool enabled);
|
||||||
|
@ -717,8 +717,14 @@ namespace Resource
|
|||||||
if (mIncrementalCompileOperation)
|
if (mIncrementalCompileOperation)
|
||||||
{
|
{
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*mIncrementalCompileOperation->getToCompiledMutex());
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*mIncrementalCompileOperation->getToCompiledMutex());
|
||||||
while (mIncrementalCompileOperation->getToCompile().size() > 1000)
|
osgUtil::IncrementalCompileOperation::CompileSets& sets = mIncrementalCompileOperation->getToCompile();
|
||||||
mIncrementalCompileOperation->getToCompile().pop_front();
|
for(osgUtil::IncrementalCompileOperation::CompileSets::iterator it = sets.begin(); it != sets.end();)
|
||||||
|
{
|
||||||
|
if ((*it)->_subgraphToCompile->referenceCount() <= 2)
|
||||||
|
it = sets.erase(it);
|
||||||
|
else
|
||||||
|
++it;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,8 +50,6 @@ namespace Terrain
|
|||||||
|
|
||||||
void releaseGLObjects(osg::State* state) override;
|
void releaseGLObjects(osg::State* state) override;
|
||||||
|
|
||||||
virtual void setExpiryDelay(double expiryDelay) override { mExpiryDelay = 0.5f; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
osg::ref_ptr<osg::Node> createChunk(float size, const osg::Vec2f& center, unsigned char lod, unsigned int lodFlags, bool compile);
|
osg::ref_ptr<osg::Node> createChunk(float size, const osg::Vec2f& center, unsigned char lod, unsigned int lodFlags, bool compile);
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ void loadRenderingNode(ViewData::Entry& entry, ViewData* vd, int vertexLodMod, f
|
|||||||
|
|
||||||
if (!entry.mRenderingNode)
|
if (!entry.mRenderingNode)
|
||||||
{
|
{
|
||||||
auto pat = new SceneUtil::PositionAttitudeTransform;
|
osg::ref_ptr<SceneUtil::PositionAttitudeTransform> pat = new SceneUtil::PositionAttitudeTransform;
|
||||||
pat->setPosition(osg::Vec3f(entry.mNode->getCenter().x()*cellWorldSize, entry.mNode->getCenter().y()*cellWorldSize, 0.f));
|
pat->setPosition(osg::Vec3f(entry.mNode->getCenter().x()*cellWorldSize, entry.mNode->getCenter().y()*cellWorldSize, 0.f));
|
||||||
|
|
||||||
const osg::Vec2f& center = entry.mNode->getCenter();
|
const osg::Vec2f& center = entry.mNode->getCenter();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user