Enums for TapNoteType, TapNoteSubType, and TapNoteSource

I intend to make additional useful information available on judgments,
such as TapNoteType and TapNoteSubType( for hold judgments ).

I am submitting this part as a separate pull request because it is more
generally applicable to anything TapNote related.
This commit is contained in:
sigatrev
2014-07-25 18:45:02 -05:00
parent 020b3916e8
commit e81af8c131
28 changed files with 462 additions and 427 deletions
+19
View File
@@ -2401,6 +2401,25 @@
<EnumValue name='&apos;TapNoteScoreJudgeType_MinimumScore&apos;' value='0'/> <EnumValue name='&apos;TapNoteScoreJudgeType_MinimumScore&apos;' value='0'/>
<EnumValue name='&apos;TapNoteScoreJudgeType_LastScore&apos;' value='1'/> <EnumValue name='&apos;TapNoteScoreJudgeType_LastScore&apos;' value='1'/>
</Enum> </Enum>
<Enum name='TapNoteType'>
<EnumValue name='&apos;TapNoteType_Empty&apos;' value='0'/>
<EnumValue name='&apos;TapNoteType_Tap&apos;' value='1'/>
<EnumValue name='&apos;TapNoteType_HoldHead&apos;' value='2'/>
<EnumValue name='&apos;TapNoteType_HoldTail&apos;' value='3'/>
<EnumValue name='&apos;TapNoteType_Mine&apos;' value='4'/>
<EnumValue name='&apos;TapNoteType_Lift&apos;' value='5'/>
<EnumValue name='&apos;TapNoteType_Attack&apos;' value='6'/>
<EnumValue name='&apos;TapNoteType_AutoKeysound&apos;' value='7'/>
<EnumValue name='&apos;TapNoteType_Fake&apos;' value='8'/>
</Enum>
<Enum name='TapNoteSubType'>
<EnumValue name='&apos;TapNoteSubType_Hold&apos;' value='0'/>
<EnumValue name='&apos;TapNoteSubType_Roll&apos;' value='1'/>
</Enum>
<Enum name='TapNoteSource'>
<EnumValue name='&apos;TapNoteSource_Original&apos;' value='0'/>
<EnumValue name='&apos;TapNoteSource_Addition&apos;' value='1'/>
</Enum>
<Enum name='TextGlowMode'> <Enum name='TextGlowMode'>
<EnumValue name='&apos;TextGlowMode_Inner&apos;' value='0'/> <EnumValue name='&apos;TextGlowMode_Inner&apos;' value='0'/>
<EnumValue name='&apos;TextGlowMode_Stroke&apos;' value='1'/> <EnumValue name='&apos;TextGlowMode_Stroke&apos;' value='1'/>
+3 -3
View File
@@ -88,7 +88,7 @@ void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain )
pn = GetNextEnabledPlayer(pn); pn = GetNextEnabledPlayer(pn);
while( pn != PLAYER_INVALID ) 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; bSoundIsGlobal = false;
pn = GetNextEnabledPlayer(pn); pn = GetNextEnabledPlayer(pn);
} }
@@ -99,7 +99,7 @@ void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain )
if( tn[pn] == TAP_EMPTY ) if( tn[pn] == TAP_EMPTY )
continue; continue;
ASSERT( tn[pn].type == TapNote::autoKeysound ); ASSERT( tn[pn].type == TapNoteType_AutoKeysound );
if( tn[pn].iKeysoundIndex >= 0 ) if( tn[pn].iKeysoundIndex >= 0 )
{ {
RString sKeysoundFilePath = sSongDir + pSong->m_vsKeysoundFile[tn[pn].iKeysoundIndex]; 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 ) FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( nd, t, r, iRowLastCrossed+1, iRowNow )
{ {
const TapNote &tn = nd.GetTapNote( t, r ); const TapNote &tn = nd.GetTapNote( t, r );
ASSERT( tn.type == TapNote::autoKeysound ); ASSERT( tn.type == TapNoteType_AutoKeysound );
if( tn.bKeysound ) if( tn.bKeysound )
m_vKeysounds[tn.iKeysoundIndex].Play(); m_vKeysounds[tn.iKeysoundIndex].Play();
} }
+1 -1
View File
@@ -352,7 +352,7 @@ void BeginnerHelper::Update( float fDeltaTime )
int iStep = 0; int iStep = 0;
const int iNumTracks = m_NoteData[pn].GetNumTracks(); const int iNumTracks = m_NoteData[pn].GetNumTracks();
for( int t=0; t<iNumTracks; t++ ) for( int t=0; t<iNumTracks; t++ )
if( m_NoteData[pn].GetTapNote(t,iRow).type == TapNote::tap ) if( m_NoteData[pn].GetTapNote(t,iRow).type == TapNoteType_Tap )
iStep |= 1 << t; iStep |= 1 << t;
// Assign new data // Assign new data
+1 -1
View File
@@ -657,7 +657,7 @@ void GameSoundManager::Update( float fDeltaTime )
// Otherwise, for each index we crossed since the last update: // Otherwise, for each index we crossed since the last update:
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( lights, cl, r, iRowLastCrossed+1, iSongRow+1 ) FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( lights, cl, r, iRowLastCrossed+1, iSongRow+1 )
{ {
if( lights.GetTapNote( cl, r ).type != TapNote::empty ) if( lights.GetTapNote( cl, r ).type != TapNoteType_Empty )
{ {
LIGHTSMAN->BlinkCabinetLight( cl ); LIGHTSMAN->BlinkCabinetLight( cl );
break; break;
+9 -9
View File
@@ -27,8 +27,8 @@ void GhostArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOffset
const GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( c, pn ); const GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( c, pn );
NOTESKIN->SetGameController( GameI.controller ); NOTESKIN->SetGameController( GameI.controller );
m_bHoldShowing.push_back( TapNote::SubType_Invalid ); m_bHoldShowing.push_back( TapNoteSubType_Invalid );
m_bLastHoldShowing.push_back( TapNote::SubType_Invalid ); m_bLastHoldShowing.push_back( TapNoteSubType_Invalid );
m_Ghost.push_back( NOTESKIN->LoadActor(sButton, "Explosion", this) ); m_Ghost.push_back( NOTESKIN->LoadActor(sButton, "Explosion", this) );
m_Ghost[c]->SetName( "GhostArrow" ); 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] != m_bHoldShowing[i] )
{ {
if( m_bLastHoldShowing[i] == TapNote::hold_head_hold ) if( m_bLastHoldShowing[i] == TapNoteSubType_Hold )
m_Ghost[i]->PlayCommand( "HoldingOff" ); 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" ); 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" ); m_Ghost[i]->PlayCommand( "MinefieldOff" );
*/ */
if( m_bHoldShowing[i] == TapNote::hold_head_hold ) if( m_bHoldShowing[i] == TapNoteSubType_Hold )
m_Ghost[i]->PlayCommand( "HoldingOn" ); 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" ); 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_Ghost[i]->PlayCommand( "MinefieldOn" );
*/ */
m_bLastHoldShowing[i] = m_bHoldShowing[i]; m_bLastHoldShowing[i] = m_bHoldShowing[i];
} }
m_bHoldShowing[i] = TapNote::SubType_Invalid; m_bHoldShowing[i] = TapNoteSubType_Invalid;
} }
} }
+2 -2
View File
@@ -25,8 +25,8 @@ protected:
const PlayerState* m_pPlayerState; const PlayerState* m_pPlayerState;
vector<Actor *> m_Ghost; vector<Actor *> m_Ghost;
vector<TapNote::SubType> m_bHoldShowing; vector<TapNoteSubType> m_bHoldShowing;
vector<TapNote::SubType> m_bLastHoldShowing; vector<TapNoteSubType> m_bLastHoldShowing;
}; };
+55 -55
View File
@@ -91,7 +91,7 @@ void NoteData::ClearRangeForTrack( int rowBegin, int rowEnd, int iTrack )
--prev; --prev;
TapNote tn = lBegin->second; TapNote tn = lBegin->second;
int iRow = prev->first; 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. // A hold note overlaps the end of the range. Separate it.
SetTapNote( iTrack, iRow, TAP_EMPTY ); SetTapNote( iTrack, iRow, TAP_EMPTY );
@@ -144,10 +144,10 @@ void NoteData::CopyRange( const NoteData& from, int rowFromBegin, int rowFromEnd
for( ; lBegin != lEnd; ++lBegin ) for( ; lBegin != lEnd; ++lBegin )
{ {
TapNote head = lBegin->second; TapNote head = lBegin->second;
if( head.type == TapNote::empty ) if( head.type == TapNoteType_Empty )
continue; continue;
if( head.type == TapNote::hold_head ) if( head.type == TapNoteType_HoldHead )
{ {
int iStartRow = lBegin->first + iMoveBy; int iStartRow = lBegin->first + iMoveBy;
int iEndRow = iStartRow + head.iDuration; int iEndRow = iStartRow + head.iDuration;
@@ -175,7 +175,7 @@ void NoteData::CopyAll( const NoteData& from )
bool NoteData::IsRowEmpty( int row ) const bool NoteData::IsRowEmpty( int row ) const
{ {
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
if( GetTapNote(t, row).type != TapNote::empty ) if( GetTapNote(t, row).type != TapNoteType_Empty )
return false; return false;
return true; return true;
} }
@@ -185,7 +185,7 @@ bool NoteData::IsRangeEmpty( int track, int rowBegin, int rowEnd ) const
ASSERT( track < GetNumTracks() ); ASSERT( track < GetNumTracks() );
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, track, r, rowBegin, rowEnd ) FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, track, r, rowBegin, rowEnd )
if( GetTapNote(track,r).type != TapNote::empty ) if( GetTapNote(track,r).type != TapNoteType_Empty )
return false; return false;
return true; return true;
} }
@@ -194,7 +194,7 @@ int NoteData::GetNumTapNonEmptyTracks( int row ) const
{ {
int iNum = 0; int iNum = 0;
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
if( GetTapNote(t, row).type != TapNote::empty ) if( GetTapNote(t, row).type != TapNoteType_Empty )
iNum++; iNum++;
return iNum; return iNum;
} }
@@ -202,7 +202,7 @@ int NoteData::GetNumTapNonEmptyTracks( int row ) const
void NoteData::GetTapNonEmptyTracks( int row, set<int>& addTo ) const void NoteData::GetTapNonEmptyTracks( int row, set<int>& addTo ) const
{ {
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
if( GetTapNote(t, row).type != TapNote::empty ) if( GetTapNote(t, row).type != TapNoteType_Empty )
addTo.insert(t); addTo.insert(t);
} }
@@ -210,7 +210,7 @@ bool NoteData::GetTapFirstNonEmptyTrack( int row, int &iNonEmptyTrackOut ) const
{ {
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
{ {
if( GetTapNote( t, row ).type != TapNote::empty ) if( GetTapNote( t, row ).type != TapNoteType_Empty )
{ {
iNonEmptyTrackOut = t; iNonEmptyTrackOut = t;
return true; return true;
@@ -223,7 +223,7 @@ bool NoteData::GetTapFirstEmptyTrack( int row, int &iEmptyTrackOut ) const
{ {
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
{ {
if( GetTapNote( t, row ).type == TapNote::empty ) if( GetTapNote( t, row ).type == TapNoteType_Empty )
{ {
iEmptyTrackOut = t; iEmptyTrackOut = t;
return true; return true;
@@ -236,7 +236,7 @@ bool NoteData::GetTapLastEmptyTrack( int row, int &iEmptyTrackOut ) const
{ {
for( int t=GetNumTracks()-1; t>=0; t-- ) for( int t=GetNumTracks()-1; t>=0; t-- )
{ {
if( GetTapNote( t, row ).type == TapNote::empty ) if( GetTapNote( t, row ).type == TapNoteType_Empty )
{ {
iEmptyTrackOut = t; iEmptyTrackOut = t;
return true; return true;
@@ -251,7 +251,7 @@ int NoteData::GetNumTracksWithTap( int row ) const
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
{ {
const TapNote &tn = GetTapNote( t, row ); const TapNote &tn = GetTapNote( t, row );
if( tn.type == TapNote::tap || tn.type == TapNote::lift ) if( tn.type == TapNoteType_Tap || tn.type == TapNoteType_Lift )
iNum++; iNum++;
} }
return iNum; return iNum;
@@ -263,7 +263,7 @@ int NoteData::GetNumTracksWithTapOrHoldHead( int row ) const
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
{ {
const TapNote &tn = GetTapNote( t, row ); 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 )
iNum++; iNum++;
} }
return iNum; return iNum;
@@ -274,7 +274,7 @@ int NoteData::GetFirstTrackWithTap( int row ) const
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
{ {
const TapNote &tn = GetTapNote( t, row ); const TapNote &tn = GetTapNote( t, row );
if( tn.type == TapNote::tap || tn.type == TapNote::lift ) if( tn.type == TapNoteType_Tap || tn.type == TapNoteType_Lift )
return t; return t;
} }
return -1; return -1;
@@ -285,7 +285,7 @@ int NoteData::GetFirstTrackWithTapOrHoldHead( int row ) const
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
{ {
const TapNote &tn = GetTapNote( t, row ); 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 t;
} }
return -1; return -1;
@@ -296,7 +296,7 @@ int NoteData::GetLastTrackWithTapOrHoldHead( int row ) const
for( int t=GetNumTracks()-1; t>=0; t-- ) for( int t=GetNumTracks()-1; t>=0; t-- )
{ {
const TapNote &tn = GetTapNote( t, row ); 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 t;
} }
return -1; return -1;
@@ -316,7 +316,7 @@ void NoteData::AddHoldNote( int iTrack, int iStartRow, int iEndRow, TapNote tn )
{ {
int iOtherRow = it->first; int iOtherRow = it->first;
const TapNote &tnOther = it->second; const TapNote &tnOther = it->second;
if( tnOther.type == TapNote::hold_head ) if( tnOther.type == TapNoteType_HoldHead )
{ {
iStartRow = min( iStartRow, iOtherRow ); iStartRow = min( iStartRow, iOtherRow );
iEndRow = max( iEndRow, iOtherRow + tnOther.iDuration ); 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 bool NoteData::IsHoldHeadOrBodyAtRow( int iTrack, int iRow, int *pHeadRow ) const
{ {
const TapNote &tn = GetTapNote( iTrack, iRow ); const TapNote &tn = GetTapNote( iTrack, iRow );
if( tn.type == TapNote::hold_head ) if( tn.type == TapNoteType_HoldHead )
{ {
if( pHeadRow != NULL ) if( pHeadRow != NULL )
*pHeadRow = iRow; *pHeadRow = iRow;
@@ -369,7 +369,7 @@ bool NoteData::IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow ) const
if( pHeadRow == NULL ) if( pHeadRow == NULL )
pHeadRow = &iDummy; 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 * a hold. If we find a tap, mine or attack, we're not--those never lie
* within hold notes. Ignore autoKeysound. */ * within hold notes. Ignore autoKeysound. */
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE_REVERSE( *this, iTrack, r, 0, iRow ) 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 ); const TapNote &tn = GetTapNote( iTrack, r );
switch( tn.type ) switch( tn.type )
{ {
case TapNote::hold_head: case TapNoteType_HoldHead:
if( tn.iDuration + r < iRow ) if( tn.iDuration + r < iRow )
return false; return false;
*pHeadRow = r; *pHeadRow = r;
return true; return true;
case TapNote::tap: case TapNoteType_Tap:
case TapNote::mine: case TapNoteType_Mine:
case TapNote::attack: case TapNoteType_Attack:
case TapNote::lift: case TapNoteType_Lift:
case TapNote::fake: case TapNoteType_Fake:
return false; return false;
case TapNote::empty: case TapNoteType_Empty:
case TapNote::autoKeysound: case TapNoteType_AutoKeysound:
// ignore // ignore
continue; continue;
DEFAULT_FAIL( tn.type ); 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 /* XXX: We might have a hold note near the end with autoplay sounds
* after it. Do something else with autoplay sounds ... */ * after it. Do something else with autoplay sounds ... */
const TapNote &tn = GetTapNote( t, iRow ); const TapNote &tn = GetTapNote( t, iRow );
if( tn.type == TapNote::hold_head ) if( tn.type == TapNoteType_HoldHead )
iRow += tn.iDuration; iRow += tn.iDuration;
iOldestRowFoundSoFar = max( iOldestRowFoundSoFar, iRow ); iOldestRowFoundSoFar = max( iOldestRowFoundSoFar, iRow );
@@ -461,27 +461,27 @@ int NoteData::GetLastRow() const
bool NoteData::IsTap(const TapNote &tn, const int row) const bool NoteData::IsTap(const TapNote &tn, const int row) const
{ {
return (tn.type != TapNote::empty && tn.type != TapNote::mine return (tn.type != TapNoteType_Empty && tn.type != TapNoteType_Mine
&& tn.type != TapNote::lift && tn.type != TapNote::fake && tn.type != TapNoteType_Lift && tn.type != TapNoteType_Fake
&& tn.type != TapNote::autoKeysound && tn.type != TapNoteType_AutoKeysound
&& GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row)); && GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row));
} }
bool NoteData::IsMine(const TapNote &tn, const int row) const bool NoteData::IsMine(const TapNote &tn, const int row) const
{ {
return (tn.type == TapNote::mine return (tn.type == TapNoteType_Mine
&& GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row)); && GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row));
} }
bool NoteData::IsLift(const TapNote &tn, const int row) const bool NoteData::IsLift(const TapNote &tn, const int row) const
{ {
return (tn.type == TapNote::lift return (tn.type == TapNoteType_Lift
&& GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row)); && GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row));
} }
bool NoteData::IsFake(const TapNote &tn, const int row) const bool NoteData::IsFake(const TapNote &tn, const int row) const
{ {
return (tn.type == TapNote::fake return (tn.type == TapNoteType_Fake
|| !GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row)); || !GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row));
} }
@@ -553,11 +553,11 @@ bool NoteData::RowNeedsAtLeastSimultaneousPresses( int iMinSimultaneousPresses,
const TapNote &tn = GetTapNote(t, row); const TapNote &tn = GetTapNote(t, row);
switch( tn.type ) switch( tn.type )
{ {
case TapNote::mine: case TapNoteType_Mine:
case TapNote::empty: case TapNoteType_Empty:
case TapNote::fake: case TapNoteType_Fake:
case TapNote::lift: // you don't "press" on a lift. case TapNoteType_Lift: // you don't "press" on a lift.
case TapNote::autoKeysound: case TapNoteType_AutoKeysound:
continue; // skip these types - they don't count continue; // skip these types - they don't count
default: break; default: break;
} }
@@ -612,10 +612,10 @@ int NoteData::GetNumRowsWithSimultaneousTaps( int iMinTaps, int iStartIndex, int
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
{ {
const TapNote &tn = GetTapNote(t, r); const TapNote &tn = GetTapNote(t, r);
if (tn.type != TapNote::mine && // mines don't count. if (tn.type != TapNoteType_Mine && // mines don't count.
tn.type != TapNote::empty && tn.type != TapNoteType_Empty &&
tn.type != TapNote::fake && tn.type != TapNoteType_Fake &&
tn.type != TapNote::autoKeysound) tn.type != TapNoteType_AutoKeysound)
iNumNotesThisIndex++; iNumNotesThisIndex++;
} }
if( iNumNotesThisIndex >= iMinTaps ) if( iNumNotesThisIndex >= iMinTaps )
@@ -634,8 +634,8 @@ int NoteData::GetNumHoldNotes( int iStartIndex, int iEndIndex ) const
GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd ); GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd );
for( ; lBegin != lEnd; ++lBegin ) for( ; lBegin != lEnd; ++lBegin )
{ {
if( lBegin->second.type != TapNote::hold_head || if( lBegin->second.type != TapNoteType_HoldHead ||
lBegin->second.subType != TapNote::hold_head_hold ) lBegin->second.subType != TapNoteSubType_Hold )
continue; continue;
if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first)) if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first))
continue; continue;
@@ -654,8 +654,8 @@ int NoteData::GetNumRolls( int iStartIndex, int iEndIndex ) const
GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd ); GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd );
for( ; lBegin != lEnd; ++lBegin ) for( ; lBegin != lEnd; ++lBegin )
{ {
if( lBegin->second.type != TapNote::hold_head || if( lBegin->second.type != TapNoteType_HoldHead ||
lBegin->second.subType != TapNote::hold_head_roll ) lBegin->second.subType != TapNoteSubType_Roll )
continue; continue;
if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first)) if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first))
continue; continue;
@@ -773,8 +773,8 @@ pair<int, int> NoteData::GetNumHoldNotesTwoPlayer( int iStartIndex, int iEndInde
GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd ); GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd );
for( ; lBegin != lEnd; ++lBegin ) for( ; lBegin != lEnd; ++lBegin )
{ {
if( lBegin->second.type != TapNote::hold_head || if( lBegin->second.type != TapNoteType_HoldHead ||
lBegin->second.subType != TapNote::hold_head_hold ) lBegin->second.subType != TapNoteSubType_Hold )
continue; continue;
if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first)) if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first))
continue; continue;
@@ -816,8 +816,8 @@ pair<int, int> NoteData::GetNumRollsTwoPlayer( int iStartIndex, int iEndIndex )
GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd ); GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd );
for( ; lBegin != lEnd; ++lBegin ) for( ; lBegin != lEnd; ++lBegin )
{ {
if( lBegin->second.type != TapNote::hold_head || if( lBegin->second.type != TapNoteType_HoldHead ||
lBegin->second.subType != TapNote::hold_head_roll ) lBegin->second.subType != TapNoteSubType_Roll )
continue; continue;
if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first)) if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first))
continue; continue;
@@ -880,8 +880,8 @@ int NoteData::GetNumMinefields( int iStartIndex, int iEndIndex ) const
GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, begin, end ); GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, begin, end );
for( ; begin != end; ++begin ) for( ; begin != end; ++begin )
{ {
if( begin->second.type != TapNote::hold_head || if( begin->second.type != TapNoteType_HoldHead ||
begin->second.subType != TapNote::hold_head_mine ) begin->second.subType != TapNoteSubType_mine )
continue; continue;
iNumMinefields++; iNumMinefields++;
} }
@@ -1033,7 +1033,7 @@ void NoteData::GetTapNoteRangeInclusive( int iTrack, int iStartRow, int iEndRow,
iterator prev = Decrement(lBegin); iterator prev = Decrement(lBegin);
const TapNote &tn = prev->second; const TapNote &tn = prev->second;
if( tn.type == TapNote::hold_head ) if( tn.type == TapNoteType_HoldHead )
{ {
int iHoldStartRow = prev->first; int iHoldStartRow = prev->first;
int iHoldEndRow = iHoldStartRow + tn.iDuration; 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. // Include the next note if it's a hold and starts on iEndRow.
const TapNote &tn = lEnd->second; const TapNote &tn = lEnd->second;
int iHoldStartRow = lEnd->first; int iHoldStartRow = lEnd->first;
if( tn.type == TapNote::hold_head && iHoldStartRow == iEndRow ) if( tn.type == TapNoteType_HoldHead && iHoldStartRow == iEndRow )
++lEnd; ++lEnd;
} }
} }
@@ -1066,7 +1066,7 @@ void NoteData::GetTapNoteRangeExclusive( int iTrack, int iStartRow, int iEndRow,
{ {
iterator prev = lEnd; iterator prev = lEnd;
--prev; --prev;
if( prev->second.type == TapNote::hold_head ) if( prev->second.type == TapNoteType_HoldHead )
{ {
int localStartRow = prev->first; int localStartRow = prev->first;
const TapNote &tn = prev->second; const TapNote &tn = prev->second;
+92 -92
View File
@@ -181,7 +181,7 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS
float fDurationSeconds = 0; float fDurationSeconds = 0;
if( sscanf( p, "%255[^:]:%f}", szModifiers, &fDurationSeconds ) == 2 ) // not fatal if this fails due to malformed data 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.sAttackModifiers = szModifiers;
tn.fAttackDurationSeconds = fDurationSeconds; 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 /* Optimization: if we pass TAP_EMPTY, NoteData will do a search
* to remove anything in this position. We know that there's nothing * to remove anything in this position. We know that there's nothing
* there, so avoid the search. */ * there, so avoid the search. */
if( tn.type != TapNote::empty && ch != '3' ) if( tn.type != TapNoteType_Empty && ch != '3' )
{ {
tn.pn = pn; tn.pn = pn;
out.SetTapNote( iTrack, iIndex, tn ); out.SetTapNote( iTrack, iIndex, tn );
@@ -251,7 +251,7 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS
{ {
NoteData::iterator next = Increment( begin ); NoteData::iterator next = Increment( begin );
const TapNote &tn = begin->second; 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; int iRow = begin->first;
LOG->UserLog( "", "", "While loading .sm/.ssc note data, there was an unmatched 2 at beat %f", NoteRowToBeat(iRow) ); LOG->UserLog( "", "", "While loading .sm/.ssc note data, there was an unmatched 2 at beat %f", NoteRowToBeat(iRow) );
@@ -323,11 +323,11 @@ void NoteDataUtil::InsertHoldTails( NoteData &inout )
{ {
int iRow = begin->first; int iRow = begin->first;
const TapNote &tn = begin->second; const TapNote &tn = begin->second;
if( tn.type != TapNote::hold_head ) if( tn.type != TapNoteType_HoldHead )
continue; continue;
TapNote tail = tn; 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 /* If iDuration is 0, we'd end up overwriting the head with the tail
* (and invalidating our iterator). Empty hold notes aren't valid. */ * (and invalidating our iterator). Empty hold notes aren't valid. */
@@ -385,36 +385,36 @@ void NoteDataUtil::GetSMNoteDataString( const NoteData &in, RString &sRet )
char c; char c;
switch( tn.type ) switch( tn.type )
{ {
case TapNote::empty: c = '0'; break; case TapNoteType_Empty: c = '0'; break;
case TapNote::tap: c = '1'; break; case TapNoteType_Tap: c = '1'; break;
case TapNote::hold_head: case TapNoteType_HoldHead:
switch( tn.subType ) switch( tn.subType )
{ {
case TapNote::hold_head_hold: c = '2'; break; case TapNoteSubType_Hold: c = '2'; break;
case TapNote::hold_head_roll: c = '4'; break; case TapNoteSubType_Roll: c = '4'; break;
//case TapNote::hold_head_mine: c = 'N'; break; //case TapNoteSubType_Mine: c = 'N'; break;
default: default:
FAIL_M(ssprintf("Invalid tap note subtype: %i", tn.subType)); FAIL_M(ssprintf("Invalid tap note subtype: %i", tn.subType));
} }
break; break;
case TapNote::hold_tail: c = '3'; break; case TapNoteType_HoldTail: c = '3'; break;
case TapNote::mine: c = 'M'; break; case TapNoteType_Mine: c = 'M'; break;
case TapNote::attack: c = 'A'; break; case TapNoteType_Attack: c = 'A'; break;
case TapNote::autoKeysound: c = 'K'; break; case TapNoteType_AutoKeysound: c = 'K'; break;
case TapNote::lift: c = 'L'; break; case TapNoteType_Lift: c = 'L'; break;
case TapNote::fake: c = 'F'; break; case TapNoteType_Fake: c = 'F'; break;
default: default:
c = '\0'; c = '\0';
FAIL_M(ssprintf("Invalid tap note type: %i", tn.type)); FAIL_M(ssprintf("Invalid tap note type: %i", tn.type));
} }
sRet.append( 1, c ); sRet.append( 1, c );
if( tn.type == TapNote::attack ) if( tn.type == TapNoteType_Attack )
{ {
sRet.append( ssprintf("{%s:%.2f}", tn.sAttackModifiers.c_str(), sRet.append( ssprintf("{%s:%.2f}", tn.sAttackModifiers.c_str(),
tn.fAttackDurationSeconds) ); 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 ) if( tn.iKeysoundIndex >= 0 )
sRet.append( ssprintf("[%d]",tn.iKeysoundIndex) ); sRet.append( ssprintf("[%d]",tn.iKeysoundIndex) );
} }
@@ -480,7 +480,7 @@ void NoteDataUtil::CombineCompositeNoteData( NoteData &out, const vector<NoteDat
int row = i->first; int row = i->first;
if( out.IsHoldNoteAtRow(track, i->first) ) if( out.IsHoldNoteAtRow(track, i->first) )
continue; continue;
if( i->second.type == TapNote::hold_head ) if( i->second.type == TapNoteType_HoldHead )
out.AddHoldNote( track, row, row + i->second.iDuration, i->second ); out.AddHoldNote( track, row, row + i->second.iDuration, i->second );
else else
out.SetTapNote( track, row, i->second ); out.SetTapNote( track, row, i->second );
@@ -588,7 +588,7 @@ void PlaceAutoKeysound( NoteData &out, int row, TapNote akTap )
if( iEmptyTrack != -1 ) if( iEmptyTrack != -1 )
{ {
akTap.type = TapNote::autoKeysound; akTap.type = TapNoteType_AutoKeysound;
out.SetTapNote( iEmptyTrack, iEmptyRow, akTap ); out.SetTapNote( iEmptyTrack, iEmptyRow, akTap );
} }
} }
@@ -619,12 +619,12 @@ void NoteDataUtil::LoadOverlapped( const NoteData &in, NoteData &out, int iNewNu
for( int iTrackFrom = 0; iTrackFrom < in.GetNumTracks(); ++iTrackFrom ) for( int iTrackFrom = 0; iTrackFrom < in.GetNumTracks(); ++iTrackFrom )
{ {
const TapNote &tnFrom = in.GetTapNote( iTrackFrom, row ); 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; continue;
// If this is a hold note, find the end. // If this is a hold note, find the end.
int iEndIndex = row; int iEndIndex = row;
if( tnFrom.type == TapNote::hold_head ) if( tnFrom.type == TapNoteType_HoldHead )
iEndIndex = row + tnFrom.iDuration; iEndIndex = row + tnFrom.iDuration;
int &iTrackTo = DestRow[iTrackFrom]; int &iTrackTo = DestRow[iTrackFrom];
@@ -655,7 +655,7 @@ void NoteDataUtil::LoadOverlapped( const NoteData &in, NoteData &out, int iNewNu
LastSourceTrack[iTrackTo] = iTrackFrom; LastSourceTrack[iTrackTo] = iTrackFrom;
LastSourceRow[iTrackTo] = iEndIndex; LastSourceRow[iTrackTo] = iEndIndex;
out.SetTapNote( iTrackTo, row, tnFrom ); out.SetTapNote( iTrackTo, row, tnFrom );
if( tnFrom.type == TapNote::hold_head ) if( tnFrom.type == TapNoteType_HoldHead )
{ {
const TapNote &tnTail = in.GetTapNote( iTrackFrom, iEndIndex ); const TapNote &tnTail = in.GetTapNote( iTrackFrom, iEndIndex );
out.SetTapNote( iTrackTo, iEndIndex, tnTail ); out.SetTapNote( iTrackTo, iEndIndex, tnTail );
@@ -666,7 +666,7 @@ void NoteDataUtil::LoadOverlapped( const NoteData &in, NoteData &out, int iNewNu
for( int iTrackFrom = 0; iTrackFrom < in.GetNumTracks(); ++iTrackFrom ) for( int iTrackFrom = 0; iTrackFrom < in.GetNumTracks(); ++iTrackFrom )
{ {
const TapNote &tnFrom = in.GetTapNote( iTrackFrom, row ); const TapNote &tnFrom = in.GetTapNote( iTrackFrom, row );
if( tnFrom.type != TapNote::autoKeysound ) if( tnFrom.type != TapNoteType_AutoKeysound )
continue; continue;
PlaceAutoKeysound( out, row, tnFrom ); PlaceAutoKeysound( out, row, tnFrom );
@@ -680,7 +680,7 @@ int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow )
for( int t=0; t<in.GetNumTracks(); t++ ) for( int t=0; t<in.GetNumTracks(); t++ )
{ {
const TapNote &tn = in.GetTapNote( t, iRow ); const TapNote &tn = in.GetTapNote( t, iRow );
if( tn.type == TapNote::hold_head ) if( tn.type == TapNoteType_HoldHead )
iMaxTailRow = max( iMaxTailRow, iRow + tn.iDuration ); iMaxTailRow = max( iMaxTailRow, iRow + tn.iDuration );
} }
@@ -798,10 +798,10 @@ RadarStats CalculateRadarStatsFast( const NoteData &in, RadarStats &out )
const TapNote &tn = in.GetTapNote(t, r); const TapNote &tn = in.GetTapNote(t, r);
switch( tn.type ) switch( tn.type )
{ {
case TapNote::mine: case TapNoteType_Mine:
case TapNote::empty: case TapNoteType_Empty:
case TapNote::fake: case TapNoteType_Fake:
case TapNote::autoKeysound: case TapNoteType_AutoKeysound:
continue; // skip these types - they don't count continue; // skip these types - they don't count
default: break; default: break;
} }
@@ -816,12 +816,12 @@ RadarStats CalculateRadarStatsFast( const NoteData &in, RadarStats &out )
else else
itr->second++; itr->second++;
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; simultaneousMapTapHoldHead[r] = 1;
} }
if( tn.type == TapNote::hold_head ) if( tn.type == TapNoteType_HoldHead )
{ {
int searchStartRow = r + 1; int searchStartRow = r + 1;
int searchEndRow = r + tn.iDuration; int searchEndRow = r + tn.iDuration;
@@ -829,9 +829,9 @@ RadarStats CalculateRadarStatsFast( const NoteData &in, RadarStats &out )
{ {
switch( in.GetTapNote(t, rr).type ) switch( in.GetTapNote(t, rr).type )
{ {
case TapNote::mine: case TapNoteType_Mine:
case TapNote::empty: case TapNoteType_Empty:
case TapNote::fake: case TapNoteType_Fake:
continue; // skip these types - they don't count continue; // skip these types - they don't count
default: break; default: break;
} }
@@ -975,10 +975,10 @@ void NoteDataUtil::RemoveHoldNotes( NoteData &in, int iStartIndex, int iEndIndex
in.GetTapNoteRangeInclusive( t, iStartIndex, iEndIndex, begin, end ); in.GetTapNoteRangeInclusive( t, iStartIndex, iEndIndex, begin, end );
for( ; begin != end; ++begin ) for( ; begin != end; ++begin )
{ {
if( begin->second.type != TapNote::hold_head || if( begin->second.type != TapNoteType_HoldHead ||
begin->second.subType != TapNote::hold_head_hold ) begin->second.subType != TapNoteSubType_Hold )
continue; continue;
begin->second.type = TapNote::tap; begin->second.type = TapNoteType_Tap;
} }
} }
} }
@@ -991,10 +991,10 @@ void NoteDataUtil::ChangeRollsToHolds( NoteData &in, int iStartIndex, int iEndIn
in.GetTapNoteRangeInclusive( t, iStartIndex, iEndIndex, begin, end ); in.GetTapNoteRangeInclusive( t, iStartIndex, iEndIndex, begin, end );
for( ; begin != end; ++begin ) for( ; begin != end; ++begin )
{ {
if( begin->second.type != TapNote::hold_head || if( begin->second.type != TapNoteType_HoldHead ||
begin->second.subType != TapNote::hold_head_roll ) begin->second.subType != TapNoteSubType_Roll )
continue; continue;
begin->second.subType = TapNote::hold_head_hold; begin->second.subType = TapNoteSubType_Hold;
} }
} }
} }
@@ -1007,10 +1007,10 @@ void NoteDataUtil::ChangeHoldsToRolls( NoteData &in, int iStartIndex, int iEndIn
in.GetTapNoteRangeInclusive( t, iStartIndex, iEndIndex, begin, end ); in.GetTapNoteRangeInclusive( t, iStartIndex, iEndIndex, begin, end );
for( ; begin != end; ++begin ) for( ; begin != end; ++begin )
{ {
if( begin->second.type != TapNote::hold_head || if( begin->second.type != TapNoteType_HoldHead ||
begin->second.subType != TapNote::hold_head_hold ) begin->second.subType != TapNoteSubType_Hold )
continue; continue;
begin->second.subType = TapNote::hold_head_roll; begin->second.subType = TapNoteSubType_Roll;
} }
} }
} }
@@ -1044,7 +1044,7 @@ void NoteDataUtil::RemoveSimultaneousNotes( NoteData &in, int iMaxSimultaneous,
for( int t=0; iTracksToRemove>0 && t<in.GetNumTracks(); t++ ) for( int t=0; iTracksToRemove>0 && t<in.GetNumTracks(); t++ )
{ {
const TapNote &tn = in.GetTapNote(t,r); const TapNote &tn = in.GetTapNote(t,r);
if( tn.type == TapNote::tap || tn.type == TapNote::hold_head ) if( tn.type == TapNoteType_Tap || tn.type == TapNoteType_HoldHead )
{ {
in.SetTapNote( t, r, TAP_EMPTY ); in.SetTapNote( t, r, TAP_EMPTY );
iTracksToRemove--; iTracksToRemove--;
@@ -1068,7 +1068,7 @@ void NoteDataUtil::RemoveQuads( NoteData &inout, int iStartIndex, int iEndIndex
RemoveSimultaneousNotes( inout, 3, iStartIndex, iEndIndex ); RemoveSimultaneousNotes( inout, 3, iStartIndex, iEndIndex );
} }
void NoteDataUtil::RemoveSpecificTapNotes( NoteData &inout, TapNote::Type tn, int iStartIndex, int iEndIndex ) void NoteDataUtil::RemoveSpecificTapNotes( NoteData &inout, TapNoteType tn, int iStartIndex, int iEndIndex )
{ {
for( int t=0; t<inout.GetNumTracks(); t++ ) for( int t=0; t<inout.GetNumTracks(); t++ )
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( inout, t, r, iStartIndex, iEndIndex ) FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( inout, t, r, iStartIndex, iEndIndex )
@@ -1078,17 +1078,17 @@ void NoteDataUtil::RemoveSpecificTapNotes( NoteData &inout, TapNote::Type tn, in
void NoteDataUtil::RemoveMines( NoteData &inout, int iStartIndex, int iEndIndex ) void NoteDataUtil::RemoveMines( NoteData &inout, int iStartIndex, int iEndIndex )
{ {
RemoveSpecificTapNotes( inout, TapNote::mine, iStartIndex, iEndIndex ); RemoveSpecificTapNotes( inout, TapNoteType_Mine, iStartIndex, iEndIndex );
} }
void NoteDataUtil::RemoveLifts( NoteData &inout, int iStartIndex, int iEndIndex ) void NoteDataUtil::RemoveLifts( NoteData &inout, int iStartIndex, int iEndIndex )
{ {
RemoveSpecificTapNotes( inout, TapNote::lift, iStartIndex, iEndIndex ); RemoveSpecificTapNotes( inout, TapNoteType_Lift, iStartIndex, iEndIndex );
} }
void NoteDataUtil::RemoveFakes( NoteData &inout, int iStartIndex, int iEndIndex ) void NoteDataUtil::RemoveFakes( NoteData &inout, int iStartIndex, int iEndIndex )
{ {
RemoveSpecificTapNotes( inout, TapNote::fake, iStartIndex, iEndIndex ); RemoveSpecificTapNotes( inout, TapNoteType_Fake, iStartIndex, iEndIndex );
} }
void NoteDataUtil::RemoveAllButOneTap( NoteData &inout, int row ) void NoteDataUtil::RemoveAllButOneTap( NoteData &inout, int row )
@@ -1098,7 +1098,7 @@ void NoteDataUtil::RemoveAllButOneTap( NoteData &inout, int row )
int track; int track;
for( track = 0; track < inout.GetNumTracks(); ++track ) for( track = 0; track < inout.GetNumTracks(); ++track )
{ {
if( inout.GetTapNote(track, row).type == TapNote::tap ) if( inout.GetTapNote(track, row).type == TapNoteType_Tap )
break; break;
} }
@@ -1107,7 +1107,7 @@ void NoteDataUtil::RemoveAllButOneTap( NoteData &inout, int row )
for( ; track < inout.GetNumTracks(); ++track ) for( ; track < inout.GetNumTracks(); ++track )
{ {
NoteData::iterator iter = inout.FindTapNote( track, row ); NoteData::iterator iter = inout.FindTapNote( track, row );
if( iter != inout.end(track) && iter->second.type == TapNote::tap ) if( iter != inout.end(track) && iter->second.type == TapNoteType_Tap )
inout.RemoveTapNote( track, iter ); inout.RemoveTapNote( track, iter );
} }
} }
@@ -1462,16 +1462,16 @@ static void SuperShuffleTaps( NoteData &inout, int iStartIndex, int iEndIndex )
const TapNote &tn1 = inout.GetTapNote( t1, r ); const TapNote &tn1 = inout.GetTapNote( t1, r );
switch( tn1.type ) switch( tn1.type )
{ {
case TapNote::empty: case TapNoteType_Empty:
case TapNote::hold_head: case TapNoteType_HoldHead:
case TapNote::hold_tail: case TapNoteType_HoldTail:
case TapNote::autoKeysound: case TapNoteType_AutoKeysound:
continue; // skip continue; // skip
case TapNote::tap: case TapNoteType_Tap:
case TapNote::mine: case TapNoteType_Mine:
case TapNote::attack: case TapNoteType_Attack:
case TapNote::lift: case TapNoteType_Lift:
case TapNote::fake: case TapNoteType_Fake:
break; // shuffle this break; // shuffle this
DEFAULT_FAIL( tn1.type ); DEFAULT_FAIL( tn1.type );
} }
@@ -1494,16 +1494,16 @@ static void SuperShuffleTaps( NoteData &inout, int iStartIndex, int iEndIndex )
const TapNote &tn2 = inout.GetTapNote( t2, r ); const TapNote &tn2 = inout.GetTapNote( t2, r );
switch( tn2.type ) switch( tn2.type )
{ {
case TapNote::hold_head: case TapNoteType_HoldHead:
case TapNote::hold_tail: case TapNoteType_HoldTail:
case TapNote::autoKeysound: case TapNoteType_AutoKeysound:
continue; // don't swap with these continue; // don't swap with these
case TapNote::empty: case TapNoteType_Empty:
case TapNote::tap: case TapNoteType_Tap:
case TapNote::mine: case TapNoteType_Mine:
case TapNote::attack: case TapNoteType_Attack:
case TapNote::lift: case TapNoteType_Lift:
case TapNote::fake: case TapNoteType_Fake:
break; // ok to swap with this break; // ok to swap with this
DEFAULT_FAIL( tn2.type ); DEFAULT_FAIL( tn2.type );
} }
@@ -1552,7 +1552,7 @@ void NoteDataUtil::Backwards( NoteData &inout )
int iRowLater = max_row-r; int iRowLater = max_row-r;
const TapNote &tnEarlier = inout.GetTapNote( t, iRowEarlier ); const TapNote &tnEarlier = inout.GetTapNote( t, iRowEarlier );
if( tnEarlier.type == TapNote::hold_head ) if( tnEarlier.type == TapNoteType_HoldHead )
iRowLater -= tnEarlier.iDuration; iRowLater -= tnEarlier.iDuration;
out.SetTapNote( t, iRowLater, tnEarlier ); out.SetTapNote( t, iRowLater, tnEarlier );
@@ -1635,7 +1635,7 @@ void NoteDataUtil::Wide( NoteData &inout, int iStartIndex, int iEndIndex )
iTrackToAdd--; iTrackToAdd--;
CLAMP( iTrackToAdd, 0, inout.GetNumTracks()-1 ); 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(); iTrackToAdd = (iTrackToAdd+1) % inout.GetNumTracks();
} }
@@ -1832,7 +1832,7 @@ void NoteDataUtil::AddMines( NoteData &inout, int iStartIndex, int iEndIndex )
if( iRowCount>=iPlaceEveryRows ) if( iRowCount>=iPlaceEveryRows )
{ {
for( int t=0; t<inout.GetNumTracks(); t++ ) for( int t=0; t<inout.GetNumTracks(); t++ )
if( inout.GetTapNote(t,r).type == TapNote::tap ) if( inout.GetTapNote(t,r).type == TapNoteType_Tap )
inout.SetTapNote(t,r,TAP_ADDITION_MINE); inout.SetTapNote(t,r,TAP_ADDITION_MINE);
iRowCount = 0; iRowCount = 0;
@@ -1849,7 +1849,7 @@ void NoteDataUtil::AddMines( NoteData &inout, int iStartIndex, int iEndIndex )
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( inout, iTrack, r, iStartIndex, iEndIndex ) FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( inout, iTrack, r, iStartIndex, iEndIndex )
{ {
const TapNote &tn = inout.GetTapNote( iTrack, r ); const TapNote &tn = inout.GetTapNote( iTrack, r );
if( tn.type != TapNote::hold_head ) if( tn.type != TapNoteType_HoldHead )
continue; continue;
int iMineRow = r + tn.iDuration + BeatToNoteRow(0.5f); int iMineRow = r + tn.iDuration + BeatToNoteRow(0.5f);
@@ -1867,7 +1867,7 @@ void NoteDataUtil::AddMines( NoteData &inout, int iStartIndex, int iEndIndex )
// Convert all notes in this row to mines. // Convert all notes in this row to mines.
for( int t=0; t<inout.GetNumTracks(); t++ ) for( int t=0; t<inout.GetNumTracks(); t++ )
if( inout.GetTapNote(t,iMineRow).type == TapNote::tap ) if( inout.GetTapNote(t,iMineRow).type == TapNoteType_Tap )
inout.SetTapNote(t,iMineRow,TAP_ADDITION_MINE); inout.SetTapNote(t,iMineRow,TAP_ADDITION_MINE);
iRowCount = 0; iRowCount = 0;
@@ -1952,7 +1952,7 @@ void NoteDataUtil::ConvertTapsToHolds( NoteData &inout, int iSimultaneousHolds,
if( iTrackAddedThisRow > iSimultaneousHolds ) if( iTrackAddedThisRow > iSimultaneousHolds )
break; break;
if( inout.GetTapNote(t,r).type == TapNote::tap ) if( inout.GetTapNote(t,r).type == TapNoteType_Tap )
{ {
// Find the ending row for this hold // Find the ending row for this hold
int iTapsLeft = iSimultaneousHolds; int iTapsLeft = iSimultaneousHolds;
@@ -1965,7 +1965,7 @@ void NoteDataUtil::ConvertTapsToHolds( NoteData &inout, int iSimultaneousHolds,
// If there are two taps in a row on the same track, // If there are two taps in a row on the same track,
// don't convert the earlier one to a hold. // 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; addHold = false;
break; break;
@@ -2015,7 +2015,7 @@ void NoteDataUtil::Stomp( NoteData &inout, StepsType st, int iStartIndex, int iE
for( int t=0; t<inout.GetNumTracks(); t++ ) for( int t=0; t<inout.GetNumTracks(); t++ )
{ {
if( inout.GetTapNote(t, r).type == TapNote::tap ) // there is a tap here if( inout.GetTapNote(t, r).type == TapNoteType_Tap ) // there is a tap here
{ {
// Look to see if there is enough empty space on either side of the note // Look to see if there is enough empty space on either side of the note
// to turn this into a jump. // to turn this into a jump.
@@ -2065,15 +2065,15 @@ void NoteDataUtil::SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteTyp
for( int c=0; c<inout.GetNumTracks(); c++ ) for( int c=0; c<inout.GetNumTracks(); c++ )
{ {
TapNote tnNew = inout.GetTapNote(c, iOldIndex); TapNote tnNew = inout.GetTapNote(c, iOldIndex);
if( tnNew.type == TapNote::empty ) if( tnNew.type == TapNoteType_Empty )
continue; continue;
inout.SetTapNote(c, iOldIndex, TAP_EMPTY); inout.SetTapNote(c, iOldIndex, TAP_EMPTY);
if( tnNew.type == TapNote::tap && inout.IsHoldNoteAtRow(c, iNewIndex) ) if( tnNew.type == TapNoteType_Tap && inout.IsHoldNoteAtRow(c, iNewIndex) )
continue; // HoldNotes override TapNotes continue; // HoldNotes override TapNotes
if( tnNew.type == TapNote::hold_head ) if( tnNew.type == TapNoteType_HoldHead )
{ {
/* Quantize the duration. If the result is empty, just discard the hold. */ /* Quantize the duration. If the result is empty, just discard the hold. */
tnNew.iDuration = Quantize( tnNew.iDuration, BeatToNoteRow(fSnapInterval1) ); tnNew.iDuration = Quantize( tnNew.iDuration, BeatToNoteRow(fSnapInterval1) );
@@ -2161,7 +2161,7 @@ void NoteDataUtil::CollapseLeft( NoteData &inout )
int iNumTracksFilled = 0; int iNumTracksFilled = 0;
for( int t=0; t<inout.GetNumTracks(); t++ ) for( int t=0; t<inout.GetNumTracks(); t++ )
{ {
if( inout.GetTapNote(t,r).type != TapNote::empty ) if( inout.GetTapNote(t,r).type != TapNoteType_Empty )
{ {
TapNote tn = inout.GetTapNote(t,r); TapNote tn = inout.GetTapNote(t,r);
inout.SetTapNote(t, r, TAP_EMPTY); inout.SetTapNote(t, r, TAP_EMPTY);
@@ -2260,7 +2260,7 @@ bool NoteDataUtil::RowPassesValidMask( NoteData &inout, int row, const bool bVal
{ {
for( int t=0; t<inout.GetNumTracks(); t++ ) for( int t=0; t<inout.GetNumTracks(); t++ )
{ {
if( !bValidMask[t] && inout.GetTapNote(t,row).type != TapNote::empty ) if( !bValidMask[t] && inout.GetTapNote(t,row).type != TapNoteType_Empty )
return false; return false;
} }
@@ -2271,10 +2271,10 @@ void NoteDataUtil::ConvertAdditionsToRegular( NoteData &inout )
{ {
for( int t=0; t<inout.GetNumTracks(); t++ ) for( int t=0; t<inout.GetNumTracks(); t++ )
FOREACH_NONEMPTY_ROW_IN_TRACK( inout, t, r ) FOREACH_NONEMPTY_ROW_IN_TRACK( inout, t, r )
if( inout.GetTapNote(t,r).source == TapNote::addition ) if( inout.GetTapNote(t,r).source == TapNoteSource_Addition )
{ {
TapNote tn = inout.GetTapNote(t,r); TapNote tn = inout.GetTapNote(t,r);
tn.source = TapNote::original; tn.source = TapNoteSource_Original;
inout.SetTapNote( t, r, tn ); inout.SetTapNote( t, r, tn );
} }
} }
@@ -2365,9 +2365,9 @@ void NoteDataUtil::AddTapAttacks( NoteData &nd, Song* pSong )
int iBeat = (int)fBeat; int iBeat = (int)fBeat;
int iTrack = iBeat % nd.GetNumTracks(); // deterministically calculates track int iTrack = iBeat % nd.GetNumTracks(); // deterministically calculates track
TapNote tn( TapNote tn(
TapNote::attack, TapNoteType_Attack,
TapNote::SubType_Invalid, TapNoteSubType_Invalid,
TapNote::original, TapNoteSource_Original,
szAttacks[RandomInt(ARRAYLEN(szAttacks))], szAttacks[RandomInt(ARRAYLEN(szAttacks))],
15.0f, 15.0f,
-1 ); -1 );
@@ -2454,7 +2454,7 @@ void NoteDataUtil::DeleteRows( NoteData &nd, int iStartIndex, int iRowsToDelete
nd.CopyRange( temp, 0, MAX_NOTE_ROW, iStartIndex ); nd.CopyRange( temp, 0, MAX_NOTE_ROW, iStartIndex );
} }
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 /* 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, * iterators invalidates only the iterator that is being erased. To that end,
@@ -2472,7 +2472,7 @@ void NoteDataUtil::RemoveAllTapsOfType( NoteData& ndInOut, TapNote::Type typeToR
} }
} }
void NoteDataUtil::RemoveAllTapsExceptForType( NoteData& ndInOut, TapNote::Type typeToKeep ) void NoteDataUtil::RemoveAllTapsExceptForType( NoteData& ndInOut, TapNoteType typeToKeep )
{ {
/* Same as in RemoveAllTapsOfType(). */ /* Same as in RemoveAllTapsOfType(). */
for( int t=0; t<ndInOut.GetNumTracks(); t++ ) for( int t=0; t<ndInOut.GetNumTracks(); t++ )
@@ -2505,8 +2505,8 @@ bool NoteDataUtil::AnyTapsAndHoldsInTrackRange( const NoteData& in, int iTrack,
{ {
switch( in.GetTapNote( iTrack, r ).type ) switch( in.GetTapNote( iTrack, r ).type )
{ {
case TapNote::empty: case TapNoteType_Empty:
case TapNote::mine: case TapNoteType_Mine:
continue; continue;
default: default:
return true; return true;
@@ -2565,7 +2565,7 @@ bool NoteDataUtil::GetPrevEditorPosition( const NoteData& in, int &rowInOut )
continue; continue;
const TapNote &tn = in.GetTapNote( t, iHeadRow ); const TapNote &tn = in.GetTapNote( t, iHeadRow );
if( tn.type != TapNote::hold_head ) if( tn.type != TapNoteType_HoldHead )
continue; continue;
int iEndRow = iHeadRow + tn.iDuration; int iEndRow = iHeadRow + tn.iDuration;
+3 -3
View File
@@ -90,7 +90,7 @@ namespace NoteDataUtil
* @param tn the TapNote Type to remove. * @param tn the TapNote Type to remove.
* @param iStartIndex the starting point for transforming. * @param iStartIndex the starting point for transforming.
* @param iEndIndex the ending point for transforming. */ * @param iEndIndex the ending point for transforming. */
void RemoveSpecificTapNotes( NoteData &inout, TapNote::Type tn, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); void RemoveSpecificTapNotes( NoteData &inout, TapNoteType tn, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
/** /**
* @brief Remove all of the mines from the chart. * @brief Remove all of the mines from the chart.
* @param inout the Notedata to be transformed. * @param inout the Notedata to be transformed.
@@ -187,8 +187,8 @@ namespace NoteDataUtil
void InsertRows( NoteData &nd, int iStartIndex, int iRowsToShift ); void InsertRows( NoteData &nd, int iStartIndex, int iRowsToShift );
void DeleteRows( NoteData &nd, int iStartIndex, int iRowsToShift ); void DeleteRows( NoteData &nd, int iStartIndex, int iRowsToShift );
void RemoveAllTapsOfType( NoteData& ndInOut, TapNote::Type typeToRemove ); void RemoveAllTapsOfType( NoteData& ndInOut, TapNoteType typeToRemove );
void RemoveAllTapsExceptForType( NoteData& ndInOut, TapNote::Type typeToKeep ); void RemoveAllTapsExceptForType( NoteData& ndInOut, TapNoteType typeToKeep );
int GetMaxNonEmptyTrack( const NoteData& in ); int GetMaxNonEmptyTrack( const NoteData& in );
bool AnyTapsAndHoldsInTrackRange( const NoteData& in, int iTrack, int iStart, int iEnd ); bool AnyTapsAndHoldsInTrackRange( const NoteData& in, int iTrack, int iStart, int iEnd );
+25 -25
View File
@@ -43,9 +43,9 @@ int GetNumNWithScore( const NoteData &in, TapNoteScore tns, int MinTaps, int iSt
return iNumSuccessfulDoubles; return iNumSuccessfulDoubles;
} }
int GetNumHoldNotesWithScore( const NoteData &in, TapNote::SubType subType, HoldNoteScore hns ) int GetNumHoldNotesWithScore( const NoteData &in, TapNoteSubType subType, HoldNoteScore hns )
{ {
ASSERT( subType != TapNote::SubType_Invalid ); ASSERT( subType != TapNoteSubType_Invalid );
int iNumSuccessfulHolds = 0; int iNumSuccessfulHolds = 0;
for( int t=0; t<in.GetNumTracks(); ++t ) for( int t=0; t<in.GetNumTracks(); ++t )
@@ -56,7 +56,7 @@ int GetNumHoldNotesWithScore( const NoteData &in, TapNote::SubType subType, Hold
for( ; begin != end; ++begin ) for( ; begin != end; ++begin )
{ {
const TapNote &tn = begin->second; const TapNote &tn = begin->second;
if( tn.type != TapNote::hold_head ) if( tn.type != TapNoteType_HoldHead )
continue; continue;
if( tn.subType != subType ) if( tn.subType != subType )
continue; 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 ); NoteData::all_tracks_const_iterator iter = in.GetTapNoteRangeAllTracks( iStartIndex, iEndIndex );
for( ; !iter.IsAtEnd(); ++iter ) 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; ++iNumSuccessfulMinesNotes;
} }
return iNumSuccessfulMinesNotes; return iNumSuccessfulMinesNotes;
@@ -93,11 +93,11 @@ int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex =
for( int t=0; t<in.GetNumTracks(); t++ ) for( int t=0; t<in.GetNumTracks(); t++ )
{ {
const TapNote &tn = in.GetTapNote(t, i); const TapNote &tn = in.GetTapNote(t, i);
if( tn.type == TapNote::empty ) if( tn.type == TapNoteType_Empty )
continue; continue;
if( tn.type == TapNote::mine ) // mines don't count if( tn.type == TapNoteType_Mine ) // mines don't count
continue; continue;
if (tn.type == TapNote::fake ) // fake arrows don't count if (tn.type == TapNoteType_Fake ) // fake arrows don't count
continue; continue;
if( tn.result.tns <= TNS_W5 ) if( tn.result.tns <= TNS_W5 )
Missed = true; Missed = true;
@@ -136,7 +136,7 @@ int GetSuccessfulLifts( const NoteData &in, TapNoteScore tns, int iStartIndex =
NoteData::all_tracks_const_iterator iter = in.GetTapNoteRangeAllTracks( iStartIndex, iEndIndex ); NoteData::all_tracks_const_iterator iter = in.GetTapNoteRangeAllTracks( iStartIndex, iEndIndex );
for( ; !iter.IsAtEnd(); ++iter ) for( ; !iter.IsAtEnd(); ++iter )
{ {
if( iter->type == TapNote::lift && iter->result.tns >= tns ) if( iter->type == TapNoteType_Lift && iter->result.tns >= tns )
++iNumSuccessfulLiftNotes; ++iNumSuccessfulLiftNotes;
} }
return iNumSuccessfulLiftNotes; return iNumSuccessfulLiftNotes;
@@ -153,10 +153,10 @@ int LastTapNoteScoreTrack( const NoteData &in, unsigned iRow, PlayerNumber pn )
{ {
/* Skip empty tracks and mines */ /* Skip empty tracks and mines */
const TapNote &tn = in.GetTapNote( t, iRow ); const TapNote &tn = in.GetTapNote( t, iRow );
if (tn.type == TapNote::empty || if (tn.type == TapNoteType_Empty ||
tn.type == TapNote::mine || tn.type == TapNoteType_Mine ||
tn.type == TapNote::fake || tn.type == TapNoteType_Fake ||
tn.type == TapNote::autoKeysound) tn.type == TapNoteType_AutoKeysound)
continue; continue;
if( tn.pn != PLAYER_INVALID && tn.pn != pn && pn != PLAYER_INVALID ) if( tn.pn != PLAYER_INVALID && tn.pn != pn && pn != PLAYER_INVALID )
continue; continue;
@@ -190,10 +190,10 @@ int MinTapNoteScoreTrack( const NoteData &in, unsigned iRow, PlayerNumber pn )
{ {
// Skip empty tracks and mines // Skip empty tracks and mines
const TapNote &tn = in.GetTapNote( t, iRow ); const TapNote &tn = in.GetTapNote( t, iRow );
if (tn.type == TapNote::empty || if (tn.type == TapNoteType_Empty ||
tn.type == TapNote::mine || tn.type == TapNoteType_Mine ||
tn.type == TapNote::fake || tn.type == TapNoteType_Fake ||
tn.type == TapNote::autoKeysound) tn.type == TapNoteType_AutoKeysound)
continue; continue;
if( tn.pn != PLAYER_INVALID && tn.pn != pn && pn != PLAYER_INVALID ) if( tn.pn != PLAYER_INVALID && tn.pn != pn && pn != PLAYER_INVALID )
continue; 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. // Ignore mines (and fake arrows), or the score will always be TNS_None.
const TapNote &tn = in.GetTapNote( t, row ); const TapNote &tn = in.GetTapNote( t, row );
if (tn.type == TapNote::empty || if (tn.type == TapNoteType_Empty ||
tn.type == TapNote::mine || tn.type == TapNoteType_Mine ||
tn.type == TapNote::fake || tn.type == TapNoteType_Fake ||
tn.type == TapNote::autoKeysound || tn.type == TapNoteType_AutoKeysound ||
( plnum != PlayerNumber_Invalid && tn.pn != plnum ) ) ( plnum != PlayerNumber_Invalid && tn.pn != plnum ) )
continue; continue;
score = min( score, tn.result.tns ); score = min( score, tn.result.tns );
@@ -332,8 +332,8 @@ float GetActualFreezeRadarValue( const NoteData &in, float fSongSeconds )
return 1.0f; return 1.0f;
const int ActualHolds = const int ActualHolds =
GetNumHoldNotesWithScore( in, TapNote::hold_head_hold, HNS_Held ) + GetNumHoldNotesWithScore( in, TapNoteSubType_Hold, HNS_Held ) +
GetNumHoldNotesWithScore( in, TapNote::hold_head_roll, HNS_Held ); GetNumHoldNotesWithScore( in, TapNoteSubType_Roll, HNS_Held );
return clamp( float(ActualHolds) / iTotalHolds, 0.0f, 1.0f ); 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_Chaos: out[rc] = GetActualChaosRadarValue( in, fSongSeconds, pss ); break;
case RadarCategory_TapsAndHolds: out[rc] = (float) GetNumNWithScore( in, TNS_W4, 1 ); 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_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_Mines: out[rc] = (float) GetSuccessfulMines( in ); break;
case RadarCategory_Hands: out[rc] = (float) GetSuccessfulHands( 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_Lifts: out[rc] = (float) GetSuccessfulLifts( in, MIN_SCORE_TO_MAINTAIN_COMBO ); break;
case RadarCategory_Fakes: out[rc] = (float) in.GetNumFakes(); 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 ); DEFAULT_FAIL( rc );
} }
} }
+20 -20
View File
@@ -519,24 +519,24 @@ void NoteDisplay::DrawHoldBody( const TapNote& tn, int iCol, float fBeat, bool b
float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar ) float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar )
{ {
vector<Sprite*> vpSprTop; vector<Sprite*> 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 ); vpSprTop.push_back( pSpriteTop );
vector<Sprite*> vpSprBody; vector<Sprite*> 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 ); vpSprBody.push_back( pSpriteBody );
vector<Sprite*> vpSprBottom; vector<Sprite*> 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 ); vpSprBottom.push_back( pSpriteBottom );
if( bIsBeingHeld && cache->m_bHoldActiveIsAddLayer ) 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 ); 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 ); 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 ); vpSprBottom.push_back( pSprBottom );
} }
@@ -659,12 +659,12 @@ void NoteDisplay::DrawHold( const TapNote &tn, int iCol, int iRow, bool bIsBeing
/* /*
if( !cache->m_bHoldHeadIsAboveWavyParts ) 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 ); DrawActor( tn, pActor, NotePart_HoldHead, iCol, bFlipHeadAndTail ? fEndYOffset : fStartYOffset, fBeat, bIsAddition, fPercentFadeToFail, fReverseOffsetPixels, fColorScale, fDrawDistanceAfterTargetsPixels, fDrawDistanceBeforeTargetsPixels, fFadeInPercentOfDrawFar );
} }
if( !cache->m_bHoldTailIsAboveWavyParts ) 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 ); 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 // of the head and tail. Perhaps make this a theme/noteskin metric? -aj
if( cache->m_bHoldTailIsAboveWavyParts ) 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 ); DrawActor( tn, pActor, NotePart_HoldTail, iCol, bFlipHeadAndTail ? fStartYOffset : fEndYOffset, fBeat, bIsAddition, fPercentFadeToFail, fReverseOffsetPixels, fColorScale, fDrawDistanceAfterTargetsPixels, fDrawDistanceBeforeTargetsPixels, fFadeInPercentOfDrawFar );
} }
if( cache->m_bHoldHeadIsAboveWavyParts ) 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 ); 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 ) 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 ) if( fYOffset < fDrawDistanceAfterTargetsPixels || fYOffset > fDrawDistanceBeforeTargetsPixels )
return; return;
const float fY = ArrowEffects::GetYPos( m_pPlayerState, iCol, fYOffset, fReverseOffsetPixels ); 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; float fRotationX = 0, fRotationZ = 0;
const float fRotationY = ArrowEffects::GetRotationY( m_pPlayerState, fYOffset ); const float fRotationY = ArrowEffects::GetRotationY( m_pPlayerState, fYOffset );
bool bIsHoldHead = tn.type == tn.hold_head; bool bIsHoldHead = tn.type == TapNoteType_HoldHead;
bool bIsHoldCap = bIsHoldHead || tn.type == tn.hold_tail; bool bIsHoldCap = bIsHoldHead || tn.type == TapNoteType_HoldTail;
fRotationZ = ArrowEffects::GetRotationZ( m_pPlayerState, fBeat, bIsHoldHead ); fRotationZ = ArrowEffects::GetRotationZ( m_pPlayerState, fBeat, bIsHoldHead );
if( !bIsHoldCap ) if( !bIsHoldCap )
@@ -711,7 +711,7 @@ void NoteDisplay::DrawActor( const TapNote& tn, Actor* pActor, NotePart part, in
fRotationX = ArrowEffects::GetRotationX( m_pPlayerState, fYOffset ); fRotationX = ArrowEffects::GetRotationX( m_pPlayerState, fYOffset );
} }
if( tn.type != tn.hold_head ) if( tn.type != TapNoteType_HoldHead )
fColorScale *= ArrowEffects::GetBrightness( m_pPlayerState, fBeat ); fColorScale *= ArrowEffects::GetBrightness( m_pPlayerState, fBeat );
pActor->SetRotationX( fRotationX ); pActor->SetRotationX( fRotationX );
@@ -752,23 +752,23 @@ void NoteDisplay::DrawTap(const TapNote& tn, int iCol, float fBeat,
Actor* pActor = NULL; Actor* pActor = NULL;
NotePart part = NotePart_Tap; NotePart part = NotePart_Tap;
/* /*
if( tn.source == TapNote::addition ) if( tn.source == TapNoteSource_Addition )
{ {
pActor = GetTapActor( m_TapAddition, NotePart_Addition, fBeat ); pActor = GetTapActor( m_TapAddition, NotePart_Addition, fBeat );
part = NotePart_Addition; part = NotePart_Addition;
} }
*/ */
if( tn.type == TapNote::lift ) if( tn.type == TapNoteType_Lift )
{ {
pActor = GetTapActor( m_TapLift, NotePart_Lift, fBeat ); pActor = GetTapActor( m_TapLift, NotePart_Lift, fBeat );
part = NotePart_Lift; part = NotePart_Lift;
} }
else if( tn.type == TapNote::mine ) else if( tn.type == TapNoteType_Mine )
{ {
pActor = GetTapActor( m_TapMine, NotePart_Mine, fBeat ); pActor = GetTapActor( m_TapMine, NotePart_Mine, fBeat );
part = NotePart_Mine; part = NotePart_Mine;
} }
else if( tn.type == TapNote::fake ) else if( tn.type == TapNoteType_Fake )
{ {
pActor = GetTapActor( m_TapFake, NotePart_Fake, fBeat ); pActor = GetTapActor( m_TapFake, NotePart_Fake, fBeat );
part = NotePart_Fake; part = NotePart_Fake;
@@ -812,7 +812,7 @@ void NoteDisplay::DrawTap(const TapNote& tn, int iCol, float fBeat,
pActor = GetTapActor( m_TapNote, NotePart_Tap, fBeat ); pActor = GetTapActor( m_TapNote, NotePart_Tap, fBeat );
} }
if( tn.type == TapNote::attack ) if( tn.type == TapNoteType_Attack )
{ {
Message msg( "SetAttack" ); Message msg( "SetAttack" );
msg.SetParam( "Modifiers", tn.sAttackModifiers ); 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 // 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 ); 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" ); pActor->PlayCommand( "UnsetAttack" );
} }
+10 -10
View File
@@ -1214,7 +1214,7 @@ void NoteField::DrawPrimitives()
for( ; begin != end; ++begin ) for( ; begin != end; ++begin )
{ {
const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, j); const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, j);
if( tn.type != TapNote::hold_head ) if( tn.type != TapNoteType_HoldHead )
continue; // skip continue; // skip
const HoldNoteResult &Result = tn.HoldResult; const HoldNoteResult &Result = tn.HoldResult;
@@ -1243,7 +1243,7 @@ void NoteField::DrawPrimitives()
continue; // skip continue; // skip
} }
bool bIsAddition = (tn.source == TapNote::addition); bool bIsAddition = (tn.source == TapNoteSource_Addition);
bool bIsHopoPossible = (tn.bHopoPossible); bool bIsHopoPossible = (tn.bHopoPossible);
bool bUseAdditionColoring = bIsAddition || bIsHopoPossible; bool bUseAdditionColoring = bIsAddition || bIsHopoPossible;
const bool bHoldGhostShowing = tn.HoldResult.bActive && tn.HoldResult.fLife > 0; 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. // Fixes hold head overlapping issue, but not the rolls.
switch( tn.type ) switch( tn.type )
{ {
case TapNote::empty: // no note here case TapNoteType_Empty: // no note here
{ {
continue; continue;
} }
case TapNote::hold_head: case TapNoteType_HoldHead:
{ {
//if (tn.subType == TapNote::hold_head_roll) //if (tn.subType == TapNoteSubType_Roll)
continue; // skip continue; // skip
} }
default: break; default: break;
@@ -1313,8 +1313,8 @@ void NoteField::DrawPrimitives()
for( int c2=0; c2<m_pNoteData->GetNumTracks(); c2++ ) for( int c2=0; c2<m_pNoteData->GetNumTracks(); c2++ )
{ {
const TapNote &tmp = m_pNoteData->GetTapNote(c2, q); const TapNote &tmp = m_pNoteData->GetTapNote(c2, q);
if(tmp.type == TapNote::hold_head && if(tmp.type == TapNoteType_HoldHead &&
tmp.subType == TapNote::hold_head_hold) tmp.subType == TapNoteSubType_Hold)
{ {
bHoldNoteBeginsOnThisBeat = true; bHoldNoteBeginsOnThisBeat = true;
break; break;
@@ -1329,8 +1329,8 @@ void NoteField::DrawPrimitives()
for( int c2=0; c2<m_pNoteData->GetNumTracks(); c2++ ) for( int c2=0; c2<m_pNoteData->GetNumTracks(); c2++ )
{ {
const TapNote &tmp = m_pNoteData->GetTapNote(c2, q); const TapNote &tmp = m_pNoteData->GetTapNote(c2, q);
if(tmp.type == TapNote::hold_head && if(tmp.type == TapNoteType_HoldHead &&
tmp.subType == TapNote::hold_head_roll) tmp.subType == TapNoteSubType_Roll)
{ {
bRollNoteBeginsOnThisBeat = true; bRollNoteBeginsOnThisBeat = true;
break; break;
@@ -1342,7 +1342,7 @@ void NoteField::DrawPrimitives()
if( m_iBeginMarker!=-1 && m_iEndMarker!=-1 ) if( m_iBeginMarker!=-1 && m_iEndMarker!=-1 )
bIsInSelectionRange = m_iBeginMarker<=q && q<m_iEndMarker; bIsInSelectionRange = m_iBeginMarker<=q && q<m_iEndMarker;
bool bIsAddition = (tn.source == TapNote::addition); bool bIsAddition = (tn.source == TapNoteSource_Addition);
bool bIsHopoPossible = (tn.bHopoPossible); bool bIsHopoPossible = (tn.bHopoPossible);
bool bUseAdditionColoring = bIsAddition || bIsHopoPossible; bool bUseAdditionColoring = bIsAddition || bIsHopoPossible;
NoteDisplayCols *displayCols = tn.pn == PLAYER_INVALID ? m_pCurDisplay : m_pDisplays[tn.pn]; NoteDisplayCols *displayCols = tn.pn == PLAYER_INVALID ? m_pCurDisplay : m_pDisplays[tn.pn];
+45 -12
View File
@@ -5,18 +5,51 @@
#include "XmlFile.h" #include "XmlFile.h"
#include "LocalizedString.h" #include "LocalizedString.h"
TapNote TAP_EMPTY ( TapNote::empty, TapNote::SubType_Invalid, TapNote::original, "", 0, -1 ); TapNote TAP_EMPTY ( TapNoteType_Empty, TapNoteSubType_Invalid, TapNoteSource_Original, "", 0, -1 );
TapNote TAP_ORIGINAL_TAP ( TapNote::tap, TapNote::SubType_Invalid, TapNote::original, "", 0, -1 ); TapNote TAP_ORIGINAL_TAP ( TapNoteType_Tap, TapNoteSubType_Invalid, TapNoteSource_Original, "", 0, -1 );
TapNote TAP_ORIGINAL_LIFT ( TapNote::lift, TapNote::SubType_Invalid, TapNote::original, "", 0, -1 ); TapNote TAP_ORIGINAL_LIFT ( TapNoteType_Lift, TapNoteSubType_Invalid, TapNoteSource_Original, "", 0, -1 );
TapNote TAP_ORIGINAL_HOLD_HEAD ( TapNote::hold_head, TapNote::hold_head_hold, TapNote::original, "", 0, -1 ); TapNote TAP_ORIGINAL_HOLD_HEAD ( TapNoteType_HoldHead, TapNoteSubType_Hold, TapNoteSource_Original, "", 0, -1 );
TapNote TAP_ORIGINAL_ROLL_HEAD ( TapNote::hold_head, TapNote::hold_head_roll, TapNote::original, "", 0, -1 ); TapNote TAP_ORIGINAL_ROLL_HEAD ( TapNoteType_HoldHead, TapNoteSubType_Roll, TapNoteSource_Original, "", 0, -1 );
TapNote TAP_ORIGINAL_MINE ( TapNote::mine, TapNote::SubType_Invalid, TapNote::original, "", 0, -1 ); TapNote TAP_ORIGINAL_MINE ( TapNoteType_Mine, TapNoteSubType_Invalid, TapNoteSource_Original, "", 0, -1 );
TapNote TAP_ORIGINAL_ATTACK ( TapNote::attack, TapNote::SubType_Invalid, TapNote::original, "", 0, -1 ); TapNote TAP_ORIGINAL_ATTACK ( TapNoteType_Attack, TapNoteSubType_Invalid, TapNoteSource_Original, "", 0, -1 );
TapNote TAP_ORIGINAL_AUTO_KEYSOUND ( TapNote::autoKeysound,TapNote::SubType_Invalid, TapNote::original, "", 0, -1 ); TapNote TAP_ORIGINAL_AUTO_KEYSOUND ( TapNoteType_AutoKeysound,TapNoteSubType_Invalid, TapNoteSource_Original, "", 0, -1 );
TapNote TAP_ORIGINAL_FAKE ( TapNote::fake, TapNote::SubType_Invalid, TapNote::original, "", 0, -1 ); TapNote TAP_ORIGINAL_FAKE ( TapNoteType_Fake, TapNoteSubType_Invalid, TapNoteSource_Original, "", 0, -1 );
//TapNote TAP_ORIGINAL_MINE_HEAD ( TapNote::mine_head, TapNote::hold_head_mine, TapNote::original, "", 0, -1 ); //TapNote TAP_ORIGINAL_MINE_HEAD ( TapNoteType_HoldHead, TapNoteSubType_Mine, TapNoteSource_Original, "", 0, -1 );
TapNote TAP_ADDITION_TAP ( TapNote::tap, TapNote::SubType_Invalid, TapNote::addition, "", 0, -1 ); TapNote TAP_ADDITION_TAP ( TapNoteType_Tap, TapNoteSubType_Invalid, TapNoteSource_Addition, "", 0, -1 );
TapNote TAP_ADDITION_MINE ( TapNote::mine, TapNote::SubType_Invalid, TapNote::addition, "", 0, -1 ); TapNote TAP_ADDITION_MINE ( TapNoteType_Mine, TapNoteSubType_Invalid, TapNoteSource_Addition, "", 0, -1 );
static const char *TapNoteTypeNames[] = {
"Empty",
"Tap",
"HoldHead",
"HoldTail",
"Mine",
"Lift",
"Attack",
"AutoKeySound",
"Fake",
};
XToString( TapNoteType );
XToLocalizedString( TapNoteType );
LuaXType( TapNoteType );
static const char *TapNoteSubTypeNames[] = {
"Hold",
"Roll",
//"Mine",
};
XToString( TapNoteSubType );
XToLocalizedString( TapNoteSubType );
LuaXType( TapNoteSubType );
static const char *TapNoteSourceNames[] = {
"Original",
"Addition",
};
XToString( TapNoteSource );
XToLocalizedString( TapNoteSource );
LuaXType( TapNoteSource );
static const char *NoteTypeNames[] = { static const char *NoteTypeNames[] = {
"4th", "4th",
+59 -76
View File
@@ -75,43 +75,59 @@ struct HoldNoteResult
void LoadFromNode( const XNode* pNode ); void LoadFromNode( const XNode* pNode );
}; };
/** @brief What is the TapNote's core type? */
enum TapNoteType
{
TapNoteType_Empty, /**< There is no note here. */
TapNoteType_Tap, /**< The player simply steps on this. */
TapNoteType_HoldHead, /**< This is graded like the Tap type, but should be held. */
TapNoteType_HoldTail, /**< In 2sand3s mode, holds are deleted and hold_tail is added. */
TapNoteType_Mine, /**< In most modes, it is suggested to not step on these mines. */
TapNoteType_Lift, /**< Lift your foot up when it crosses the target area. */
TapNoteType_Attack, /**< Hitting this note causes an attack to take place. */
TapNoteType_AutoKeysound, /**< A special sound is played when this note crosses the target area. */
TapNoteType_Fake, /**< This arrow can't be scored for or against the player. */
NUM_TapNoteType,
TapNoteType_Invalid
};
const RString& TapNoteTypeToString( TapNoteType tnt );
const RString& TapNoteTypeToLocalizedString( TapNoteType tnt );
LuaDeclareType( TapNoteType );
/** @brief The list of a TapNote's sub types. */
enum TapNoteSubType
{
TapNoteSubType_Hold, /**< The start of a traditional hold note. */
TapNoteSubType_Roll, /**< The start of a roll note that must be hit repeatedly. */
//TapNoteSubType_Mine,
NUM_TapNoteSubType,
TapNoteSubType_Invalid
};
const RString& TapNoteSubTypeToString( TapNoteSubType tnst );
const RString& TapNoteSubTypeToLocalizedString( TapNoteSubType tnst );
LuaDeclareType( TapNoteSubType );
/** @brief The different places a TapNote could come from. */
enum TapNoteSource
{
TapNoteSource_Original, /**< This note is part of the original NoteData. */
TapNoteSource_Addition, /**< This note is additional note added by a transform. */
NUM_TapNoteSource,
TapNoteSource_Invalid
};
const RString& TapNoteSourceToString( TapNoteSource tns );
const RString& TapNoteSourceToLocalizedString( TapNoteSource tns );
LuaDeclareType( TapNoteSource );
/** @brief The various properties of a tap note. */ /** @brief The various properties of a tap note. */
struct TapNote struct TapNote
{ {
/** @brief What is the TapNote's core type? */
enum Type
{
empty, /**< There is no note here. */
tap, /**< The player simply steps on this. */
hold_head, /**< This is graded like the Tap type, but should be held. */
hold_tail, /**< In 2sand3s mode, holds are deleted and hold_tail is added. */
mine, /**< In most modes, it is suggested to not step on these mines. */
lift, /**< Lift your foot up when it crosses the target area. */
attack, /**< Hitting this note causes an attack to take place. */
autoKeysound, /**< A special sound is played when this note crosses the target area. */
fake, /**< This arrow can't be scored for or against the player. */
};
/** @brief The list of a TapNote's sub types. */
enum SubType
{
hold_head_hold, /**< The start of a traditional hold note. */
hold_head_roll, /**< The start of a roll note that must be hit repeatedly. */
//hold_head_mine,
NUM_SubType,
SubType_Invalid
};
/** @brief The different places a TapNote could come from. */
enum Source
{
original, /**< This note is part of the original NoteData. */
addition, /**< This note is additional note added by a transform. */
};
/** @brief The core note type that is about to cross the target area. */ /** @brief The core note type that is about to cross the target area. */
Type type; TapNoteType type;
/** @brief The sub type of the note. This is only used if the type is hold_head. */ /** @brief The sub type of the note. This is only used if the type is hold_head. */
SubType subType; TapNoteSubType subType;
/** @brief The originating source of the TapNote. */ /** @brief The originating source of the TapNote. */
Source source; TapNoteSource source;
/** @brief The result of hitting or missing the TapNote. */ /** @brief The result of hitting or missing the TapNote. */
TapNoteResult result; TapNoteResult result;
/** @brief The Player that is supposed to hit this note. This is mainly for Routine Mode. */ /** @brief The Player that is supposed to hit this note. This is mainly for Routine Mode. */
@@ -134,15 +150,15 @@ struct TapNote
XNode* CreateNode() const; XNode* CreateNode() const;
void LoadFromNode( const XNode* pNode ); void LoadFromNode( const XNode* pNode );
TapNote(): type(empty), subType(SubType_Invalid), source(original), TapNote(): type(TapNoteType_Empty), subType(TapNoteSubType_Invalid),
result(), pn(PLAYER_INVALID), bHopoPossible(false), source(TapNoteSource_Original), result(), pn(PLAYER_INVALID),
sAttackModifiers(""), fAttackDurationSeconds(0), bHopoPossible(false), sAttackModifiers(""), fAttackDurationSeconds(0),
iKeysoundIndex(-1), iDuration(0), HoldResult() {} iKeysoundIndex(-1), iDuration(0), HoldResult() {}
void Init() void Init()
{ {
type = empty; type = TapNoteType_Empty;
subType = SubType_Invalid; subType = TapNoteSubType_Invalid;
source = original; source = TapNoteSource_Original;
pn = PLAYER_INVALID, pn = PLAYER_INVALID,
bHopoPossible = false; bHopoPossible = false;
fAttackDurationSeconds = 0.f; fAttackDurationSeconds = 0.f;
@@ -150,9 +166,9 @@ struct TapNote
iDuration = 0; iDuration = 0;
} }
TapNote( TapNote(
Type type_, TapNoteType type_,
SubType subType_, TapNoteSubType subType_,
Source source_, TapNoteSource source_,
RString sAttackModifiers_, RString sAttackModifiers_,
float fAttackDurationSeconds_, float fAttackDurationSeconds_,
int iKeysoundIndex_ ): int iKeysoundIndex_ ):
@@ -162,10 +178,10 @@ struct TapNote
fAttackDurationSeconds(fAttackDurationSeconds_), fAttackDurationSeconds(fAttackDurationSeconds_),
iKeysoundIndex(iKeysoundIndex_), iDuration(0), HoldResult() iKeysoundIndex(iKeysoundIndex_), iDuration(0), HoldResult()
{ {
if (type_ > 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_ ); 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 = TapNote::empty; type = TapNoteType_Empty;
} }
} }
@@ -207,39 +223,6 @@ extern TapNote TAP_ORIGINAL_FAKE; // 'F'
extern TapNote TAP_ADDITION_TAP; extern TapNote TAP_ADDITION_TAP;
extern TapNote TAP_ADDITION_MINE; 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. * @brief The number of tracks allowed.
* *
+4 -4
View File
@@ -942,8 +942,8 @@ bool BMSChartReader::ReadNoteData()
{ {
// this object is the end of the hold note. // this object is the end of the hold note.
TapNote tn = nd.GetTapNote(track, holdStart[track]); TapNote tn = nd.GetTapNote(track, holdStart[track]);
tn.type = TapNote::hold_head; tn.type = TapNoteType_HoldHead;
tn.subType = TapNote::hold_head_hold; tn.subType = TapNoteSubType_Hold;
nd.AddHoldNote( track, holdStart[track], row, tn ); nd.AddHoldNote( track, holdStart[track], row, tn );
holdStart[track] = -1; holdStart[track] = -1;
lastNote[track] = -1; lastNote[track] = -1;
@@ -953,8 +953,8 @@ bool BMSChartReader::ReadNoteData()
// this object is the end of the hold note. // this object is the end of the hold note.
// lnobj: set last note to hold head. // lnobj: set last note to hold head.
TapNote tn = nd.GetTapNote(track, lastNote[track]); TapNote tn = nd.GetTapNote(track, lastNote[track]);
tn.type = TapNote::hold_head; tn.type = TapNoteType_HoldHead;
tn.subType = TapNote::hold_head_hold; tn.subType = TapNoteSubType_Hold;
nd.AddHoldNote( track, lastNote[track], row, tn ); nd.AddHoldNote( track, lastNote[track], row, tn );
holdStart[track] = -1; holdStart[track] = -1;
lastNote[track] = -1; lastNote[track] = -1;
+2 -2
View File
@@ -367,7 +367,7 @@ static NoteData ParseNoteData(RString &step1, RString &step2,
FOREACH_NONEMPTY_ROW_IN_TRACK( newNoteData, t, iHeadRow ) FOREACH_NONEMPTY_ROW_IN_TRACK( newNoteData, t, iHeadRow )
{ {
TapNote tn = newNoteData.GetTapNote( t, iHeadRow ); TapNote tn = newNoteData.GetTapNote( t, iHeadRow );
if( tn.type != TapNote::hold_head ) if( tn.type != TapNoteType_HoldHead )
continue; continue;
int iTailRow = iHeadRow; int iTailRow = iHeadRow;
@@ -375,7 +375,7 @@ static NoteData ParseNoteData(RString &step1, RString &step2,
while( !bFound && newNoteData.GetNextTapNoteRowForTrack(t, iTailRow) ) while( !bFound && newNoteData.GetNextTapNoteRowForTrack(t, iTailRow) )
{ {
const TapNote &TailTap = newNoteData.GetTapNote( t, iTailRow ); const TapNote &TailTap = newNoteData.GetTapNote( t, iTailRow );
if( TailTap.type == TapNote::empty ) if( TailTap.type == TapNoteType_Empty )
continue; continue;
newNoteData.SetTapNote( t, iTailRow, TAP_EMPTY ); newNoteData.SetTapNote( t, iTailRow, TAP_EMPTY );
+4 -4
View File
@@ -89,11 +89,11 @@ static void Deserialize(BackgroundChange &o, const Json::Value &root )
static void Deserialize( TapNote &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() ) if( root.isInt() )
o.type = (TapNote::Type)root["Type"].asInt(); o.type = (TapNoteType)root["Type"].asInt();
//if( o.type == TapNote::hold_head ) //if( o.type == TapNoteType_HoldHead )
o.subType = (TapNote::SubType)root["SubType"].asInt(); o.subType = (TapNoteSubType)root["SubType"].asInt();
//root["Source"] = (int)source; //root["Source"] = (int)source;
//if( !o.sAttackModifiers.empty() ) //if( !o.sAttackModifiers.empty() )
o.sAttackModifiers = root["AttackModifiers"].asString(); o.sAttackModifiers = root["AttackModifiers"].asString();
+3 -3
View File
@@ -123,13 +123,13 @@ static RString NotesToDWIString( const TapNote tnCols[6] )
{ {
switch( tnCols[col].type ) switch( tnCols[col].type )
{ {
case TapNote::empty: case TapNoteType_Empty:
case TapNote::mine: case TapNoteType_Mine:
continue; continue;
default: break; default: break;
} }
if( tnCols[col].type == TapNote::hold_head ) if( tnCols[col].type == TapNoteType_HoldHead )
holds += dirs[col]; holds += dirs[col];
else else
taps += dirs[col]; taps += dirs[col];
+2 -2
View File
@@ -55,9 +55,9 @@ static void Serialize( const TapNote &o, Json::Value &root )
{ {
root = Json::Value(Json::objectValue); root = Json::Value(Json::objectValue);
if( o.type != TapNote::tap ) if( o.type != TapNoteType_Tap )
root["Type"] = (int)o.type; root["Type"] = (int)o.type;
if( o.type == TapNote::hold_head ) if( o.type == TapNoteType_HoldHead )
root["SubType"] = (int)o.subType; root["SubType"] = (int)o.subType;
//root["Source"] = (int)source; //root["Source"] = (int)source;
if( !o.sAttackModifiers.empty() ) if( !o.sAttackModifiers.empty() )
+70 -70
View File
@@ -537,16 +537,16 @@ static bool NeedsTapJudging( const TapNote &tn )
switch( tn.type ) switch( tn.type )
{ {
DEFAULT_FAIL( tn.type ); DEFAULT_FAIL( tn.type );
case TapNote::tap: case TapNoteType_Tap:
case TapNote::hold_head: case TapNoteType_HoldHead:
case TapNote::mine: case TapNoteType_Mine:
case TapNote::lift: case TapNoteType_Lift:
return tn.result.tns == TNS_None; return tn.result.tns == TNS_None;
case TapNote::hold_tail: case TapNoteType_HoldTail:
case TapNote::attack: case TapNoteType_Attack:
case TapNote::autoKeysound: case TapNoteType_AutoKeysound:
case TapNote::fake: case TapNoteType_Fake:
case TapNote::empty: case TapNoteType_Empty:
return false; return false;
} }
} }
@@ -560,16 +560,16 @@ static bool NeedsHoldJudging( const TapNote &tn )
switch( tn.type ) switch( tn.type )
{ {
DEFAULT_FAIL( tn.type ); DEFAULT_FAIL( tn.type );
case TapNote::hold_head: case TapNoteType_HoldHead:
return tn.HoldResult.hns == HNS_None; return tn.HoldResult.hns == HNS_None;
case TapNote::tap: case TapNoteType_Tap:
case TapNote::hold_tail: case TapNoteType_HoldTail:
case TapNote::mine: case TapNoteType_Mine:
case TapNote::lift: case TapNoteType_Lift:
case TapNote::attack: case TapNoteType_Attack:
case TapNote::autoKeysound: case TapNoteType_AutoKeysound:
case TapNote::fake: case TapNoteType_Fake:
case TapNote::empty: case TapNoteType_Empty:
return false; return false;
} }
} }
@@ -947,7 +947,7 @@ void Player::Update( float fDeltaTime )
iHeadRow = iSongRow; iHeadRow = iSongRow;
const TapNote &tn = m_NoteData.GetTapNote( iTrack, iHeadRow ); 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; continue;
if( tn.HoldResult.hns != HNS_None ) if( tn.HoldResult.hns != HNS_None )
continue; continue;
@@ -981,7 +981,7 @@ void Player::Update( float fDeltaTime )
for( ; !iter.IsAtEnd() && iter.Row() <= iSongRow; ++iter ) for( ; !iter.IsAtEnd() && iter.Row() <= iSongRow; ++iter )
{ {
TapNote &tn = *iter; TapNote &tn = *iter;
if( tn.type != TapNote::hold_head ) if( tn.type != TapNoteType_HoldHead )
continue; continue;
int iTrack = iter.Track(); int iTrack = iter.Track();
@@ -994,9 +994,9 @@ void Player::Update( float fDeltaTime )
switch( tn.subType ) switch( tn.subType )
{ {
DEFAULT_FAIL( tn.subType ); DEFAULT_FAIL( tn.subType );
case TapNote::hold_head_hold: case TapNoteSubType_Hold:
break; break;
case TapNote::hold_head_roll: case TapNoteSubType_Roll:
{ {
vector<TrackRowTapNote> v; vector<TrackRowTapNote> v;
v.push_back( trtn ); v.push_back( trtn );
@@ -1005,7 +1005,7 @@ void Player::Update( float fDeltaTime )
continue; // don't process this below continue; // don't process this below
} }
/* /*
case TapNote::hold_head_mine: case TapNoteSubType_Mine:
break; break;
*/ */
@@ -1088,14 +1088,14 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
int iMaxEndRow = INT_MIN; int iMaxEndRow = INT_MIN;
int iFirstTrackWithMaxEndRow = -1; int iFirstTrackWithMaxEndRow = -1;
TapNote::SubType subType = TapNote::SubType_Invalid; TapNoteSubType subType = TapNoteSubType_Invalid;
FOREACH( TrackRowTapNote, vTN, trtn ) FOREACH( TrackRowTapNote, vTN, trtn )
{ {
int iTrack = trtn->iTrack; int iTrack = trtn->iTrack;
ASSERT( iStartRow == trtn->iRow ); ASSERT( iStartRow == trtn->iRow );
TapNote &tn = *trtn->pTN; TapNote &tn = *trtn->pTN;
int iEndRow = iStartRow + tn.iDuration; int iEndRow = iStartRow + tn.iDuration;
if( subType == TapNote::SubType_Invalid ) if( subType == TapNoteSubType_Invalid )
subType = tn.subType; subType = tn.subType;
/* All holds must be of the same subType because fLife is handled /* All holds must be of the same subType because fLife is handled
@@ -1250,7 +1250,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
{ {
switch( subType ) switch( subType )
{ {
case TapNote::hold_head_hold: case TapNoteSubType_Hold:
FOREACH( TrackRowTapNote, vTN, trtn ) FOREACH( TrackRowTapNote, vTN, trtn )
{ {
TapNote &tn = *trtn->pTN; TapNote &tn = *trtn->pTN;
@@ -1296,7 +1296,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
} }
} }
break; break;
case TapNote::hold_head_roll: case TapNoteSubType_Roll:
FOREACH( TrackRowTapNote, vTN, trtn ) FOREACH( TrackRowTapNote, vTN, trtn )
{ {
TapNote &tn = *trtn->pTN; TapNote &tn = *trtn->pTN;
@@ -1311,7 +1311,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
fLife = max( fLife, 0 ); // clamp fLife = max( fLife, 0 ); // clamp
break; break;
/* /*
case TapNote::hold_head_mine: case TapNoteSubType_Mine:
break; break;
*/ */
default: default:
@@ -1353,14 +1353,14 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
switch( subType ) switch( subType )
{ {
DEFAULT_FAIL( subType ); DEFAULT_FAIL( subType );
case TapNote::hold_head_hold: case TapNoteSubType_Hold:
bAllowHoldCheckpoints = true; bAllowHoldCheckpoints = true;
break; break;
case TapNote::hold_head_roll: case TapNoteSubType_Roll:
bAllowHoldCheckpoints = false; bAllowHoldCheckpoints = false;
break; break;
/* /*
case TapNote::hold_head_mine: case TapNoteSubType_Mine:
bAllowHoldCheckpoints = true; bAllowHoldCheckpoints = true;
break; break;
*/ */
@@ -1454,7 +1454,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
if( tn.iKeysoundIndex >= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() ) if( tn.iKeysoundIndex >= 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); 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 )) if (!m_Timing->IsJudgableAtRow( begin->first ))
break; break;
// unsure if autoKeysounds should be excluded. -Wolfman2000 // 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; break;
if( !bAllowGraded && tn.result.tns != TNS_None ) if( !bAllowGraded && tn.result.tns != TNS_None )
break; break;
@@ -1974,7 +1974,7 @@ void Player::PlayKeysound( const TapNote &tn, TapNoteScore score )
if( tn.iKeysoundIndex >= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() ) if( tn.iKeysoundIndex >= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() )
{ {
// handle a case for hold notes // 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 the hold is not already held
if( tn.HoldResult.hns == HNS_None ) 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 ) for( ; begin != end; ++begin )
{ {
TapNote &tn = begin->second; TapNote &tn = begin->second;
if( tn.type != TapNote::hold_head ) if( tn.type != TapNoteType_HoldHead )
continue; continue;
switch( tn.subType ) switch( tn.subType )
{ {
DEFAULT_FAIL( tn.subType ); DEFAULT_FAIL( tn.subType );
case TapNote::hold_head_hold: case TapNoteSubType_Hold:
continue; continue;
case TapNote::hold_head_roll: case TapNoteSubType_Roll:
break; break;
} }
@@ -2240,18 +2240,18 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
case PC_HUMAN: case PC_HUMAN:
switch( pTN->type ) switch( pTN->type )
{ {
case TapNote::mine: case TapNoteType_Mine:
// Stepped too close to mine? // Stepped too close to mine?
if( !bRelease && ( REQUIRE_STEP_ON_MINES == !bHeld ) && if( !bRelease && ( REQUIRE_STEP_ON_MINES == !bHeld ) &&
fSecondsFromExact <= GetWindowSeconds(TW_Mine) && fSecondsFromExact <= GetWindowSeconds(TW_Mine) &&
m_Timing->IsJudgableAtRow(iSongRow)) m_Timing->IsJudgableAtRow(iSongRow))
score = TNS_HitMine; score = TNS_HitMine;
break; break;
case TapNote::attack: case TapNoteType_Attack:
if( !bRelease && fSecondsFromExact <= GetWindowSeconds(TW_Attack) && !pTN->result.bHidden ) if( !bRelease && fSecondsFromExact <= GetWindowSeconds(TW_Attack) && !pTN->result.bHidden )
score = AllowW1() ? TNS_W1 : TNS_W2; // sentinel score = AllowW1() ? TNS_W1 : TNS_W2; // sentinel
break; break;
case TapNote::hold_head: case TapNoteType_HoldHead:
// oh wow, this was causing the trigger before the hold heads // oh wow, this was causing the trigger before the hold heads
// bug. (It was fNoteOffset > 0.f before) -DaisuMaster // bug. (It was fNoteOffset > 0.f before) -DaisuMaster
if( !REQUIRE_STEP_ON_HOLD_HEADS && ( fNoteOffset <= GetWindowSeconds( TW_W5 ) && GetWindowSeconds( TW_W5 ) != 0 ) ) 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. // Fall through to default.
default: default:
if( (pTN->type == TapNote::lift) == bRelease ) if( (pTN->type == TapNoteType_Lift) == bRelease )
{ {
if( fSecondsFromExact <= GetWindowSeconds(TW_W1) ) score = TNS_W1; if( fSecondsFromExact <= GetWindowSeconds(TW_W1) ) score = TNS_W1;
else if( fSecondsFromExact <= GetWindowSeconds(TW_W2) ) score = TNS_W2; 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 // 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" // 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 // The CPU hits a lot of mines. Only consider hitting the
// first mine for a row. We know we're the first mine if // first mine for a row. We know we're the first mine if
// there are are no mines to the left of us. // there are are no mines to the left of us.
for( int t=0; t<col; t++ ) for( int t=0; t<col; t++ )
{ {
if( m_NoteData.GetTapNote(t,iRowOfOverlappingNoteOrRow).type == TapNote::mine ) // there's a mine to the left of us if( m_NoteData.GetTapNote(t,iRowOfOverlappingNoteOrRow).type == TapNoteType_Mine ) // there's a mine to the left of us
return; // avoid return; // avoid
} }
@@ -2314,7 +2314,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
score = TNS_HitMine; score = TNS_HitMine;
} }
if( pTN->type == TapNote::attack && score > TNS_W4 ) if( pTN->type == TapNoteType_Attack && score > TNS_W4 )
score = TNS_W2; // sentinel score = TNS_W2; // sentinel
/* AI will generate misses here. Don't handle a miss like a regular /* 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; i<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; i++ ) for( int i=0; i<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; i++ )
{ {
const TapNote &tn = m_NoteData.GetTapNote( i, iRowOfOverlappingNoteOrRow ); const TapNote &tn = m_NoteData.GetTapNote( i, iRowOfOverlappingNoteOrRow );
bool bIsNote = (tn.type != TapNote::empty); bool bIsNote = (tn.type != TapNoteType_Empty);
if( iFirstNoteCol == -1 && bIsNote ) if( iFirstNoteCol == -1 && bIsNote )
iFirstNoteCol = i; 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-- ) for( int i=GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer-1; i>=0; i-- )
{ {
const TapNote &tn = m_NoteData.GetTapNote( i, iRowOfOverlappingNoteOrRow ); const TapNote &tn = m_NoteData.GetTapNote( i, iRowOfOverlappingNoteOrRow );
bool bIsNote = (tn.type != TapNote::empty); bool bIsNote = (tn.type != TapNoteType_Empty);
if( bIsNote ) if( bIsNote )
{ {
iLastNoteCol = i; 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 ); 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? 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 ); 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 // 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 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; t<m_NoteData.GetNumTracks(); t++ ) for( int t=0; t<m_NoteData.GetNumTracks(); t++ )
{ {
const TapNote &tn = m_NoteData.GetTapNote( t, iRowOfOverlappingNoteOrRow ); const TapNote &tn = m_NoteData.GetTapNote( t, iRowOfOverlappingNoteOrRow );
if( tn.type == TapNote::attack ) if( tn.type == TapNoteType_Attack )
HideNote( t, iRowOfOverlappingNoteOrRow ); HideNote( t, iRowOfOverlappingNoteOrRow );
} }
} }
@@ -2537,7 +2537,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
for( int t=0; t<m_NoteData.GetNumTracks(); t++ ) for( int t=0; t<m_NoteData.GetNumTracks(); t++ )
{ {
TapNote tn = m_NoteData.GetTapNote( t, iRowOfOverlappingNoteOrRow ); TapNote tn = m_NoteData.GetTapNote( t, iRowOfOverlappingNoteOrRow );
if( tn.type != TapNote::empty ) if( tn.type != TapNoteType_Empty )
{ {
tn.result.tns = score; tn.result.tns = score;
tn.result.fTapNoteOffset = -fNoteOffset; tn.result.fTapNoteOffset = -fNoteOffset;
@@ -2556,7 +2556,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
m_LastTapNoteScore = score; m_LastTapNoteScore = score;
if( GAMESTATE->GetCurrentGame()->m_bCountNotesSeparately ) if( GAMESTATE->GetCurrentGame()->m_bCountNotesSeparately )
{ {
if( pTN->type != TapNote::mine ) if( pTN->type != TapNoteType_Mine )
{ {
const bool bBlind = (m_pPlayerState->m_PlayerOptions.GetCurrent().m_fBlind != 0); const bool bBlind = (m_pPlayerState->m_PlayerOptions.GetCurrent().m_fBlind != 0);
// XXX: This is the wrong combo for shared players. // XXX: This is the wrong combo for shared players.
@@ -2734,7 +2734,7 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds )
if (!m_Timing->IsJudgableAtRow(iter.Row())) if (!m_Timing->IsJudgableAtRow(iter.Row()))
continue; continue;
if( tn.type == TapNote::mine ) if( tn.type == TapNoteType_Mine )
{ {
tn.result.tns = TNS_AvoidMine; tn.result.tns = TNS_AvoidMine;
@@ -2793,9 +2793,9 @@ void Player::UpdateJudgedRows()
for( int iTrack = 0; iTrack < m_NoteData.GetNumTracks(); ++iTrack ) for( int iTrack = 0; iTrack < m_NoteData.GetNumTracks(); ++iTrack )
{ {
const TapNote &tn = m_NoteData.GetTapNote( iTrack, iRow ); const TapNote &tn = m_NoteData.GetTapNote( iTrack, iRow );
if (tn.type == TapNote::empty || if (tn.type == TapNoteType_Empty ||
tn.type == TapNote::mine || tn.type == TapNoteType_Mine ||
tn.type == TapNote::autoKeysound) continue; tn.type == TapNoteType_AutoKeysound) continue;
SetJudgment( tn.result.tns, iTrack, tn.result.fTapNoteOffset ); SetJudgment( tn.result.tns, iTrack, tn.result.fTapNoteOffset );
} }
} }
@@ -2805,8 +2805,8 @@ void Player::UpdateJudgedRows()
for( int iTrack = 0; iTrack < m_NoteData.GetNumTracks(); ++iTrack ) for( int iTrack = 0; iTrack < m_NoteData.GetNumTracks(); ++iTrack )
{ {
const TapNote &tn = m_NoteData.GetTapNote( iTrack, iRow ); const TapNote &tn = m_NoteData.GetTapNote( iTrack, iRow );
if (tn.type == TapNote::tap || tn.type == TapNote::lift || if (tn.type == TapNoteType_Tap || tn.type == TapNoteType_Lift ||
( tn.type == TapNote::hold_head && REQUIRE_STEP_ON_HOLD_HEADS ) ) ( tn.type == TapNoteType_HoldHead && REQUIRE_STEP_ON_HOLD_HEADS ) )
{ {
viColsWithTaps.push_back( iTrack ); viColsWithTaps.push_back( iTrack );
}; };
@@ -2841,7 +2841,7 @@ void Player::UpdateJudgedRows()
*m_pIterUnjudgedMineRows = iter; *m_pIterUnjudgedMineRows = iter;
} }
bool bMineNotHidden = tn.type == TapNote::mine && !tn.result.bHidden; bool bMineNotHidden = tn.type == TapNoteType_Mine && !tn.result.bHidden;
if( !bMineNotHidden ) if( !bMineNotHidden )
continue; continue;
@@ -2916,7 +2916,7 @@ void Player::FlashGhostRow( int iRow )
{ {
const TapNote &tn = m_NoteData.GetTapNote( iTrack, 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; continue;
if( m_pNoteField ) if( m_pNoteField )
m_pNoteField->DidTapNote( iTrack, lastTNS, bBright ); m_pNoteField->DidTapNote( iTrack, lastTNS, bBright );
@@ -2939,7 +2939,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
int iTrack = iter.Track(); int iTrack = iter.Track();
switch( tn.type ) switch( tn.type )
{ {
case TapNote::hold_head: case TapNoteType_HoldHead:
{ {
tn.HoldResult.fLife = INITIAL_HOLD_LIFE; tn.HoldResult.fLife = INITIAL_HOLD_LIFE;
if( !REQUIRE_STEP_ON_HOLD_HEADS ) if( !REQUIRE_STEP_ON_HOLD_HEADS )
@@ -2959,7 +2959,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
} }
break; break;
} }
case TapNote::mine: case TapNoteType_Mine:
{ {
// Hold the panel while crossing a mine will cause the mine to explode // Hold the panel while crossing a mine will cause the mine to explode
// TODO: Remove use of PlayerNumber. // 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 // check to see if there's a note at the crossed row
if( m_pPlayerState->m_PlayerController != PC_HUMAN ) if( m_pPlayerState->m_PlayerController != PC_HUMAN )
{ {
if (tn.type != TapNote::empty && if (tn.type != TapNoteType_Empty &&
tn.type != TapNote::fake && tn.type != TapNoteType_Fake &&
tn.type != TapNote::autoKeysound && tn.type != TapNoteType_AutoKeysound &&
tn.result.tns == TNS_None && tn.result.tns == TNS_None &&
this->m_Timing->IsJudgableAtRow(iRow) ) 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) for (int t = 0; t < m_NoteData.GetNumTracks(); ++t)
{ {
const TapNote &tap = m_NoteData.GetTapNote(t, iRow); const TapNote &tap = m_NoteData.GetTapNote(t, iRow);
if (tap.type == TapNote::autoKeysound) if (tap.type == TapNoteType_AutoKeysound)
{ {
PlayKeysound(tap, TNS_None); PlayKeysound(tap, TNS_None);
} }
@@ -3047,7 +3047,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
for( ; !nIter.IsAtEnd(); ++nIter ) for( ; !nIter.IsAtEnd(); ++nIter )
{ {
TapNote &tn = *nIter; TapNote &tn = *nIter;
if( tn.type != TapNote::hold_head ) if( tn.type != TapNoteType_HoldHead )
continue; continue;
int iTrack = nIter.Track(); int iTrack = nIter.Track();
@@ -3109,10 +3109,10 @@ void Player::HandleTapRowScore( unsigned row )
{ {
const TapNote &tn = m_NoteData.GetTapNote( track, row ); const TapNote &tn = m_NoteData.GetTapNote( track, row );
// Mines cannot be handled here. // Mines cannot be handled here.
if (tn.type == TapNote::empty || if (tn.type == TapNoteType_Empty ||
tn.type == TapNote::fake || tn.type == TapNoteType_Fake ||
tn.type == TapNote::mine || tn.type == TapNoteType_Mine ||
tn.type == TapNote::autoKeysound) tn.type == TapNoteType_AutoKeysound)
continue; continue;
if( m_pPrimaryScoreKeeper ) if( m_pPrimaryScoreKeeper )
m_pPrimaryScoreKeeper->HandleTapScore( tn ); m_pPrimaryScoreKeeper->HandleTapScore( tn );
+1 -1
View File
@@ -19,7 +19,7 @@ void ScoreKeeper::GetScoreOfLastTapInRow( const NoteData &nd, int iRow,
{ {
const TapNote &tn = nd.GetTapNote( track, 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; continue;
++iNum; ++iNum;
} }
+2 -2
View File
@@ -337,7 +337,7 @@ void ScoreKeeperNormal::HandleTapScore( const TapNote &tn )
{ {
TapNoteScore tns = tn.result.tns; TapNoteScore tns = tn.result.tns;
if( tn.type == TapNote::mine ) if( tn.type == TapNoteType_Mine )
{ {
if( tns == TNS_HitMine ) if( tns == TNS_HitMine )
{ {
@@ -463,7 +463,7 @@ void ScoreKeeperNormal::GetRowCounts( const NoteData &nd, int iRow,
{ {
const TapNote &tn = nd.GetTapNote( track, 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; continue;
TapNoteScore tns = tn.result.tns; TapNoteScore tns = tn.result.tns;
if( tns >= m_MinScoreToContinueCombo ) if( tns >= m_MinScoreToContinueCombo )
+22 -22
View File
@@ -1825,7 +1825,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
m_NoteDataEdit.SetTapNote( iCol, iHeadRow, TAP_EMPTY ); m_NoteDataEdit.SetTapNote( iCol, iHeadRow, TAP_EMPTY );
// Don't CheckNumberOfNotesAndUndo. We don't want to revert any change that removes notes. // 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(); m_soundRemoveNote.Play();
SetDirty( true ); SetDirty( true );
@@ -1855,10 +1855,10 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
{ {
switch ( m_selectedTap.type ) switch ( m_selectedTap.type )
{ {
case TapNote::tap: m_selectedTap = TAP_ORIGINAL_FAKE; break; case TapNoteType_Tap: m_selectedTap = TAP_ORIGINAL_FAKE; break;
case TapNote::mine: m_selectedTap = TAP_ORIGINAL_TAP; break; case TapNoteType_Mine: m_selectedTap = TAP_ORIGINAL_TAP; break;
case TapNote::lift: m_selectedTap = TAP_ORIGINAL_MINE; break; case TapNoteType_Lift: m_selectedTap = TAP_ORIGINAL_MINE; break;
case TapNote::fake: m_selectedTap = TAP_ORIGINAL_LIFT; break; case TapNoteType_Fake: m_selectedTap = TAP_ORIGINAL_LIFT; break;
DEFAULT_FAIL( m_selectedTap.type ); DEFAULT_FAIL( m_selectedTap.type );
} }
return true; return true;
@@ -1867,10 +1867,10 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
{ {
switch ( m_selectedTap.type ) switch ( m_selectedTap.type )
{ {
case TapNote::tap: m_selectedTap = TAP_ORIGINAL_MINE; break; case TapNoteType_Tap: m_selectedTap = TAP_ORIGINAL_MINE; break;
case TapNote::mine: m_selectedTap = TAP_ORIGINAL_LIFT; break; case TapNoteType_Mine: m_selectedTap = TAP_ORIGINAL_LIFT; break;
case TapNote::lift: m_selectedTap = TAP_ORIGINAL_FAKE; break; case TapNoteType_Lift: m_selectedTap = TAP_ORIGINAL_FAKE; break;
case TapNote::fake: m_selectedTap = TAP_ORIGINAL_TAP; break; case TapNoteType_Fake: m_selectedTap = TAP_ORIGINAL_TAP; break;
DEFAULT_FAIL( m_selectedTap.type ); DEFAULT_FAIL( m_selectedTap.type );
} }
return true; return true;
@@ -3501,18 +3501,18 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
// set note at this row to use this keysound file. // set note at this row to use this keysound file.
// if it's empty, make it an auto keysound. // if it's empty, make it an auto keysound.
newNote.iKeysoundIndex = sound; 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() else // sound > kses.size()
{ {
// remove the sound. if it's an auto keysound, make it empty. // remove the sound. if it's an auto keysound, make it empty.
newNote.iKeysoundIndex = -1; 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); m_NoteDataEdit.SetTapNote(track, row, newNote);
@@ -3530,8 +3530,8 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
if (newNote.iKeysoundIndex == static_cast<int>(sound)) if (newNote.iKeysoundIndex == static_cast<int>(sound))
{ {
newNote.iKeysoundIndex = -1; newNote.iKeysoundIndex = -1;
if (newNote.type == TapNote::autoKeysound) if (newNote.type == TapNoteType_AutoKeysound)
newNote.type = TapNote::empty; newNote.type = TapNoteType_Empty;
} }
else if (newNote.iKeysoundIndex > static_cast<int>(sound)) else if (newNote.iKeysoundIndex > static_cast<int>(sound))
newNote.iKeysoundIndex--; newNote.iKeysoundIndex--;
@@ -3560,8 +3560,8 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
{ {
newNote.iKeysoundIndex = pos; newNote.iKeysoundIndex = pos;
} }
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.
m_NoteDataEdit.SetTapNote(track, row, newNote); m_NoteDataEdit.SetTapNote(track, row, newNote);
SetDirty(true); SetDirty(true);
} }
@@ -3588,9 +3588,9 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
const int row = BeatToNoteRow( GAMESTATE->m_Position.m_fSongBeat ); const int row = BeatToNoteRow( GAMESTATE->m_Position.m_fSongBeat );
TapNote tn( TapNote tn(
TapNote::attack, TapNoteType_Attack,
TapNote::SubType_Invalid, TapNoteSubType_Invalid,
TapNote::original, TapNoteSource_Original,
sMods, sMods,
g_fLastInsertAttackDurationSeconds, g_fLastInsertAttackDurationSeconds,
-1 ); -1 );
@@ -4829,7 +4829,7 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector<int> &iAn
for (int t = 0; t < nd.GetNumTracks(); t++) for (int t = 0; t < nd.GetNumTracks(); t++)
{ {
const TapNote &tn = nd.GetTapNote(t, r); const TapNote &tn = nd.GetTapNote(t, r);
if (tn.type != TapNote::empty) if (tn.type != TapNoteType_Empty)
{ {
TapNote nTap = tn; TapNote nTap = tn;
nTap.pn = (tn.pn == PLAYER_1 ? nTap.pn = (tn.pn == PLAYER_1 ?
@@ -4858,7 +4858,7 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector<int> &iAn
for (int t = 0; t < tracks; t++) for (int t = 0; t < tracks; t++)
{ {
const TapNote &tn = nd.GetTapNote(t, r); 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; TapNote nTap = tn;
nTap.pn = nPN; nTap.pn = nPN;
+5 -5
View File
@@ -1017,14 +1017,14 @@ void ScreenGameplay::SetupSong( int iSongIndex )
// load player // load player
{ {
pi->m_NoteData = ndTransformed; pi->m_NoteData = ndTransformed;
NoteDataUtil::RemoveAllTapsOfType( pi->m_NoteData, TapNote::autoKeysound ); NoteDataUtil::RemoveAllTapsOfType( pi->m_NoteData, TapNoteType_AutoKeysound );
pi->m_pPlayer->Load(); pi->m_pPlayer->Load();
} }
// load auto keysounds // load auto keysounds
{ {
NoteData nd = ndTransformed; NoteData nd = ndTransformed;
NoteDataUtil::RemoveAllTapsExceptForType( nd, TapNote::autoKeysound ); NoteDataUtil::RemoveAllTapsExceptForType( nd, TapNoteType_AutoKeysound );
m_AutoKeysounds.Load( pi->GetStepsAndTrailIndex(), nd ); m_AutoKeysounds.Load( pi->GetStepsAndTrailIndex(), nd );
} }
@@ -2049,7 +2049,7 @@ void ScreenGameplay::UpdateLights()
// for each index we crossed since the last update: // for each index we crossed since the last update:
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( m_CabinetLightsNoteData, cl, r, iRowLastCrossed+1, iSongRow+1 ) 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; bBlinkCabinetLight[cl] = true;
} }
@@ -2068,7 +2068,7 @@ void ScreenGameplay::UpdateLights()
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( nd, t, r, iRowLastCrossed+1, iSongRow+1 ) FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( nd, t, r, iRowLastCrossed+1, iSongRow+1 )
{ {
const TapNote &tn = nd.GetTapNote( t, r ); const TapNote &tn = nd.GetTapNote( t, r );
if( tn.type != TapNote::mine ) if( tn.type != TapNoteType_Mine )
bBlink = true; bBlink = true;
} }
@@ -2165,7 +2165,7 @@ void ScreenGameplay::SendCrossedMessages()
int iNumTracksWithTapOrHoldHead = 0; int iNumTracksWithTapOrHoldHead = 0;
for( int t=0; t<nd.GetNumTracks(); t++ ) for( int t=0; t<nd.GetNumTracks(); t++ )
{ {
if( nd.GetTapNote(t,r).type == TapNote::empty ) if( nd.GetTapNote(t,r).type == TapNoteType_Empty )
continue; continue;
iNumTracksWithTapOrHoldHead++; iNumTracksWithTapOrHoldHead++;
+1 -1
View File
@@ -221,7 +221,7 @@ void ScreenHowToPlay::Step()
{ {
const int iNumTracks = m_NoteData.GetNumTracks(); const int iNumTracks = m_NoteData.GetNumTracks();
for( int k=0; k<iNumTracks; k++ ) for( int k=0; k<iNumTracks; k++ )
if( m_NoteData.GetTapNote(k, iNoteRow).type == TapNote::tap ) if( m_NoteData.GetTapNote(k, iNoteRow).type == TapNoteType_Tap )
iStep |= 1 << k; iStep |= 1 << k;
switch( iStep ) switch( iStep )
+1 -1
View File
@@ -97,7 +97,7 @@ void SoundEffectControl::HoldsBeingHeld( int iRow, int &iHoldsHeld, int &iHoldsL
continue; continue;
const TapNote &tn = begin->second; const TapNote &tn = begin->second;
if( tn.type != TapNote::hold_head ) if( tn.type != TapNoteType_HoldHead )
continue; continue;
if( tn.HoldResult.bActive ) if( tn.HoldResult.bActive )
++iHoldsHeld; ++iHoldsHeld;
Binary file not shown.
Binary file not shown.