[timing] NoteField covered.

This commit is contained in:
Jason Felds
2011-07-27 23:11:34 -04:00
parent b711e34431
commit 5391b4c11d
2 changed files with 39 additions and 18 deletions
+37 -17
View File
@@ -500,27 +500,35 @@ void NoteField::DrawBPMText( const float fBeat, const float fBPM )
m_textMeasureNumber.Draw(); m_textMeasureNumber.Draw();
} }
void NoteField::DrawFreezeText( const float fBeat, const float fSecs, const float bDelay ) void NoteField::DrawFreezeText( const float fBeat, const float fSecs )
{ {
const float fYOffset = ArrowEffects::GetYOffset( m_pPlayerState, 0, fBeat ); const float fYOffset = ArrowEffects::GetYOffset( m_pPlayerState, 0, fBeat );
const float fYPos = ArrowEffects::GetYPos( m_pPlayerState, 0, fYOffset, m_fYReverseOffsetPixels ); const float fYPos = ArrowEffects::GetYPos( m_pPlayerState, 0, fYOffset, m_fYReverseOffsetPixels );
const float fZoom = ArrowEffects::GetZoom( m_pPlayerState ); const float fZoom = ArrowEffects::GetZoom( m_pPlayerState );
const float xBase = GetWidth()/2.f; const float xBase = GetWidth()/2.f;
const float xOffset = (bDelay ? DELAY_OFFSETX : STOP_OFFSETX) * fZoom; const float xOffset = STOP_OFFSETX * fZoom;
m_textMeasureNumber.SetZoom( fZoom ); m_textMeasureNumber.SetZoom( fZoom );
if(bDelay) m_textMeasureNumber.SetHorizAlign( STOP_IS_LEFT_SIDE ? align_right : align_left );
{ m_textMeasureNumber.SetDiffuse( STOP_COLOR );
m_textMeasureNumber.SetHorizAlign( DELAY_IS_LEFT_SIDE ? align_right : align_left ); m_textMeasureNumber.SetXY( (STOP_IS_LEFT_SIDE ? -xBase - xOffset : xBase + xOffset), fYPos );
m_textMeasureNumber.SetDiffuse( DELAY_COLOR ); m_textMeasureNumber.SetGlow( RageColor(1,1,1,RageFastCos(RageTimer::GetTimeSinceStartFast()*2)/2+0.5f) );
m_textMeasureNumber.SetXY( (DELAY_IS_LEFT_SIDE ? -xBase - xOffset : xBase + xOffset), fYPos ); m_textMeasureNumber.SetText( ssprintf("%.3f", fSecs) );
} m_textMeasureNumber.Draw();
else }
{
m_textMeasureNumber.SetHorizAlign( STOP_IS_LEFT_SIDE ? align_right : align_left ); void NoteField::DrawDelayText( const float fBeat, const float fSecs )
m_textMeasureNumber.SetDiffuse( STOP_COLOR ); {
m_textMeasureNumber.SetXY( (STOP_IS_LEFT_SIDE ? -xBase - xOffset : xBase + xOffset), fYPos ); const float fYOffset = ArrowEffects::GetYOffset( m_pPlayerState, 0, fBeat );
} const float fYPos = ArrowEffects::GetYPos( m_pPlayerState, 0, fYOffset, m_fYReverseOffsetPixels );
const float fZoom = ArrowEffects::GetZoom( m_pPlayerState );
const float xBase = GetWidth()/2.f;
const float xOffset = DELAY_OFFSETX * fZoom;
m_textMeasureNumber.SetZoom( fZoom );
m_textMeasureNumber.SetHorizAlign( DELAY_IS_LEFT_SIDE ? align_right : align_left );
m_textMeasureNumber.SetDiffuse( DELAY_COLOR );
m_textMeasureNumber.SetXY( (DELAY_IS_LEFT_SIDE ? -xBase - xOffset : xBase + xOffset), fYPos );
m_textMeasureNumber.SetGlow( RageColor(1,1,1,RageFastCos(RageTimer::GetTimeSinceStartFast()*2)/2+0.5f) ); m_textMeasureNumber.SetGlow( RageColor(1,1,1,RageFastCos(RageTimer::GetTimeSinceStartFast()*2)/2+0.5f) );
m_textMeasureNumber.SetText( ssprintf("%.3f", fSecs) ); m_textMeasureNumber.SetText( ssprintf("%.3f", fSecs) );
m_textMeasureNumber.Draw(); m_textMeasureNumber.Draw();
@@ -926,14 +934,26 @@ void NoteField::DrawPrimitives()
} }
// Freeze text // Freeze text
for (i = 0; i < segs[SEGMENT_STOP_DELAY].size(); i++) for (i = 0; i < segs[SEGMENT_STOP].size(); i++)
{ {
StopSegment *seg = static_cast<StopSegment *>(segs[SEGMENT_STOP_DELAY][i]); StopSegment *seg = static_cast<StopSegment *>(segs[SEGMENT_STOP][i]);
if( seg->GetRow() >= iFirstRowToDraw && seg->GetRow() <= iLastRowToDraw ) if( seg->GetRow() >= iFirstRowToDraw && seg->GetRow() <= iLastRowToDraw )
{ {
float fBeat = seg->GetBeat(); float fBeat = seg->GetBeat();
if( IS_ON_SCREEN(fBeat) ) if( IS_ON_SCREEN(fBeat) )
DrawFreezeText( fBeat, seg->GetPause(), seg->GetDelay() ); DrawFreezeText( fBeat, seg->GetPause() );
}
}
// Delay text
for (i = 0; i < segs[SEGMENT_DELAY].size(); i++)
{
DelaySegment *seg = static_cast<DelaySegment *>(segs[SEGMENT_DELAY][i]);
if( seg->GetRow() >= iFirstRowToDraw && seg->GetRow() <= iLastRowToDraw )
{
float fBeat = seg->GetBeat();
if( IS_ON_SCREEN(fBeat) )
DrawFreezeText( fBeat, seg->GetPause() );
} }
} }
+2 -1
View File
@@ -58,7 +58,8 @@ protected:
void DrawMarkerBar( int fBeat ); void DrawMarkerBar( int fBeat );
void DrawAreaHighlight( int iStartBeat, int iEndBeat ); void DrawAreaHighlight( int iStartBeat, int iEndBeat );
void DrawBPMText( const float fBeat, const float fBPM ); void DrawBPMText( const float fBeat, const float fBPM );
void DrawFreezeText( const float fBeat, const float fLength, const float bDelay ); void DrawFreezeText( const float fBeat, const float fLength );
void DrawDelayText( const float fBeat, const float fLength );
void DrawWarpText( const float fBeat, const float fNewBeat ); void DrawWarpText( const float fBeat, const float fNewBeat );
void DrawTimeSignatureText( const float fBeat, int iNumerator, int iDenominator ); void DrawTimeSignatureText( const float fBeat, int iNumerator, int iDenominator );
void DrawTickcountText( const float fBeat, int iTicks ); void DrawTickcountText( const float fBeat, int iTicks );