From 025997d453214674313a4186699bd229f048e1b1 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sun, 9 Jul 2006 20:11:46 +0000 Subject: [PATCH] Removes all tap notes except for those with PLAYER_INVALID and those matching that player. --- stepmania/src/NoteDataUtil.cpp | 17 +++++++++++++++++ stepmania/src/NoteDataUtil.h | 1 + 2 files changed, 18 insertions(+) diff --git a/stepmania/src/NoteDataUtil.cpp b/stepmania/src/NoteDataUtil.cpp index 94520e1070..1a7e168f0b 100644 --- a/stepmania/src/NoteDataUtil.cpp +++ b/stepmania/src/NoteDataUtil.cpp @@ -893,6 +893,23 @@ void NoteDataUtil::RemoveAllButOneTap( NoteData &inout, int row ) } } +void NoteDataUtil::RemoveAllButPlayer( NoteData &inout, PlayerNumber pn ) +{ + for( int track = 0; track < inout.GetNumTracks(); ++track ) + { + NoteData::iterator i = inout.begin( track ); + + while( i != inout.end(track) ) + { + if( i->second.pn != pn && i->second.pn != PLAYER_INVALID ) + inout.RemoveTapNote( track, i++ ); + else + ++i; + } + } +} + + static void GetTrackMapping( StepsType st, NoteDataUtil::TrackMapping tt, int NumTracks, int *iTakeFromTrack ) { // Identity transform for cases not handled below. diff --git a/stepmania/src/NoteDataUtil.h b/stepmania/src/NoteDataUtil.h index 5964dbde2b..0296246985 100644 --- a/stepmania/src/NoteDataUtil.h +++ b/stepmania/src/NoteDataUtil.h @@ -47,6 +47,7 @@ namespace NoteDataUtil void RemoveMines( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); void RemoveStretch( NoteData &inout, StepsType st, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); void RemoveAllButOneTap( NoteData &inout, int row ); + void RemoveAllButPlayer( NoteData &inout, PlayerNumber pn ); enum TrackMapping { left, right, mirror, shuffle, super_shuffle, stomp, NUM_TRACK_MAPPINGS }; void Turn( NoteData &inout, StepsType st, TrackMapping tt, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); void Little( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );