From 3ddc314cbdf360879e765b1fae8a8bac4063946c Mon Sep 17 00:00:00 2001 From: John Bauer Date: Thu, 2 Nov 2006 21:00:20 +0000 Subject: [PATCH] Currently, long hold arrows are smudged like wet fountain pen ink. This change fixes them. Apparently the DISPLAY does not keep track of all of these state changes in between calls to Draw(). --- stepmania/src/NoteDisplay.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/stepmania/src/NoteDisplay.cpp b/stepmania/src/NoteDisplay.cpp index 84c4483cbc..db4628989c 100644 --- a/stepmania/src/NoteDisplay.cpp +++ b/stepmania/src/NoteDisplay.cpp @@ -495,11 +495,6 @@ void NoteDisplay::DrawHoldBody( const TapNote& tn, int iCol, int iRow, bool bIsB // draw manually in small segments const RectF *pRect = pSprBody->GetCurrentTextureCoordRect(); - DISPLAY->ClearAllTextures(); - DISPLAY->SetCullMode( CULL_NONE ); - DISPLAY->SetTextureWrapping( true ); - - const float fFrameWidth = pSprBody->GetZoomedWidth(); const float fFrameHeight = pSprBody->GetZoomedHeight(); const float fYBodyTop = fYHead + cache->m_iStartDrawingHoldBodyOffsetFromHead; @@ -544,7 +539,7 @@ void NoteDisplay::DrawHoldBody( const TapNote& tn, int iCol, int iRow, bool bIsB const float fXRight = fX + fFrameWidth/2; const float fDistFromBodyBottom = fYBodyBottom - fY; const float fDistFromBodyTop = fY - fYBodyTop; - float fTexCoordTop = SCALE( bAnchorToBottom ? fDistFromBodyTop : fDistFromBodyBottom, 0, fFrameHeight, pRect->bottom, pRect->top ); + float fTexCoordTop = SCALE( bAnchorToBottom ? fDistFromBodyTop : fDistFromBodyBottom, 0, fFrameHeight, pRect->bottom, pRect->top ); /* For very large hold notes, shift the texture coordinates to be near 0, so we * don't send very large values to the renderer. */ if( fY == fDrawYBodyTop ) // first @@ -558,8 +553,8 @@ void NoteDisplay::DrawHoldBody( const TapNote& tn, int iCol, int iRow, bool bIsB if( fAlpha > 0 ) bAllAreTransparent = false; - queue.v[0].p = RageVector3(fXLeft, fY, fZ); queue.v[0].c = color; queue.v[0].t = RageVector2(fTexCoordLeft, fTexCoordTop); - queue.v[1].p = RageVector3(fXRight, fY, fZ); queue.v[1].c = color; queue.v[1].t = RageVector2(fTexCoordRight, fTexCoordTop); + queue.v[0].p = RageVector3(fXLeft, fY, fZ); queue.v[0].c = color; queue.v[0].t = RageVector2(fTexCoordLeft, fTexCoordTop); + queue.v[1].p = RageVector3(fXRight, fY, fZ); queue.v[1].c = color; queue.v[1].t = RageVector2(fTexCoordRight, fTexCoordTop); queue.v+=2; if( queue.Free() < 2 ) { @@ -570,8 +565,11 @@ void NoteDisplay::DrawHoldBody( const TapNote& tn, int iCol, int iRow, bool bIsB FOREACH( Sprite*, vpSpr, spr ) { RageTexture* pTexture = (*spr)->GetTexture(); + DISPLAY->ClearAllTextures(); DISPLAY->SetTexture( TextureUnit_1, pTexture->GetTexHandle() ); DISPLAY->SetBlendMode( spr == vpSpr.begin() ? BLEND_NORMAL : BLEND_ADD ); + DISPLAY->SetCullMode( CULL_NONE ); + DISPLAY->SetTextureWrapping( true ); queue.Draw(); } } @@ -586,8 +584,11 @@ void NoteDisplay::DrawHoldBody( const TapNote& tn, int iCol, int iRow, bool bIsB FOREACH( Sprite*, vpSpr, spr ) { RageTexture* pTexture = (*spr)->GetTexture(); + DISPLAY->ClearAllTextures(); DISPLAY->SetTexture( TextureUnit_1, pTexture->GetTexHandle() ); DISPLAY->SetBlendMode( spr == vpSpr.begin() ? BLEND_NORMAL : BLEND_ADD ); + DISPLAY->SetCullMode( CULL_NONE ); + DISPLAY->SetTextureWrapping( true ); queue.Draw(); } }