1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-20 04:41:32 +00:00

Move symbols not defined in header to unnamed namespace

This commit is contained in:
elsid 2024-05-05 12:57:04 +02:00
parent 05815b3952
commit 524af5b723
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625

View file

@ -40,7 +40,8 @@
namespace MWRender namespace MWRender
{ {
namespace
{
bool typeFilter(int type, bool far) bool typeFilter(int type, bool far)
{ {
switch (type) switch (type)
@ -73,6 +74,7 @@ namespace MWRender
return {}; return {};
} }
} }
}
osg::ref_ptr<osg::Node> ObjectPaging::getChunk(float size, const osg::Vec2f& center, unsigned char lod, osg::ref_ptr<osg::Node> ObjectPaging::getChunk(float size, const osg::Vec2f& center, unsigned char lod,
unsigned int lodFlags, bool activeGrid, const osg::Vec3f& viewPoint, bool compile) unsigned int lodFlags, bool activeGrid, const osg::Vec3f& viewPoint, bool compile)
@ -94,6 +96,8 @@ namespace MWRender
} }
} }
namespace
{
class CanOptimizeCallback : public SceneUtil::Optimizer::IsOperationPermissibleForObjectCallback class CanOptimizeCallback : public SceneUtil::Optimizer::IsOperationPermissibleForObjectCallback
{ {
public: public:
@ -109,8 +113,6 @@ namespace MWRender
} }
}; };
namespace
{
using LODRange = osg::LOD::MinMaxPair; using LODRange = osg::LOD::MinMaxPair;
LODRange intersection(const LODRange& left, const LODRange& right) LODRange intersection(const LODRange& left, const LODRange& right)
@ -127,7 +129,6 @@ namespace MWRender
{ {
return { r.first / div, r.second / div }; return { r.first / div, r.second / div };
} }
}
class CopyOp : public osg::CopyOp class CopyOp : public osg::CopyOp
{ {
@ -419,8 +420,9 @@ namespace MWRender
m->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(0.1f, 0.1f, 0.1f, 1.f)); m->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(0.1f, 0.1f, 0.1f, 1.f));
m->setColorMode(osg::Material::OFF); m->setColorMode(osg::Material::OFF);
m->setEmission(osg::Material::FRONT_AND_BACK, osg::Vec4f(color)); m->setEmission(osg::Material::FRONT_AND_BACK, osg::Vec4f(color));
osg::ref_ptr<osg::StateSet> stateset osg::ref_ptr<osg::StateSet> stateset = node.getStateSet()
= node.getStateSet() ? osg::clone(node.getStateSet(), osg::CopyOp::SHALLOW_COPY) : new osg::StateSet; ? osg::clone(node.getStateSet(), osg::CopyOp::SHALLOW_COPY)
: new osg::StateSet;
stateset->setAttribute(m); stateset->setAttribute(m);
stateset->addUniform(new osg::Uniform("colorMode", 0)); stateset->addUniform(new osg::Uniform("colorMode", 0));
stateset->addUniform(new osg::Uniform("emissiveMult", 1.f)); stateset->addUniform(new osg::Uniform("emissiveMult", 1.f));
@ -447,6 +449,7 @@ namespace MWRender
node.getOrCreateUserDataContainer()->addUserObject(marker); node.getOrCreateUserDataContainer()->addUserObject(marker);
} }
}; };
}
ObjectPaging::ObjectPaging(Resource::SceneManager* sceneManager, ESM::RefId worldspace) ObjectPaging::ObjectPaging(Resource::SceneManager* sceneManager, ESM::RefId worldspace)
: GenericResourceManager<ChunkId>(nullptr, Settings::cells().mCacheExpiryDelay) : GenericResourceManager<ChunkId>(nullptr, Settings::cells().mCacheExpiryDelay)
@ -984,6 +987,8 @@ namespace MWRender
return true; return true;
} }
namespace
{
struct GetRefnumsFunctor struct GetRefnumsFunctor
{ {
GetRefnumsFunctor(std::vector<ESM::RefNum>& output) GetRefnumsFunctor(std::vector<ESM::RefNum>& output)
@ -1012,6 +1017,7 @@ namespace MWRender
osg::Vec4i mActiveGrid; osg::Vec4i mActiveGrid;
std::vector<ESM::RefNum>& mOutput; std::vector<ESM::RefNum>& mOutput;
}; };
}
void ObjectPaging::getPagedRefnums(const osg::Vec4i& activeGrid, std::vector<ESM::RefNum>& out) void ObjectPaging::getPagedRefnums(const osg::Vec4i& activeGrid, std::vector<ESM::RefNum>& out)
{ {