Fixed crash drawing area highlight if boost is on

This commit is contained in:
Chris Danford
2003-02-19 06:55:07 +00:00
parent 82b51a2896
commit 89114ee921
3 changed files with 11 additions and 6 deletions
+2 -1
View File
@@ -45,7 +45,8 @@ float ArrowGetYOffset( PlayerNumber pn, float fNoteBeat )
switch( GAMESTATE->m_PlayerOptions[pn].m_AccelType )
{
case PlayerOptions::ACCEL_BOOST:
fYOffset *= 1.5f / ((fYOffset+SCREEN_HEIGHT/1.2f)/SCREEN_HEIGHT);
if( fYOffset > 0 ) // speed the arrows back to normal after they cross 0
fYOffset *= 1.5f / ((fYOffset+SCREEN_HEIGHT/1.2f)/SCREEN_HEIGHT);
break;
case PlayerOptions::ACCEL_LAND:
if( fYOffset > 0 ) // speed the arrows back to normal after they cross 0
+8 -4
View File
@@ -140,10 +140,14 @@ void NoteField::DrawMarkerBar( const float fBeat )
void NoteField::DrawAreaHighlight( const float fStartBeat, const float fEndBeat )
{
const float fYStartOffset = ArrowGetYOffset( m_PlayerNumber, fStartBeat );
const float fYStartPos = ArrowGetYPos( m_PlayerNumber, fYStartOffset );
const float fYEndOffset = ArrowGetYOffset( m_PlayerNumber, fEndBeat );
const float fYEndPos = ArrowGetYPos( m_PlayerNumber, fYEndOffset );
float fYStartOffset = ArrowGetYOffset( m_PlayerNumber, fStartBeat );
float fYStartPos = ArrowGetYPos( m_PlayerNumber, fYStartOffset );
float fYEndOffset = ArrowGetYOffset( m_PlayerNumber, fEndBeat );
float fYEndPos = ArrowGetYPos( m_PlayerNumber, fYEndOffset );
// Something in OpenGL crashes if this is values are too large. Strange. -Chris
fYStartPos = max( fYStartPos, -1000 );
fYEndPos = min( fYEndPos, +5000 );
m_rectAreaHighlight.StretchTo( RectI(0, (int)fYStartPos-ARROW_SIZE/2, 1, (int)fYEndPos+ARROW_SIZE/2) );
m_rectAreaHighlight.SetZoomX( (float)(GetNumTracks()+1) * ARROW_SIZE );
+1 -1
View File
@@ -231,7 +231,7 @@ ScreenEdit::ScreenEdit()
m_NoteFieldEdit.SetXY( EDIT_X, EDIT_GRAY_Y );
m_NoteFieldEdit.SetZoom( 0.5f );
m_NoteFieldEdit.Load( &noteData, PLAYER_1, -200, 800 );
m_NoteFieldEdit.Load( &noteData, PLAYER_1, -220, 800 );
m_rectRecordBack.StretchTo( RectI(SCREEN_LEFT, SCREEN_TOP, SCREEN_RIGHT, SCREEN_BOTTOM) );
m_rectRecordBack.SetDiffuse( RageColor(0,0,0,0) );