From 6b5ddcab6c0549da5b252e9b69228a3448e40a3f Mon Sep 17 00:00:00 2001 From: jonwd7 Date: Mon, 18 Dec 2017 01:27:37 -0500 Subject: [PATCH] [GL] Fix skinned NiMesh rendering from 11f2980 POSITION_BP semantic was being ignored for the check that the mesh had vertices. This was causing skinned meshes using POSITION_BP to no longer render. --- src/data/niftypes.h | 20 ++++++++++++-------- src/gl/glmesh.cpp | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/data/niftypes.h b/src/data/niftypes.h index 6f13cb869..eab32f167 100644 --- a/src/data/niftypes.h +++ b/src/data/niftypes.h @@ -2052,15 +2052,19 @@ typedef enum typedef enum { HAS_NONE = 0, - HAS_POSITION = 1 << E_POSITION, - HAS_NORMAL = 1 << E_NORMAL, - HAS_BINORMAL = 1 << E_BINORMAL, - HAS_TANGENT = 1 << E_TANGENT, - HAS_TEXCOORD = 1 << E_TEXCOORD, - HAS_BLENDWEIGHT = 1 << E_BLENDWEIGHT, + HAS_POSITION = 1 << E_POSITION, + HAS_NORMAL = 1 << E_NORMAL, + HAS_BINORMAL = 1 << E_BINORMAL, + HAS_TANGENT = 1 << E_TANGENT, + HAS_TEXCOORD = 1 << E_TEXCOORD, + HAS_BLENDWEIGHT = 1 << E_BLENDWEIGHT, HAS_BLENDINDICES = 1 << E_BLENDINDICES, - HAS_COLOR = 1 << E_COLOR, - HAS_INDEX = 1 << E_INDEX + HAS_COLOR = 1 << E_COLOR, + HAS_INDEX = 1 << E_INDEX, + HAS_POSITION_BP = 1 << E_POSITION_BP, + HAS_NORMAL_BP = 1 << E_NORMAL_BP, + HAS_BINORMAL_BP = 1 << E_BINORMAL_BP, + HAS_TANGENT_BP = 1 << E_TANGENT_BP, } SemanticFlags; #define SEM(string) {#string, E_##string}, diff --git a/src/gl/glmesh.cpp b/src/gl/glmesh.cpp index 9e1c51b81..63a44069a 100644 --- a/src/gl/glmesh.cpp +++ b/src/gl/glmesh.cpp @@ -381,7 +381,7 @@ void Mesh::transform() } // This NiMesh does not have vertices, abort - if ( !(semFlags & NiMesh::HAS_POSITION) ) + if ( !(semFlags & NiMesh::HAS_POSITION || semFlags & NiMesh::HAS_POSITION_BP) ) return; // The number of triangle indices across the submeshes for this NiMesh