From d65404e750aff5cbcc15cb338eb964fd76321d15 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 24 May 2004 04:26:54 +0000 Subject: [PATCH] TapSteps -> TapNotes --- stepmania/src/GameState.cpp | 2 ++ stepmania/src/GameState.h | 1 + stepmania/src/NoteData.cpp | 44 +++++++++++++-------------- stepmania/src/NoteData.h | 16 +++++----- stepmania/src/NoteDataUtil.cpp | 4 +-- stepmania/src/NoteDataWithScoring.cpp | 14 ++++----- stepmania/src/NoteDataWithScoring.h | 2 +- stepmania/src/Player.cpp | 8 ++--- stepmania/src/Player.h | 2 +- stepmania/src/ScoreKeeperMAX2.cpp | 10 +++--- stepmania/src/ScoreKeeperMAX2.h | 2 +- stepmania/src/ScreenEdit.cpp | 6 ++-- 12 files changed, 57 insertions(+), 54 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 72be00485d..7a970e842e 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -148,6 +148,8 @@ void GameState::Reset() FOREACH_PlayerNumber( p ) m_pCurNotes[p] = NULL; m_pCurCourse = NULL; + FOREACH_PlayerNumber( p ) + m_pCurTrail[p] = NULL; SAFE_DELETE( m_pPosition ); m_pPosition = new NoteFieldPositioning("Positioning.ini"); diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index 73a35613cc..51b52ec1af 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -142,6 +142,7 @@ public: Song* m_pCurSong; Steps* m_pCurNotes[NUM_PLAYERS]; Course* m_pCurCourse; + Course* m_pCurTrail[NUM_PLAYERS]; // diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index 1eeeeacb78..9e8c7f8acd 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -42,14 +42,14 @@ void NoteData::SetNumTracks( int iNewNumTracks ) // Make sure that all tracks are of the same length ASSERT( m_iNumTracks > 0 ); - int rows = m_TapSteps[0].size(); + int rows = m_TapNotes[0].size(); for( int t=0; tm_TapSteps[c]; + m_TapNotes[c] = pFrom->m_TapNotes[c]; m_HoldNotes = pFrom->m_HoldNotes; m_AttackMap = pFrom->m_AttackMap; } @@ -376,7 +376,7 @@ int NoteData::GetFirstRow() const int i; - for( i=0; i < int(m_TapSteps[0].size()); i++ ) + for( i=0; i < int(m_TapNotes[0].size()); i++ ) { if( !IsRowEmpty(i) ) { @@ -409,7 +409,7 @@ int NoteData::GetLastRow() const int i; - for( i = int(m_TapSteps[0].size()); i>=0; i-- ) // iterate back to front + for( i = int(m_TapNotes[0].size()); i>=0; i-- ) // iterate back to front { if( !IsRowEmpty(i) ) { @@ -432,7 +432,7 @@ float NoteData::GetLastBeat() const return NoteRowToBeat( GetLastRow() ); } -int NoteData::GetNumTapSteps( float fStartBeat, float fEndBeat ) const +int NoteData::GetNumTapNotes( float fStartBeat, float fEndBeat ) const { int iNumNotes = 0; @@ -755,7 +755,7 @@ void NoteData::LoadTransformed( const NoteData* pOriginal, int iNewNumTracks, co if( iOriginalTrack == -1 ) continue; - m_TapSteps[t] = Original.m_TapSteps[iOriginalTrack]; + m_TapNotes[t] = Original.m_TapNotes[iOriginalTrack]; } Convert4sToHoldNotes(); @@ -795,7 +795,7 @@ void NoteData::LoadOverlapped( const NoteData* pOriginal, int iNewNumTracks ) const int iTrackFrom = i; int &iTrackTo = DestRow[i]; - const TapNote iStepFrom = in.m_TapSteps[iTrackFrom][row]; + const TapNote iStepFrom = in.m_TapNotes[iTrackFrom][row]; if( iStepFrom == TAP_EMPTY ) continue; @@ -891,49 +891,49 @@ void NoteData::LoadTransformedSlidingWindow( const NoteData* pOriginal, int iNew m_AttackMap = Original.GetAttackMap(); } -void NoteData::PadTapSteps(int rows) +void NoteData::PadTapNotes(int rows) { - int needed = rows - m_TapSteps[0].size() + 1; + int needed = rows - m_TapNotes[0].size() + 1; if(needed < 0) return; needed += 100; /* optimization: give it a little more than it needs */ for(int track = 0; track < m_iNumTracks; ++track) - m_TapSteps[track].insert(m_TapSteps[track].end(), needed, TAP_EMPTY); + m_TapNotes[track].insert(m_TapNotes[track].end(), needed, TAP_EMPTY); } void NoteData::MoveTapNoteTrack(int dest, int src) { if(dest == src) return; - m_TapSteps[dest] = m_TapSteps[src]; - m_TapSteps[src].clear(); + m_TapNotes[dest] = m_TapNotes[src]; + m_TapNotes[src].clear(); } void NoteData::SetTapNote(int track, int row, TapNote t) { if(row < 0) return; - PadTapSteps(row); - m_TapSteps[track][row]=t; + PadTapNotes(row); + m_TapNotes[track][row]=t; } void NoteData::ReserveRows( int row ) { for(int track = 0; track < m_iNumTracks; ++track) - m_TapSteps[track].reserve( row ); + m_TapNotes[track].reserve( row ); } void NoteData::EliminateAllButOneTap(int row) { if(row < 0) return; - PadTapSteps(row); + PadTapNotes(row); int track; for(track = 0; track < m_iNumTracks; ++track) { - if( m_TapSteps[track][row] == TAP_TAP ) + if( m_TapNotes[track][row] == TAP_TAP ) break; } @@ -941,8 +941,8 @@ void NoteData::EliminateAllButOneTap(int row) for( ; track < m_iNumTracks; ++track) { - if( m_TapSteps[track][row] == TAP_TAP ) - m_TapSteps[track][row] = TAP_EMPTY; + if( m_TapNotes[track][row] == TAP_TAP ) + m_TapNotes[track][row] = TAP_EMPTY; } } diff --git a/stepmania/src/NoteData.h b/stepmania/src/NoteData.h index 84a5d98819..6ac7042eb1 100644 --- a/stepmania/src/NoteData.h +++ b/stepmania/src/NoteData.h @@ -23,15 +23,15 @@ class NoteData { /* Keep this aligned, so that they all have the same size. */ - vector m_TapSteps[MAX_NOTE_TRACKS]; + vector m_TapNotes[MAX_NOTE_TRACKS]; int m_iNumTracks; vector m_HoldNotes; map m_AttackMap; - /* Pad m_TapSteps so it includes the row "rows". */ - void PadTapSteps(int rows); + /* Pad m_TapNotes so it includes the row "rows". */ + void PadTapNotes(int rows); void LoadOverlapped( const NoteData* pOriginal, int iNewNumTracks ); @@ -56,8 +56,8 @@ public: * range; pretend the song goes on with TAP_EMPTYs indefinitely. */ inline TapNote GetTapNote(unsigned track, int row) const { - if(row < 0 || row >= (int) m_TapSteps[track].size()) return TapNote(TAP_EMPTY); - return m_TapSteps[track][row]; + if(row < 0 || row >= (int) m_TapNotes[track].size()) return TapNote(TAP_EMPTY); + return m_TapNotes[track][row]; } void ReserveRows( int row ); @@ -65,7 +65,7 @@ public: * which is much faster. Be sure that 0 <= row < GetMaxRow(). */ inline TapNote GetTapNoteX(unsigned track, int row) const { - return m_TapSteps[track][row]; + return m_TapNotes[track][row]; } void MoveTapNoteTrack(int dest, int src); void SetTapNote(int track, int row, TapNote t); @@ -116,13 +116,13 @@ public: /* Return the highest beat/row that might contain notes. (Use GetLastBeat if you need * accuracy.) */ float GetMaxBeat() const { return NoteRowToBeat(GetMaxRow()); } - int GetMaxRow() const { return int(m_TapSteps[0].size()); } + int GetMaxRow() const { return int(m_TapNotes[0].size()); } float GetFirstBeat() const; // return the beat number of the first note int GetFirstRow() const; float GetLastBeat() const; // return the beat number of the last note int GetLastRow() const; - int GetNumTapSteps( const float fStartBeat = 0, const float fEndBeat = -1 ) const; + int GetNumTapNotes( const float fStartBeat = 0, const float fEndBeat = -1 ) const; int GetNumMines( const float fStartBeat = 0, const float fEndBeat = -1 ) const; int GetNumHands( const float fStartBeat = 0, const float fEndBeat = -1 ) const; int GetNumRowsWithTap( const float fStartBeat = 0, const float fEndBeat = -1 ) const; diff --git a/stepmania/src/NoteDataUtil.cpp b/stepmania/src/NoteDataUtil.cpp index d5ed53512a..5b01578baa 100644 --- a/stepmania/src/NoteDataUtil.cpp +++ b/stepmania/src/NoteDataUtil.cpp @@ -321,7 +321,7 @@ float NoteDataUtil::GetStreamRadarValue( const NoteData &in, float fSongSeconds if( !fSongSeconds ) return 0.0f; // density of steps - int iNumNotes = in.GetNumTapSteps() + in.GetNumHoldNotes(); + int iNumNotes = in.GetNumTapNotes() + in.GetNumHoldNotes(); float fNotesPerSecond = iNumNotes/fSongSeconds; float fReturn = fNotesPerSecond / 7; return min( fReturn, 1.0f ); @@ -342,7 +342,7 @@ float NoteDataUtil::GetVoltageRadarValue( const NoteData &in, float fSongSeconds for( int i=0; i<=int(fLastBeat); i+=BEAT_WINDOW ) { - int iNumNotesThisWindow = in.GetNumTapSteps((float)i,(float)i+BEAT_WINDOW) + in.GetNumHoldNotes((float)i,(float)i+BEAT_WINDOW); + int iNumNotesThisWindow = in.GetNumTapNotes((float)i,(float)i+BEAT_WINDOW) + in.GetNumHoldNotes((float)i,(float)i+BEAT_WINDOW); float fDensityThisWindow = iNumNotesThisWindow/(float)BEAT_WINDOW; fMaxDensitySoFar = max( fMaxDensitySoFar, fDensityThisWindow ); } diff --git a/stepmania/src/NoteDataWithScoring.cpp b/stepmania/src/NoteDataWithScoring.cpp index 551aa65a8e..375a193e8a 100644 --- a/stepmania/src/NoteDataWithScoring.cpp +++ b/stepmania/src/NoteDataWithScoring.cpp @@ -31,9 +31,9 @@ void NoteDataWithScoring::Init() m_HoldNoteScores.clear(); } -int NoteDataWithScoring::GetNumTapStepsWithScore( TapNoteScore tns, const float fStartBeat, float fEndBeat ) const +int NoteDataWithScoring::GetNumTapNotesWithScore( TapNoteScore tns, const float fStartBeat, float fEndBeat ) const { - int iNumSuccessfulTapSteps = 0; + int iNumSuccessfulTapNotes = 0; if(fEndBeat == -1) fEndBeat = GetMaxBeat()+1; @@ -46,11 +46,11 @@ int NoteDataWithScoring::GetNumTapStepsWithScore( TapNoteScore tns, const float for( int t=0; tGetTapNote(t, i) != TAP_EMPTY && GetTapNoteScore(t, i) >= tns ) - iNumSuccessfulTapSteps++; + iNumSuccessfulTapNotes++; } } - return iNumSuccessfulTapSteps; + return iNumSuccessfulTapNotes; } int NoteDataWithScoring::GetNumNWithScore( TapNoteScore tns, int MinTaps, const float fStartBeat, float fEndBeat ) const @@ -281,17 +281,17 @@ float NoteDataWithScoring::GetActualRadarValue( RadarCategory rv, PlayerNumber p float NoteDataWithScoring::GetActualStreamRadarValue( float fSongSeconds, PlayerNumber pn ) const { - int TotalSteps = GetNumTapSteps(); + int TotalSteps = GetNumTapNotes(); if( !TotalSteps ) return 1; - const int Perfects = GetNumTapStepsWithScore(TNS_PERFECT); + const int Perfects = GetNumTapNotesWithScore(TNS_PERFECT); return clamp( float(Perfects)/TotalSteps, 0.0f, 1.0f ); } float NoteDataWithScoring::GetActualVoltageRadarValue( float fSongSeconds, PlayerNumber pn ) const { - /* g_CurStageStats.iMaxCombo is unrelated to GetNumTapSteps: m_bComboContinuesBetweenSongs + /* g_CurStageStats.iMaxCombo is unrelated to GetNumTapNotes: m_bComboContinuesBetweenSongs * might be on, and the way combo is counted varies depending on the mode and score * keeper. Instead, let's use the length of the longest recorded combo. This is * only subtly different: it's the percent of the song the longest combo took to get. */ diff --git a/stepmania/src/NoteDataWithScoring.h b/stepmania/src/NoteDataWithScoring.h index c4cc4bdc5a..4fff1c1dca 100644 --- a/stepmania/src/NoteDataWithScoring.h +++ b/stepmania/src/NoteDataWithScoring.h @@ -65,7 +65,7 @@ public: void Init(); // statistics - int GetNumTapStepsWithScore( TapNoteScore tns, const float fStartBeat = 0, const float fEndBeat = -1 ) const; + int GetNumTapNotesWithScore( TapNoteScore tns, const float fStartBeat = 0, const float fEndBeat = -1 ) const; int GetNumNWithScore( TapNoteScore tns, int MinTaps, const float fStartBeat = 0, const float fEndBeat = -1 ) const; int GetNumHoldNotesWithScore( HoldNoteScore hns, const float fStartBeat = 0, const float fEndBeat = -1 ) const; int GetSuccessfulMines( const float fStartBeat = 0, const float fEndBeat = -1 ) const; diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 2a432e7a02..a4ab91822f 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -300,7 +300,7 @@ void PlayerMinus::Update( float fDeltaTime ) // // Check for TapNote misses // - UpdateTapStepsMissedOlderThan( GetMaxStepDistanceSeconds() ); + UpdateTapNotesMissedOlderThan( GetMaxStepDistanceSeconds() ); // // update pressed flag @@ -847,7 +847,7 @@ void PlayerMinus::Step( int col, RageTimer tm ) /* AI will generate misses here. Don't handle a miss like a regular note because * we want the judgment animation to appear delayed. Instead, return early if - * AI generated a miss, and let UpdateMissedTapStepsOlderThan() detect and handle the + * AI generated a miss, and let UpdateMissedTapNotesOlderThan() detect and handle the * misses. */ if( score == TNS_MISS ) return; @@ -1030,9 +1030,9 @@ void PlayerMinus::OnRowCompletelyJudged( int iIndexThatWasSteppedOn ) } -void PlayerMinus::UpdateTapStepsMissedOlderThan( float fMissIfOlderThanSeconds ) +void PlayerMinus::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds ) { - //LOG->Trace( "Steps::UpdateTapStepsMissedOlderThan(%f)", fMissIfOlderThanThisBeat ); + //LOG->Trace( "Steps::UpdateTapNotesMissedOlderThan(%f)", fMissIfOlderThanThisBeat ); int iMissIfOlderThanThisIndex; { const float fEarliestTime = GAMESTATE->m_fMusicSeconds - fMissIfOlderThanSeconds; diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index d66f6a5fcb..7d5809a762 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -61,7 +61,7 @@ public: static float GetMaxStepDistanceSeconds(); protected: - void UpdateTapStepsMissedOlderThan( float fMissIfOlderThanThisBeat ); + void UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat ); void OnRowCompletelyJudged( int iStepIndex ); void HandleTapRowScore( unsigned row ); void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ); diff --git a/stepmania/src/ScoreKeeperMAX2.cpp b/stepmania/src/ScoreKeeperMAX2.cpp index 54f0c16ea1..8c724a573a 100644 --- a/stepmania/src/ScoreKeeperMAX2.cpp +++ b/stepmania/src/ScoreKeeperMAX2.cpp @@ -183,7 +183,7 @@ void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, const Steps* pSteps, c ASSERT( m_iPointBonus >= 0 ); - m_iTapStepsHit = 0; + m_iTapNotesHit = 0; } static int GetScore(int p, int B, int S, int n) @@ -267,7 +267,7 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score ) default: p = 0; break; } - m_iTapStepsHit++; + m_iTapNotesHit++; const int N = m_iNumTapsAndHolds; const int sum = (N * (N + 1)) / 2; @@ -286,15 +286,15 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score ) } else { - iScore += GetScore(p, B, sum, m_iTapStepsHit); + iScore += GetScore(p, B, sum, m_iTapNotesHit); const int &iCurrentCombo = g_CurStageStats.iCurCombo[m_PlayerNumber]; g_CurStageStats.iBonus[m_PlayerNumber] += m_ComboBonusFactor[score] * iCurrentCombo; } /* Subtract the maximum this step could have been worth from the bonus. */ - m_iPointBonus -= GetScore(10, B, sum, m_iTapStepsHit); + m_iPointBonus -= GetScore(10, B, sum, m_iTapNotesHit); - if ( m_iTapStepsHit == m_iNumTapsAndHolds && score >= TNS_PERFECT ) + if ( m_iTapNotesHit == m_iNumTapsAndHolds && score >= TNS_PERFECT ) { if (!g_CurStageStats.bFailedEarlier[m_PlayerNumber]) iScore += m_iPointBonus; diff --git a/stepmania/src/ScoreKeeperMAX2.h b/stepmania/src/ScoreKeeperMAX2.h index 7dd308b259..3d31c1aa75 100644 --- a/stepmania/src/ScoreKeeperMAX2.h +++ b/stepmania/src/ScoreKeeperMAX2.h @@ -20,7 +20,7 @@ class ScoreKeeperMAX2: public ScoreKeeper { int m_iScoreRemainder; int m_iMaxPossiblePoints; - int m_iTapStepsHit; // number of notes judged so far, needed by scoring + int m_iTapNotesHit; // number of notes judged so far, needed by scoring int m_iNumTapsAndHolds; int m_iMaxScoreSoFar; // for nonstop scoring diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index d54a8041fb..8f760037a3 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -554,7 +554,7 @@ void ScreenEdit::Update( float fDeltaTime ) void ScreenEdit::UpdateTextInfo() { - int iNumTapSteps = m_NoteFieldEdit.GetNumTapSteps(); + int iNumTapNotes = m_NoteFieldEdit.GetNumTapNotes(); int iNumHoldNotes = m_NoteFieldEdit.GetNumHoldNotes(); CString sNoteType; @@ -588,7 +588,7 @@ void ScreenEdit::UpdateTextInfo() sText += ssprintf( "Description:\n %s\n", GAMESTATE->m_pCurNotes[PLAYER_1] ? GAMESTATE->m_pCurNotes[PLAYER_1]->GetDescription().c_str() : "no description" ); sText += ssprintf( "Main title:\n %s\n", m_pSong->m_sMainTitle.c_str() ); sText += ssprintf( "Sub title:\n %s\n", m_pSong->m_sSubTitle.c_str() ); - sText += ssprintf( "Tap Steps:\n %d\n", iNumTapSteps ); + sText += ssprintf( "Tap Steps:\n %d\n", iNumTapNotes ); sText += ssprintf( "Hold Steps:\n %d\n", iNumHoldNotes ); sText += ssprintf( "Beat 0 Offset:\n %.3f secs\n", m_pSong->m_Timing.m_fBeat0OffsetInSeconds ); sText += ssprintf( "Preview Start:\n %.2f secs\n", m_pSong->m_fMusicSampleStartSeconds ); @@ -1561,7 +1561,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, int* iAnswers ) g_EditNotesStatistics.rows[meter].defaultChoice = pSteps->GetMeter()-1; g_EditNotesStatistics.rows[predict_meter].choices.resize(1);g_EditNotesStatistics.rows[predict_meter].choices[0] = ssprintf("%f",pSteps->PredictMeter()); g_EditNotesStatistics.rows[description].choices.resize(1); g_EditNotesStatistics.rows[description].choices[0] = pSteps->GetDescription(); - g_EditNotesStatistics.rows[tap_notes].choices.resize(1); g_EditNotesStatistics.rows[tap_notes].choices[0] = ssprintf("%d", m_NoteFieldEdit.GetNumTapSteps()); + g_EditNotesStatistics.rows[tap_notes].choices.resize(1); g_EditNotesStatistics.rows[tap_notes].choices[0] = ssprintf("%d", m_NoteFieldEdit.GetNumTapNotes()); g_EditNotesStatistics.rows[hold_notes].choices.resize(1); g_EditNotesStatistics.rows[hold_notes].choices[0] = ssprintf("%d", m_NoteFieldEdit.GetNumHoldNotes()); g_EditNotesStatistics.rows[stream].choices.resize(1); g_EditNotesStatistics.rows[stream].choices[0] = ssprintf("%f", NoteDataUtil::GetStreamRadarValue(m_NoteFieldEdit,fMusicSeconds)); g_EditNotesStatistics.rows[voltage].choices.resize(1); g_EditNotesStatistics.rows[voltage].choices[0] = ssprintf("%f", NoteDataUtil::GetVoltageRadarValue(m_NoteFieldEdit,fMusicSeconds));