diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 87ffeb232c..11f8fb4661 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -349,8 +349,12 @@ namespace NifOsg if (props[i].getPtr()->recType == Nif::RC_NiStencilProperty) { - hasStencilProperty = true; - break; + const Nif::NiStencilProperty* stencilprop = static_cast(props[i].getPtr()); + if (stencilprop->data.enabled != 0) + { + hasStencilProperty = true; + break; + } } } diff --git a/components/sceneutil/depth.cpp b/components/sceneutil/depth.cpp index 5d53b97726..ee95f8c7ec 100644 --- a/components/sceneutil/depth.cpp +++ b/components/sceneutil/depth.cpp @@ -6,10 +6,6 @@ #include -#ifndef GL_DEPTH32F_STENCIL8_NV -#define GL_DEPTH32F_STENCIL8_NV 0x8DAC -#endif - namespace SceneUtil { void setCameraClearDepth(osg::Camera* camera) diff --git a/components/sceneutil/depth.hpp b/components/sceneutil/depth.hpp index 11a863ef7a..1f4ba55297 100644 --- a/components/sceneutil/depth.hpp +++ b/components/sceneutil/depth.hpp @@ -5,6 +5,10 @@ #include "util.hpp" +#ifndef GL_DEPTH32F_STENCIL8_NV +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#endif + namespace SceneUtil { // Sets camera clear depth to 0 if reversed depth buffer is in use, 1 otherwise.