From a05e029aa040d8af4b27eacd0a250a46b7d34be8 Mon Sep 17 00:00:00 2001 From: "glassmancody.info" Date: Tue, 8 Feb 2022 13:49:05 -0800 Subject: [PATCH 1/2] search for stencil enabled flag correctly --- components/nifosg/nifloader.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; + } } } From 27d2daabc15d114229d1b19e53b7fdf1cc658f92 Mon Sep 17 00:00:00 2001 From: "glassmancody.info" Date: Tue, 8 Feb 2022 14:12:17 -0800 Subject: [PATCH 2/2] move depth define to header, missing on mac --- components/sceneutil/depth.cpp | 4 ---- components/sceneutil/depth.hpp | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) 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.