diff --git a/src/GameConstantsAndTypes.cpp b/src/GameConstantsAndTypes.cpp index 82257bad14..0bf98e905b 100644 --- a/src/GameConstantsAndTypes.cpp +++ b/src/GameConstantsAndTypes.cpp @@ -35,6 +35,7 @@ static const char *RadarCategoryNames[] = { "Mines", "Hands", "Rolls", + "Lifts", "MinMidiNote", "MaxMidiNote", }; diff --git a/src/GameConstantsAndTypes.h b/src/GameConstantsAndTypes.h index ef36efc289..06b7c342d8 100644 --- a/src/GameConstantsAndTypes.h +++ b/src/GameConstantsAndTypes.h @@ -29,6 +29,7 @@ enum RadarCategory RadarCategory_Mines, RadarCategory_Hands, RadarCategory_Rolls, + RadarCategory_Lifts, RadarCategory_MinMidiNote, RadarCategory_MaxMidiNote, NUM_RadarCategory, // leave this at the end @@ -54,7 +55,7 @@ enum StepsType StepsType_dance_double, StepsType_dance_couple, StepsType_dance_solo, - //StepsType_dance_three, + //StepsType_dance_three, // kurisu calls this "3panel" StepsType_dance_routine, StepsType_pump_single, StepsType_pump_halfdouble, diff --git a/src/NoteData.cpp b/src/NoteData.cpp index f0759311fb..452cbb89f2 100644 --- a/src/NoteData.cpp +++ b/src/NoteData.cpp @@ -37,18 +37,18 @@ bool NoteData::IsComposite() const return false; } -/* Clear [rowBegin,rowEnd). */ +// Clear (rowBegin,rowEnd). void NoteData::ClearRangeForTrack( int rowBegin, int rowEnd, int iTrack ) { - /* Optimization: if the range encloses everything, just clear the whole maps. */ + // Optimization: if the range encloses everything, just clear the whole maps. if( rowBegin == 0 && rowEnd == MAX_NOTE_ROW ) { m_TapNotes[iTrack].clear(); return; } - /* If the range is empty, don't do anything. Otherwise, an empty range will cause - * hold notes to be split when they shouldn't be. */ + /* If the range is empty, don't do anything. Otherwise, an empty range will + * cause hold notes to be split when they shouldn't be. */ if( rowBegin == rowEnd ) return; @@ -57,8 +57,8 @@ void NoteData::ClearRangeForTrack( int rowBegin, int rowEnd, int iTrack ) if( begin != end && begin->first < rowBegin && begin->first + begin->second.iDuration > rowEnd ) { - /* A hold note overlaps the whole range. Truncate it, and add the remainder to - * the end. */ + /* A hold note overlaps the whole range. Truncate it, and add the + * remainder to the end. */ TapNote tn1 = begin->second; TapNote tn2 = tn1; @@ -71,12 +71,12 @@ void NoteData::ClearRangeForTrack( int rowBegin, int rowEnd, int iTrack ) SetTapNote( iTrack, iRow, tn1 ); SetTapNote( iTrack, rowEnd, tn2 ); - /* We may have invalidated our iterators. */ + // We may have invalidated our iterators. GetTapNoteRangeInclusive( iTrack, rowBegin, rowEnd, begin, end ); } else if( begin != end && begin->first < rowBegin ) { - /* A hold note overlaps the beginning of the range. Truncate it. */ + // A hold note overlaps the beginning of the range. Truncate it. TapNote &tn1 = begin->second; int iRow = begin->first; tn1.iDuration = rowBegin - iRow; @@ -92,7 +92,7 @@ void NoteData::ClearRangeForTrack( int rowBegin, int rowEnd, int iTrack ) int iRow = prev->first; if( tn.type == TapNote::hold_head && 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 ); int iAdd = rowEnd - iRow; @@ -102,7 +102,7 @@ void NoteData::ClearRangeForTrack( int rowBegin, int rowEnd, int iTrack ) end = prev; } - /* We may have invalidated our iterators. */ + // We may have invalidated our iterators. GetTapNoteRangeInclusive( iTrack, rowBegin, rowEnd, begin, end ); } @@ -121,19 +121,19 @@ void NoteData::ClearAll() m_TapNotes[t].clear(); } -/* Copy [rowFromBegin,rowFromEnd) from pFrom to this. (Note that this does *not* overlay; - * all data in the range is overwritten.) */ +/* Copy [rowFromBegin,rowFromEnd) from pFrom to this. (Note that this does + * *not* overlay; all data in the range is overwritten.) */ void NoteData::CopyRange( const NoteData& from, int rowFromBegin, int rowFromEnd, int rowToBegin ) { ASSERT( from.GetNumTracks() == GetNumTracks() ); if( rowFromBegin > rowFromEnd ) - return; /* empty range */ + return; // empty range const int rowToEnd = (rowFromEnd-rowFromBegin) + rowToBegin; const int iMoveBy = rowToBegin-rowFromBegin; - /* Clear the region. */ + // Clear the region. ClearRange( rowToBegin, rowToEnd ); for( int t=0; t=0 && iEndRow>=0 ); ASSERT_M( iEndRow >= iStartRow, ssprintf("EndRow %d < StartRow %d",iEndRow,iStartRow) ); - + /* Include adjacent (non-overlapping) hold notes, since we need to merge with them. */ iterator begin, end; GetTapNoteRangeInclusive( iTrack, iStartRow, iEndRow, begin, end, true ); - /* Look for other hold notes that overlap and merge them into add. */ + // Look for other hold notes that overlap and merge them into add. for( iterator it = begin; it != end; ++it ) { int iOtherRow = it->first; @@ -324,19 +324,19 @@ void NoteData::AddHoldNote( int iTrack, int iStartRow, int iEndRow, TapNote tn ) tn.iDuration = iEndRow - iStartRow; - /* Remove everything in the range. */ + // Remove everything in the range. while( begin != end ) { iterator next = begin; ++next; RemoveTapNote( iTrack, begin ); - + begin = next; } - /* Additionally, if there's a tap note lying at the end of our range, remove it, - * too. */ + /* Additionally, if there's a tap note lying at the end of our range, + * remove it too. */ SetTapNote( iTrack, iEndRow, TAP_EMPTY ); // add a tap note at the start of this hold @@ -358,8 +358,8 @@ bool NoteData::IsHoldHeadOrBodyAtRow( int iTrack, int iRow, int *pHeadRow ) cons return IsHoldNoteAtRow( iTrack, iRow, pHeadRow ); } -/* Determine if a hold note lies on the given spot. Return true if so. If - * pHeadRow is non-NULL, return the row of the head. (Note that this returns +/* Determine if a hold note lies on the given spot. Return true if so. If + * pHeadRow is non-NULL, return the row of the head. (Note that this returns * false if a hold head lies on iRow itself.) */ /* XXX: rename this to IsHoldBodyAtRow */ bool NoteData::IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow ) const @@ -368,9 +368,9 @@ bool NoteData::IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow ) const if( pHeadRow == NULL ) pHeadRow = &iDummy; - /* Starting at iRow, search upwards. If we find a TapNote::hold_head, we're within - * a hold. If we find a tap, mine or attack, we're not--those never lie within hold - * notes. Ignore autoKeysound. */ + /* Starting at iRow, search upwards. If we find a TapNote::hold_head, we're within + * a hold. If we find a tap, mine or attack, we're not--those never lie + * within hold notes. Ignore autoKeysound. */ FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE_REVERSE( *this, iTrack, r, 0, iRow ) { const TapNote &tn = GetTapNote( iTrack, r ); @@ -391,7 +391,7 @@ bool NoteData::IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow ) const case TapNote::empty: case TapNote::autoKeysound: - /* ignore */ + // ignore continue; DEFAULT_FAIL( tn.type ); } @@ -417,7 +417,7 @@ bool NoteData::IsEmpty() const int NoteData::GetFirstRow() const { int iEarliestRowFoundSoFar = -1; - + for( int t=0; t < GetNumTracks(); t++ ) { int iRow = -1; @@ -439,7 +439,7 @@ int NoteData::GetFirstRow() const int NoteData::GetLastRow() const { int iOldestRowFoundSoFar = 0; - + for( int t=0; t < GetNumTracks(); t++ ) { int iRow = MAX_NOTE_ROW; @@ -470,7 +470,7 @@ int NoteData::GetNumTapNotes( int iStartIndex, int iEndIndex ) const iNumNotes++; } } - + return iNumNotes; } @@ -486,7 +486,7 @@ int NoteData::GetNumRowsWithTap( int iStartIndex, int iEndIndex ) const FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, r, iStartIndex, iEndIndex ) if( IsThereATapAtRow(r) ) iNumNotes++; - + return iNumNotes; } @@ -500,7 +500,7 @@ int NoteData::GetNumMines( int iStartIndex, int iEndIndex ) const if( GetTapNote(t, r).type == TapNote::mine ) iNumMines++; } - + return iNumMines; } @@ -510,7 +510,7 @@ int NoteData::GetNumRowsWithTapOrHoldHead( int iStartIndex, int iEndIndex ) cons FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, r, iStartIndex, iEndIndex ) if( IsThereATapOrHoldHeadAtRow(r) ) iNumNotes++; - + return iNumNotes; } @@ -581,7 +581,7 @@ int NoteData::GetNumRowsWithSimultaneousTaps( int iMinTaps, int iStartIndex, int if( iNumNotesThisIndex >= iMinTaps ) iNum++; } - + return iNum; } @@ -621,6 +621,20 @@ int NoteData::GetNumRolls( int iStartIndex, int iEndIndex ) const return iNumRolls; } +int NoteData::GetNumLifts( int iStartIndex, int iEndIndex ) const +{ + int iNumLifts = 0; + + for( int t=0; ttype == TapNote::lift && iter->result.tns == tns ) + ++iNumSuccessfulLiftNotes; + } + return iNumSuccessfulLiftNotes; +} + /* Return the last tap score of a row: the grade of the tap that completed * the row. If the row has no tap notes, return -1. If any tap notes aren't * graded (any tap is TNS_None) or are missed (TNS_Miss), return it. */ @@ -336,6 +348,7 @@ void NoteDataWithScoring::GetActualRadarValues( const NoteData &in, const Player case RadarCategory_Mines: out[rc] = (float) GetSuccessfulMines( in ); break; case RadarCategory_Hands: out[rc] = (float) GetSuccessfulHands( in ); break; case RadarCategory_Rolls: out[rc] = (float) GetNumHoldNotesWithScore( in, TapNote::hold_head_roll, HNS_Held ); break; + case RadarCategory_Lifts: out[rc] = (float) GetSuccessfulLifts( in, TNS_W4 ); break; case RadarCategory_MinMidiNote: out[rc] = 0; break; // no meaning case RadarCategory_MaxMidiNote: out[rc] = 0; break; // no meaning //case RadarCategory_Minefields: out[rc] = (float) GetNumMinefieldsWithScore( in, TapNote::hold_head_mine, HNS_Held ); break; diff --git a/src/PaneDisplay.cpp b/src/PaneDisplay.cpp index 57a9addba8..b8f7ba1019 100644 --- a/src/PaneDisplay.cpp +++ b/src/PaneDisplay.cpp @@ -25,7 +25,7 @@ static const char *PaneCategoryNames[] = { "Rolls", "Mines", "Hands", - //"Lifts", + "Lifts", "MachineHighScore", "MachineHighName", "ProfileHighScore", @@ -43,16 +43,16 @@ struct Content_t static const Content_t g_Contents[NUM_PaneCategory] = { - { NEED_NOTES, "count" }, - { NEED_NOTES, "count" }, - { NEED_NOTES, "count" }, - { NEED_NOTES, "count" }, - { NEED_NOTES, "count" }, - { NEED_NOTES, "count" }, - //{ NEED_NOTES, "count" }, - { NEED_NOTES, "score" }, - { NEED_NOTES, "name" }, - { NEED_NOTES|NEED_PROFILE, "score" }, + { NEED_NOTES, "count" }, // NumSteps + { NEED_NOTES, "count" }, // Jumps + { NEED_NOTES, "count" }, // Holds + { NEED_NOTES, "count" }, // Rolls + { NEED_NOTES, "count" }, // Mines + { NEED_NOTES, "count" }, // Hands + { NEED_NOTES, "count" }, // Lifts + { NEED_NOTES, "score" }, // MachineHighScore + { NEED_NOTES, "name" }, // MachineHighName + { NEED_NOTES|NEED_PROFILE, "score" }, // ProfileHighScore }; REGISTER_ACTOR_CLASS( PaneDisplay ) @@ -65,7 +65,6 @@ void PaneDisplay::Load( const RString &sMetricsGroup, PlayerNumber pn ) NOT_AVAILABLE.Load( sMetricsGroup, "NotAvailable" ); COUNT_FORMAT.Load( sMetricsGroup, "CountFormat" ); - FOREACH_ENUM( PaneCategory, pc ) { LuaThreadVariable var( "PaneCategory", LuaReference::Create(pc) ); @@ -160,7 +159,7 @@ void PaneDisplay::SetContent( PaneCategory c ) case PaneCategory_Rolls: val = rv[RadarCategory_Rolls]; break; case PaneCategory_Mines: val = rv[RadarCategory_Mines]; break; case PaneCategory_Hands: val = rv[RadarCategory_Hands]; break; - //case PaneCategory_Lifts: val = rv[RadarCategory_Lifts]; break; + case PaneCategory_Lifts: val = rv[RadarCategory_Lifts]; break; case PaneCategory_ProfileHighScore: case PaneCategory_MachineHighName: /* set val for color */ case PaneCategory_MachineHighScore: @@ -199,7 +198,7 @@ void PaneDisplay::SetContent( PaneCategory c ) case PaneCategory_Rolls: case PaneCategory_Mines: case PaneCategory_Hands: - //case PaneCategory_Lifts: + case PaneCategory_Lifts: str = ssprintf( COUNT_FORMAT.GetValue(), val ); } } diff --git a/src/PaneDisplay.h b/src/PaneDisplay.h index e6be986e66..9d4c862b20 100644 --- a/src/PaneDisplay.h +++ b/src/PaneDisplay.h @@ -23,7 +23,7 @@ enum PaneCategory PaneCategory_Rolls, PaneCategory_Mines, PaneCategory_Hands, - //PaneCategory_Lifts, + PaneCategory_Lifts, PaneCategory_MachineHighScore, PaneCategory_MachineHighName, PaneCategory_ProfileHighScore, diff --git a/src/RadarValues.h b/src/RadarValues.h index e6eaf4013b..3ffa01035b 100644 --- a/src/RadarValues.h +++ b/src/RadarValues.h @@ -28,6 +28,7 @@ struct RadarValues float fNumMines; float fNumHands; float fNumRolls; + float fNumLifts; float fMinMidiNote; float fMaxMidiNote; } v; diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index 0db97a357d..72bd91d757 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -357,7 +357,6 @@ void ScreenSelectMusic::CheckBackgroundRequests( bool bForce ) FallbackMusic.fFadeInLengthSeconds = SAMPLE_MUSIC_FALLBACK_FADE_IN_SECONDS; FallbackMusic.bAlignBeat = ALIGN_MUSIC_BEATS; - //if( SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_StartToPreview ) SOUND->PlayMusic( PlayParams, FallbackMusic ); } } @@ -990,6 +989,15 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input ) // a song was selected if( m_MusicWheel.GetSelectedSong() != NULL ) { + /* + if(TWO_PART_CONFIRMS_ONLY && SAMPLE_MUSIC_PREVIEW_MODE == SampleMusicPreviewMode_StartToPreview) + { + // start playing the preview music. + g_bSampleMusicWaiting = true; + CheckBackgroundRequests( true ); + } + */ + const bool bIsNew = PROFILEMAN->IsSongNew( m_MusicWheel.GetSelectedSong() ); bool bIsHard = false; FOREACH_HumanPlayer( p ) @@ -1048,15 +1056,6 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input ) // We haven't made a selection yet. return; } - - /* - if(TWO_PART_CONFIRMS_ONLY && SAMPLE_MUSIC_PREVIEW_MODE == SampleMusicPreviewMode_StartToPreview) - { - // start playing the preview music. - g_bSampleMusicWaiting = true; - } - */ - // I believe this is for those who like pump pro. -aj MESSAGEMAN->Broadcast("SongChosen"); @@ -1484,7 +1483,7 @@ void ScreenSelectMusic::AfterMusicChange() m_iSelection[p] = -1; g_sCDTitlePath = ""; // none - + //if( SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_LastSong ) //{ m_fSampleStartSeconds = 0; @@ -1535,22 +1534,23 @@ void ScreenSelectMusic::AfterMusicChange() // check SampleMusicPreviewMode here. switch( SAMPLE_MUSIC_PREVIEW_MODE ) { + DEFAULT_FAIL(SAMPLE_MUSIC_PREVIEW_MODE); case SampleMusicPreviewMode_ScreenMusic: - // play the screen music, hopefully? + // play the screen music m_sSampleMusicToPlay = m_sLoopMusicPath; m_fSampleStartSeconds = 0; m_fSampleLengthSeconds = -1; break; - case SampleMusicPreviewMode_Normal: //case SampleMusicPreviewMode_StartToPreview: + // we want to load the sample music, but we don't want to + // actually play it; fall through for now. -aj + case SampleMusicPreviewMode_Normal: // play the sample music m_sSampleMusicToPlay = pSong->GetMusicPath(); m_pSampleMusicTimingData = &pSong->m_Timing; m_fSampleStartSeconds = pSong->m_fMusicSampleStartSeconds; m_fSampleLengthSeconds = pSong->m_fMusicSampleLengthSeconds; break; - default: - ASSERT(0); } SongUtil::GetPlayableSteps( pSong, m_vpSteps ); diff --git a/src/SongManager.cpp b/src/SongManager.cpp index 7b4ae8e441..d091e2aaa7 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -70,9 +70,9 @@ SongManager::SongManager() } NUM_SONG_GROUP_COLORS .Load( "SongManager", "NumSongGroupColors" ); - SONG_GROUP_COLOR .Load( "SongManager", SONG_GROUP_COLOR_NAME, NUM_SONG_GROUP_COLORS ); + SONG_GROUP_COLOR .Load( "SongManager", SONG_GROUP_COLOR_NAME, NUM_SONG_GROUP_COLORS ); NUM_COURSE_GROUP_COLORS .Load( "SongManager", "NumCourseGroupColors" ); - COURSE_GROUP_COLOR .Load( "SongManager", COURSE_GROUP_COLOR_NAME, NUM_COURSE_GROUP_COLORS ); + COURSE_GROUP_COLOR .Load( "SongManager", COURSE_GROUP_COLOR_NAME, NUM_COURSE_GROUP_COLORS ); } SongManager::~SongManager() @@ -128,7 +128,7 @@ void SongManager::Reload( bool bAllowFastLoad, LoadingWindow *ld ) UpdatePreferredSort(); // Reload song/course group colors to prevent a crash when switching - // themes in-game. -aj + // themes in-game. (apparently not, though.) -aj NUM_SONG_GROUP_COLORS .Load( "SongManager", "NumSongGroupColors" ); SONG_GROUP_COLOR .Load( "SongManager", SONG_GROUP_COLOR_NAME, NUM_SONG_GROUP_COLORS ); NUM_COURSE_GROUP_COLORS .Load( "SongManager", "NumCourseGroupColors" ); diff --git a/src/StatsManager.cpp b/src/StatsManager.cpp index ffb49137b6..0f372178aa 100644 --- a/src/StatsManager.cpp +++ b/src/StatsManager.cpp @@ -215,8 +215,9 @@ void StatsManager::CommitStatsToProfiles( const StageStats *pSS ) int iNumRolls = (int) pSS->m_player[pn].m_radarActual[RadarCategory_Rolls]; int iNumMines = (int) pSS->m_player[pn].m_radarActual[RadarCategory_Mines]; int iNumHands = (int) pSS->m_player[pn].m_radarActual[RadarCategory_Hands]; + int iNumLifts = (int) pSS->m_player[pn].m_radarActual[RadarCategory_Lifts]; float fCaloriesBurned = pSS->m_player[pn].m_fCaloriesBurned; - PROFILEMAN->AddStepTotals( pn, iNumTapsAndHolds, iNumJumps, iNumHolds, iNumRolls, iNumMines, iNumHands, fCaloriesBurned ); + PROFILEMAN->AddStepTotals( pn, iNumTapsAndHolds, iNumJumps, iNumHolds, iNumRolls, iNumMines, iNumHands, iNumLifts, fCaloriesBurned ); } // Update profile stats diff --git a/src/Steps.cpp b/src/Steps.cpp index 943b5ff479..517e20b840 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -142,7 +142,7 @@ float Steps::PredictMeter() const const float ChaosSquare = rv[RadarCategory_Chaos] * rv[RadarCategory_Chaos]; pMeter += -6.35f * SV; pMeter += -2.58f * ChaosSquare; - if (pMeter < 1) pMeter = 1; + if (pMeter < 1) pMeter = 1; return pMeter; }