From 0c50d0daec198f6837f6153d03d503c6a0a170dc Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 1 May 2005 00:06:53 +0000 Subject: [PATCH] reset tex matrix per-material --- stepmania/src/Model.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stepmania/src/Model.cpp b/stepmania/src/Model.cpp index a6a1347146..012b8ddbf1 100644 --- a/stepmania/src/Model.cpp +++ b/stepmania/src/Model.cpp @@ -362,7 +362,6 @@ void Model::DrawPrimitives() { const msMesh *pMesh = &m_pGeometry->m_Meshes[i]; - DISPLAY->TexturePushMatrix(); if( pMesh->nMaterialIndex != -1 ) // has a material { @@ -381,7 +380,10 @@ void Model::DrawPrimitives() RageVector2 vTexTranslate = mat.diffuse.GetTextureTranslate(); if( vTexTranslate.x != 0 || vTexTranslate.y != 0 ) + { + DISPLAY->TexturePushMatrix(); DISPLAY->TextureTranslate( vTexTranslate.x, vTexTranslate.y, 0 ); + } /* There's some common code that could be folded out here, but it seems * clearer to keep it separate. */ @@ -438,6 +440,9 @@ void Model::DrawPrimitives() DISPLAY->SetTexture( 0, NULL ); DISPLAY->SetSphereEnvironmentMapping( 0 ); } + + if( vTexTranslate.x != 0 || vTexTranslate.y != 0 ) + DISPLAY->TexturePopMatrix(); } else { @@ -454,7 +459,6 @@ void Model::DrawPrimitives() DISPLAY->SetSphereEnvironmentMapping( false ); DISPLAY->SetBlendMode( BLEND_NORMAL ); - DISPLAY->TexturePopMatrix(); } }