Skip to content

Commit

Permalink
Fixed bug preventing the selection of transparent shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
fo76utils committed Aug 25, 2024
1 parent b6948f0 commit c4e35c1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 4 additions & 3 deletions src/gl/BSMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down
5 changes: 2 additions & 3 deletions src/gl/bsshape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 2 additions & 3 deletions src/gl/glmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit c4e35c1

Please sign in to comment.