mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-20 20:09:41 +00:00
comply by elsid review
Signed-off-by: Bret Curtis <psi29a@gmail.com>
This commit is contained in:
parent
ce505a9bb3
commit
cf439581e1
5 changed files with 16 additions and 12 deletions
|
@ -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)
|
||||
{
|
||||
|
@ -57,7 +57,8 @@ namespace MWRender
|
|||
return store.get<ESM::Door>().searchStatic(id)->mModel;
|
||||
case ESM::REC_CONT:
|
||||
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());
|
||||
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.mInstances.push_back(&ref);
|
||||
|
@ -410,8 +411,9 @@ namespace MWRender
|
|||
|
||||
group->getBound();
|
||||
group->setNodeMask(Mask_Static);
|
||||
|
||||
group->getOrCreateUserDataContainer()->addUserObject(templateRefs);
|
||||
osg::UserDataContainer* udc = group->getOrCreateUserDataContainer();
|
||||
udc->addUserObject(templateRefs);
|
||||
udc->addUserObject(mergeGroup); // for ICO ref counting
|
||||
|
||||
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);
|
||||
|
||||
virtual void setExpiryDelay(double expiryDelay) override { mExpiryDelay = 0.5f; }
|
||||
|
||||
virtual unsigned int getNodeMask() override;
|
||||
|
||||
void enableObject(const ESM::RefNum & refnum, bool enabled);
|
||||
|
|
|
@ -717,8 +717,14 @@ namespace Resource
|
|||
if (mIncrementalCompileOperation)
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*mIncrementalCompileOperation->getToCompiledMutex());
|
||||
while (mIncrementalCompileOperation->getToCompile().size() > 1000)
|
||||
mIncrementalCompileOperation->getToCompile().pop_front();
|
||||
osgUtil::IncrementalCompileOperation::CompileSets& sets = mIncrementalCompileOperation->getToCompile();
|
||||
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;
|
||||
|
||||
virtual void setExpiryDelay(double expiryDelay) override { mExpiryDelay = 0.5f; }
|
||||
|
||||
private:
|
||||
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)
|
||||
{
|
||||
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));
|
||||
|
||||
const osg::Vec2f& center = entry.mNode->getCenter();
|
||||
|
|
Loading…
Reference in a new issue