diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml index df5d1ca652..efe59ad1da 100644 --- a/Docs/Luadoc/Lua.xml +++ b/Docs/Luadoc/Lua.xml @@ -2404,6 +2404,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/AutoKeysounds.cpp b/src/AutoKeysounds.cpp index e7fcf31f2b..8c6c59f857 100644 --- a/src/AutoKeysounds.cpp +++ b/src/AutoKeysounds.cpp @@ -88,7 +88,7 @@ void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain ) pn = GetNextEnabledPlayer(pn); while( pn != PLAYER_INVALID ) { - if( tn[pn].type != TapNote::autoKeysound || tn[pn].iKeysoundIndex != tap.iKeysoundIndex ) + if( tn[pn].type != TapNoteType_AutoKeysound || tn[pn].iKeysoundIndex != tap.iKeysoundIndex ) bSoundIsGlobal = false; pn = GetNextEnabledPlayer(pn); } @@ -99,7 +99,7 @@ void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain ) if( tn[pn] == TAP_EMPTY ) continue; - ASSERT( tn[pn].type == TapNote::autoKeysound ); + ASSERT( tn[pn].type == TapNoteType_AutoKeysound ); if( tn[pn].iKeysoundIndex >= 0 ) { RString sKeysoundFilePath = sSongDir + pSong->m_vsKeysoundFile[tn[pn].iKeysoundIndex]; @@ -351,7 +351,7 @@ void AutoKeysounds::Update( float fDelta ) FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( nd, t, r, iRowLastCrossed+1, iRowNow ) { const TapNote &tn = nd.GetTapNote( t, r ); - ASSERT( tn.type == TapNote::autoKeysound ); + ASSERT( tn.type == TapNoteType_AutoKeysound ); if( tn.bKeysound ) m_vKeysounds[tn.iKeysoundIndex].Play(); } diff --git a/src/BeginnerHelper.cpp b/src/BeginnerHelper.cpp index 5fe57b0c64..5c6f2968ee 100644 --- a/src/BeginnerHelper.cpp +++ b/src/BeginnerHelper.cpp @@ -352,7 +352,7 @@ void BeginnerHelper::Update( float fDeltaTime ) int iStep = 0; const int iNumTracks = m_NoteData[pn].GetNumTracks(); for( int t=0; tBlinkCabinetLight( cl ); break; diff --git a/src/GhostArrowRow.cpp b/src/GhostArrowRow.cpp index 9693167e6d..fef07474e7 100644 --- a/src/GhostArrowRow.cpp +++ b/src/GhostArrowRow.cpp @@ -27,8 +27,8 @@ void GhostArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOffset const GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( c, pn ); NOTESKIN->SetGameController( GameI.controller ); - m_bHoldShowing.push_back( TapNote::SubType_Invalid ); - m_bLastHoldShowing.push_back( TapNote::SubType_Invalid ); + m_bHoldShowing.push_back( TapNoteSubType_Invalid ); + m_bLastHoldShowing.push_back( TapNoteSubType_Invalid ); m_Ghost.push_back( NOTESKIN->LoadActor(sButton, "Explosion", this) ); m_Ghost[c]->SetName( "GhostArrow" ); @@ -67,26 +67,26 @@ void GhostArrowRow::Update( float fDeltaTime ) { if( m_bLastHoldShowing[i] != m_bHoldShowing[i] ) { - if( m_bLastHoldShowing[i] == TapNote::hold_head_hold ) + if( m_bLastHoldShowing[i] == TapNoteSubType_Hold ) m_Ghost[i]->PlayCommand( "HoldingOff" ); - else if( m_bLastHoldShowing[i] == TapNote::hold_head_roll ) + else if( m_bLastHoldShowing[i] == TapNoteSubType_Roll ) m_Ghost[i]->PlayCommand( "RollOff" ); /* - else if( m_bLastHoldShowing[i] == TapNote::hold_head_mine ) + else if( m_bLastHoldShowing[i] == TapNoteSubType_Mine ) m_Ghost[i]->PlayCommand( "MinefieldOff" ); */ - if( m_bHoldShowing[i] == TapNote::hold_head_hold ) + if( m_bHoldShowing[i] == TapNoteSubType_Hold ) m_Ghost[i]->PlayCommand( "HoldingOn" ); - else if( m_bHoldShowing[i] == TapNote::hold_head_roll ) + else if( m_bHoldShowing[i] == TapNoteSubType_Roll ) m_Ghost[i]->PlayCommand( "RollOn" ); /* - else if( m_bHoldShowing[i] == TapNote::hold_head_mine ) + else if( m_bHoldShowing[i] == TapNoteSubType_Mine ) m_Ghost[i]->PlayCommand( "MinefieldOn" ); */ m_bLastHoldShowing[i] = m_bHoldShowing[i]; } - m_bHoldShowing[i] = TapNote::SubType_Invalid; + m_bHoldShowing[i] = TapNoteSubType_Invalid; } } diff --git a/src/GhostArrowRow.h b/src/GhostArrowRow.h index f93159eec9..b1647d3aa9 100644 --- a/src/GhostArrowRow.h +++ b/src/GhostArrowRow.h @@ -25,8 +25,8 @@ protected: const PlayerState* m_pPlayerState; vector m_Ghost; - vector m_bHoldShowing; - vector m_bLastHoldShowing; + vector m_bHoldShowing; + vector m_bLastHoldShowing; }; diff --git a/src/NoteData.cpp b/src/NoteData.cpp index 52a1daf4ac..bd8de09ef2 100644 --- a/src/NoteData.cpp +++ b/src/NoteData.cpp @@ -91,7 +91,7 @@ void NoteData::ClearRangeForTrack( int rowBegin, int rowEnd, int iTrack ) --prev; TapNote tn = lBegin->second; int iRow = prev->first; - if( tn.type == TapNote::hold_head && iRow + tn.iDuration > rowEnd ) + if( tn.type == TapNoteType_HoldHead && iRow + tn.iDuration > rowEnd ) { // A hold note overlaps the end of the range. Separate it. SetTapNote( iTrack, iRow, TAP_EMPTY ); @@ -144,10 +144,10 @@ void NoteData::CopyRange( const NoteData& from, int rowFromBegin, int rowFromEnd for( ; lBegin != lEnd; ++lBegin ) { TapNote head = lBegin->second; - if( head.type == TapNote::empty ) + if( head.type == TapNoteType_Empty ) continue; - if( head.type == TapNote::hold_head ) + if( head.type == TapNoteType_HoldHead ) { int iStartRow = lBegin->first + iMoveBy; int iEndRow = iStartRow + head.iDuration; @@ -175,7 +175,7 @@ void NoteData::CopyAll( const NoteData& from ) bool NoteData::IsRowEmpty( int row ) const { for( int t=0; t& addTo ) const { for( int t=0; t=0; t-- ) { - if( GetTapNote( t, row ).type == TapNote::empty ) + if( GetTapNote( t, row ).type == TapNoteType_Empty ) { iEmptyTrackOut = t; return true; @@ -251,7 +251,7 @@ int NoteData::GetNumTracksWithTap( int row ) const for( int t=0; t=0; t-- ) { const TapNote &tn = GetTapNote( t, row ); - if( tn.type == TapNote::tap || tn.type == TapNote::lift || tn.type == TapNote::hold_head ) + if( tn.type == TapNoteType_Tap || tn.type == TapNoteType_Lift || tn.type == TapNoteType_HoldHead ) return t; } return -1; @@ -316,7 +316,7 @@ void NoteData::AddHoldNote( int iTrack, int iStartRow, int iEndRow, TapNote tn ) { int iOtherRow = it->first; const TapNote &tnOther = it->second; - if( tnOther.type == TapNote::hold_head ) + if( tnOther.type == TapNoteType_HoldHead ) { iStartRow = min( iStartRow, iOtherRow ); iEndRow = max( iEndRow, iOtherRow + tnOther.iDuration ); @@ -349,7 +349,7 @@ void NoteData::AddHoldNote( int iTrack, int iStartRow, int iEndRow, TapNote tn ) bool NoteData::IsHoldHeadOrBodyAtRow( int iTrack, int iRow, int *pHeadRow ) const { const TapNote &tn = GetTapNote( iTrack, iRow ); - if( tn.type == TapNote::hold_head ) + if( tn.type == TapNoteType_HoldHead ) { if( pHeadRow != NULL ) *pHeadRow = iRow; @@ -369,7 +369,7 @@ bool NoteData::IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow ) const if( pHeadRow == NULL ) pHeadRow = &iDummy; - /* Starting at iRow, search upwards. If we find a TapNote::hold_head, we're within + /* Starting at iRow, search upwards. If we find a TapNoteType_HoldHead, we're within * a hold. If we find a tap, mine or attack, we're not--those never lie * within hold notes. Ignore autoKeysound. */ FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE_REVERSE( *this, iTrack, r, 0, iRow ) @@ -377,21 +377,21 @@ bool NoteData::IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow ) const const TapNote &tn = GetTapNote( iTrack, r ); switch( tn.type ) { - case TapNote::hold_head: + case TapNoteType_HoldHead: if( tn.iDuration + r < iRow ) return false; *pHeadRow = r; return true; - case TapNote::tap: - case TapNote::mine: - case TapNote::attack: - case TapNote::lift: - case TapNote::fake: + case TapNoteType_Tap: + case TapNoteType_Mine: + case TapNoteType_Attack: + case TapNoteType_Lift: + case TapNoteType_Fake: return false; - case TapNote::empty: - case TapNote::autoKeysound: + case TapNoteType_Empty: + case TapNoteType_AutoKeysound: // ignore continue; DEFAULT_FAIL( tn.type ); @@ -450,7 +450,7 @@ int NoteData::GetLastRow() const /* XXX: We might have a hold note near the end with autoplay sounds * after it. Do something else with autoplay sounds ... */ const TapNote &tn = GetTapNote( t, iRow ); - if( tn.type == TapNote::hold_head ) + if( tn.type == TapNoteType_HoldHead ) iRow += tn.iDuration; iOldestRowFoundSoFar = max( iOldestRowFoundSoFar, iRow ); @@ -461,27 +461,27 @@ int NoteData::GetLastRow() const bool NoteData::IsTap(const TapNote &tn, const int row) const { - return (tn.type != TapNote::empty && tn.type != TapNote::mine - && tn.type != TapNote::lift && tn.type != TapNote::fake - && tn.type != TapNote::autoKeysound + return (tn.type != TapNoteType_Empty && tn.type != TapNoteType_Mine + && tn.type != TapNoteType_Lift && tn.type != TapNoteType_Fake + && tn.type != TapNoteType_AutoKeysound && GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row)); } bool NoteData::IsMine(const TapNote &tn, const int row) const { - return (tn.type == TapNote::mine + return (tn.type == TapNoteType_Mine && GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row)); } bool NoteData::IsLift(const TapNote &tn, const int row) const { - return (tn.type == TapNote::lift + return (tn.type == TapNoteType_Lift && GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row)); } bool NoteData::IsFake(const TapNote &tn, const int row) const { - return (tn.type == TapNote::fake + return (tn.type == TapNoteType_Fake || !GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row)); } @@ -553,11 +553,11 @@ bool NoteData::RowNeedsAtLeastSimultaneousPresses( int iMinSimultaneousPresses, const TapNote &tn = GetTapNote(t, row); switch( tn.type ) { - case TapNote::mine: - case TapNote::empty: - case TapNote::fake: - case TapNote::lift: // you don't "press" on a lift. - case TapNote::autoKeysound: + case TapNoteType_Mine: + case TapNoteType_Empty: + case TapNoteType_Fake: + case TapNoteType_Lift: // you don't "press" on a lift. + case TapNoteType_AutoKeysound: continue; // skip these types - they don't count default: break; } @@ -612,10 +612,10 @@ int NoteData::GetNumRowsWithSimultaneousTaps( int iMinTaps, int iStartIndex, int for( int t=0; t= iMinTaps ) @@ -634,8 +634,8 @@ int NoteData::GetNumHoldNotes( int iStartIndex, int iEndIndex ) const GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd ); for( ; lBegin != lEnd; ++lBegin ) { - if( lBegin->second.type != TapNote::hold_head || - lBegin->second.subType != TapNote::hold_head_hold ) + if( lBegin->second.type != TapNoteType_HoldHead || + lBegin->second.subType != TapNoteSubType_Hold ) continue; if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first)) continue; @@ -654,8 +654,8 @@ int NoteData::GetNumRolls( int iStartIndex, int iEndIndex ) const GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd ); for( ; lBegin != lEnd; ++lBegin ) { - if( lBegin->second.type != TapNote::hold_head || - lBegin->second.subType != TapNote::hold_head_roll ) + if( lBegin->second.type != TapNoteType_HoldHead || + lBegin->second.subType != TapNoteSubType_Roll ) continue; if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first)) continue; @@ -773,8 +773,8 @@ pair NoteData::GetNumHoldNotesTwoPlayer( int iStartIndex, int iEndInde GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd ); for( ; lBegin != lEnd; ++lBegin ) { - if( lBegin->second.type != TapNote::hold_head || - lBegin->second.subType != TapNote::hold_head_hold ) + if( lBegin->second.type != TapNoteType_HoldHead || + lBegin->second.subType != TapNoteSubType_Hold ) continue; if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first)) continue; @@ -816,8 +816,8 @@ pair NoteData::GetNumRollsTwoPlayer( int iStartIndex, int iEndIndex ) GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd ); for( ; lBegin != lEnd; ++lBegin ) { - if( lBegin->second.type != TapNote::hold_head || - lBegin->second.subType != TapNote::hold_head_roll ) + if( lBegin->second.type != TapNoteType_HoldHead || + lBegin->second.subType != TapNoteSubType_Roll ) continue; if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first)) continue; @@ -880,8 +880,8 @@ int NoteData::GetNumMinefields( int iStartIndex, int iEndIndex ) const GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, begin, end ); for( ; begin != end; ++begin ) { - if( begin->second.type != TapNote::hold_head || - begin->second.subType != TapNote::hold_head_mine ) + if( begin->second.type != TapNoteType_HoldHead || + begin->second.subType != TapNoteSubType_mine ) continue; iNumMinefields++; } @@ -1033,7 +1033,7 @@ void NoteData::GetTapNoteRangeInclusive( int iTrack, int iStartRow, int iEndRow, iterator prev = Decrement(lBegin); const TapNote &tn = prev->second; - if( tn.type == TapNote::hold_head ) + if( tn.type == TapNoteType_HoldHead ) { int iHoldStartRow = prev->first; int iHoldEndRow = iHoldStartRow + tn.iDuration; @@ -1052,7 +1052,7 @@ void NoteData::GetTapNoteRangeInclusive( int iTrack, int iStartRow, int iEndRow, // Include the next note if it's a hold and starts on iEndRow. const TapNote &tn = lEnd->second; int iHoldStartRow = lEnd->first; - if( tn.type == TapNote::hold_head && iHoldStartRow == iEndRow ) + if( tn.type == TapNoteType_HoldHead && iHoldStartRow == iEndRow ) ++lEnd; } } @@ -1066,7 +1066,7 @@ void NoteData::GetTapNoteRangeExclusive( int iTrack, int iStartRow, int iEndRow, { iterator prev = lEnd; --prev; - if( prev->second.type == TapNote::hold_head ) + if( prev->second.type == TapNoteType_HoldHead ) { int localStartRow = prev->first; const TapNote &tn = prev->second; diff --git a/src/NoteDataUtil.cpp b/src/NoteDataUtil.cpp index b521f84125..888d38b85b 100644 --- a/src/NoteDataUtil.cpp +++ b/src/NoteDataUtil.cpp @@ -181,7 +181,7 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS float fDurationSeconds = 0; if( sscanf( p, "%255[^:]:%f}", szModifiers, &fDurationSeconds ) == 2 ) // not fatal if this fails due to malformed data { - tn.type = TapNote::attack; + tn.type = TapNoteType_Attack; tn.sAttackModifiers = szModifiers; tn.fAttackDurationSeconds = fDurationSeconds; } @@ -231,7 +231,7 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS /* Optimization: if we pass TAP_EMPTY, NoteData will do a search * to remove anything in this position. We know that there's nothing * there, so avoid the search. */ - if( tn.type != TapNote::empty && ch != '3' ) + if( tn.type != TapNoteType_Empty && ch != '3' ) { tn.pn = pn; out.SetTapNote( iTrack, iIndex, tn ); @@ -251,7 +251,7 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS { NoteData::iterator next = Increment( begin ); const TapNote &tn = begin->second; - if( tn.type == TapNote::hold_head && tn.iDuration == MAX_NOTE_ROW ) + if( tn.type == TapNoteType_HoldHead && tn.iDuration == MAX_NOTE_ROW ) { int iRow = begin->first; LOG->UserLog( "", "", "While loading .sm/.ssc note data, there was an unmatched 2 at beat %f", NoteRowToBeat(iRow) ); @@ -325,11 +325,11 @@ void NoteDataUtil::InsertHoldTails( NoteData &inout ) { int iRow = begin->first; const TapNote &tn = begin->second; - if( tn.type != TapNote::hold_head ) + if( tn.type != TapNoteType_HoldHead ) continue; TapNote tail = tn; - tail.type = TapNote::hold_tail; + tail.type = TapNoteType_HoldTail; /* If iDuration is 0, we'd end up overwriting the head with the tail * (and invalidating our iterator). Empty hold notes aren't valid. */ @@ -387,36 +387,36 @@ void NoteDataUtil::GetSMNoteDataString( const NoteData &in, RString &sRet ) char c; switch( tn.type ) { - case TapNote::empty: c = '0'; break; - case TapNote::tap: c = '1'; break; - case TapNote::hold_head: + case TapNoteType_Empty: c = '0'; break; + case TapNoteType_Tap: c = '1'; break; + case TapNoteType_HoldHead: switch( tn.subType ) { - case TapNote::hold_head_hold: c = '2'; break; - case TapNote::hold_head_roll: c = '4'; break; - //case TapNote::hold_head_mine: c = 'N'; break; + case TapNoteSubType_Hold: c = '2'; break; + case TapNoteSubType_Roll: c = '4'; break; + //case TapNoteSubType_Mine: c = 'N'; break; default: FAIL_M(ssprintf("Invalid tap note subtype: %i", tn.subType)); } break; - case TapNote::hold_tail: c = '3'; break; - case TapNote::mine: c = 'M'; break; - case TapNote::attack: c = 'A'; break; - case TapNote::autoKeysound: c = 'K'; break; - case TapNote::lift: c = 'L'; break; - case TapNote::fake: c = 'F'; break; + case TapNoteType_HoldTail: c = '3'; break; + case TapNoteType_Mine: c = 'M'; break; + case TapNoteType_Attack: c = 'A'; break; + case TapNoteType_AutoKeysound: c = 'K'; break; + case TapNoteType_Lift: c = 'L'; break; + case TapNoteType_Fake: c = 'F'; break; default: c = '\0'; FAIL_M(ssprintf("Invalid tap note type: %i", tn.type)); } sRet.append( 1, c ); - if( tn.type == TapNote::attack ) + if( tn.type == TapNoteType_Attack ) { sRet.append( ssprintf("{%s:%.2f}", tn.sAttackModifiers.c_str(), tn.fAttackDurationSeconds) ); } - // hey maybe if we have TapNote::item we can do things here. + // hey maybe if we have TapNoteType_Item we can do things here. if( tn.iKeysoundIndex >= 0 ) sRet.append( ssprintf("[%d]",tn.iKeysoundIndex) ); } @@ -482,7 +482,7 @@ void NoteDataUtil::CombineCompositeNoteData( NoteData &out, const vectorfirst; if( out.IsHoldNoteAtRow(track, i->first) ) continue; - if( i->second.type == TapNote::hold_head ) + if( i->second.type == TapNoteType_HoldHead ) out.AddHoldNote( track, row, row + i->second.iDuration, i->second ); else out.SetTapNote( track, row, i->second ); @@ -592,7 +592,7 @@ void PlaceAutoKeysound( NoteData &out, int row, TapNote akTap ) if( iEmptyTrack != -1 ) { - akTap.type = TapNote::autoKeysound; + akTap.type = TapNoteType_AutoKeysound; out.SetTapNote( iEmptyTrack, iEmptyRow, akTap ); } } @@ -623,12 +623,12 @@ void NoteDataUtil::LoadOverlapped( const NoteData &in, NoteData &out, int iNewNu for( int iTrackFrom = 0; iTrackFrom < in.GetNumTracks(); ++iTrackFrom ) { const TapNote &tnFrom = in.GetTapNote( iTrackFrom, row ); - if( tnFrom.type == TapNote::empty || tnFrom.type == TapNote::autoKeysound ) + if( tnFrom.type == TapNoteType_Empty || tnFrom.type == TapNoteType_AutoKeysound ) continue; // If this is a hold note, find the end. int iEndIndex = row; - if( tnFrom.type == TapNote::hold_head ) + if( tnFrom.type == TapNoteType_HoldHead ) iEndIndex = row + tnFrom.iDuration; int &iTrackTo = DestRow[iTrackFrom]; @@ -659,7 +659,7 @@ void NoteDataUtil::LoadOverlapped( const NoteData &in, NoteData &out, int iNewNu LastSourceTrack[iTrackTo] = iTrackFrom; LastSourceRow[iTrackTo] = iEndIndex; out.SetTapNote( iTrackTo, row, tnFrom ); - if( tnFrom.type == TapNote::hold_head ) + if( tnFrom.type == TapNoteType_HoldHead ) { const TapNote &tnTail = in.GetTapNote( iTrackFrom, iEndIndex ); out.SetTapNote( iTrackTo, iEndIndex, tnTail ); @@ -670,7 +670,7 @@ void NoteDataUtil::LoadOverlapped( const NoteData &in, NoteData &out, int iNewNu for( int iTrackFrom = 0; iTrackFrom < in.GetNumTracks(); ++iTrackFrom ) { const TapNote &tnFrom = in.GetTapNote( iTrackFrom, row ); - if( tnFrom.type != TapNote::autoKeysound ) + if( tnFrom.type != TapNoteType_AutoKeysound ) continue; PlaceAutoKeysound( out, row, tnFrom ); @@ -685,7 +685,7 @@ int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow ) for( int t=0; tsecond++; - if( tn.type == TapNote::tap || tn.type == TapNote::lift || tn.type == TapNote::hold_head ) + if( tn.type == TapNoteType_Tap || tn.type == TapNoteType_Lift || tn.type == TapNoteType_HoldHead ) { simultaneousMapTapHoldHead[r] = 1; } - if( tn.type == TapNote::hold_head ) + if( tn.type == TapNoteType_HoldHead ) { int searchStartRow = r + 1; int searchEndRow = r + tn.iDuration; @@ -834,9 +834,9 @@ RadarStats CalculateRadarStatsFast( const NoteData &in, RadarStats &out ) { switch( in.GetTapNote(t, rr).type ) { - case TapNote::mine: - case TapNote::empty: - case TapNote::fake: + case TapNoteType_Mine: + case TapNoteType_Empty: + case TapNoteType_Fake: continue; // skip these types - they don't count default: break; } @@ -980,10 +980,10 @@ void NoteDataUtil::RemoveHoldNotes( NoteData &in, int iStartIndex, int iEndIndex in.GetTapNoteRangeInclusive( t, iStartIndex, iEndIndex, begin, end ); for( ; begin != end; ++begin ) { - if( begin->second.type != TapNote::hold_head || - begin->second.subType != TapNote::hold_head_hold ) + if( begin->second.type != TapNoteType_HoldHead || + begin->second.subType != TapNoteSubType_Hold ) continue; - begin->second.type = TapNote::tap; + begin->second.type = TapNoteType_Tap; } } in.RevalidateATIs(vector(), false); @@ -997,10 +997,10 @@ void NoteDataUtil::ChangeRollsToHolds( NoteData &in, int iStartIndex, int iEndIn in.GetTapNoteRangeInclusive( t, iStartIndex, iEndIndex, begin, end ); for( ; begin != end; ++begin ) { - if( begin->second.type != TapNote::hold_head || - begin->second.subType != TapNote::hold_head_roll ) + if( begin->second.type != TapNoteType_HoldHead || + begin->second.subType != TapNoteSubType_Roll ) continue; - begin->second.subType = TapNote::hold_head_hold; + begin->second.subType = TapNoteSubType_Hold; } } in.RevalidateATIs(vector(), false); @@ -1014,10 +1014,10 @@ void NoteDataUtil::ChangeHoldsToRolls( NoteData &in, int iStartIndex, int iEndIn in.GetTapNoteRangeInclusive( t, iStartIndex, iEndIndex, begin, end ); for( ; begin != end; ++begin ) { - if( begin->second.type != TapNote::hold_head || - begin->second.subType != TapNote::hold_head_hold ) + if( begin->second.type != TapNoteType_HoldHead || + begin->second.subType != TapNoteSubType_Hold ) continue; - begin->second.subType = TapNote::hold_head_roll; + begin->second.subType = TapNoteSubType_Roll; } } in.RevalidateATIs(vector(), false); @@ -1052,7 +1052,7 @@ void NoteDataUtil::RemoveSimultaneousNotes( NoteData &in, int iMaxSimultaneous, for( int t=0; iTracksToRemove>0 && tsecond.type == TapNote::tap ) + if( iter != inout.end(track) && iter->second.type == TapNoteType_Tap ) inout.RemoveTapNote( track, iter ); } inout.RevalidateATIs(vector(), false); @@ -1474,16 +1474,16 @@ static void SuperShuffleTaps( NoteData &inout, int iStartIndex, int iEndIndex ) const TapNote &tn1 = inout.GetTapNote( t1, r ); switch( tn1.type ) { - case TapNote::empty: - case TapNote::hold_head: - case TapNote::hold_tail: - case TapNote::autoKeysound: + case TapNoteType_Empty: + case TapNoteType_HoldHead: + case TapNoteType_HoldTail: + case TapNoteType_AutoKeysound: continue; // skip - case TapNote::tap: - case TapNote::mine: - case TapNote::attack: - case TapNote::lift: - case TapNote::fake: + case TapNoteType_Tap: + case TapNoteType_Mine: + case TapNoteType_Attack: + case TapNoteType_Lift: + case TapNoteType_Fake: break; // shuffle this DEFAULT_FAIL( tn1.type ); } @@ -1506,16 +1506,16 @@ static void SuperShuffleTaps( NoteData &inout, int iStartIndex, int iEndIndex ) const TapNote &tn2 = inout.GetTapNote( t2, r ); switch( tn2.type ) { - case TapNote::hold_head: - case TapNote::hold_tail: - case TapNote::autoKeysound: + case TapNoteType_HoldHead: + case TapNoteType_HoldTail: + case TapNoteType_AutoKeysound: continue; // don't swap with these - case TapNote::empty: - case TapNote::tap: - case TapNote::mine: - case TapNote::attack: - case TapNote::lift: - case TapNote::fake: + case TapNoteType_Empty: + case TapNoteType_Tap: + case TapNoteType_Mine: + case TapNoteType_Attack: + case TapNoteType_Lift: + case TapNoteType_Fake: break; // ok to swap with this DEFAULT_FAIL( tn2.type ); } @@ -1565,7 +1565,7 @@ void NoteDataUtil::Backwards( NoteData &inout ) int iRowLater = max_row-r; const TapNote &tnEarlier = inout.GetTapNote( t, iRowEarlier ); - if( tnEarlier.type == TapNote::hold_head ) + if( tnEarlier.type == TapNoteType_HoldHead ) iRowLater -= tnEarlier.iDuration; out.SetTapNote( t, iRowLater, tnEarlier ); @@ -1651,7 +1651,7 @@ void NoteDataUtil::Wide( NoteData &inout, int iStartIndex, int iEndIndex ) iTrackToAdd--; CLAMP( iTrackToAdd, 0, inout.GetNumTracks()-1 ); - if( inout.GetTapNote(iTrackToAdd, i).type != TapNote::empty && inout.GetTapNote(iTrackToAdd, i).type != TapNote::fake ) + if( inout.GetTapNote(iTrackToAdd, i).type != TapNoteType_Empty && inout.GetTapNote(iTrackToAdd, i).type != TapNoteType_Fake ) { iTrackToAdd = (iTrackToAdd+1) % inout.GetNumTracks(); } @@ -1850,7 +1850,7 @@ void NoteDataUtil::AddMines( NoteData &inout, int iStartIndex, int iEndIndex ) if( iRowCount>=iPlaceEveryRows ) { for( int t=0; t iSimultaneousHolds ) break; - if( inout.GetTapNote(t,r).type == TapNote::tap ) + if( inout.GetTapNote(t,r).type == TapNoteType_Tap ) { // Find the ending row for this hold int iTapsLeft = iSimultaneousHolds; @@ -1985,7 +1985,7 @@ void NoteDataUtil::ConvertTapsToHolds( NoteData &inout, int iSimultaneousHolds, // If there are two taps in a row on the same track, // don't convert the earlier one to a hold. - if( inout.GetTapNote(t,r2).type != TapNote::empty ) + if( inout.GetTapNote(t,r2).type != TapNoteType_Empty ) { addHold = false; break; @@ -2035,7 +2035,7 @@ void NoteDataUtil::Stomp( NoteData &inout, StepsType st, int iStartIndex, int iE for( int t=0; t(), false); @@ -2389,9 +2389,9 @@ void NoteDataUtil::AddTapAttacks( NoteData &nd, Song* pSong ) int iBeat = (int)fBeat; int iTrack = iBeat % nd.GetNumTracks(); // deterministically calculates track TapNote tn( - TapNote::attack, - TapNote::SubType_Invalid, - TapNote::original, + TapNoteType_Attack, + TapNoteSubType_Invalid, + TapNoteSource_Original, szAttacks[RandomInt(ARRAYLEN(szAttacks))], 15.0f, -1 ); @@ -2483,7 +2483,7 @@ void NoteDataUtil::DeleteRows( NoteData &nd, int iStartIndex, int iRowsToDelete nd.RevalidateATIs(vector(), false); } -void NoteDataUtil::RemoveAllTapsOfType( NoteData& ndInOut, TapNote::Type typeToRemove ) +void NoteDataUtil::RemoveAllTapsOfType( NoteData& ndInOut, TapNoteType typeToRemove ) { /* Be very careful when deleting the tap notes. Erasing elements from maps using * iterators invalidates only the iterator that is being erased. To that end, @@ -2502,7 +2502,7 @@ void NoteDataUtil::RemoveAllTapsOfType( NoteData& ndInOut, TapNote::Type typeToR ndInOut.RevalidateATIs(vector(), false); } -void NoteDataUtil::RemoveAllTapsExceptForType( NoteData& ndInOut, TapNote::Type typeToKeep ) +void NoteDataUtil::RemoveAllTapsExceptForType( NoteData& ndInOut, TapNoteType typeToKeep ) { /* Same as in RemoveAllTapsOfType(). */ for( int t=0; tsecond; - if( tn.type != TapNote::hold_head ) + if( tn.type != TapNoteType_HoldHead ) continue; if( tn.subType != subType ) continue; @@ -74,7 +74,7 @@ int GetSuccessfulMines( const NoteData &in, int iStartIndex = 0, int iEndIndex = NoteData::all_tracks_const_iterator iter = in.GetTapNoteRangeAllTracks( iStartIndex, iEndIndex ); for( ; !iter.IsAtEnd(); ++iter ) { - if( iter->type == TapNote::mine && iter->result.tns == TNS_AvoidMine ) + if( iter->type == TapNoteType_Mine && iter->result.tns == TNS_AvoidMine ) ++iNumSuccessfulMinesNotes; } return iNumSuccessfulMinesNotes; @@ -93,11 +93,11 @@ int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex = for( int t=0; ttype == TapNote::lift && iter->result.tns >= tns ) + if( iter->type == TapNoteType_Lift && iter->result.tns >= tns ) ++iNumSuccessfulLiftNotes; } return iNumSuccessfulLiftNotes; @@ -153,10 +153,10 @@ int LastTapNoteScoreTrack( const NoteData &in, unsigned iRow, PlayerNumber pn ) { /* Skip empty tracks and mines */ const TapNote &tn = in.GetTapNote( t, iRow ); - if (tn.type == TapNote::empty || - tn.type == TapNote::mine || - tn.type == TapNote::fake || - tn.type == TapNote::autoKeysound) + if (tn.type == TapNoteType_Empty || + tn.type == TapNoteType_Mine || + tn.type == TapNoteType_Fake || + tn.type == TapNoteType_AutoKeysound) continue; if( tn.pn != PLAYER_INVALID && tn.pn != pn && pn != PLAYER_INVALID ) continue; @@ -190,10 +190,10 @@ int MinTapNoteScoreTrack( const NoteData &in, unsigned iRow, PlayerNumber pn ) { // Skip empty tracks and mines const TapNote &tn = in.GetTapNote( t, iRow ); - if (tn.type == TapNote::empty || - tn.type == TapNote::mine || - tn.type == TapNote::fake || - tn.type == TapNote::autoKeysound) + if (tn.type == TapNoteType_Empty || + tn.type == TapNoteType_Mine || + tn.type == TapNoteType_Fake || + tn.type == TapNoteType_AutoKeysound) continue; if( tn.pn != PLAYER_INVALID && tn.pn != pn && pn != PLAYER_INVALID ) continue; @@ -256,10 +256,10 @@ TapNoteScore NoteDataWithScoring::MinTapNoteScore( const NoteData &in, unsigned { // Ignore mines (and fake arrows), or the score will always be TNS_None. const TapNote &tn = in.GetTapNote( t, row ); - if (tn.type == TapNote::empty || - tn.type == TapNote::mine || - tn.type == TapNote::fake || - tn.type == TapNote::autoKeysound || + if (tn.type == TapNoteType_Empty || + tn.type == TapNoteType_Mine || + tn.type == TapNoteType_Fake || + tn.type == TapNoteType_AutoKeysound || ( plnum != PlayerNumber_Invalid && tn.pn != plnum ) ) continue; score = min( score, tn.result.tns ); @@ -332,8 +332,8 @@ float GetActualFreezeRadarValue( const NoteData &in, float fSongSeconds ) return 1.0f; const int ActualHolds = - GetNumHoldNotesWithScore( in, TapNote::hold_head_hold, HNS_Held ) + - GetNumHoldNotesWithScore( in, TapNote::hold_head_roll, HNS_Held ); + GetNumHoldNotesWithScore( in, TapNoteSubType_Hold, HNS_Held ) + + GetNumHoldNotesWithScore( in, TapNoteSubType_Roll, HNS_Held ); return clamp( float(ActualHolds) / iTotalHolds, 0.0f, 1.0f ); } @@ -355,13 +355,13 @@ void NoteDataWithScoring::GetActualRadarValues( const NoteData &in, const Player case RadarCategory_Chaos: out[rc] = GetActualChaosRadarValue( in, fSongSeconds, pss ); break; case RadarCategory_TapsAndHolds: out[rc] = (float) GetNumNWithScore( in, TNS_W4, 1 ); break; case RadarCategory_Jumps: out[rc] = (float) GetNumNWithScore( in, TNS_W4, 2 ); break; - case RadarCategory_Holds: out[rc] = (float) GetNumHoldNotesWithScore( in, TapNote::hold_head_hold, HNS_Held ); break; + case RadarCategory_Holds: out[rc] = (float) GetNumHoldNotesWithScore( in, TapNoteSubType_Hold, HNS_Held ); break; case RadarCategory_Mines: out[rc] = (float) GetSuccessfulMines( in ); break; case RadarCategory_Hands: out[rc] = (float) GetSuccessfulHands( in ); break; - case RadarCategory_Rolls: out[rc] = (float) GetNumHoldNotesWithScore( in, TapNote::hold_head_roll, HNS_Held ); break; + case RadarCategory_Rolls: out[rc] = (float) GetNumHoldNotesWithScore( in, TapNoteSubType_Roll, HNS_Held ); break; case RadarCategory_Lifts: out[rc] = (float) GetSuccessfulLifts( in, MIN_SCORE_TO_MAINTAIN_COMBO ); break; case RadarCategory_Fakes: out[rc] = (float) in.GetNumFakes(); break; - //case RadarCategory_Minefields: out[rc] = (float) GetNumMinefieldsWithScore( in, TapNote::hold_head_mine, HNS_Held ); break; + //case RadarCategory_Minefields: out[rc] = (float) GetNumMinefieldsWithScore( in, TapNoteSubType_Mine, HNS_Held ); break; DEFAULT_FAIL( rc ); } } diff --git a/src/NoteDisplay.cpp b/src/NoteDisplay.cpp index 94cdb1cb23..e8d4d51312 100644 --- a/src/NoteDisplay.cpp +++ b/src/NoteDisplay.cpp @@ -519,24 +519,24 @@ void NoteDisplay::DrawHoldBody( const TapNote& tn, int iCol, float fBeat, bool b float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar ) { vector vpSprTop; - Sprite *pSpriteTop = GetHoldSprite( m_HoldTopCap, NotePart_HoldTopCap, fBeat, tn.subType == TapNote::hold_head_roll, bIsBeingHeld && !cache->m_bHoldActiveIsAddLayer ); + Sprite *pSpriteTop = GetHoldSprite( m_HoldTopCap, NotePart_HoldTopCap, fBeat, tn.subType == TapNoteSubType_Roll, bIsBeingHeld && !cache->m_bHoldActiveIsAddLayer ); vpSprTop.push_back( pSpriteTop ); vector vpSprBody; - Sprite *pSpriteBody = GetHoldSprite( m_HoldBody, NotePart_HoldBody, fBeat, tn.subType == TapNote::hold_head_roll, bIsBeingHeld && !cache->m_bHoldActiveIsAddLayer ); + Sprite *pSpriteBody = GetHoldSprite( m_HoldBody, NotePart_HoldBody, fBeat, tn.subType == TapNoteSubType_Roll, bIsBeingHeld && !cache->m_bHoldActiveIsAddLayer ); vpSprBody.push_back( pSpriteBody ); vector vpSprBottom; - Sprite *pSpriteBottom = GetHoldSprite( m_HoldBottomCap, NotePart_HoldBottomCap, fBeat, tn.subType == TapNote::hold_head_roll, bIsBeingHeld && !cache->m_bHoldActiveIsAddLayer ); + Sprite *pSpriteBottom = GetHoldSprite( m_HoldBottomCap, NotePart_HoldBottomCap, fBeat, tn.subType == TapNoteSubType_Roll, bIsBeingHeld && !cache->m_bHoldActiveIsAddLayer ); vpSprBottom.push_back( pSpriteBottom ); if( bIsBeingHeld && cache->m_bHoldActiveIsAddLayer ) { - Sprite *pSprTop = GetHoldSprite( m_HoldTopCap, NotePart_HoldTopCap, fBeat, tn.subType == TapNote::hold_head_roll, true ); + Sprite *pSprTop = GetHoldSprite( m_HoldTopCap, NotePart_HoldTopCap, fBeat, tn.subType == TapNoteSubType_Roll, true ); vpSprTop.push_back( pSprTop ); - Sprite *pSprBody = GetHoldSprite( m_HoldBody, NotePart_HoldBody, fBeat, tn.subType == TapNote::hold_head_roll, true ); + Sprite *pSprBody = GetHoldSprite( m_HoldBody, NotePart_HoldBody, fBeat, tn.subType == TapNoteSubType_Roll, true ); vpSprBody.push_back( pSprBody ); - Sprite *pSprBottom = GetHoldSprite( m_HoldBottomCap, NotePart_HoldBottomCap, fBeat, tn.subType == TapNote::hold_head_roll, true ); + Sprite *pSprBottom = GetHoldSprite( m_HoldBottomCap, NotePart_HoldBottomCap, fBeat, tn.subType == TapNoteSubType_Roll, true ); vpSprBottom.push_back( pSprBottom ); } @@ -659,12 +659,12 @@ void NoteDisplay::DrawHold( const TapNote &tn, int iCol, int iRow, bool bIsBeing /* if( !cache->m_bHoldHeadIsAboveWavyParts ) { - Actor *pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld ); + Actor *pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, NoteRowToBeat(iRow), tn.subType == TapNoteSubType_Roll, bIsBeingHeld ); DrawActor( tn, pActor, NotePart_HoldHead, iCol, bFlipHeadAndTail ? fEndYOffset : fStartYOffset, fBeat, bIsAddition, fPercentFadeToFail, fReverseOffsetPixels, fColorScale, fDrawDistanceAfterTargetsPixels, fDrawDistanceBeforeTargetsPixels, fFadeInPercentOfDrawFar ); } if( !cache->m_bHoldTailIsAboveWavyParts ) { - Actor *pActor = GetHoldActor( m_HoldTail, NotePart_HoldTail, NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld ); + Actor *pActor = GetHoldActor( m_HoldTail, NotePart_HoldTail, NoteRowToBeat(iRow), tn.subType == TapNoteSubType_Roll, bIsBeingHeld ); DrawActor( tn, pActor, NotePart_HoldTail, iCol, bFlipHeadAndTail ? fStartYOffset : fEndYOffset, fBeat, bIsAddition, fPercentFadeToFail, fReverseOffsetPixels, fColorScale, fDrawDistanceAfterTargetsPixels, fDrawDistanceBeforeTargetsPixels, fFadeInPercentOfDrawFar ); } */ @@ -677,19 +677,19 @@ void NoteDisplay::DrawHold( const TapNote &tn, int iCol, int iRow, bool bIsBeing // of the head and tail. Perhaps make this a theme/noteskin metric? -aj if( cache->m_bHoldTailIsAboveWavyParts ) { - Actor *pActor = GetHoldActor( m_HoldTail, NotePart_HoldTail, NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld ); + Actor *pActor = GetHoldActor( m_HoldTail, NotePart_HoldTail, NoteRowToBeat(iRow), tn.subType == TapNoteSubType_Roll, bIsBeingHeld ); DrawActor( tn, pActor, NotePart_HoldTail, iCol, bFlipHeadAndTail ? fStartYOffset : fEndYOffset, fBeat, bIsAddition, fPercentFadeToFail, fReverseOffsetPixels, fColorScale, fDrawDistanceAfterTargetsPixels, fDrawDistanceBeforeTargetsPixels, fFadeInPercentOfDrawFar ); } if( cache->m_bHoldHeadIsAboveWavyParts ) { - Actor *pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld ); + Actor *pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, NoteRowToBeat(iRow), tn.subType == TapNoteSubType_Roll, bIsBeingHeld ); DrawActor( tn, pActor, NotePart_HoldHead, iCol, bFlipHeadAndTail ? fEndYOffset : fStartYOffset, fBeat, bIsAddition, fPercentFadeToFail, fReverseOffsetPixels, fColorScale, fDrawDistanceAfterTargetsPixels, fDrawDistanceBeforeTargetsPixels, fFadeInPercentOfDrawFar ); } } void NoteDisplay::DrawActor( const TapNote& tn, Actor* pActor, NotePart part, int iCol, float fYOffset, float fBeat, bool bIsAddition, float fPercentFadeToFail, float fReverseOffsetPixels, float fColorScale, float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar ) { - if (tn.type == TapNote::autoKeysound && !GAMESTATE->m_bInStepEditor) return; + if (tn.type == TapNoteType_AutoKeysound && !GAMESTATE->m_bInStepEditor) return; if( fYOffset < fDrawDistanceAfterTargetsPixels || fYOffset > fDrawDistanceBeforeTargetsPixels ) return; const float fY = ArrowEffects::GetYPos( m_pPlayerState, iCol, fYOffset, fReverseOffsetPixels ); @@ -702,8 +702,8 @@ void NoteDisplay::DrawActor( const TapNote& tn, Actor* pActor, NotePart part, in float fRotationX = 0, fRotationZ = 0; const float fRotationY = ArrowEffects::GetRotationY( m_pPlayerState, fYOffset ); - bool bIsHoldHead = tn.type == tn.hold_head; - bool bIsHoldCap = bIsHoldHead || tn.type == tn.hold_tail; + bool bIsHoldHead = tn.type == TapNoteType_HoldHead; + bool bIsHoldCap = bIsHoldHead || tn.type == TapNoteType_HoldTail; fRotationZ = ArrowEffects::GetRotationZ( m_pPlayerState, fBeat, bIsHoldHead ); if( !bIsHoldCap ) @@ -711,7 +711,7 @@ void NoteDisplay::DrawActor( const TapNote& tn, Actor* pActor, NotePart part, in fRotationX = ArrowEffects::GetRotationX( m_pPlayerState, fYOffset ); } - if( tn.type != tn.hold_head ) + if( tn.type != TapNoteType_HoldHead ) fColorScale *= ArrowEffects::GetBrightness( m_pPlayerState, fBeat ); pActor->SetRotationX( fRotationX ); @@ -752,23 +752,23 @@ void NoteDisplay::DrawTap(const TapNote& tn, int iCol, float fBeat, Actor* pActor = NULL; NotePart part = NotePart_Tap; /* - if( tn.source == TapNote::addition ) + if( tn.source == TapNoteSource_Addition ) { pActor = GetTapActor( m_TapAddition, NotePart_Addition, fBeat ); part = NotePart_Addition; } */ - if( tn.type == TapNote::lift ) + if( tn.type == TapNoteType_Lift ) { pActor = GetTapActor( m_TapLift, NotePart_Lift, fBeat ); part = NotePart_Lift; } - else if( tn.type == TapNote::mine ) + else if( tn.type == TapNoteType_Mine ) { pActor = GetTapActor( m_TapMine, NotePart_Mine, fBeat ); part = NotePart_Mine; } - else if( tn.type == TapNote::fake ) + else if( tn.type == TapNoteType_Fake ) { pActor = GetTapActor( m_TapFake, NotePart_Fake, fBeat ); part = NotePart_Fake; @@ -812,7 +812,7 @@ void NoteDisplay::DrawTap(const TapNote& tn, int iCol, float fBeat, pActor = GetTapActor( m_TapNote, NotePart_Tap, fBeat ); } - if( tn.type == TapNote::attack ) + if( tn.type == TapNoteType_Attack ) { Message msg( "SetAttack" ); msg.SetParam( "Modifiers", tn.sAttackModifiers ); @@ -823,7 +823,7 @@ void NoteDisplay::DrawTap(const TapNote& tn, int iCol, float fBeat, // this is the line that forces the (1,1,1,x) part of the noteskin diffuse -aj DrawActor( tn, pActor, part, iCol, fYOffset, fBeat, bIsAddition, fPercentFadeToFail, fReverseOffsetPixels, 1.0f, fDrawDistanceAfterTargetsPixels, fDrawDistanceBeforeTargetsPixels, fFadeInPercentOfDrawFar ); - if( tn.type == TapNote::attack ) + if( tn.type == TapNoteType_Attack ) pActor->PlayCommand( "UnsetAttack" ); } diff --git a/src/NoteField.cpp b/src/NoteField.cpp index 56fa3a3a6d..6bde0e551a 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -1214,7 +1214,7 @@ void NoteField::DrawPrimitives() for( ; begin != end; ++begin ) { const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, j); - if( tn.type != TapNote::hold_head ) + if( tn.type != TapNoteType_HoldHead ) continue; // skip const HoldNoteResult &Result = tn.HoldResult; @@ -1243,7 +1243,7 @@ void NoteField::DrawPrimitives() continue; // skip } - bool bIsAddition = (tn.source == TapNote::addition); + bool bIsAddition = (tn.source == TapNoteSource_Addition); bool bIsHopoPossible = (tn.bHopoPossible); bool bUseAdditionColoring = bIsAddition || bIsHopoPossible; const bool bHoldGhostShowing = tn.HoldResult.bActive && tn.HoldResult.fLife > 0; @@ -1280,13 +1280,13 @@ void NoteField::DrawPrimitives() // Fixes hold head overlapping issue, but not the rolls. switch( tn.type ) { - case TapNote::empty: // no note here + case TapNoteType_Empty: // no note here { continue; } - case TapNote::hold_head: + case TapNoteType_HoldHead: { - //if (tn.subType == TapNote::hold_head_roll) + //if (tn.subType == TapNoteSubType_Roll) continue; // skip } default: break; @@ -1313,8 +1313,8 @@ void NoteField::DrawPrimitives() for( int c2=0; c2GetNumTracks(); c2++ ) { const TapNote &tmp = m_pNoteData->GetTapNote(c2, q); - if(tmp.type == TapNote::hold_head && - tmp.subType == TapNote::hold_head_hold) + if(tmp.type == TapNoteType_HoldHead && + tmp.subType == TapNoteSubType_Hold) { bHoldNoteBeginsOnThisBeat = true; break; @@ -1329,8 +1329,8 @@ void NoteField::DrawPrimitives() for( int c2=0; c2GetNumTracks(); c2++ ) { const TapNote &tmp = m_pNoteData->GetTapNote(c2, q); - if(tmp.type == TapNote::hold_head && - tmp.subType == TapNote::hold_head_roll) + if(tmp.type == TapNoteType_HoldHead && + tmp.subType == TapNoteSubType_Roll) { bRollNoteBeginsOnThisBeat = true; break; @@ -1342,7 +1342,7 @@ void NoteField::DrawPrimitives() if( m_iBeginMarker!=-1 && m_iEndMarker!=-1 ) bIsInSelectionRange = m_iBeginMarker<=q && q TapNote::fake ) + if (type_ > TapNoteType_Fake ) { - LOG->Trace("Invalid tap note type %d (most likely) due to random vanish issues. Assume it doesn't need judging.", (int)type_ ); - type = TapNote::empty; + LOG->Trace("Invalid tap note type %d (most likely) due to random vanish issues. Assume it doesn't need judging.", TapNoteTypeToString(type_).c_str() ); + type = TapNoteType_Empty; } } @@ -207,39 +223,6 @@ extern TapNote TAP_ORIGINAL_FAKE; // 'F' extern TapNote TAP_ADDITION_TAP; extern TapNote TAP_ADDITION_MINE; -/** - * @brief Retrieve the string representing the TapNote Type. - * - * TODO: Find a way to standardize this with the other enum string calls. - * @param tn the TapNote's type. - * @return the intended string. */ -inline const RString TapNoteTypeToString( TapNote::Type tn ) -{ - switch( tn ) - { - case TapNote::empty: - return RString("empty"); - case TapNote::tap: - return RString("tap"); - case TapNote::hold_head: - return RString("hold_head"); - case TapNote::hold_tail: - return RString("hold_tail"); - case TapNote::mine: - return RString("mine"); - case TapNote::lift: - return RString("lift"); - case TapNote::attack: - return RString("attack"); - case TapNote::autoKeysound: - return RString("autoKeysound"); - case TapNote::fake: - return RString("fake"); - default: - return RString(""); - } -} - /** * @brief The number of tracks allowed. * diff --git a/src/NotesLoaderBMS.cpp b/src/NotesLoaderBMS.cpp index ef49a5130c..9de9354d7d 100644 --- a/src/NotesLoaderBMS.cpp +++ b/src/NotesLoaderBMS.cpp @@ -942,8 +942,8 @@ bool BMSChartReader::ReadNoteData() { // this object is the end of the hold note. TapNote tn = nd.GetTapNote(track, holdStart[track]); - tn.type = TapNote::hold_head; - tn.subType = TapNote::hold_head_hold; + tn.type = TapNoteType_HoldHead; + tn.subType = TapNoteSubType_Hold; nd.AddHoldNote( track, holdStart[track], row, tn ); holdStart[track] = -1; lastNote[track] = -1; @@ -953,8 +953,8 @@ bool BMSChartReader::ReadNoteData() // this object is the end of the hold note. // lnobj: set last note to hold head. TapNote tn = nd.GetTapNote(track, lastNote[track]); - tn.type = TapNote::hold_head; - tn.subType = TapNote::hold_head_hold; + tn.type = TapNoteType_HoldHead; + tn.subType = TapNoteSubType_Hold; nd.AddHoldNote( track, lastNote[track], row, tn ); holdStart[track] = -1; lastNote[track] = -1; diff --git a/src/NotesLoaderDWI.cpp b/src/NotesLoaderDWI.cpp index e826cf56f0..ece1b5fe1f 100644 --- a/src/NotesLoaderDWI.cpp +++ b/src/NotesLoaderDWI.cpp @@ -367,7 +367,7 @@ static NoteData ParseNoteData(RString &step1, RString &step2, FOREACH_NONEMPTY_ROW_IN_TRACK( newNoteData, t, iHeadRow ) { TapNote tn = newNoteData.GetTapNote( t, iHeadRow ); - if( tn.type != TapNote::hold_head ) + if( tn.type != TapNoteType_HoldHead ) continue; int iTailRow = iHeadRow; @@ -375,9 +375,9 @@ static NoteData ParseNoteData(RString &step1, RString &step2, while( !bFound && newNoteData.GetNextTapNoteRowForTrack(t, iTailRow) ) { const TapNote &TailTap = newNoteData.GetTapNote( t, iTailRow ); - if( TailTap.type == TapNote::empty ) + if( TailTap.type == TapNoteType_Empty ) continue; - + newNoteData.SetTapNote( t, iTailRow, TAP_EMPTY ); tn.iDuration = iTailRow - iHeadRow; newNoteData.SetTapNote( t, iHeadRow, tn ); diff --git a/src/NotesLoaderJson.cpp b/src/NotesLoaderJson.cpp index b09d564454..60d7fd88dc 100644 --- a/src/NotesLoaderJson.cpp +++ b/src/NotesLoaderJson.cpp @@ -89,11 +89,11 @@ static void Deserialize(BackgroundChange &o, const Json::Value &root ) static void Deserialize( TapNote &o, const Json::Value &root ) { - //if( o.type != TapNote::tap ) + //if( o.type != TapNoteType_Tap ) if( root.isInt() ) - o.type = (TapNote::Type)root["Type"].asInt(); - //if( o.type == TapNote::hold_head ) - o.subType = (TapNote::SubType)root["SubType"].asInt(); + o.type = (TapNoteType)root["Type"].asInt(); + //if( o.type == TapNoteType_HoldHead ) + o.subType = (TapNoteSubType)root["SubType"].asInt(); //root["Source"] = (int)source; //if( !o.sAttackModifiers.empty() ) o.sAttackModifiers = root["AttackModifiers"].asString(); diff --git a/src/NotesWriterDWI.cpp b/src/NotesWriterDWI.cpp index 939848e7b3..5ce10f69ea 100644 --- a/src/NotesWriterDWI.cpp +++ b/src/NotesWriterDWI.cpp @@ -123,13 +123,13 @@ static RString NotesToDWIString( const TapNote tnCols[6] ) { switch( tnCols[col].type ) { - case TapNote::empty: - case TapNote::mine: + case TapNoteType_Empty: + case TapNoteType_Mine: continue; default: break; } - if( tnCols[col].type == TapNote::hold_head ) + if( tnCols[col].type == TapNoteType_HoldHead ) holds += dirs[col]; else taps += dirs[col]; diff --git a/src/NotesWriterJson.cpp b/src/NotesWriterJson.cpp index e1b056a9f0..0854d1d17e 100644 --- a/src/NotesWriterJson.cpp +++ b/src/NotesWriterJson.cpp @@ -55,9 +55,9 @@ static void Serialize( const TapNote &o, Json::Value &root ) { root = Json::Value(Json::objectValue); - if( o.type != TapNote::tap ) + if( o.type != TapNoteType_Tap ) root["Type"] = (int)o.type; - if( o.type == TapNote::hold_head ) + if( o.type == TapNoteType_HoldHead ) root["SubType"] = (int)o.subType; //root["Source"] = (int)source; if( !o.sAttackModifiers.empty() ) diff --git a/src/Player.cpp b/src/Player.cpp index 6a7e8a990c..0865791d96 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -537,16 +537,16 @@ static bool NeedsTapJudging( const TapNote &tn ) switch( tn.type ) { DEFAULT_FAIL( tn.type ); - case TapNote::tap: - case TapNote::hold_head: - case TapNote::mine: - case TapNote::lift: + case TapNoteType_Tap: + case TapNoteType_HoldHead: + case TapNoteType_Mine: + case TapNoteType_Lift: return tn.result.tns == TNS_None; - case TapNote::hold_tail: - case TapNote::attack: - case TapNote::autoKeysound: - case TapNote::fake: - case TapNote::empty: + case TapNoteType_HoldTail: + case TapNoteType_Attack: + case TapNoteType_AutoKeysound: + case TapNoteType_Fake: + case TapNoteType_Empty: return false; } } @@ -560,16 +560,16 @@ static bool NeedsHoldJudging( const TapNote &tn ) switch( tn.type ) { DEFAULT_FAIL( tn.type ); - case TapNote::hold_head: + case TapNoteType_HoldHead: return tn.HoldResult.hns == HNS_None; - case TapNote::tap: - case TapNote::hold_tail: - case TapNote::mine: - case TapNote::lift: - case TapNote::attack: - case TapNote::autoKeysound: - case TapNote::fake: - case TapNote::empty: + case TapNoteType_Tap: + case TapNoteType_HoldTail: + case TapNoteType_Mine: + case TapNoteType_Lift: + case TapNoteType_Attack: + case TapNoteType_AutoKeysound: + case TapNoteType_Fake: + case TapNoteType_Empty: return false; } } @@ -947,7 +947,7 @@ void Player::Update( float fDeltaTime ) iHeadRow = iSongRow; const TapNote &tn = m_NoteData.GetTapNote( iTrack, iHeadRow ); - if( tn.type != TapNote::hold_head || tn.subType != TapNote::hold_head_roll ) + if( tn.type != TapNoteType_HoldHead || tn.subType != TapNoteSubType_Roll ) continue; if( tn.HoldResult.hns != HNS_None ) continue; @@ -981,7 +981,7 @@ void Player::Update( float fDeltaTime ) for( ; !iter.IsAtEnd() && iter.Row() <= iSongRow; ++iter ) { TapNote &tn = *iter; - if( tn.type != TapNote::hold_head ) + if( tn.type != TapNoteType_HoldHead ) continue; int iTrack = iter.Track(); @@ -994,9 +994,9 @@ void Player::Update( float fDeltaTime ) switch( tn.subType ) { DEFAULT_FAIL( tn.subType ); - case TapNote::hold_head_hold: + case TapNoteSubType_Hold: break; - case TapNote::hold_head_roll: + case TapNoteSubType_Roll: { vector v; v.push_back( trtn ); @@ -1005,7 +1005,7 @@ void Player::Update( float fDeltaTime ) continue; // don't process this below } /* - case TapNote::hold_head_mine: + case TapNoteSubType_Mine: break; */ @@ -1088,14 +1088,14 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vectoriTrack; ASSERT( iStartRow == trtn->iRow ); TapNote &tn = *trtn->pTN; int iEndRow = iStartRow + tn.iDuration; - if( subType == TapNote::SubType_Invalid ) + if( subType == TapNoteSubType_Invalid ) subType = tn.subType; /* All holds must be of the same subType because fLife is handled @@ -1250,7 +1250,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vectorpTN; @@ -1296,7 +1296,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vectorpTN; @@ -1311,7 +1311,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() ) { - float factor = (tn.subType == TapNote::hold_head_roll ? 2.0f * fLifeFraction : 10.0f * fLifeFraction - 8.5f); + float factor = (tn.subType == TapNoteSubType_Roll ? 2.0f * fLifeFraction : 10.0f * fLifeFraction - 8.5f); m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", max(0.0f, min(1.0f, factor)) * fVol); } } @@ -1667,7 +1667,7 @@ int Player::GetClosestNoteDirectional( int col, int iStartRow, int iEndRow, bool if (!m_Timing->IsJudgableAtRow( begin->first )) break; // unsure if autoKeysounds should be excluded. -Wolfman2000 - if( tn.type == TapNote::empty || tn.type == TapNote::autoKeysound ) + if( tn.type == TapNoteType_Empty || tn.type == TapNoteType_AutoKeysound ) break; if( !bAllowGraded && tn.result.tns != TNS_None ) break; @@ -1974,7 +1974,7 @@ void Player::PlayKeysound( const TapNote &tn, TapNoteScore score ) if( tn.iKeysoundIndex >= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() ) { // handle a case for hold notes - if( tn.type == TapNote::hold_head ) + if( tn.type == TapNoteType_HoldHead ) { // if the hold is not already held if( tn.HoldResult.hns == HNS_None ) @@ -2046,15 +2046,15 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b for( ; begin != end; ++begin ) { TapNote &tn = begin->second; - if( tn.type != TapNote::hold_head ) + if( tn.type != TapNoteType_HoldHead ) continue; switch( tn.subType ) { DEFAULT_FAIL( tn.subType ); - case TapNote::hold_head_hold: + case TapNoteSubType_Hold: continue; - case TapNote::hold_head_roll: + case TapNoteSubType_Roll: break; } @@ -2240,18 +2240,18 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b case PC_HUMAN: switch( pTN->type ) { - case TapNote::mine: + case TapNoteType_Mine: // Stepped too close to mine? if( !bRelease && ( REQUIRE_STEP_ON_MINES == !bHeld ) && fSecondsFromExact <= GetWindowSeconds(TW_Mine) && m_Timing->IsJudgableAtRow(iSongRow)) score = TNS_HitMine; break; - case TapNote::attack: + case TapNoteType_Attack: if( !bRelease && fSecondsFromExact <= GetWindowSeconds(TW_Attack) && !pTN->result.bHidden ) score = AllowW1() ? TNS_W1 : TNS_W2; // sentinel break; - case TapNote::hold_head: + case TapNoteType_HoldHead: // oh wow, this was causing the trigger before the hold heads // bug. (It was fNoteOffset > 0.f before) -DaisuMaster if( !REQUIRE_STEP_ON_HOLD_HEADS && ( fNoteOffset <= GetWindowSeconds( TW_W5 ) && GetWindowSeconds( TW_W5 ) != 0 ) ) @@ -2261,7 +2261,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b } // Fall through to default. default: - if( (pTN->type == TapNote::lift) == bRelease ) + if( (pTN->type == TapNoteType_Lift) == bRelease ) { if( fSecondsFromExact <= GetWindowSeconds(TW_W1) ) score = TNS_W1; else if( fSecondsFromExact <= GetWindowSeconds(TW_W2) ) score = TNS_W2; @@ -2292,14 +2292,14 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b // TRICKY: We're asking the AI to judge mines. Consider TNS_W4 and // below as "mine was hit" and everything else as "mine was avoided" - if( pTN->type == TapNote::mine ) + if( pTN->type == TapNoteType_Mine ) { // The CPU hits a lot of mines. Only consider hitting the // first mine for a row. We know we're the first mine if // there are are no mines to the left of us. for( int t=0; ttype == TapNote::attack && score > TNS_W4 ) + if( pTN->type == TapNoteType_Attack && score > TNS_W4 ) score = TNS_W2; // sentinel /* AI will generate misses here. Don't handle a miss like a regular @@ -2405,7 +2405,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b for( int i=0; iGetCurrentStyle()->m_iColsPerPlayer; i++ ) { const TapNote &tn = m_NoteData.GetTapNote( i, iRowOfOverlappingNoteOrRow ); - bool bIsNote = (tn.type != TapNote::empty); + bool bIsNote = (tn.type != TapNoteType_Empty); if( iFirstNoteCol == -1 && bIsNote ) iFirstNoteCol = i; @@ -2432,7 +2432,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b for( int i=GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer-1; i>=0; i-- ) { const TapNote &tn = m_NoteData.GetTapNote( i, iRowOfOverlappingNoteOrRow ); - bool bIsNote = (tn.type != TapNote::empty); + bool bIsNote = (tn.type != TapNoteType_Empty); if( bIsNote ) { iLastNoteCol = i; @@ -2462,7 +2462,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b } const TapNote &tn = m_NoteData.GetTapNote( col, iRowOfOverlappingNoteOrRow ); - ASSERT( tn.type != TapNote::empty ); + ASSERT( tn.type != TapNoteType_Empty ); int iRowsAgoLastNote = 100000; // TODO: find more reasonable value based on HOPO_CHAIN_SECONDS? NoteData::all_tracks_reverse_iterator iter = m_NoteData.GetTapNoteRangeAllTracksReverse( iRowsAgoLastNote-iRowsAgoLastNote, iRowOfOverlappingNoteOrRow-1 ); @@ -2489,7 +2489,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b } // handle attack notes - if( pTN->type == TapNote::attack && score == TNS_W2 ) + if( pTN->type == TapNoteType_Attack && score == TNS_W2 ) { score = TNS_None; // don't score this as anything @@ -2514,7 +2514,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b for( int t=0; tGetCurrentGame()->m_bCountNotesSeparately ) { - if( pTN->type != TapNote::mine ) + if( pTN->type != TapNoteType_Mine ) { const bool bBlind = (m_pPlayerState->m_PlayerOptions.GetCurrent().m_fBlind != 0); // XXX: This is the wrong combo for shared players. @@ -2734,7 +2734,7 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds ) if (!m_Timing->IsJudgableAtRow(iter.Row())) continue; - if( tn.type == TapNote::mine ) + if( tn.type == TapNoteType_Mine ) { tn.result.tns = TNS_AvoidMine; @@ -2793,9 +2793,9 @@ void Player::UpdateJudgedRows() for( int iTrack = 0; iTrack < m_NoteData.GetNumTracks(); ++iTrack ) { const TapNote &tn = m_NoteData.GetTapNote( iTrack, iRow ); - if (tn.type == TapNote::empty || - tn.type == TapNote::mine || - tn.type == TapNote::autoKeysound) continue; + if (tn.type == TapNoteType_Empty || + tn.type == TapNoteType_Mine || + tn.type == TapNoteType_AutoKeysound) continue; SetJudgment( tn.result.tns, iTrack, tn.result.fTapNoteOffset ); } } @@ -2805,8 +2805,8 @@ void Player::UpdateJudgedRows() for( int iTrack = 0; iTrack < m_NoteData.GetNumTracks(); ++iTrack ) { const TapNote &tn = m_NoteData.GetTapNote( iTrack, iRow ); - if (tn.type == TapNote::tap || tn.type == TapNote::lift || - ( tn.type == TapNote::hold_head && REQUIRE_STEP_ON_HOLD_HEADS ) ) + if (tn.type == TapNoteType_Tap || tn.type == TapNoteType_Lift || + ( tn.type == TapNoteType_HoldHead && REQUIRE_STEP_ON_HOLD_HEADS ) ) { viColsWithTaps.push_back( iTrack ); }; @@ -2841,7 +2841,7 @@ void Player::UpdateJudgedRows() *m_pIterUnjudgedMineRows = iter; } - bool bMineNotHidden = tn.type == TapNote::mine && !tn.result.bHidden; + bool bMineNotHidden = tn.type == TapNoteType_Mine && !tn.result.bHidden; if( !bMineNotHidden ) continue; @@ -2916,7 +2916,7 @@ void Player::FlashGhostRow( int iRow ) { const TapNote &tn = m_NoteData.GetTapNote( iTrack, iRow ); - if( tn.type == TapNote::empty || tn.type == TapNote::mine || tn.type == TapNote::fake ) + if( tn.type == TapNoteType_Empty || tn.type == TapNoteType_Mine || tn.type == TapNoteType_Fake ) continue; if( m_pNoteField ) m_pNoteField->DidTapNote( iTrack, lastTNS, bBright ); @@ -2939,7 +2939,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) int iTrack = iter.Track(); switch( tn.type ) { - case TapNote::hold_head: + case TapNoteType_HoldHead: { tn.HoldResult.fLife = INITIAL_HOLD_LIFE; if( !REQUIRE_STEP_ON_HOLD_HEADS ) @@ -2959,7 +2959,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) } break; } - case TapNote::mine: + case TapNoteType_Mine: { // Hold the panel while crossing a mine will cause the mine to explode // TODO: Remove use of PlayerNumber. @@ -2984,9 +2984,9 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) // check to see if there's a note at the crossed row if( m_pPlayerState->m_PlayerController != PC_HUMAN ) { - if (tn.type != TapNote::empty && - tn.type != TapNote::fake && - tn.type != TapNote::autoKeysound && + if (tn.type != TapNoteType_Empty && + tn.type != TapNoteType_Fake && + tn.type != TapNoteType_AutoKeysound && tn.result.tns == TNS_None && this->m_Timing->IsJudgableAtRow(iRow) ) { @@ -3013,7 +3013,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) for (int t = 0; t < m_NoteData.GetNumTracks(); ++t) { const TapNote &tap = m_NoteData.GetTapNote(t, iRow); - if (tap.type == TapNote::autoKeysound) + if (tap.type == TapNoteType_AutoKeysound) { PlayKeysound(tap, TNS_None); } @@ -3047,7 +3047,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) for( ; !nIter.IsAtEnd(); ++nIter ) { TapNote &tn = *nIter; - if( tn.type != TapNote::hold_head ) + if( tn.type != TapNoteType_HoldHead ) continue; int iTrack = nIter.Track(); @@ -3109,10 +3109,10 @@ void Player::HandleTapRowScore( unsigned row ) { const TapNote &tn = m_NoteData.GetTapNote( track, row ); // Mines cannot be handled here. - if (tn.type == TapNote::empty || - tn.type == TapNote::fake || - tn.type == TapNote::mine || - tn.type == TapNote::autoKeysound) + if (tn.type == TapNoteType_Empty || + tn.type == TapNoteType_Fake || + tn.type == TapNoteType_Mine || + tn.type == TapNoteType_AutoKeysound) continue; if( m_pPrimaryScoreKeeper ) m_pPrimaryScoreKeeper->HandleTapScore( tn ); diff --git a/src/ScoreKeeper.cpp b/src/ScoreKeeper.cpp index 2a0825c614..fb85102464 100644 --- a/src/ScoreKeeper.cpp +++ b/src/ScoreKeeper.cpp @@ -19,7 +19,7 @@ void ScoreKeeper::GetScoreOfLastTapInRow( const NoteData &nd, int iRow, { const TapNote &tn = nd.GetTapNote( track, iRow ); - if( tn.type != TapNote::tap && tn.type != TapNote::hold_head ) + if( tn.type != TapNoteType_Tap && tn.type != TapNoteType_HoldHead ) continue; ++iNum; } diff --git a/src/ScoreKeeperNormal.cpp b/src/ScoreKeeperNormal.cpp index 59e768ab0e..6cb4e42ec0 100644 --- a/src/ScoreKeeperNormal.cpp +++ b/src/ScoreKeeperNormal.cpp @@ -337,7 +337,7 @@ void ScoreKeeperNormal::HandleTapScore( const TapNote &tn ) { TapNoteScore tns = tn.result.tns; - if( tn.type == TapNote::mine ) + if( tn.type == TapNoteType_Mine ) { if( tns == TNS_HitMine ) { @@ -463,7 +463,7 @@ void ScoreKeeperNormal::GetRowCounts( const NoteData &nd, int iRow, { const TapNote &tn = nd.GetTapNote( track, iRow ); - if( tn.type != TapNote::tap && tn.type != TapNote::hold_head && tn.type != TapNote::lift ) + if( tn.type != TapNoteType_Tap && tn.type != TapNoteType_HoldHead && tn.type != TapNoteType_Lift ) continue; TapNoteScore tns = tn.result.tns; if( tns >= m_MinScoreToContinueCombo ) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 6a05c933dc..62657c2270 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -1825,7 +1825,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) m_NoteDataEdit.SetTapNote( iCol, iHeadRow, TAP_EMPTY ); // Don't CheckNumberOfNotesAndUndo. We don't want to revert any change that removes notes. } - else if( m_NoteDataEdit.GetTapNote(iCol, iSongIndex).type != TapNote::empty ) + else if( m_NoteDataEdit.GetTapNote(iCol, iSongIndex).type != TapNoteType_Empty ) { m_soundRemoveNote.Play(); SetDirty( true ); @@ -1855,10 +1855,10 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { switch ( m_selectedTap.type ) { - case TapNote::tap: m_selectedTap = TAP_ORIGINAL_FAKE; break; - case TapNote::mine: m_selectedTap = TAP_ORIGINAL_TAP; break; - case TapNote::lift: m_selectedTap = TAP_ORIGINAL_MINE; break; - case TapNote::fake: m_selectedTap = TAP_ORIGINAL_LIFT; break; + case TapNoteType_Tap: m_selectedTap = TAP_ORIGINAL_FAKE; break; + case TapNoteType_Mine: m_selectedTap = TAP_ORIGINAL_TAP; break; + case TapNoteType_Lift: m_selectedTap = TAP_ORIGINAL_MINE; break; + case TapNoteType_Fake: m_selectedTap = TAP_ORIGINAL_LIFT; break; DEFAULT_FAIL( m_selectedTap.type ); } return true; @@ -1867,10 +1867,10 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { switch ( m_selectedTap.type ) { - case TapNote::tap: m_selectedTap = TAP_ORIGINAL_MINE; break; - case TapNote::mine: m_selectedTap = TAP_ORIGINAL_LIFT; break; - case TapNote::lift: m_selectedTap = TAP_ORIGINAL_FAKE; break; - case TapNote::fake: m_selectedTap = TAP_ORIGINAL_TAP; break; + case TapNoteType_Tap: m_selectedTap = TAP_ORIGINAL_MINE; break; + case TapNoteType_Mine: m_selectedTap = TAP_ORIGINAL_LIFT; break; + case TapNoteType_Lift: m_selectedTap = TAP_ORIGINAL_FAKE; break; + case TapNoteType_Fake: m_selectedTap = TAP_ORIGINAL_TAP; break; DEFAULT_FAIL( m_selectedTap.type ); } return true; @@ -3501,18 +3501,18 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) // set note at this row to use this keysound file. // if it's empty, make it an auto keysound. newNote.iKeysoundIndex = sound; - if (newNote.type == TapNote::empty) + if (newNote.type == TapNoteType_Empty) { - newNote.type = TapNote::autoKeysound; // keysounds need something non empty. + newNote.type = TapNoteType_AutoKeysound; // keysounds need something non empty. } } else // sound > kses.size() { // remove the sound. if it's an auto keysound, make it empty. newNote.iKeysoundIndex = -1; - if (newNote.type == TapNote::autoKeysound) + if (newNote.type == TapNoteType_AutoKeysound) { - newNote.type = TapNote::empty; // autoKeysound with no sound is pointless. + newNote.type = TapNoteType_Empty; // autoKeysound with no sound is pointless. } } m_NoteDataEdit.SetTapNote(track, row, newNote); @@ -3530,8 +3530,8 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) if (newNote.iKeysoundIndex == static_cast(sound)) { newNote.iKeysoundIndex = -1; - if (newNote.type == TapNote::autoKeysound) - newNote.type = TapNote::empty; + if (newNote.type == TapNoteType_AutoKeysound) + newNote.type = TapNoteType_Empty; } else if (newNote.iKeysoundIndex > static_cast(sound)) newNote.iKeysoundIndex--; @@ -3560,8 +3560,8 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) { newNote.iKeysoundIndex = pos; } - if (newNote.type == TapNote::empty) - newNote.type = TapNote::autoKeysound; // keysounds need something non empty. + if (newNote.type == TapNoteType_Empty) + newNote.type = TapNoteType_AutoKeysound; // keysounds need something non empty. m_NoteDataEdit.SetTapNote(track, row, newNote); SetDirty(true); } @@ -3588,9 +3588,9 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) const int row = BeatToNoteRow( GAMESTATE->m_Position.m_fSongBeat ); TapNote tn( - TapNote::attack, - TapNote::SubType_Invalid, - TapNote::original, + TapNoteType_Attack, + TapNoteSubType_Invalid, + TapNoteSource_Original, sMods, g_fLastInsertAttackDurationSeconds, -1 ); @@ -4829,7 +4829,7 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector &iAn for (int t = 0; t < nd.GetNumTracks(); t++) { const TapNote &tn = nd.GetTapNote(t, r); - if (tn.type != TapNote::empty) + if (tn.type != TapNoteType_Empty) { TapNote nTap = tn; nTap.pn = (tn.pn == PLAYER_1 ? @@ -4858,7 +4858,7 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector &iAn for (int t = 0; t < tracks; t++) { const TapNote &tn = nd.GetTapNote(t, r); - if (tn.type != TapNote::empty && tn.pn == oPN) + if (tn.type != TapNoteType_Empty && tn.pn == oPN) { TapNote nTap = tn; nTap.pn = nPN; diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index 7a958027d5..7f3ca0260b 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -1017,14 +1017,14 @@ void ScreenGameplay::SetupSong( int iSongIndex ) // load player { pi->m_NoteData = ndTransformed; - NoteDataUtil::RemoveAllTapsOfType( pi->m_NoteData, TapNote::autoKeysound ); + NoteDataUtil::RemoveAllTapsOfType( pi->m_NoteData, TapNoteType_AutoKeysound ); pi->m_pPlayer->Load(); } // load auto keysounds { NoteData nd = ndTransformed; - NoteDataUtil::RemoveAllTapsExceptForType( nd, TapNote::autoKeysound ); + NoteDataUtil::RemoveAllTapsExceptForType( nd, TapNoteType_AutoKeysound ); m_AutoKeysounds.Load( pi->GetStepsAndTrailIndex(), nd ); } @@ -2057,7 +2057,7 @@ void ScreenGameplay::UpdateLights() // for each index we crossed since the last update: FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( m_CabinetLightsNoteData, cl, r, iRowLastCrossed+1, iSongRow+1 ) { - if( m_CabinetLightsNoteData.GetTapNote( cl, r ).type != TapNote::empty ) + if( m_CabinetLightsNoteData.GetTapNote( cl, r ).type != TapNoteType_Empty ) bBlinkCabinetLight[cl] = true; } @@ -2076,7 +2076,7 @@ void ScreenGameplay::UpdateLights() FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( nd, t, r, iRowLastCrossed+1, iSongRow+1 ) { const TapNote &tn = nd.GetTapNote( t, r ); - if( tn.type != TapNote::mine ) + if( tn.type != TapNoteType_Mine ) bBlink = true; } @@ -2173,7 +2173,7 @@ void ScreenGameplay::SendCrossedMessages() int iNumTracksWithTapOrHoldHead = 0; for( int t=0; tsecond; - if( tn.type != TapNote::hold_head ) + if( tn.type != TapNoteType_HoldHead ) continue; if( tn.HoldResult.bActive ) ++iHoldsHeld; diff --git a/src/libtomcrypt/Debug/libtomcrypt.lib b/src/libtomcrypt/Debug/libtomcrypt.lib new file mode 100644 index 0000000000..f4d2d9a49e Binary files /dev/null and b/src/libtomcrypt/Debug/libtomcrypt.lib differ diff --git a/src/libtommath/Debug/libtommath.lib b/src/libtommath/Debug/libtommath.lib new file mode 100644 index 0000000000..330a2284fa Binary files /dev/null and b/src/libtommath/Debug/libtommath.lib differ