From dd347e27c54606720ac90c74446083b499a1d600 Mon Sep 17 00:00:00 2001 From: Mike Hawkins Date: Wed, 14 May 2008 23:18:58 +0000 Subject: [PATCH] Holds to rolls modifier --- stepmania/src/NoteDataUtil.cpp | 19 +++++++++++++++++++ stepmania/src/NoteDataUtil.h | 1 + stepmania/src/PlayerOptions.cpp | 2 ++ stepmania/src/PlayerOptions.h | 1 + 4 files changed, 23 insertions(+) diff --git a/stepmania/src/NoteDataUtil.cpp b/stepmania/src/NoteDataUtil.cpp index 71b6c3d9d9..7199491996 100644 --- a/stepmania/src/NoteDataUtil.cpp +++ b/stepmania/src/NoteDataUtil.cpp @@ -857,6 +857,22 @@ void NoteDataUtil::ChangeRollsToHolds( NoteData &in, int iStartIndex, int iEndIn } } +void NoteDataUtil::ChangeHoldsToRolls( NoteData &in, int iStartIndex, int iEndIndex ) +{ + for( int t=0; tsecond.type != TapNote::hold_head || + begin->second.subType != TapNote::hold_head_hold ) + continue; + begin->second.subType = TapNote::hold_head_roll; + } + } +} + void NoteDataUtil::RemoveSimultaneousNotes( NoteData &in, int iMaxSimultaneous, int iStartIndex, int iEndIndex ) { // Remove tap and hold notes so no more than iMaxSimultaneous buttons are being held at any @@ -1979,6 +1995,9 @@ void NoteDataUtil::TransformNoteData( NoteData &nd, const PlayerOptions &po, Ste if( po.m_bTransforms[PlayerOptions::TRANSFORM_FLOORED] ) NoteDataUtil::Floored( nd, iStartIndex, iEndIndex ); if( po.m_bTransforms[PlayerOptions::TRANSFORM_TWISTER] ) NoteDataUtil::Twister( nd, iStartIndex, iEndIndex ); + // Do this here to turn any added holds into rolls + if( po.m_bTransforms[PlayerOptions::TRANSFORM_HOLDROLLS] ) NoteDataUtil::ChangeHoldsToRolls( ns, iStartIndex, iEndIndex ); + // Apply turns and shuffles last so that they affect inserts. 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 ); diff --git a/stepmania/src/NoteDataUtil.h b/stepmania/src/NoteDataUtil.h index e308619ee2..e43d2b97a1 100644 --- a/stepmania/src/NoteDataUtil.h +++ b/stepmania/src/NoteDataUtil.h @@ -42,6 +42,7 @@ namespace NoteDataUtil void RemoveHoldNotes( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); void ChangeRollsToHolds( NoteData &in, int iStartIndex, int iEndIndex ); + void ChangeHoldsToRolls( NoteData &in, int iStartIndex, int iEndIndex ); void RemoveSimultaneousNotes( NoteData &inout, int iMaxSimultaneous, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); void RemoveJumps( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); void RemoveHands( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); diff --git a/stepmania/src/PlayerOptions.cpp b/stepmania/src/PlayerOptions.cpp index 44882f0410..4bcee642fb 100644 --- a/stepmania/src/PlayerOptions.cpp +++ b/stepmania/src/PlayerOptions.cpp @@ -188,6 +188,7 @@ void PlayerOptions::GetMods( vector &AddTo, bool bForceNoteSkin ) const if( m_bTransforms[TRANSFORM_PLANTED] ) AddTo.push_back( "Planted" ); if( m_bTransforms[TRANSFORM_FLOORED] ) AddTo.push_back( "Floored" ); if( m_bTransforms[TRANSFORM_TWISTER] ) AddTo.push_back( "Twister" ); + if( m_bTransforms[TRANSFORM_HOLDROLLS] ) AddTo.push_back( "HoldsToRolls" ); if( m_bTransforms[TRANSFORM_NOJUMPS] ) AddTo.push_back( "NoJumps" ); if( m_bTransforms[TRANSFORM_NOHANDS] ) AddTo.push_back( "NoHands" ); if( m_bTransforms[TRANSFORM_NOQUADS] ) AddTo.push_back( "NoQuads" ); @@ -356,6 +357,7 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut else if( sBit == "planted" ) m_bTransforms[TRANSFORM_PLANTED] = on; else if( sBit == "floored" ) m_bTransforms[TRANSFORM_FLOORED] = on; else if( sBit == "twister" ) m_bTransforms[TRANSFORM_TWISTER] = on; + else if( sBit == "holdrolls" ) m_bTransforms[TRANSFORM_HOLDROLLS] = on; else if( sBit == "nojumps" ) m_bTransforms[TRANSFORM_NOJUMPS] = on; else if( sBit == "nohands" ) m_bTransforms[TRANSFORM_NOHANDS] = on; else if( sBit == "noquads" ) m_bTransforms[TRANSFORM_NOQUADS] = on; diff --git a/stepmania/src/PlayerOptions.h b/stepmania/src/PlayerOptions.h index 84ec47b453..c7c5e21f16 100644 --- a/stepmania/src/PlayerOptions.h +++ b/stepmania/src/PlayerOptions.h @@ -88,6 +88,7 @@ public: TRANSFORM_PLANTED, TRANSFORM_FLOORED, TRANSFORM_TWISTER, + TRANSFORM_HOLDROLLS, TRANSFORM_NOJUMPS, TRANSFORM_NOHANDS, TRANSFORM_NOQUADS,