From c4e35c19ab4a86da9504235c3b4347dc90405aaf Mon Sep 17 00:00:00 2001 From: fo76utils <87907510+fo76utils@users.noreply.github.com> Date: Mon, 26 Aug 2024 01:10:20 +0200 Subject: [PATCH] Fixed bug preventing the selection of transparent shapes --- CHANGELOG.md | 2 -- src/gl/BSMesh.cpp | 7 ++++--- src/gl/bsshape.cpp | 5 ++--- src/gl/glmesh.cpp | 5 ++--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d47e386..00fd891a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,5 @@ == CHANGELOG == -#### NifSkope-2.0.dev9-20240825 - * New render setting for the mouse wheel zoom speed in the main window and UV editor. * Implemented the 'Startup Direction' render setting that was previously disabled. * Skyrim and Fallout 4 shader property data is no longer moved to a sub-structure of BSLightingShaderProperty or BSEffectShaderProperty. diff --git a/src/gl/BSMesh.cpp b/src/gl/BSMesh.cpp index 89710280..bbbf0683 100644 --- a/src/gl/BSMesh.cpp +++ b/src/gl/BSMesh.cpp @@ -76,6 +76,9 @@ void BSMesh::drawShapes( NodeList * secondPass ) scene->renderer->stopProgram(); + glDisableClientState(GL_NORMAL_ARRAY); + glDisableClientState(GL_COLOR_ARRAY); + } else { glDisable(GL_FRAMEBUFFER_SRGB); @@ -85,13 +88,11 @@ void BSMesh::drawShapes( NodeList * secondPass ) glColor4f( 0, 0, 0, 1 ); } - if ( sortedTriangles.count() && !drawInSecondPass ) + if ( sortedTriangles.count() && !( drawInSecondPass && scene->isSelModeVertex() ) ) glDrawElements(GL_TRIANGLES, sortedTriangles.count() * 3, GL_UNSIGNED_SHORT, sortedTriangles.constData()); } glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); glDisable(GL_POLYGON_OFFSET_FILL); diff --git a/src/gl/bsshape.cpp b/src/gl/bsshape.cpp index a9d07f8c..390625e3 100644 --- a/src/gl/bsshape.cpp +++ b/src/gl/bsshape.cpp @@ -317,13 +317,12 @@ void BSShape::drawShapes( NodeList * secondPass ) if ( nif->getBSVersion() >= 151 ) glDisable( GL_FRAMEBUFFER_SRGB ); - if ( drawInSecondPass ) { + if ( drawInSecondPass && scene->isSelModeVertex() ) { glDisableClientState( GL_VERTEX_ARRAY ); glDisable( GL_POLYGON_OFFSET_FILL ); - if ( scene->isSelModeVertex() ) - drawVerts(); + drawVerts(); if ( transformRigid ) glPopMatrix(); diff --git a/src/gl/glmesh.cpp b/src/gl/glmesh.cpp index 57ba204b..14913c57 100644 --- a/src/gl/glmesh.cpp +++ b/src/gl/glmesh.cpp @@ -833,13 +833,12 @@ void Mesh::drawShapes( NodeList * secondPass ) if ( !Node::SELECTING ) shader = scene->renderer->setupProgram( this, shader ); - } else if ( drawInSecondPass ) { + } else if ( drawInSecondPass && scene->isSelModeVertex() ) { glDisableClientState( GL_VERTEX_ARRAY ); glDisable( GL_POLYGON_OFFSET_FILL ); - if ( scene->isSelModeVertex() ) - drawVerts(); + drawVerts(); if ( transformRigid ) glPopMatrix();