From 0178e1e3dfff229bea52139965c768690beab089 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 12 Nov 2002 01:55:25 +0000 Subject: [PATCH] fix hold notes --- stepmania/src/NoteDisplay.cpp | 39 ++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/stepmania/src/NoteDisplay.cpp b/stepmania/src/NoteDisplay.cpp index e22b79275a..7b3e5ed5f0 100644 --- a/stepmania/src/NoteDisplay.cpp +++ b/stepmania/src/NoteDisplay.cpp @@ -223,14 +223,13 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float const int fYStep = 8; // draw a segment every 8 pixels // this requires that the texture dimensions be a multiple of 8 -// DISPLAY->SetBlendModeNormal(); -// if( bDrawGlowOnly ) -// DISPLAY->SetColorDiffuse(); -// else -// DISPLAY->SetColorTextureMultDiffuse(); -// DISPLAY->SetAlphaTextureMultDiffuse(); -// DISPLAY->EnableTextureWrapping(); -// DISPLAY->SetTexture( m_sprHoldParts.GetTexture() ); + DISPLAY->SetBlendModeNormal(); + if( bDrawGlowOnly ) + DISPLAY->SetTextureModeGlow(); + else + DISPLAY->SetTextureModeModulate(); + DISPLAY->EnableTextureWrapping(); + DISPLAY->SetTexture( m_sprHoldParts.GetTexture() ); // // Draw the tail @@ -274,8 +273,8 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float static RageVertex v[4]; v[0].p = RageVector3(fXTopLeft-0.5f, fYTop-0.5f, 0); v[0].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[0].t = RageVector2(fTexCoordLeft, fTexCoordTop), v[1].p = RageVector3(fXTopRight-0.5f, fYTop-0.5f, 0); v[1].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[1].t = RageVector2(fTexCoordRight, fTexCoordTop); - v[2].p = RageVector3(fXBottomLeft-0.5f, fYBottom-0.5f,0); v[2].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordLeft, fTexCoordBottom); - v[3].p = RageVector3(fXBottomRight-0.5f,fYBottom-0.5f,0); v[3].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[3].t = RageVector2(fTexCoordRight, fTexCoordBottom); + v[2].p = RageVector3(fXBottomRight-0.5f,fYBottom-0.5f,0); v[2].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordRight, fTexCoordBottom); + v[3].p = RageVector3(fXBottomLeft-0.5f, fYBottom-0.5f,0); v[3].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[3].t = RageVector2(fTexCoordLeft, fTexCoordBottom); DISPLAY->DrawQuad( v ); } @@ -315,10 +314,11 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float continue; static RageVertex v[4]; - v[0].p = RageVector3(fXTopLeft-0.5f, fYTop-0.5f, 0); v[0].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[2].t = RageVector2(fTexCoordLeft, fTexCoordTop); - v[1].p = RageVector3(fXTopRight-0.5f, fYTop-0.5f, 0); v[1].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[2].t = RageVector2(fTexCoordRight, fTexCoordTop); - v[2].p = RageVector3(fXBottomLeft-0.5f, fYBottom-0.5f,0); v[2].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordLeft, fTexCoordBottom); - v[3].p = RageVector3(fXBottomRight-0.5f,fYBottom-0.5f,0); v[3].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordRight, fTexCoordBottom); + v[0].p = RageVector3(fXTopLeft-0.5f, fYTop-0.5f, 0); v[0].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[0].t = RageVector2(fTexCoordLeft, fTexCoordTop); + v[1].p = RageVector3(fXTopRight-0.5f, fYTop-0.5f, 0); v[1].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[1].t = RageVector2(fTexCoordRight, fTexCoordTop); + v[2].p = RageVector3(fXBottomRight-0.5f,fYBottom-0.5f,0); v[2].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordRight, fTexCoordBottom); + v[3].p = RageVector3(fXBottomLeft-0.5f, fYBottom-0.5f,0); v[3].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[3].t = RageVector2(fTexCoordLeft, fTexCoordBottom); + DISPLAY->DrawQuad( v ); } if( g_bDrawTapOnTopOfHoldHead ) @@ -361,11 +361,12 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float if( !bDrawGlowOnly && colorDiffuseTop.a==0 && colorDiffuseBottom.a==0 ) continue; - static RageVertex v[4]; - v[0].p = RageVector3(fXTopLeft-0.5f, fYTop-0.5f, 0); v[0].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[2].t = RageVector2(fTexCoordLeft, fTexCoordTop); - v[0].p = RageVector3(fXTopRight-0.5f, fYTop-0.5f, 0); v[0].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[2].t = RageVector2(fTexCoordRight, fTexCoordTop); - v[0].p = RageVector3(fXBottomLeft-0.5f, fYBottom-0.5f,0); v[0].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordLeft, fTexCoordBottom); - v[0].p = RageVector3(fXBottomRight-0.5f,fYBottom-0.5f,0); v[0].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordRight, fTexCoordBottom); + static RageVertex v[4]; + v[0].p = RageVector3(fXTopLeft-0.5f, fYTop-0.5f, 0); v[0].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[0].t = RageVector2(fTexCoordLeft, fTexCoordTop); + v[1].p = RageVector3(fXTopRight-0.5f, fYTop-0.5f, 0); v[1].c = bDrawGlowOnly ? colorGlowTop : colorDiffuseTop; v[1].t = RageVector2(fTexCoordRight, fTexCoordTop); + v[2].p = RageVector3(fXBottomRight-0.5f,fYBottom-0.5f,0); v[2].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[2].t = RageVector2(fTexCoordRight, fTexCoordBottom); + v[3].p = RageVector3(fXBottomLeft-0.5f, fYBottom-0.5f,0); v[3].c = bDrawGlowOnly ? colorGlowBottom : colorDiffuseBottom; v[3].t = RageVector2(fTexCoordLeft, fTexCoordBottom); + DISPLAY->DrawQuad( v ); } } else