Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Disable depth writing instead of clearing depth buffer bit
Browse files Browse the repository at this point in the history
#223
  • Loading branch information
SamVanheer committed Sep 5, 2021
1 parent e55263b commit 9fd49de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tools/hlmv/ui/C3DView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ void C3DView::DrawTexture( const int iXOffset, const int iYOffset, const int iWi
glMatrixMode( GL_PROJECTION );
glLoadIdentity();

glDepthMask(GL_FALSE);

glOrtho( 0.0f, ( float ) iWidth, ( float ) iHeight, 0.0f, 1.0f, -1.0f );

const studiohdr_t* const hdr = pModel->GetTextureHeader();
Expand Down Expand Up @@ -640,11 +642,11 @@ void C3DView::DrawTexture( const int iXOffset, const int iYOffset, const int iWi

glPopMatrix();

glClear( GL_DEPTH_BUFFER_BIT );

if( texture.flags & STUDIO_NF_MASKED )
glDisable( GL_ALPHA_TEST );
}

glDepthMask(GL_TRUE);
}

void C3DView::DrawModel()
Expand Down

0 comments on commit 9fd49de

Please sign in to comment.