1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 22:15:32 +00:00

Move NoTraverseCallback to mwrender/util.hpp

This commit is contained in:
Alexander "Ace" Olofsson 2016-01-29 17:00:18 +01:00 committed by scrawl
parent d43315fe4e
commit 776c715ccd
3 changed files with 12 additions and 20 deletions

View file

@ -42,6 +42,7 @@
#include "camera.hpp"
#include "water.hpp"
#include "terrainstorage.hpp"
#include "util.hpp"
namespace MWRender
{
@ -504,15 +505,6 @@ namespace MWRender
mutable bool mDone;
};
class NoTraverseCallback : public osg::NodeCallback
{
public:
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
}
};
void RenderingManager::screenshot(osg::Image *image, int w, int h)
{
osg::ref_ptr<osg::Camera> rttCamera (new osg::Camera);

View file

@ -1,6 +1,7 @@
#ifndef OPENMW_MWRENDER_UTIL_H
#define OPENMW_MWRENDER_UTIL_H
#include <osg/NodeCallback>
#include <osg/ref_ptr>
#include <string>
@ -16,9 +17,17 @@ namespace Resource
namespace MWRender
{
void overrideTexture(const std::string& texture, Resource::ResourceSystem* resourceSystem, osg::ref_ptr<osg::Node> node);
// Node callback to entirely skip the traversal.
class NoTraverseCallback : public osg::NodeCallback
{
public:
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
// no traverse()
}
};
}
#endif

View file

@ -41,6 +41,7 @@
#include "vismask.hpp"
#include "ripplesimulation.hpp"
#include "renderbin.hpp"
#include "util.hpp"
namespace
{
@ -210,16 +211,6 @@ private:
osg::Plane mPlane;
};
// Node callback to entirely skip the traversal.
class NoTraverseCallback : public osg::NodeCallback
{
public:
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
// no traverse()
}
};
/// Moves water mesh away from the camera slightly if the camera gets too close on the Z axis.
/// The offset works around graphics artifacts that occured with the GL_DEPTH_CLAMP when the camera gets extremely close to the mesh (seen on NVIDIA at least).
/// Must be added as a Cull callback.