2003-10-25 22:00:58 +00:00
|
|
|
#include "global.h"
|
|
|
|
|
#include "Attack.h"
|
|
|
|
|
#include "GameState.h"
|
2003-12-05 20:31:06 +00:00
|
|
|
#include "RageUtil.h"
|
2003-10-25 22:00:58 +00:00
|
|
|
#include "song.h"
|
|
|
|
|
|
|
|
|
|
void Attack::GetAttackBeats( const Song *song, PlayerNumber pn, float &fStartBeat, float &fEndBeat ) const
|
|
|
|
|
{
|
|
|
|
|
if( fStartSecond >= 0 )
|
|
|
|
|
{
|
2003-12-05 20:31:06 +00:00
|
|
|
CHECKPOINT;
|
2003-10-25 22:00:58 +00:00
|
|
|
fStartBeat = song->GetBeatFromElapsedTime( fStartSecond );
|
|
|
|
|
fEndBeat = song->GetBeatFromElapsedTime( fStartSecond+fSecsRemaining );
|
|
|
|
|
} else {
|
2003-12-05 20:31:06 +00:00
|
|
|
CHECKPOINT;
|
2003-10-26 03:02:30 +00:00
|
|
|
/* If fStartSecond < 0, then the attack starts right off the screen; this requires
|
|
|
|
|
* that a song actually be playing. Pre-queued course attacks must always have
|
|
|
|
|
* fStartSecond >= 0. */
|
|
|
|
|
ASSERT( GAMESTATE->m_pCurSong );
|
|
|
|
|
|
2003-10-25 22:00:58 +00:00
|
|
|
/* We're setting this effect on the fly. If it's an arrow-changing effect
|
|
|
|
|
* (transform or note skin), apply it in the future, past what's currently on
|
|
|
|
|
* screen, so new arrows will scroll on screen with this effect. */
|
|
|
|
|
GAMESTATE->GetUndisplayedBeats( pn, fSecsRemaining, fStartBeat, fEndBeat );
|
|
|
|
|
}
|
2003-11-19 11:52:20 +00:00
|
|
|
|
2003-12-05 20:31:06 +00:00
|
|
|
RAGE_ASSERT_M( fEndBeat >= fStartBeat, ssprintf("%f >= %f", fEndBeat, fStartBeat) );
|
2003-10-25 22:00:58 +00:00
|
|
|
}
|