From 77d58c0d638907e2598d8391be317fb1b653f1fd Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 22 Jan 2005 17:34:10 +0000 Subject: [PATCH] "Beat rows" are really just a fixed-point representation of beats. Prefer using them in general over beats: it's more precise (we can tell exactly how it'll round, and we can compare them without ugly error-margin hacks), and it's what we need to use them with NoteData. --- stepmania/src/NoteData.cpp | 82 +++-------- stepmania/src/NoteData.h | 16 +-- stepmania/src/NoteDataUtil.cpp | 249 +++++++++++++-------------------- stepmania/src/NoteDataUtil.h | 52 +++---- stepmania/src/Player.cpp | 2 +- stepmania/src/ScreenEdit.cpp | 41 +++--- 6 files changed, 172 insertions(+), 270 deletions(-) diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index 320504f2d8..d59efd4d50 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -347,20 +347,12 @@ int NoteData::GetLastRow() const return iOldestRowFoundSoFar; } -int NoteData::GetNumTapNotes( float fStartBeat, float fEndBeat ) const +int NoteData::GetNumTapNotes( int iStartIndex, int iEndIndex ) const { - if( fEndBeat == -1 ) - fEndBeat = 999999; + if( iEndIndex == -1 ) + iEndIndex = 999999; int iNumNotes = 0; - - int iStartIndex = BeatToNoteRow( fStartBeat ); - int iEndIndex = BeatToNoteRow( fEndBeat ); - - /* Clamp to known-good ranges. */ - iStartIndex = max( iStartIndex, 0 ); - iEndIndex = min( iEndIndex, GetLastRow() ); - for( int t=0; t= 3; } -int NoteData::GetNumHands( float fStartBeat, float fEndBeat ) const +int NoteData::GetNumHands( int iStartIndex, int iEndIndex ) const { /* Count the number of times you have to use your hands. This includes * three taps at the same time, a tap while two hold notes are being held, * etc. Only count rows that have at least one tap note (hold heads count). * Otherwise, every row of hold notes counts, so three simultaneous hold * notes will count as hundreds of "hands". */ - if( fEndBeat == -1 ) - fEndBeat = GetLastBeat(); - - int iStartIndex = BeatToNoteRow( fStartBeat ); - int iEndIndex = BeatToNoteRow( fEndBeat ); - - /* Clamp to known-good ranges. */ - iStartIndex = max( iStartIndex, 0 ); - iEndIndex = min( iEndIndex, GetLastRow() ); + if( iEndIndex == -1 ) + iEndIndex = 999999; int iNum = 0; FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, r, iStartIndex, iEndIndex ) @@ -495,17 +465,10 @@ int NoteData::GetNumHands( float fStartBeat, float fEndBeat ) const return iNum; } -int NoteData::GetNumN( int iMinTaps, float fStartBeat, float fEndBeat ) const +int NoteData::GetNumN( int iMinTaps, int iStartIndex, int iEndIndex ) const { - if( fEndBeat == -1 ) - fEndBeat = GetLastBeat(); - - int iStartIndex = BeatToNoteRow( fStartBeat ); - int iEndIndex = BeatToNoteRow( fEndBeat ); - - /* Clamp to known-good ranges. */ - iStartIndex = max( iStartIndex, 0 ); - iEndIndex = min( iEndIndex, GetLastRow() ); + if( iEndIndex == -1 ) + iEndIndex = 999999; int iNum = 0; FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, r, iStartIndex, iEndIndex ) @@ -524,13 +487,10 @@ int NoteData::GetNumN( int iMinTaps, float fStartBeat, float fEndBeat ) const return iNum; } -int NoteData::GetNumHoldNotes( float fStartBeat, float fEndBeat ) const +int NoteData::GetNumHoldNotes( int iStartIndex, int iEndIndex ) const { - if( fEndBeat == -1 ) - fEndBeat = GetLastBeat(); - - int iStartIndex = BeatToNoteRow( fStartBeat ); - int iEndIndex = BeatToNoteRow( fEndBeat ); + if( iEndIndex == -1 ) + iEndIndex = GetLastRow(); int iNumHolds = 0; for( int i=0; i=0; i-- ) // iterate backwards so we can delete { @@ -530,11 +528,8 @@ void NoteDataUtil::RemoveHoldNotes(NoteData &in, float fStartBeat, float fEndBea } -void NoteDataUtil::RemoveSimultaneousNotes(NoteData &in, int iMaxSimultaneous, float fStartBeat, float fEndBeat) +void NoteDataUtil::RemoveSimultaneousNotes( NoteData &in, int iMaxSimultaneous, int iStartIndex, int iEndIndex ) { - int iStartIndex = BeatToNoteRow( fStartBeat ); - int iEndIndex = BeatToNoteRow( fEndBeat ); - // turn all the HoldNotes into TapNotes FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( in, r, iStartIndex, iEndIndex ) { @@ -568,27 +563,25 @@ void NoteDataUtil::RemoveSimultaneousNotes(NoteData &in, int iMaxSimultaneous, f } } -void NoteDataUtil::RemoveJumps( NoteData &inout, float fStartBeat, float fEndBeat ) +void NoteDataUtil::RemoveJumps( NoteData &inout, int iStartIndex, int iEndIndex ) { - RemoveSimultaneousNotes(inout,1); + RemoveSimultaneousNotes( inout, 1, iStartIndex, iEndIndex ); } -void NoteDataUtil::RemoveHands( NoteData &inout, float fStartBeat, float fEndBeat ) +void NoteDataUtil::RemoveHands( NoteData &inout, int iStartIndex, int iEndIndex ) { - RemoveSimultaneousNotes(inout,2); + RemoveSimultaneousNotes( inout, 2, iStartIndex, iEndIndex ); } -void NoteDataUtil::RemoveQuads( NoteData &inout, float fStartBeat, float fEndBeat ) +void NoteDataUtil::RemoveQuads( NoteData &inout, int iStartIndex, int iEndIndex ) { - RemoveSimultaneousNotes(inout,3); + RemoveSimultaneousNotes( inout, 3, iStartIndex, iEndIndex ); } -void NoteDataUtil::RemoveMines(NoteData &inout, float fStartBeat, float fEndBeat ) +void NoteDataUtil::RemoveMines( NoteData &inout, int iStartIndex, int iEndIndex ) { - int iRowStart = BeatToNoteRow(fStartBeat); - int iRowEnd = BeatToNoteRow(fEndBeat); for( int t=0; t last_row ) + if( iMineRow < iStartIndex || iMineRow > iEndIndex ) continue; // Only place a mines if there's not another step nearby @@ -1110,19 +1082,18 @@ void NoteDataUtil::AddMines( NoteData &inout, float fStartBeat, float fEndBeat ) } } -void NoteDataUtil::Echo( NoteData &inout, float fStartBeat, float fEndBeat ) +void NoteDataUtil::Echo( NoteData &inout, int iStartIndex, int iEndIndex ) { // add 8th note tap "echos" after all taps int iEchoTrack = -1; - fStartBeat = Quantize( fStartBeat, 0.5 ); + iStartIndex = Quantize( iStartIndex, BeatToNoteRow(0.5f) ); - const int first_row = BeatToNoteRow( fStartBeat ); - const int last_row = min( BeatToNoteRow(fEndBeat), inout.GetLastRow() ); - const int rows_per_interval = BeatToNoteRow( 0.5 ); + iEndIndex = min( iEndIndex, inout.GetLastRow() ); + const int rows_per_interval = BeatToNoteRow( 0.5f ); // window is one beat wide and slides 1/2 a beat at a time - for( int r=first_row; rGetAttackBeats( pSong, NULL, fStartBeat, fEndBeat ); - NoteDataUtil::TransformNoteData( nd, po, st, fStartBeat, fEndBeat ); + NoteDataUtil::TransformNoteData( nd, po, st, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat) ); } } } -void NoteDataUtil::TransformNoteData( NoteData &nd, const PlayerOptions &po, StepsType st, float fStartBeat, float fEndBeat ) +void NoteDataUtil::TransformNoteData( NoteData &nd, const PlayerOptions &po, StepsType st, int iStartIndex, int iEndIndex ) { // Apply remove transforms before others so that we don't go removing // notes we just inserted. - if( po.m_bTransforms[PlayerOptions::TRANSFORM_LITTLE] ) NoteDataUtil::Little(nd, fStartBeat, fEndBeat); - if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOHOLDS] ) NoteDataUtil::RemoveHoldNotes(nd, fStartBeat, fEndBeat); - if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOMINES] ) NoteDataUtil::RemoveMines(nd, fStartBeat, fEndBeat); - if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOJUMPS] ) NoteDataUtil::RemoveJumps(nd, fStartBeat, fEndBeat); - if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOHANDS] ) NoteDataUtil::RemoveHands(nd, fStartBeat, fEndBeat); - if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOQUADS] ) NoteDataUtil::RemoveQuads(nd, fStartBeat, fEndBeat); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_LITTLE] ) NoteDataUtil::Little( nd, iStartIndex, iEndIndex ); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOHOLDS] ) NoteDataUtil::RemoveHoldNotes( nd, iStartIndex, iEndIndex ); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOMINES] ) NoteDataUtil::RemoveMines( nd, iStartIndex, iEndIndex ); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOJUMPS] ) NoteDataUtil::RemoveJumps( nd, iStartIndex, iEndIndex ); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOHANDS] ) NoteDataUtil::RemoveHands( nd, iStartIndex, iEndIndex ); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOQUADS] ) NoteDataUtil::RemoveQuads( nd, iStartIndex, iEndIndex ); // Apply inserts. - if( po.m_bTransforms[PlayerOptions::TRANSFORM_BIG] ) NoteDataUtil::Big(nd, fStartBeat, fEndBeat); - if( po.m_bTransforms[PlayerOptions::TRANSFORM_QUICK] ) NoteDataUtil::Quick(nd, fStartBeat, fEndBeat); - if( po.m_bTransforms[PlayerOptions::TRANSFORM_BMRIZE] ) NoteDataUtil::BMRize(nd, fStartBeat, fEndBeat); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_BIG] ) NoteDataUtil::Big( nd, iStartIndex, iEndIndex ); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_QUICK] ) NoteDataUtil::Quick( nd, iStartIndex, iEndIndex ); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_BMRIZE] ) NoteDataUtil::BMRize( nd, iStartIndex, iEndIndex ); // Skippy will still add taps to places that the other // AddIntelligentTaps above won't. - if( po.m_bTransforms[PlayerOptions::TRANSFORM_SKIPPY] ) NoteDataUtil::Skippy(nd, fStartBeat, fEndBeat); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_SKIPPY] ) NoteDataUtil::Skippy( nd, iStartIndex, iEndIndex ); // These aren't affects by the above inserts very much. - if( po.m_bTransforms[PlayerOptions::TRANSFORM_MINES] ) NoteDataUtil::AddMines(nd, fStartBeat, fEndBeat); - if( po.m_bTransforms[PlayerOptions::TRANSFORM_ECHO] ) NoteDataUtil::Echo(nd, fStartBeat, fEndBeat); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_MINES] ) NoteDataUtil::AddMines( nd, iStartIndex, iEndIndex ); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_ECHO] ) NoteDataUtil::Echo( nd, iStartIndex, iEndIndex ); // Jump-adding transforms aren't much affected by additional taps. - if( po.m_bTransforms[PlayerOptions::TRANSFORM_WIDE] ) NoteDataUtil::Wide(nd, fStartBeat, fEndBeat); - if( po.m_bTransforms[PlayerOptions::TRANSFORM_STOMP] ) NoteDataUtil::Stomp(nd, st, fStartBeat, fEndBeat); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_WIDE] ) NoteDataUtil::Wide( nd, iStartIndex, iEndIndex ); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_STOMP] ) NoteDataUtil::Stomp( nd, st, iStartIndex, iEndIndex ); // Transforms that add holds go last. If they went first, most tap-adding // transforms wouldn't do anything because tap-adding transforms skip areas // where there's a hold. - if( po.m_bTransforms[PlayerOptions::TRANSFORM_PLANTED] ) NoteDataUtil::Planted(nd, fStartBeat, fEndBeat); - if( po.m_bTransforms[PlayerOptions::TRANSFORM_FLOORED] ) NoteDataUtil::Floored(nd, fStartBeat, fEndBeat); - if( po.m_bTransforms[PlayerOptions::TRANSFORM_TWISTER] ) NoteDataUtil::Twister(nd, fStartBeat, fEndBeat); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_PLANTED] ) NoteDataUtil::Planted( nd, iStartIndex, iEndIndex ); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_FLOORED] ) NoteDataUtil::Floored( nd, iStartIndex, iEndIndex ); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_TWISTER] ) NoteDataUtil::Twister( nd, iStartIndex, iEndIndex ); // Apply turns and shuffles last to that they affect inserts. - if( po.m_bTurns[PlayerOptions::TURN_MIRROR] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::mirror, fStartBeat, fEndBeat ); - if( po.m_bTurns[PlayerOptions::TURN_LEFT] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::left, fStartBeat, fEndBeat ); - if( po.m_bTurns[PlayerOptions::TURN_RIGHT] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::right, fStartBeat, fEndBeat ); - if( po.m_bTurns[PlayerOptions::TURN_SHUFFLE] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::shuffle, fStartBeat, fEndBeat ); - if( po.m_bTurns[PlayerOptions::TURN_SUPER_SHUFFLE] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::super_shuffle, fStartBeat, fEndBeat ); + if( po.m_bTurns[PlayerOptions::TURN_MIRROR] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::mirror, iStartIndex, iEndIndex ); + if( po.m_bTurns[PlayerOptions::TURN_LEFT] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::left, iStartIndex, iEndIndex ); + if( po.m_bTurns[PlayerOptions::TURN_RIGHT] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::right, iStartIndex, iEndIndex ); + if( po.m_bTurns[PlayerOptions::TURN_SHUFFLE] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::shuffle, iStartIndex, iEndIndex ); + if( po.m_bTurns[PlayerOptions::TURN_SUPER_SHUFFLE] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::super_shuffle, iStartIndex, iEndIndex ); } void NoteDataUtil::AddTapAttacks( NoteData &nd, Song* pSong ) diff --git a/stepmania/src/NoteDataUtil.h b/stepmania/src/NoteDataUtil.h index 794c0064ae..475161301a 100644 --- a/stepmania/src/NoteDataUtil.h +++ b/stepmania/src/NoteDataUtil.h @@ -32,36 +32,36 @@ namespace NoteDataUtil void GetRadarValues( const NoteData &in, float fSongSeconds, RadarValues& out ); - void RemoveHoldNotes( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void RemoveSimultaneousNotes( NoteData &inout, int iMaxSimultaneous, float fStartBeat = 0, float fEndBeat = 99999 ); - void RemoveJumps( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void RemoveHands( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void RemoveQuads( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void RemoveMines( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); + void RemoveHoldNotes( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void RemoveSimultaneousNotes( NoteData &inout, int iMaxSimultaneous, int iStartIndex = 0, int iEndIndex = 999999 ); + void RemoveJumps( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void RemoveHands( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void RemoveQuads( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void RemoveMines( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); void RemoveAllButOneTap( NoteData &inout, int row ); enum TrackMapping { left, right, mirror, shuffle, super_shuffle, stomp, NUM_TRACK_MAPPINGS }; - void Turn( NoteData &inout, StepsType st, TrackMapping tt, float fStartBeat = 0, float fEndBeat = -1 ); - void Little( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void Wide( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void Big( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void Quick( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void BMRize( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void Skippy( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); + void Turn( NoteData &inout, StepsType st, TrackMapping tt, int iStartIndex = 0, int iEndIndex = 999999 ); + void Little( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void Wide( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void Big( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void Quick( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void BMRize( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void Skippy( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); void InsertIntelligentTaps( NoteData &in, float fWindowSizeBeats, float fInsertOffsetBeats, float fWindowStrideBeats, bool bSkippy, - float fStartBeat = 0, - float fEndBeat = 99999 ); - void AddMines( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void Echo( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void Stomp( NoteData &inout, StepsType st, float fStartBeat = 0, float fEndBeat = 99999 ); - void Planted( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void Floored( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void Twister( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 ); - void ConvertTapsToHolds( NoteData &inout, int iSimultaneousHolds, float fStartBeat = 0, float fEndBeat = 99999 ); + int iStartIndex = 0, + int iEndIndex = 999999 ); + void AddMines( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void Echo( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void Stomp( NoteData &inout, StepsType st, int iStartIndex = 0, int iEndIndex = 999999 ); + void Planted( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void Floored( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void Twister( NoteData &inout, int iStartIndex = 0, int iEndIndex = 999999 ); + void ConvertTapsToHolds( NoteData &inout, int iSimultaneousHolds, int iStartIndex = 0, int iEndIndex = 999999 ); // change all TAP_ADDITIONs to TAP_TAPs void ConvertAdditionsToRegular( NoteData &inout ); @@ -77,11 +77,11 @@ namespace NoteDataUtil void ShiftLeft( NoteData &inout ); void ShiftRight( NoteData &inout ); - void SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteType nt2, float fBeginBeat, float fEndBeat ); + void SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteType nt2, int iStartIndex, int iEndIndex ); - inline void SnapToNearestNoteType( NoteData &inout, NoteType nt, float fBeginBeat, float fEndBeat ) + inline void SnapToNearestNoteType( NoteData &inout, NoteType nt, int iStartIndex, int iEndIndex ) { - SnapToNearestNoteType( inout, nt, NOTE_TYPE_INVALID, fBeginBeat, fEndBeat ); + SnapToNearestNoteType( inout, nt, NOTE_TYPE_INVALID, iStartIndex, iEndIndex ); } void FixImpossibleRows( NoteData &inout, StepsType st ); @@ -90,7 +90,7 @@ namespace NoteDataUtil bool RowPassesValidMask( NoteData &inout, int row, const bool bValidMask[] ); void TransformNoteData( NoteData &nd, const AttackArray &aa, StepsType st, Song* pSong ); - void TransformNoteData( NoteData &nd, const PlayerOptions &po, StepsType st, float fStartBeat = 0, float fEndBeat = 99999 ); + void TransformNoteData( NoteData &nd, const PlayerOptions &po, StepsType st, int iStartIndex = 0, int iEndIndex = 999999 ); void AddTapAttacks( NoteData &nd, Song* pSong ); // void Scale( NoteData &nd, float fScale ); diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index fa855758ab..963ddf6223 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -498,7 +498,7 @@ void Player::ApplyWaitingTransforms() if( po.m_sNoteSkin != "" ) GAMESTATE->SetNoteSkinForBeatRange( m_pPlayerState, po.m_sNoteSkin, fStartBeat, fEndBeat ); - NoteDataUtil::TransformNoteData( m_NoteData, po, GAMESTATE->GetCurrentStyle()->m_StepsType, fStartBeat, fEndBeat ); + NoteDataUtil::TransformNoteData( m_NoteData, po, GAMESTATE->GetCurrentStyle()->m_StepsType, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat) ); } m_pPlayerState->m_ModsToApply.clear(); } diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index ba12429f2c..7951cdc6b8 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -1943,7 +1943,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers ) case quantize: { NoteType nt = (NoteType)iAnswers[c]; - NoteDataUtil::SnapToNearestNoteType( m_NoteDataEdit, nt, nt, m_NoteFieldEdit.m_fBeginMarker, m_NoteFieldEdit.m_fEndMarker ); + NoteDataUtil::SnapToNearestNoteType( m_NoteDataEdit, nt, nt, BeatToNoteRow(m_NoteFieldEdit.m_fBeginMarker), BeatToNoteRow(m_NoteFieldEdit.m_fEndMarker) ); } break; case turn: @@ -1969,29 +1969,30 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers ) break; case transform: { - float fBeginBeat = m_NoteFieldEdit.m_fBeginMarker; - float fEndBeat = m_NoteFieldEdit.m_fEndMarker; + int iBeginRow = BeatToNoteRow( m_NoteFieldEdit.m_fBeginMarker ); + int iEndRow = BeatToNoteRow( m_NoteFieldEdit.m_fEndMarker ); TransformType tt = (TransformType)iAnswers[c]; StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; + switch( tt ) { - case noholds: NoteDataUtil::RemoveHoldNotes( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case nomines: NoteDataUtil::RemoveMines( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case little: NoteDataUtil::Little( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case wide: NoteDataUtil::Wide( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case big: NoteDataUtil::Big( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case quick: NoteDataUtil::Quick( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case bmrize: NoteDataUtil::BMRize( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case skippy: NoteDataUtil::Skippy( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case mines: NoteDataUtil::AddMines( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case echo: NoteDataUtil::Echo( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case stomp: NoteDataUtil::Stomp( m_NoteDataEdit, st, fBeginBeat, fEndBeat ); break; - case planted: NoteDataUtil::Planted( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case floored: NoteDataUtil::Floored( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case twister: NoteDataUtil::Twister( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case nojumps: NoteDataUtil::RemoveJumps( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case nohands: NoteDataUtil::RemoveHands( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; - case noquads: NoteDataUtil::RemoveQuads( m_NoteDataEdit, fBeginBeat, fEndBeat ); break; + case noholds: NoteDataUtil::RemoveHoldNotes( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case nomines: NoteDataUtil::RemoveMines( m_NoteDataEdit, iBeginRow, iBeginRow ); break; + case little: NoteDataUtil::Little( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case wide: NoteDataUtil::Wide( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case big: NoteDataUtil::Big( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case quick: NoteDataUtil::Quick( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case bmrize: NoteDataUtil::BMRize( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case skippy: NoteDataUtil::Skippy( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case mines: NoteDataUtil::AddMines( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case echo: NoteDataUtil::Echo( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case stomp: NoteDataUtil::Stomp( m_NoteDataEdit, st, iBeginRow, iEndRow ); break; + case planted: NoteDataUtil::Planted( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case floored: NoteDataUtil::Floored( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case twister: NoteDataUtil::Twister( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case nojumps: NoteDataUtil::RemoveJumps( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case nohands: NoteDataUtil::RemoveHands( m_NoteDataEdit, iBeginRow, iEndRow ); break; + case noquads: NoteDataUtil::RemoveQuads( m_NoteDataEdit, iBeginRow, iEndRow ); break; default: ASSERT(0); }