[splittiming] temporary fix for ScreenEdit. It uses song position for now. (82)
So once it builds we have to test it extensively to see where it could be wrong.
This commit is contained in:
+93
-91
@@ -722,8 +722,10 @@ void ScreenEdit::Init()
|
|||||||
|
|
||||||
GAMESTATE->m_bGameplayLeadIn.Set( true );
|
GAMESTATE->m_bGameplayLeadIn.Set( true );
|
||||||
GAMESTATE->m_EditMode = EDIT_MODE.GetValue();
|
GAMESTATE->m_EditMode = EDIT_MODE.GetValue();
|
||||||
GAMESTATE->m_fSongBeat = 0;
|
GAMESTATE->m_Position.m_fSongBeat = 0;
|
||||||
m_fTrailingBeat = GAMESTATE->m_fSongBeat;
|
FOREACH_PlayerNumber( p )
|
||||||
|
GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat = 0;
|
||||||
|
m_fTrailingBeat = GAMESTATE->m_Position.m_fSongBeat;
|
||||||
|
|
||||||
m_iShiftAnchor = -1;
|
m_iShiftAnchor = -1;
|
||||||
m_iStartPlayingAt = -1;
|
m_iStartPlayingAt = -1;
|
||||||
@@ -927,12 +929,12 @@ void ScreenEdit::Update( float fDeltaTime )
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
float fStartPlayingAtBeat = NoteRowToBeat(m_iStartPlayingAt);
|
float fStartPlayingAtBeat = NoteRowToBeat(m_iStartPlayingAt);
|
||||||
if( GAMESTATE->m_fSongBeat <= fStartPlayingAtBeat )
|
if( GAMESTATE->m_Position.m_fSongBeat <= fStartPlayingAtBeat )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
float fStartedHoldingSeconds = m_pSoundMusic->GetPositionSeconds() - fSecsHeld;
|
float fStartedHoldingSeconds = m_pSoundMusic->GetPositionSeconds() - fSecsHeld;
|
||||||
float fStartBeat = max( fStartPlayingAtBeat, m_pSteps->m_Timing.GetBeatFromElapsedTime(fStartedHoldingSeconds) );
|
float fStartBeat = max( fStartPlayingAtBeat, m_pSteps->m_Timing.GetBeatFromElapsedTime(fStartedHoldingSeconds) );
|
||||||
float fEndBeat = max( fStartBeat, GAMESTATE->m_fSongBeat );
|
float fEndBeat = max( fStartBeat, GAMESTATE->m_Position.m_fSongBeat );
|
||||||
fEndBeat = min( fEndBeat, NoteRowToBeat(m_iStopPlayingAt) );
|
fEndBeat = min( fEndBeat, NoteRowToBeat(m_iStopPlayingAt) );
|
||||||
|
|
||||||
// Round start and end to the nearest snap interval
|
// Round start and end to the nearest snap interval
|
||||||
@@ -981,7 +983,7 @@ void ScreenEdit::Update( float fDeltaTime )
|
|||||||
}
|
}
|
||||||
|
|
||||||
float fStopAtSeconds = m_pSteps->m_Timing.GetElapsedTimeFromBeat( NoteRowToBeat(m_iStopPlayingAt) ) + 1;
|
float fStopAtSeconds = m_pSteps->m_Timing.GetElapsedTimeFromBeat( NoteRowToBeat(m_iStopPlayingAt) ) + 1;
|
||||||
if( GAMESTATE->m_fMusicSeconds > fStopAtSeconds )
|
if( GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fMusicSeconds > fStopAtSeconds )
|
||||||
{
|
{
|
||||||
// loop
|
// loop
|
||||||
TransitionEditState( STATE_PLAYING );
|
TransitionEditState( STATE_PLAYING );
|
||||||
@@ -994,12 +996,12 @@ void ScreenEdit::Update( float fDeltaTime )
|
|||||||
|
|
||||||
|
|
||||||
// Update trailing beat
|
// Update trailing beat
|
||||||
float fDelta = GAMESTATE->m_fSongBeat - m_fTrailingBeat;
|
float fDelta = GAMESTATE->m_Position.m_fSongBeat - m_fTrailingBeat;
|
||||||
if( fabsf(fDelta) < 10 )
|
if( fabsf(fDelta) < 10 )
|
||||||
fapproach( m_fTrailingBeat, GAMESTATE->m_fSongBeat,
|
fapproach( m_fTrailingBeat, GAMESTATE->m_Position.m_fSongBeat,
|
||||||
fDeltaTime*40 / m_NoteFieldEdit.GetPlayerState()->m_PlayerOptions.GetCurrent().m_fScrollSpeed );
|
fDeltaTime*40 / m_NoteFieldEdit.GetPlayerState()->m_PlayerOptions.GetCurrent().m_fScrollSpeed );
|
||||||
else
|
else
|
||||||
fapproach( m_fTrailingBeat, GAMESTATE->m_fSongBeat,
|
fapproach( m_fTrailingBeat, GAMESTATE->m_Position.m_fSongBeat,
|
||||||
fabsf(fDelta) * fDeltaTime*5 );
|
fabsf(fDelta) * fDeltaTime*5 );
|
||||||
|
|
||||||
PlayTicks();
|
PlayTicks();
|
||||||
@@ -1070,8 +1072,8 @@ void ScreenEdit::UpdateTextInfo()
|
|||||||
RString sNoteType = ssprintf( NOTES.GetValue(), NoteTypeToLocalizedString(m_SnapDisplay.GetNoteType()).c_str() );
|
RString sNoteType = ssprintf( NOTES.GetValue(), NoteTypeToLocalizedString(m_SnapDisplay.GetNoteType()).c_str() );
|
||||||
|
|
||||||
RString sText;
|
RString sText;
|
||||||
sText += ssprintf( CURRENT_BEAT_FORMAT.GetValue(), CURRENT_BEAT.GetValue().c_str(), GAMESTATE->m_fSongBeat );
|
sText += ssprintf( CURRENT_BEAT_FORMAT.GetValue(), CURRENT_BEAT.GetValue().c_str(), GAMESTATE->m_Position.m_fSongBeat );
|
||||||
sText += ssprintf( CURRENT_SECOND_FORMAT.GetValue(), CURRENT_SECOND.GetValue().c_str(), m_pSteps->m_Timing.GetElapsedTimeFromBeat(GAMESTATE->m_fSongBeat) );
|
sText += ssprintf( CURRENT_SECOND_FORMAT.GetValue(), CURRENT_SECOND.GetValue().c_str(), m_pSteps->m_Timing.GetElapsedTimeFromBeat(GAMESTATE->m_Position.m_fSongBeat) );
|
||||||
switch( EDIT_MODE.GetValue() )
|
switch( EDIT_MODE.GetValue() )
|
||||||
{
|
{
|
||||||
DEFAULT_FAIL( EDIT_MODE.GetValue() );
|
DEFAULT_FAIL( EDIT_MODE.GetValue() );
|
||||||
@@ -1141,14 +1143,14 @@ void ScreenEdit::UpdateTextInfo()
|
|||||||
void ScreenEdit::DrawPrimitives()
|
void ScreenEdit::DrawPrimitives()
|
||||||
{
|
{
|
||||||
// HACK: Draw using the trailing beat
|
// HACK: Draw using the trailing beat
|
||||||
float fSongBeat = GAMESTATE->m_fSongBeat; // save song beat
|
float fSongBeat = GAMESTATE->m_Position.m_fSongBeat; // save song beat
|
||||||
float fSongBeatNoOffset = GAMESTATE->m_fSongBeatNoOffset;
|
float fSongBeatNoOffset = GAMESTATE->m_Position.m_fSongBeatNoOffset;
|
||||||
float fSongBeatVisible = GAMESTATE->m_fSongBeatVisible;
|
float fSongBeatVisible = GAMESTATE->m_fSongBeatVisible;
|
||||||
|
|
||||||
if( !m_pSoundMusic->IsPlaying() )
|
if( !m_pSoundMusic->IsPlaying() )
|
||||||
{
|
{
|
||||||
GAMESTATE->m_fSongBeat = m_fTrailingBeat; // put trailing beat in effect
|
GAMESTATE->m_Position.m_fSongBeat = m_fTrailingBeat; // put trailing beat in effect
|
||||||
GAMESTATE->m_fSongBeatNoOffset = m_fTrailingBeat; // put trailing beat in effect
|
GAMESTATE->m_Position.m_fSongBeatNoOffset = m_fTrailingBeat; // put trailing beat in effect
|
||||||
GAMESTATE->m_fSongBeatVisible = m_fTrailingBeat; // put trailing beat in effect
|
GAMESTATE->m_fSongBeatVisible = m_fTrailingBeat; // put trailing beat in effect
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1156,8 +1158,8 @@ void ScreenEdit::DrawPrimitives()
|
|||||||
|
|
||||||
if( !m_pSoundMusic->IsPlaying() )
|
if( !m_pSoundMusic->IsPlaying() )
|
||||||
{
|
{
|
||||||
GAMESTATE->m_fSongBeat = fSongBeat; // restore real song beat
|
GAMESTATE->m_Position.m_fSongBeat = fSongBeat; // restore real song beat
|
||||||
GAMESTATE->m_fSongBeatNoOffset = fSongBeatNoOffset;
|
GAMESTATE->m_Position.m_fSongBeatNoOffset = fSongBeatNoOffset;
|
||||||
GAMESTATE->m_fSongBeatVisible = fSongBeatVisible;
|
GAMESTATE->m_fSongBeatVisible = fSongBeatVisible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1243,7 +1245,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
m_iShiftAnchor = -1;
|
m_iShiftAnchor = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int beatsPerMeasure = GAMESTATE->m_pCurSong->m_SongTiming.GetTimeSignatureSegmentAtBeat( GAMESTATE->m_fSongBeat ).m_iNumerator;
|
int beatsPerMeasure = GAMESTATE->m_pCurSong->m_SongTiming.GetTimeSignatureSegmentAtBeat( GAMESTATE->m_Position.m_fSongBeat ).m_iNumerator;
|
||||||
|
|
||||||
switch( EditB )
|
switch( EditB )
|
||||||
{
|
{
|
||||||
@@ -1269,7 +1271,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
ShiftToRightSide( iCol, m_NoteDataEdit.GetNumTracks() );
|
ShiftToRightSide( iCol, m_NoteDataEdit.GetNumTracks() );
|
||||||
|
|
||||||
|
|
||||||
const float fSongBeat = GAMESTATE->m_fSongBeat;
|
const float fSongBeat = GAMESTATE->m_Position.m_fSongBeat;
|
||||||
const int iSongIndex = BeatToNoteRow( fSongBeat );
|
const int iSongIndex = BeatToNoteRow( fSongBeat );
|
||||||
|
|
||||||
if( iCol >= m_NoteDataEdit.GetNumTracks() ) // this button is not in the range of columns for this Style
|
if( iCol >= m_NoteDataEdit.GetNumTracks() ) // this button is not in the range of columns for this Style
|
||||||
@@ -1407,7 +1409,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
if( m_PlayerStateEdit.m_PlayerOptions.GetSong().m_fScrolls[PlayerOptions::SCROLL_REVERSE] > 0.5 )
|
if( m_PlayerStateEdit.m_PlayerOptions.GetSong().m_fScrolls[PlayerOptions::SCROLL_REVERSE] > 0.5 )
|
||||||
fBeatsToMove *= -1;
|
fBeatsToMove *= -1;
|
||||||
|
|
||||||
float fDestinationBeat = GAMESTATE->m_fSongBeat + fBeatsToMove;
|
float fDestinationBeat = GAMESTATE->m_Position.m_fSongBeat + fBeatsToMove;
|
||||||
fDestinationBeat = Quantize( fDestinationBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
|
fDestinationBeat = Quantize( fDestinationBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
|
||||||
|
|
||||||
ScrollTo( fDestinationBeat );
|
ScrollTo( fDestinationBeat );
|
||||||
@@ -1415,28 +1417,28 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
break;
|
break;
|
||||||
case EDIT_BUTTON_SCROLL_NEXT_MEASURE:
|
case EDIT_BUTTON_SCROLL_NEXT_MEASURE:
|
||||||
{
|
{
|
||||||
float fDestinationBeat = GAMESTATE->m_fSongBeat + beatsPerMeasure;
|
float fDestinationBeat = GAMESTATE->m_Position.m_fSongBeat + beatsPerMeasure;
|
||||||
fDestinationBeat = ftruncf( fDestinationBeat, (float)beatsPerMeasure );
|
fDestinationBeat = ftruncf( fDestinationBeat, (float)beatsPerMeasure );
|
||||||
ScrollTo( fDestinationBeat );
|
ScrollTo( fDestinationBeat );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EDIT_BUTTON_SCROLL_PREV_MEASURE:
|
case EDIT_BUTTON_SCROLL_PREV_MEASURE:
|
||||||
{
|
{
|
||||||
float fDestinationBeat = QuantizeUp( GAMESTATE->m_fSongBeat, (float)beatsPerMeasure );
|
float fDestinationBeat = QuantizeUp( GAMESTATE->m_Position.m_fSongBeat, (float)beatsPerMeasure );
|
||||||
fDestinationBeat -= (float)beatsPerMeasure;
|
fDestinationBeat -= (float)beatsPerMeasure;
|
||||||
ScrollTo( fDestinationBeat );
|
ScrollTo( fDestinationBeat );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EDIT_BUTTON_SCROLL_NEXT:
|
case EDIT_BUTTON_SCROLL_NEXT:
|
||||||
{
|
{
|
||||||
int iRow = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
int iRow = BeatToNoteRow( GAMESTATE->m_Position.m_fSongBeat );
|
||||||
NoteDataUtil::GetNextEditorPosition( m_NoteDataEdit, iRow );
|
NoteDataUtil::GetNextEditorPosition( m_NoteDataEdit, iRow );
|
||||||
ScrollTo( NoteRowToBeat(iRow) );
|
ScrollTo( NoteRowToBeat(iRow) );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EDIT_BUTTON_SCROLL_PREV:
|
case EDIT_BUTTON_SCROLL_PREV:
|
||||||
{
|
{
|
||||||
int iRow = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
int iRow = BeatToNoteRow( GAMESTATE->m_Position.m_fSongBeat );
|
||||||
NoteDataUtil::GetPrevEditorPosition( m_NoteDataEdit, iRow );
|
NoteDataUtil::GetPrevEditorPosition( m_NoteDataEdit, iRow );
|
||||||
ScrollTo( NoteRowToBeat(iRow) );
|
ScrollTo( NoteRowToBeat(iRow) );
|
||||||
}
|
}
|
||||||
@@ -1444,13 +1446,13 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
case EDIT_BUTTON_LABEL_NEXT:
|
case EDIT_BUTTON_LABEL_NEXT:
|
||||||
{
|
{
|
||||||
ScrollTo( GAMESTATE->m_pCurSong->m_SongTiming.
|
ScrollTo( GAMESTATE->m_pCurSong->m_SongTiming.
|
||||||
GetNextLabelSegmentBeatAtBeat( GAMESTATE->m_fSongBeat ) );
|
GetNextLabelSegmentBeatAtBeat( GAMESTATE->m_Position.m_fSongBeat ) );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EDIT_BUTTON_LABEL_PREV:
|
case EDIT_BUTTON_LABEL_PREV:
|
||||||
{
|
{
|
||||||
ScrollTo( GAMESTATE->m_pCurSong->m_SongTiming.
|
ScrollTo( GAMESTATE->m_pCurSong->m_SongTiming.
|
||||||
GetPreviousLabelSegmentBeatAtBeat( GAMESTATE->m_fSongBeat ) );
|
GetPreviousLabelSegmentBeatAtBeat( GAMESTATE->m_Position.m_fSongBeat ) );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EDIT_BUTTON_SNAP_NEXT:
|
case EDIT_BUTTON_SNAP_NEXT:
|
||||||
@@ -1463,11 +1465,11 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
break;
|
break;
|
||||||
case EDIT_BUTTON_LAY_SELECT:
|
case EDIT_BUTTON_LAY_SELECT:
|
||||||
{
|
{
|
||||||
const int iCurrentRow = BeatToNoteRow(GAMESTATE->m_fSongBeat);
|
const int iCurrentRow = BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat);
|
||||||
if( m_NoteFieldEdit.m_iBeginMarker==-1 && m_NoteFieldEdit.m_iEndMarker==-1 )
|
if( m_NoteFieldEdit.m_iBeginMarker==-1 && m_NoteFieldEdit.m_iEndMarker==-1 )
|
||||||
{
|
{
|
||||||
// lay begin marker
|
// lay begin marker
|
||||||
m_NoteFieldEdit.m_iBeginMarker = BeatToNoteRow(GAMESTATE->m_fSongBeat);
|
m_NoteFieldEdit.m_iBeginMarker = BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat);
|
||||||
}
|
}
|
||||||
else if( m_NoteFieldEdit.m_iEndMarker==-1 ) // only begin marker is laid
|
else if( m_NoteFieldEdit.m_iEndMarker==-1 ) // only begin marker is laid
|
||||||
{
|
{
|
||||||
@@ -1579,7 +1581,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
case EDIT_BUTTON_BPM_UP:
|
case EDIT_BUTTON_BPM_UP:
|
||||||
case EDIT_BUTTON_BPM_DOWN:
|
case EDIT_BUTTON_BPM_DOWN:
|
||||||
{
|
{
|
||||||
float fBPM = m_pSteps->m_Timing.GetBPMAtBeat( GAMESTATE->m_fSongBeat );
|
float fBPM = m_pSteps->m_Timing.GetBPMAtBeat( GAMESTATE->m_Position.m_fSongBeat );
|
||||||
float fDelta;
|
float fDelta;
|
||||||
switch( EditB )
|
switch( EditB )
|
||||||
{
|
{
|
||||||
@@ -1600,7 +1602,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
}
|
}
|
||||||
|
|
||||||
float fNewBPM = fBPM + fDelta;
|
float fNewBPM = fBPM + fDelta;
|
||||||
m_pSteps->m_Timing.SetBPMAtBeat( GAMESTATE->m_fSongBeat, fNewBPM );
|
m_pSteps->m_Timing.SetBPMAtBeat( GAMESTATE->m_Position.m_fSongBeat, fNewBPM );
|
||||||
(fDelta>0 ? m_soundValueIncrease : m_soundValueDecrease).Play();
|
(fDelta>0 ? m_soundValueIncrease : m_soundValueDecrease).Play();
|
||||||
SetDirty( true );
|
SetDirty( true );
|
||||||
}
|
}
|
||||||
@@ -1629,7 +1631,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
for( i=0; i<m_pSteps->m_Timing.m_StopSegments.size(); i++ )
|
for( i=0; i<m_pSteps->m_Timing.m_StopSegments.size(); i++ )
|
||||||
{
|
{
|
||||||
if( m_pSteps->m_Timing.m_StopSegments[i].m_iStartRow == BeatToNoteRow(GAMESTATE->m_fSongBeat) )
|
if( m_pSteps->m_Timing.m_StopSegments[i].m_iStartRow == BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat) )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1637,7 +1639,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
{
|
{
|
||||||
// create a new StopSegment
|
// create a new StopSegment
|
||||||
if( fDelta > 0 )
|
if( fDelta > 0 )
|
||||||
m_pSteps->m_Timing.AddStopSegment( StopSegment(BeatToNoteRow(GAMESTATE->m_fSongBeat), fDelta) );
|
m_pSteps->m_Timing.AddStopSegment( StopSegment(BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat), fDelta) );
|
||||||
}
|
}
|
||||||
else // StopSegment being modified is m_SongTiming.m_StopSegments[i]
|
else // StopSegment being modified is m_SongTiming.m_StopSegments[i]
|
||||||
{
|
{
|
||||||
@@ -1675,7 +1677,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
for( i=0; i<m_pSteps->m_Timing.m_StopSegments.size(); i++ )
|
for( i=0; i<m_pSteps->m_Timing.m_StopSegments.size(); i++ )
|
||||||
{
|
{
|
||||||
if( m_pSteps->m_Timing.m_StopSegments[i].m_iStartRow == BeatToNoteRow(GAMESTATE->m_fSongBeat) )
|
if( m_pSteps->m_Timing.m_StopSegments[i].m_iStartRow == BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat) )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1683,7 +1685,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
{
|
{
|
||||||
// create a new delay segment
|
// create a new delay segment
|
||||||
if( fDelta > 0 )
|
if( fDelta > 0 )
|
||||||
m_pSong->AddStopSegment( StopSegment(BeatToNoteRow(GAMESTATE->m_fSongBeat), fDelta, true) );
|
m_pSong->AddStopSegment( StopSegment(BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat), fDelta, true) );
|
||||||
}
|
}
|
||||||
else // delay segment being modified is m_SongTiming.m_StopSegments[i]
|
else // delay segment being modified is m_SongTiming.m_StopSegments[i]
|
||||||
{
|
{
|
||||||
@@ -1807,7 +1809,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
BackgroundChange bgChange;
|
BackgroundChange bgChange;
|
||||||
FOREACH( BackgroundChange, m_pSong->GetBackgroundChanges(g_CurrentBGChangeLayer), bgc )
|
FOREACH( BackgroundChange, m_pSong->GetBackgroundChanges(g_CurrentBGChangeLayer), bgc )
|
||||||
{
|
{
|
||||||
if( bgc->m_fStartBeat == GAMESTATE->m_fSongBeat )
|
if( bgc->m_fStartBeat == GAMESTATE->m_Position.m_fSongBeat )
|
||||||
{
|
{
|
||||||
bAlreadyBGChangeHere = true;
|
bAlreadyBGChangeHere = true;
|
||||||
bgChange = *bgc;
|
bgChange = *bgc;
|
||||||
@@ -1900,7 +1902,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
if( pCourse == NULL )
|
if( pCourse == NULL )
|
||||||
break;
|
break;
|
||||||
CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex];
|
CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex];
|
||||||
float fStartTime = m_pSteps->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_fSongBeat );
|
float fStartTime = m_pSteps->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_Position.m_fSongBeat );
|
||||||
int iAttack = FindAttackAtTime( ce.attacks, fStartTime );
|
int iAttack = FindAttackAtTime( ce.attacks, fStartTime );
|
||||||
|
|
||||||
if( iAttack >= 0 )
|
if( iAttack >= 0 )
|
||||||
@@ -1974,10 +1976,10 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
bool bAlreadyBGChangeHere = false;
|
bool bAlreadyBGChangeHere = false;
|
||||||
BackgroundLayer iLayer = BACKGROUND_LAYER_1;
|
BackgroundLayer iLayer = BACKGROUND_LAYER_1;
|
||||||
BackgroundChange bgChange;
|
BackgroundChange bgChange;
|
||||||
bgChange.m_fStartBeat = GAMESTATE->m_fSongBeat;
|
bgChange.m_fStartBeat = GAMESTATE->m_Position.m_fSongBeat;
|
||||||
FOREACH( BackgroundChange, m_pSong->GetBackgroundChanges(iLayer), bgc )
|
FOREACH( BackgroundChange, m_pSong->GetBackgroundChanges(iLayer), bgc )
|
||||||
{
|
{
|
||||||
if( bgc->m_fStartBeat == GAMESTATE->m_fSongBeat )
|
if( bgc->m_fStartBeat == GAMESTATE->m_Position.m_fSongBeat )
|
||||||
{
|
{
|
||||||
bAlreadyBGChangeHere = true;
|
bAlreadyBGChangeHere = true;
|
||||||
bgChange = *bgc;
|
bgChange = *bgc;
|
||||||
@@ -2012,12 +2014,12 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
{
|
{
|
||||||
if( g_iDefaultRecordLength.Get() == -1 )
|
if( g_iDefaultRecordLength.Get() == -1 )
|
||||||
{
|
{
|
||||||
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat);
|
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat);
|
||||||
m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() + 1 );
|
m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() + 1 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_iStartPlayingAt = BeatToNoteRow( ftruncf(GAMESTATE->m_fSongBeat, g_iDefaultRecordLength.Get()) );
|
m_iStartPlayingAt = BeatToNoteRow( ftruncf(GAMESTATE->m_Position.m_fSongBeat, g_iDefaultRecordLength.Get()) );
|
||||||
m_iStopPlayingAt = m_iStartPlayingAt + BeatToNoteRow( g_iDefaultRecordLength.Get() );
|
m_iStopPlayingAt = m_iStartPlayingAt + BeatToNoteRow( g_iDefaultRecordLength.Get() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2034,7 +2036,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EDIT_BUTTON_RECORD_FROM_CURSOR:
|
case EDIT_BUTTON_RECORD_FROM_CURSOR:
|
||||||
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat);
|
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat);
|
||||||
m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() );
|
m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() );
|
||||||
TransitionEditState( STATE_RECORDING );
|
TransitionEditState( STATE_RECORDING );
|
||||||
break;
|
break;
|
||||||
@@ -2103,7 +2105,7 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add a tap
|
// Add a tap
|
||||||
float fBeat = GAMESTATE->m_fSongBeat;
|
float fBeat = GAMESTATE->m_Position.m_fSongBeat;
|
||||||
fBeat = Quantize( fBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
|
fBeat = Quantize( fBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
|
||||||
|
|
||||||
const int iRow = BeatToNoteRow( fBeat );
|
const int iRow = BeatToNoteRow( fBeat );
|
||||||
@@ -2239,7 +2241,7 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
|
|||||||
{
|
{
|
||||||
case EDIT_BUTTON_RETURN_TO_EDIT:
|
case EDIT_BUTTON_RETURN_TO_EDIT:
|
||||||
/* When exiting play mode manually, leave the cursor where it is. */
|
/* When exiting play mode manually, leave the cursor where it is. */
|
||||||
m_fBeatToReturnTo = GAMESTATE->m_fSongBeat;
|
m_fBeatToReturnTo = GAMESTATE->m_Position.m_fSongBeat;
|
||||||
TransitionEditState( STATE_EDITING );
|
TransitionEditState( STATE_EDITING );
|
||||||
break;
|
break;
|
||||||
case EDIT_BUTTON_OFFSET_UP:
|
case EDIT_BUTTON_OFFSET_UP:
|
||||||
@@ -2310,7 +2312,7 @@ void ScreenEdit::TransitionEditState( EditState em )
|
|||||||
{
|
{
|
||||||
case STATE_EDITING:
|
case STATE_EDITING:
|
||||||
// If exiting EDIT mode, save the cursor position.
|
// If exiting EDIT mode, save the cursor position.
|
||||||
m_fBeatToReturnTo = GAMESTATE->m_fSongBeat;
|
m_fBeatToReturnTo = GAMESTATE->m_Position.m_fSongBeat;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_PLAYING:
|
case STATE_PLAYING:
|
||||||
@@ -2363,14 +2365,14 @@ void ScreenEdit::TransitionEditState( EditState em )
|
|||||||
m_Foreground.Unload();
|
m_Foreground.Unload();
|
||||||
|
|
||||||
// Restore the cursor position.
|
// Restore the cursor position.
|
||||||
GAMESTATE->m_fSongBeat = m_fBeatToReturnTo;
|
GAMESTATE->m_Position.m_fSongBeat = m_fBeatToReturnTo;
|
||||||
|
|
||||||
// Make sure we're snapped.
|
// Make sure we're snapped.
|
||||||
GAMESTATE->m_fSongBeat = Quantize( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
|
GAMESTATE->m_Position.m_fSongBeat = Quantize( GAMESTATE->m_Position.m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
|
||||||
|
|
||||||
/* Playing and recording have lead-ins, which may start before beat 0;
|
/* Playing and recording have lead-ins, which may start before beat 0;
|
||||||
* make sure we don't stay there if we escaped out early. */
|
* make sure we don't stay there if we escaped out early. */
|
||||||
GAMESTATE->m_fSongBeat = max( GAMESTATE->m_fSongBeat, 0 );
|
GAMESTATE->m_Position.m_fSongBeat = max( GAMESTATE->m_Position.m_fSongBeat, 0 );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2463,7 +2465,7 @@ void ScreenEdit::TransitionEditState( EditState em )
|
|||||||
{
|
{
|
||||||
case STATE_PLAYING:
|
case STATE_PLAYING:
|
||||||
case STATE_RECORDING:
|
case STATE_RECORDING:
|
||||||
const float fStartSeconds = m_pSteps->m_Timing.GetElapsedTimeFromBeat(GAMESTATE->m_fSongBeat);
|
const float fStartSeconds = m_pSteps->m_Timing.GetElapsedTimeFromBeat(GAMESTATE->m_Position.m_fSongBeat);
|
||||||
LOG->Trace( "Starting playback at %f", fStartSeconds );
|
LOG->Trace( "Starting playback at %f", fStartSeconds );
|
||||||
|
|
||||||
RageSoundParams p;
|
RageSoundParams p;
|
||||||
@@ -2483,11 +2485,11 @@ void ScreenEdit::ScrollTo( float fDestinationBeat )
|
|||||||
CLAMP( fDestinationBeat, 0, GetMaximumBeatForMoving() );
|
CLAMP( fDestinationBeat, 0, GetMaximumBeatForMoving() );
|
||||||
|
|
||||||
// Don't play the sound and do the hold note logic below if our position didn't change.
|
// Don't play the sound and do the hold note logic below if our position didn't change.
|
||||||
const float fOriginalBeat = GAMESTATE->m_fSongBeat;
|
const float fOriginalBeat = GAMESTATE->m_Position.m_fSongBeat;
|
||||||
if( fOriginalBeat == fDestinationBeat )
|
if( fOriginalBeat == fDestinationBeat )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GAMESTATE->m_fSongBeat = fDestinationBeat;
|
GAMESTATE->m_Position.m_fSongBeat = fDestinationBeat;
|
||||||
|
|
||||||
// check to see if they're holding a button
|
// check to see if they're holding a button
|
||||||
for( int n=0; n<NUM_EDIT_BUTTON_COLUMNS; n++ )
|
for( int n=0; n<NUM_EDIT_BUTTON_COLUMNS; n++ )
|
||||||
@@ -2627,21 +2629,21 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
{
|
{
|
||||||
float fBPM = StringToFloat( ScreenTextEntry::s_sLastAnswer );
|
float fBPM = StringToFloat( ScreenTextEntry::s_sLastAnswer );
|
||||||
if( fBPM > 0 )
|
if( fBPM > 0 )
|
||||||
m_pSteps->m_Timing.SetBPMAtBeat( GAMESTATE->m_fSongBeat, fBPM );
|
m_pSteps->m_Timing.SetBPMAtBeat( GAMESTATE->m_Position.m_fSongBeat, fBPM );
|
||||||
SetDirty( true );
|
SetDirty( true );
|
||||||
}
|
}
|
||||||
else if( SM == SM_BackFromStopChange )
|
else if( SM == SM_BackFromStopChange )
|
||||||
{
|
{
|
||||||
float fStop = StringToFloat( ScreenTextEntry::s_sLastAnswer );
|
float fStop = StringToFloat( ScreenTextEntry::s_sLastAnswer );
|
||||||
if( fStop >= 0 )
|
if( fStop >= 0 )
|
||||||
m_pSteps->m_Timing.SetStopAtBeat( GAMESTATE->m_fSongBeat, fStop );
|
m_pSteps->m_Timing.SetStopAtBeat( GAMESTATE->m_Position.m_fSongBeat, fStop );
|
||||||
SetDirty( true );
|
SetDirty( true );
|
||||||
}
|
}
|
||||||
else if( SM == SM_BackFromDelayChange )
|
else if( SM == SM_BackFromDelayChange )
|
||||||
{
|
{
|
||||||
float fDelay = StringToFloat( ScreenTextEntry::s_sLastAnswer );
|
float fDelay = StringToFloat( ScreenTextEntry::s_sLastAnswer );
|
||||||
if( fDelay >= 0 )
|
if( fDelay >= 0 )
|
||||||
m_pSteps->m_Timing.SetStopAtBeat( GAMESTATE->m_fSongBeat, fDelay, true );
|
m_pSteps->m_Timing.SetStopAtBeat( GAMESTATE->m_Position.m_fSongBeat, fDelay, true );
|
||||||
SetDirty( true );
|
SetDirty( true );
|
||||||
}
|
}
|
||||||
else if( SM == SM_BackFromTimeSignatureNumeratorChange )
|
else if( SM == SM_BackFromTimeSignatureNumeratorChange )
|
||||||
@@ -2649,7 +2651,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
int iNum = atoi( ScreenTextEntry::s_sLastAnswer );
|
int iNum = atoi( ScreenTextEntry::s_sLastAnswer );
|
||||||
if( iNum > 0 )
|
if( iNum > 0 )
|
||||||
{
|
{
|
||||||
m_pSteps->m_Timing.SetTimeSignatureNumeratorAtBeat( GAMESTATE->m_fSongBeat, iNum );
|
m_pSteps->m_Timing.SetTimeSignatureNumeratorAtBeat( GAMESTATE->m_Position.m_fSongBeat, iNum );
|
||||||
}
|
}
|
||||||
SetDirty( true );
|
SetDirty( true );
|
||||||
}
|
}
|
||||||
@@ -2658,7 +2660,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
int iDen = atoi( ScreenTextEntry::s_sLastAnswer );
|
int iDen = atoi( ScreenTextEntry::s_sLastAnswer );
|
||||||
if( iDen > 0)
|
if( iDen > 0)
|
||||||
{
|
{
|
||||||
m_pSteps->m_Timing.SetTimeSignatureDenominatorAtBeat( GAMESTATE->m_fSongBeat, iDen );
|
m_pSteps->m_Timing.SetTimeSignatureDenominatorAtBeat( GAMESTATE->m_Position.m_fSongBeat, iDen );
|
||||||
}
|
}
|
||||||
SetDirty( true );
|
SetDirty( true );
|
||||||
}
|
}
|
||||||
@@ -2667,7 +2669,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
int iTick = atoi( ScreenTextEntry::s_sLastAnswer );
|
int iTick = atoi( ScreenTextEntry::s_sLastAnswer );
|
||||||
if ( iTick >= 0 && iTick <= ROWS_PER_BEAT )
|
if ( iTick >= 0 && iTick <= ROWS_PER_BEAT )
|
||||||
{
|
{
|
||||||
m_pSteps->m_Timing.SetTickcountAtBeat( GAMESTATE->m_fSongBeat, iTick );
|
m_pSteps->m_Timing.SetTickcountAtBeat( GAMESTATE->m_Position.m_fSongBeat, iTick );
|
||||||
}
|
}
|
||||||
SetDirty( true );
|
SetDirty( true );
|
||||||
}
|
}
|
||||||
@@ -2676,7 +2678,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
int iCombo = atoi( ScreenTextEntry::s_sLastAnswer );
|
int iCombo = atoi( ScreenTextEntry::s_sLastAnswer );
|
||||||
if ( iCombo >= 0 )
|
if ( iCombo >= 0 )
|
||||||
{
|
{
|
||||||
m_pSteps->m_Timing.SetComboAtBeat( GAMESTATE->m_fSongBeat, iCombo );
|
m_pSteps->m_Timing.SetComboAtBeat( GAMESTATE->m_Position.m_fSongBeat, iCombo );
|
||||||
}
|
}
|
||||||
SetDirty( true );
|
SetDirty( true );
|
||||||
}
|
}
|
||||||
@@ -2687,14 +2689,14 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
{
|
{
|
||||||
sLabel.Replace("=", "_");
|
sLabel.Replace("=", "_");
|
||||||
sLabel.Replace(",", "_");
|
sLabel.Replace(",", "_");
|
||||||
m_pSteps->m_Timing.SetLabelAtBeat( GAMESTATE->m_fSongBeat, sLabel );
|
m_pSteps->m_Timing.SetLabelAtBeat( GAMESTATE->m_Position.m_fSongBeat, sLabel );
|
||||||
SetDirty( true );
|
SetDirty( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( SM == SM_BackFromWarpChange )
|
else if ( SM == SM_BackFromWarpChange )
|
||||||
{
|
{
|
||||||
float fWarp = StringToFloat( ScreenTextEntry::s_sLastAnswer );
|
float fWarp = StringToFloat( ScreenTextEntry::s_sLastAnswer );
|
||||||
m_pSteps->m_Timing.SetWarpAtBeat( GAMESTATE->m_fSongBeat, fWarp );
|
m_pSteps->m_Timing.SetWarpAtBeat( GAMESTATE->m_Position.m_fSongBeat, fWarp );
|
||||||
SetDirty( true );
|
SetDirty( true );
|
||||||
}
|
}
|
||||||
else if( SM == SM_BackFromBGChange )
|
else if( SM == SM_BackFromBGChange )
|
||||||
@@ -2745,7 +2747,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
{
|
{
|
||||||
PlayerOptions poChosen = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.GetPreferred();
|
PlayerOptions poChosen = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.GetPreferred();
|
||||||
RString sMods = poChosen.GetString();
|
RString sMods = poChosen.GetString();
|
||||||
const int row = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
const int row = BeatToNoteRow( GAMESTATE->m_Position.m_fSongBeat );
|
||||||
|
|
||||||
TapNote tn(
|
TapNote tn(
|
||||||
TapNote::attack,
|
TapNote::attack,
|
||||||
@@ -2767,7 +2769,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex];
|
CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex];
|
||||||
int iAttack;
|
int iAttack;
|
||||||
|
|
||||||
g_fLastInsertAttackPositionSeconds = m_pSteps->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_fSongBeat );
|
g_fLastInsertAttackPositionSeconds = m_pSteps->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_Position.m_fSongBeat );
|
||||||
g_fLastInsertAttackDurationSeconds = StringToFloat( g_InsertCourseAttack.rows[0].choices[iDurationChoice] );
|
g_fLastInsertAttackDurationSeconds = StringToFloat( g_InsertCourseAttack.rows[0].choices[iDurationChoice] );
|
||||||
iAttack = FindAttackAtTime( ce.attacks, g_fLastInsertAttackPositionSeconds );
|
iAttack = FindAttackAtTime( ce.attacks, g_fLastInsertAttackPositionSeconds );
|
||||||
|
|
||||||
@@ -2922,12 +2924,12 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
{
|
{
|
||||||
/* When another screen comes up, RageSounds takes over the sound timer. When we come
|
/* When another screen comes up, RageSounds takes over the sound timer. When we come
|
||||||
* back, put the timer back to where it was. */
|
* back, put the timer back to where it was. */
|
||||||
GAMESTATE->m_fSongBeat = m_fTrailingBeat;
|
GAMESTATE->m_Position.m_fSongBeat = m_fTrailingBeat;
|
||||||
}
|
}
|
||||||
else if( SM == SM_LoseFocus )
|
else if( SM == SM_LoseFocus )
|
||||||
{
|
{
|
||||||
// Snap the trailing beat, in case we lose focus while tweening.
|
// Snap the trailing beat, in case we lose focus while tweening.
|
||||||
m_fTrailingBeat = GAMESTATE->m_fSongBeat;
|
m_fTrailingBeat = GAMESTATE->m_Position.m_fSongBeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenWithMenuElements::HandleScreenMessage( SM );
|
ScreenWithMenuElements::HandleScreenMessage( SM );
|
||||||
@@ -2938,10 +2940,10 @@ void ScreenEdit::OnSnapModeChange()
|
|||||||
m_soundChangeSnap.Play();
|
m_soundChangeSnap.Play();
|
||||||
|
|
||||||
NoteType nt = m_SnapDisplay.GetNoteType();
|
NoteType nt = m_SnapDisplay.GetNoteType();
|
||||||
int iStepIndex = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
int iStepIndex = BeatToNoteRow( GAMESTATE->m_Position.m_fSongBeat );
|
||||||
int iElementsPerNoteType = BeatToNoteRow( NoteTypeToBeat(nt) );
|
int iElementsPerNoteType = BeatToNoteRow( NoteTypeToBeat(nt) );
|
||||||
int iStepIndexHangover = iStepIndex % iElementsPerNoteType;
|
int iStepIndexHangover = iStepIndex % iElementsPerNoteType;
|
||||||
GAMESTATE->m_fSongBeat -= NoteRowToBeat( iStepIndexHangover );
|
GAMESTATE->m_Position.m_fSongBeat -= NoteRowToBeat( iStepIndexHangover );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3088,14 +3090,14 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
|
|||||||
break;
|
break;
|
||||||
case play_current_beat_to_end:
|
case play_current_beat_to_end:
|
||||||
{
|
{
|
||||||
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat);
|
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat);
|
||||||
m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() );
|
m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() );
|
||||||
TransitionEditState( STATE_PLAYING );
|
TransitionEditState( STATE_PLAYING );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case set_selection_start:
|
case set_selection_start:
|
||||||
{
|
{
|
||||||
const int iCurrentRow = BeatToNoteRow(GAMESTATE->m_fSongBeat);
|
const int iCurrentRow = BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat);
|
||||||
if( m_NoteFieldEdit.m_iEndMarker!=-1 && iCurrentRow >= m_NoteFieldEdit.m_iEndMarker )
|
if( m_NoteFieldEdit.m_iEndMarker!=-1 && iCurrentRow >= m_NoteFieldEdit.m_iEndMarker )
|
||||||
{
|
{
|
||||||
SCREENMAN->PlayInvalidSound();
|
SCREENMAN->PlayInvalidSound();
|
||||||
@@ -3109,7 +3111,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
|
|||||||
break;
|
break;
|
||||||
case set_selection_end:
|
case set_selection_end:
|
||||||
{
|
{
|
||||||
const int iCurrentRow = BeatToNoteRow(GAMESTATE->m_fSongBeat);
|
const int iCurrentRow = BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat);
|
||||||
if( m_NoteFieldEdit.m_iBeginMarker!=-1 && iCurrentRow <= m_NoteFieldEdit.m_iBeginMarker )
|
if( m_NoteFieldEdit.m_iBeginMarker!=-1 && iCurrentRow <= m_NoteFieldEdit.m_iBeginMarker )
|
||||||
{
|
{
|
||||||
SCREENMAN->PlayInvalidSound();
|
SCREENMAN->PlayInvalidSound();
|
||||||
@@ -3256,7 +3258,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
|
|||||||
case edit_timing_data:
|
case edit_timing_data:
|
||||||
{
|
{
|
||||||
TimingData pTime = m_pSteps->m_Timing;
|
TimingData pTime = m_pSteps->m_Timing;
|
||||||
const float fBeat = pTime.GetBeatFromElapsedTime(GAMESTATE->m_fMusicSeconds);
|
const float fBeat = GAMESTATE->m_Position.m_fSongBeat;
|
||||||
g_TimingDataInformation.rows[bpm].SetOneUnthemedChoice( ssprintf("%.5f", pTime.GetBPMAtBeat( fBeat ) ) );
|
g_TimingDataInformation.rows[bpm].SetOneUnthemedChoice( ssprintf("%.5f", pTime.GetBPMAtBeat( fBeat ) ) );
|
||||||
g_TimingDataInformation.rows[stop].SetOneUnthemedChoice( ssprintf("%.5f", pTime.GetStopAtBeat( fBeat ) ) ) ;
|
g_TimingDataInformation.rows[stop].SetOneUnthemedChoice( ssprintf("%.5f", pTime.GetStopAtBeat( fBeat ) ) ) ;
|
||||||
g_TimingDataInformation.rows[delay].SetOneUnthemedChoice( ssprintf("%.5f", pTime.GetDelayAtBeat( fBeat ) ) );
|
g_TimingDataInformation.rows[delay].SetOneUnthemedChoice( ssprintf("%.5f", pTime.GetDelayAtBeat( fBeat ) ) );
|
||||||
@@ -3361,7 +3363,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector<int> &iAns
|
|||||||
{
|
{
|
||||||
DEFAULT_FAIL( c );
|
DEFAULT_FAIL( c );
|
||||||
case paste_at_current_beat:
|
case paste_at_current_beat:
|
||||||
iDestFirstRow = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
iDestFirstRow = BeatToNoteRow( GAMESTATE->m_Position.m_fSongBeat );
|
||||||
break;
|
break;
|
||||||
case paste_at_begin_marker:
|
case paste_at_begin_marker:
|
||||||
ASSERT( m_NoteFieldEdit.m_iBeginMarker!=-1 );
|
ASSERT( m_NoteFieldEdit.m_iBeginMarker!=-1 );
|
||||||
@@ -3539,16 +3541,16 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector<int> &iAns
|
|||||||
TransitionEditState( STATE_RECORDING );
|
TransitionEditState( STATE_RECORDING );
|
||||||
break;
|
break;
|
||||||
case insert_and_shift:
|
case insert_and_shift:
|
||||||
NoteDataUtil::InsertRows( m_NoteDataEdit, BeatToNoteRow(GAMESTATE->m_fSongBeat), BeatToNoteRow(1) );
|
NoteDataUtil::InsertRows( m_NoteDataEdit, BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat), BeatToNoteRow(1) );
|
||||||
break;
|
break;
|
||||||
case delete_and_shift:
|
case delete_and_shift:
|
||||||
NoteDataUtil::DeleteRows( m_NoteDataEdit, BeatToNoteRow(GAMESTATE->m_fSongBeat), BeatToNoteRow(1) );
|
NoteDataUtil::DeleteRows( m_NoteDataEdit, BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat), BeatToNoteRow(1) );
|
||||||
break;
|
break;
|
||||||
case shift_pauses_forward:
|
case shift_pauses_forward:
|
||||||
m_pSteps->m_Timing.InsertRows( BeatToNoteRow(GAMESTATE->m_fSongBeat), BeatToNoteRow(1) );
|
m_pSteps->m_Timing.InsertRows( BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat), BeatToNoteRow(1) );
|
||||||
break;
|
break;
|
||||||
case shift_pauses_backward:
|
case shift_pauses_backward:
|
||||||
m_pSteps->m_Timing.DeleteRows( BeatToNoteRow(GAMESTATE->m_fSongBeat), BeatToNoteRow(1) );
|
m_pSteps->m_Timing.DeleteRows( BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat), BeatToNoteRow(1) );
|
||||||
break;
|
break;
|
||||||
case convert_to_pause:
|
case convert_to_pause:
|
||||||
{
|
{
|
||||||
@@ -3576,14 +3578,14 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector<int> &iAns
|
|||||||
case convert_pause_to_beat:
|
case convert_pause_to_beat:
|
||||||
{
|
{
|
||||||
// TODO: Convert both Delays and Stops at once.
|
// TODO: Convert both Delays and Stops at once.
|
||||||
float fStopSeconds = m_pSteps->m_Timing.GetStopAtRow( BeatToNoteRow(GAMESTATE->m_fSongBeat) );
|
float fStopSeconds = m_pSteps->m_Timing.GetStopAtRow( BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat) );
|
||||||
m_pSteps->m_Timing.SetStopAtBeat( GAMESTATE->m_fSongBeat, 0 );
|
m_pSteps->m_Timing.SetStopAtBeat( GAMESTATE->m_Position.m_fSongBeat, 0 );
|
||||||
|
|
||||||
float fStopBeats = fStopSeconds * m_pSteps->m_Timing.GetBPMAtBeat(GAMESTATE->m_fSongBeat) / 60;
|
float fStopBeats = fStopSeconds * m_pSteps->m_Timing.GetBPMAtBeat(GAMESTATE->m_Position.m_fSongBeat) / 60;
|
||||||
|
|
||||||
// don't move the step from where it is, just move everything later
|
// don't move the step from where it is, just move everything later
|
||||||
NoteDataUtil::InsertRows( m_NoteDataEdit, BeatToNoteRow(GAMESTATE->m_fSongBeat) + 1, BeatToNoteRow(fStopBeats) );
|
NoteDataUtil::InsertRows( m_NoteDataEdit, BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat) + 1, BeatToNoteRow(fStopBeats) );
|
||||||
m_pSteps->m_Timing.InsertRows( BeatToNoteRow(GAMESTATE->m_fSongBeat) + 1, BeatToNoteRow(fStopBeats) );
|
m_pSteps->m_Timing.InsertRows( BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat) + 1, BeatToNoteRow(fStopBeats) );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case undo:
|
case undo:
|
||||||
@@ -3749,7 +3751,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice
|
|||||||
ScreenTextEntry::TextEntry(
|
ScreenTextEntry::TextEntry(
|
||||||
SM_BackFromBPMChange,
|
SM_BackFromBPMChange,
|
||||||
ENTER_BPM_VALUE,
|
ENTER_BPM_VALUE,
|
||||||
ssprintf( "%.4f", m_pSteps->m_Timing.GetBPMAtBeat(GAMESTATE->m_fSongBeat) ),
|
ssprintf( "%.4f", m_pSteps->m_Timing.GetBPMAtBeat(GAMESTATE->m_Position.m_fSongBeat) ),
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -3757,7 +3759,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice
|
|||||||
ScreenTextEntry::TextEntry(
|
ScreenTextEntry::TextEntry(
|
||||||
SM_BackFromStopChange,
|
SM_BackFromStopChange,
|
||||||
ENTER_STOP_VALUE,
|
ENTER_STOP_VALUE,
|
||||||
ssprintf( "%.4f", m_pSteps->m_Timing.GetStopAtRow( BeatToNoteRow(GAMESTATE->m_fSongBeat) ) ),
|
ssprintf( "%.4f", m_pSteps->m_Timing.GetStopAtRow( BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat) ) ),
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -3765,7 +3767,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice
|
|||||||
ScreenTextEntry::TextEntry(
|
ScreenTextEntry::TextEntry(
|
||||||
SM_BackFromDelayChange,
|
SM_BackFromDelayChange,
|
||||||
ENTER_DELAY_VALUE,
|
ENTER_DELAY_VALUE,
|
||||||
ssprintf( "%.4f", m_pSteps->m_Timing.GetDelayAtRow( BeatToNoteRow(GAMESTATE->m_fSongBeat) ) ),
|
ssprintf( "%.4f", m_pSteps->m_Timing.GetDelayAtRow( BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat) ) ),
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -3773,7 +3775,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice
|
|||||||
ScreenTextEntry::TextEntry(
|
ScreenTextEntry::TextEntry(
|
||||||
SM_BackFromTimeSignatureNumeratorChange,
|
SM_BackFromTimeSignatureNumeratorChange,
|
||||||
ENTER_TIME_SIGNATURE_NUMERATOR_VALUE,
|
ENTER_TIME_SIGNATURE_NUMERATOR_VALUE,
|
||||||
ssprintf( "%d", m_pSteps->m_Timing.GetTimeSignatureSegmentAtBeat( GAMESTATE->m_fSongBeat ).m_iNumerator ),
|
ssprintf( "%d", m_pSteps->m_Timing.GetTimeSignatureSegmentAtBeat( GAMESTATE->m_Position.m_fSongBeat ).m_iNumerator ),
|
||||||
3
|
3
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -3781,7 +3783,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice
|
|||||||
ScreenTextEntry::TextEntry(
|
ScreenTextEntry::TextEntry(
|
||||||
SM_BackFromTimeSignatureDenominatorChange,
|
SM_BackFromTimeSignatureDenominatorChange,
|
||||||
ENTER_TIME_SIGNATURE_DENOMINATOR_VALUE,
|
ENTER_TIME_SIGNATURE_DENOMINATOR_VALUE,
|
||||||
ssprintf( "%d", m_pSteps->m_Timing.GetTimeSignatureSegmentAtBeat( GAMESTATE->m_fSongBeat ).m_iDenominator ),
|
ssprintf( "%d", m_pSteps->m_Timing.GetTimeSignatureSegmentAtBeat( GAMESTATE->m_Position.m_fSongBeat ).m_iDenominator ),
|
||||||
3
|
3
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -3789,7 +3791,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice
|
|||||||
ScreenTextEntry::TextEntry(
|
ScreenTextEntry::TextEntry(
|
||||||
SM_BackFromTickcountChange,
|
SM_BackFromTickcountChange,
|
||||||
ENTER_TICKCOUNT_VALUE,
|
ENTER_TICKCOUNT_VALUE,
|
||||||
ssprintf( "%d", m_pSteps->m_Timing.GetTickcountAtBeat( GAMESTATE->m_fSongBeat ) ),
|
ssprintf( "%d", m_pSteps->m_Timing.GetTickcountAtBeat( GAMESTATE->m_Position.m_fSongBeat ) ),
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -3797,7 +3799,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice
|
|||||||
ScreenTextEntry::TextEntry(
|
ScreenTextEntry::TextEntry(
|
||||||
SM_BackFromComboChange,
|
SM_BackFromComboChange,
|
||||||
ENTER_COMBO_VALUE,
|
ENTER_COMBO_VALUE,
|
||||||
ssprintf( "%d", m_pSteps->m_Timing.GetComboAtBeat( GAMESTATE->m_fSongBeat ) ),
|
ssprintf( "%d", m_pSteps->m_Timing.GetComboAtBeat( GAMESTATE->m_Position.m_fSongBeat ) ),
|
||||||
4
|
4
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -3805,7 +3807,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice
|
|||||||
ScreenTextEntry::TextEntry(
|
ScreenTextEntry::TextEntry(
|
||||||
SM_BackFromLabelChange,
|
SM_BackFromLabelChange,
|
||||||
ENTER_LABEL_VALUE,
|
ENTER_LABEL_VALUE,
|
||||||
ssprintf( "%s", m_pSteps->m_Timing.GetLabelAtBeat( GAMESTATE->m_fSongBeat ).c_str() ),
|
ssprintf( "%s", m_pSteps->m_Timing.GetLabelAtBeat( GAMESTATE->m_Position.m_fSongBeat ).c_str() ),
|
||||||
64
|
64
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -3813,7 +3815,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice
|
|||||||
ScreenTextEntry::TextEntry(
|
ScreenTextEntry::TextEntry(
|
||||||
SM_BackFromWarpChange,
|
SM_BackFromWarpChange,
|
||||||
ENTER_WARP_VALUE,
|
ENTER_WARP_VALUE,
|
||||||
ssprintf( "%.4f", m_pSteps->m_Timing.GetWarpAtRow( BeatToNoteRow(GAMESTATE->m_fSongBeat) ) ),
|
ssprintf( "%.4f", m_pSteps->m_Timing.GetWarpAtRow( BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat) ) ),
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -3826,7 +3828,7 @@ void ScreenEdit::HandleBGChangeChoice( BGChangeChoice c, const vector<int> &iAns
|
|||||||
|
|
||||||
FOREACH( BackgroundChange, m_pSong->GetBackgroundChanges(g_CurrentBGChangeLayer), iter )
|
FOREACH( BackgroundChange, m_pSong->GetBackgroundChanges(g_CurrentBGChangeLayer), iter )
|
||||||
{
|
{
|
||||||
if( iter->m_fStartBeat == GAMESTATE->m_fSongBeat )
|
if( iter->m_fStartBeat == GAMESTATE->m_Position.m_fSongBeat )
|
||||||
{
|
{
|
||||||
newChange = *iter;
|
newChange = *iter;
|
||||||
// delete the old change. We'll add a new one below.
|
// delete the old change. We'll add a new one below.
|
||||||
@@ -3835,7 +3837,7 @@ void ScreenEdit::HandleBGChangeChoice( BGChangeChoice c, const vector<int> &iAns
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
newChange.m_fStartBeat = GAMESTATE->m_fSongBeat;
|
newChange.m_fStartBeat = GAMESTATE->m_Position.m_fSongBeat;
|
||||||
newChange.m_fRate = StringToFloat( g_BackgroundChange.rows[rate].choices[iAnswers[rate]] )/100.f;
|
newChange.m_fRate = StringToFloat( g_BackgroundChange.rows[rate].choices[iAnswers[rate]] )/100.f;
|
||||||
newChange.m_sTransition = iAnswers[transition] ? g_BackgroundChange.rows[transition].choices[iAnswers[transition]] : RString();
|
newChange.m_sTransition = iAnswers[transition] ? g_BackgroundChange.rows[transition].choices[iAnswers[transition]] : RString();
|
||||||
newChange.m_def.m_sEffect = iAnswers[effect] ? g_BackgroundChange.rows[effect].choices[iAnswers[effect]] : RString();
|
newChange.m_def.m_sEffect = iAnswers[effect] ? g_BackgroundChange.rows[effect].choices[iAnswers[effect]] : RString();
|
||||||
@@ -4020,7 +4022,7 @@ void ScreenEdit::CheckNumberOfNotesAndUndo()
|
|||||||
if( EDIT_MODE.GetValue() != EditMode_Home )
|
if( EDIT_MODE.GetValue() != EditMode_Home )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TimeSignatureSegment curTime = GAMESTATE->m_pCurSong->m_SongTiming.GetTimeSignatureSegmentAtBeat( GAMESTATE->m_fSongBeat );
|
TimeSignatureSegment curTime = GAMESTATE->m_pCurSong->m_SongTiming.GetTimeSignatureSegmentAtBeat( GAMESTATE->m_Position.m_fSongBeat );
|
||||||
int rowsPerMeasure = curTime.m_iDenominator * curTime.m_iNumerator;
|
int rowsPerMeasure = curTime.m_iDenominator * curTime.m_iNumerator;
|
||||||
|
|
||||||
for( int row=0; row<=m_NoteDataEdit.GetLastRow(); row+=rowsPerMeasure )
|
for( int row=0; row<=m_NoteDataEdit.GetLastRow(); row+=rowsPerMeasure )
|
||||||
@@ -4072,7 +4074,7 @@ float ScreenEdit::GetMaximumBeatForNewNote() const
|
|||||||
/* Round up to the next measure end. Some songs end on weird beats
|
/* Round up to the next measure end. Some songs end on weird beats
|
||||||
* mid-measure, and it's odd to have movement capped to these weird
|
* mid-measure, and it's odd to have movement capped to these weird
|
||||||
* beats. */
|
* beats. */
|
||||||
int beatsPerMeasure = GAMESTATE->m_pCurSong->m_SongTiming.GetTimeSignatureSegmentAtBeat( GAMESTATE->m_fSongBeat ).m_iNumerator;
|
int beatsPerMeasure = GAMESTATE->m_pCurSong->m_SongTiming.GetTimeSignatureSegmentAtBeat( GAMESTATE->m_Position.m_fSongBeat ).m_iNumerator;
|
||||||
fEndBeat += beatsPerMeasure;
|
fEndBeat += beatsPerMeasure;
|
||||||
fEndBeat = ftruncf( fEndBeat, (float)beatsPerMeasure );
|
fEndBeat = ftruncf( fEndBeat, (float)beatsPerMeasure );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user