forked from mirror/openmw-tes3mp
Move NoTraverseCallback to mwrender/util.hpp
This commit is contained in:
parent
d43315fe4e
commit
776c715ccd
3 changed files with 12 additions and 20 deletions
|
@ -42,6 +42,7 @@
|
||||||
#include "camera.hpp"
|
#include "camera.hpp"
|
||||||
#include "water.hpp"
|
#include "water.hpp"
|
||||||
#include "terrainstorage.hpp"
|
#include "terrainstorage.hpp"
|
||||||
|
#include "util.hpp"
|
||||||
|
|
||||||
namespace MWRender
|
namespace MWRender
|
||||||
{
|
{
|
||||||
|
@ -504,15 +505,6 @@ namespace MWRender
|
||||||
mutable bool mDone;
|
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)
|
void RenderingManager::screenshot(osg::Image *image, int w, int h)
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::Camera> rttCamera (new osg::Camera);
|
osg::ref_ptr<osg::Camera> rttCamera (new osg::Camera);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef OPENMW_MWRENDER_UTIL_H
|
#ifndef OPENMW_MWRENDER_UTIL_H
|
||||||
#define OPENMW_MWRENDER_UTIL_H
|
#define OPENMW_MWRENDER_UTIL_H
|
||||||
|
|
||||||
|
#include <osg/NodeCallback>
|
||||||
#include <osg/ref_ptr>
|
#include <osg/ref_ptr>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -16,9 +17,17 @@ namespace Resource
|
||||||
|
|
||||||
namespace MWRender
|
namespace MWRender
|
||||||
{
|
{
|
||||||
|
|
||||||
void overrideTexture(const std::string& texture, Resource::ResourceSystem* resourceSystem, osg::ref_ptr<osg::Node> node);
|
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
|
#endif
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include "vismask.hpp"
|
#include "vismask.hpp"
|
||||||
#include "ripplesimulation.hpp"
|
#include "ripplesimulation.hpp"
|
||||||
#include "renderbin.hpp"
|
#include "renderbin.hpp"
|
||||||
|
#include "util.hpp"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
@ -210,16 +211,6 @@ private:
|
||||||
osg::Plane mPlane;
|
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.
|
/// 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).
|
/// 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.
|
/// Must be added as a Cull callback.
|
||||||
|
|
Loading…
Reference in a new issue