From 776c715ccd419f1e77a8445e2ddd31692efcc942 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Fri, 29 Jan 2016 17:00:18 +0100 Subject: [PATCH] Move NoTraverseCallback to mwrender/util.hpp --- apps/openmw/mwrender/renderingmanager.cpp | 10 +--------- apps/openmw/mwrender/util.hpp | 11 ++++++++++- apps/openmw/mwrender/water.cpp | 11 +---------- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 61ce626fd..c8d0925b0 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -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 rttCamera (new osg::Camera); diff --git a/apps/openmw/mwrender/util.hpp b/apps/openmw/mwrender/util.hpp index d078f0d98..815e34596 100644 --- a/apps/openmw/mwrender/util.hpp +++ b/apps/openmw/mwrender/util.hpp @@ -1,6 +1,7 @@ #ifndef OPENMW_MWRENDER_UTIL_H #define OPENMW_MWRENDER_UTIL_H +#include #include #include @@ -16,9 +17,17 @@ namespace Resource namespace MWRender { - void overrideTexture(const std::string& texture, Resource::ResourceSystem* resourceSystem, osg::ref_ptr 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 diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index 1b19246f5..b2bef7122 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -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.