From 0ec148b4f09b057814bd0ff4b68bd4f75f8a838e Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 26 Apr 2005 08:11:30 +0000 Subject: [PATCH] fix multipass path doesn't clear 2nd texture unit if model doesn't have 2nd material --- stepmania/src/Model.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/stepmania/src/Model.cpp b/stepmania/src/Model.cpp index 4d8bd7c314..248d9b53af 100644 --- a/stepmania/src/Model.cpp +++ b/stepmania/src/Model.cpp @@ -413,11 +413,6 @@ void Model::DrawPrimitives() } else { - // render the diffuse texture with texture unit 1 - DISPLAY->SetTexture( 0, mat.diffuse.GetCurrentTexture() ); - Actor::SetTextureRenderStates(); // set Actor-specified render states - DISPLAY->SetSphereEnvironmentMapping( mat.diffuse.m_bSphereMapped ); - // render the additive texture with texture unit 2 if( mat.alpha.GetCurrentTexture() ) { @@ -427,7 +422,16 @@ void Model::DrawPrimitives() DISPLAY->SetTextureModeAdd(); DISPLAY->SetTextureFiltering( true ); } + else + { + DISPLAY->SetTexture( 1, NULL ); + } + // render the diffuse texture with texture unit 1 + DISPLAY->SetTexture( 0, mat.diffuse.GetCurrentTexture() ); + Actor::SetTextureRenderStates(); // set Actor-specified render states + DISPLAY->SetSphereEnvironmentMapping( mat.diffuse.m_bSphereMapped ); + /* go */ DrawMesh( i );