diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index f7c61ddf24..d3561d3f52 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1246,6 +1246,8 @@ Hands=Hands Holds=Holds Mines=Mines Rolls=Rolls +Lifts=Lifts +Fakes=Fakes Beat 0 offset=Beat 0 offset Preview Start=Preview Start Preview Length=Preview Length diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 3bc0718e63..bbfe73a778 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -3631,6 +3631,8 @@ NumHoldsFormat="%s: %d\n" NumMinesFormat="%s: %d\n" NumHandsFormat="%s: %d\n" NumRollsFormat="%s: %d\n" +NumLiftsFormat="%s: %d\n" +NumFakesFormat="%s: %d\n" Beat0OffsetFormat="%s:\n %.5f secs\n" PreviewStartFormat="%s:\n %.5f secs\n" PreviewLengthFormat="%s:\n %.5f secs\n" diff --git a/Themes/default/Graphics/PaneDisplay text.lua b/Themes/default/Graphics/PaneDisplay text.lua index e0277a18df..3738f5bdb1 100644 --- a/Themes/default/Graphics/PaneDisplay text.lua +++ b/Themes/default/Graphics/PaneDisplay text.lua @@ -120,16 +120,16 @@ t[#t+1] = Def.ActorFrame { InitCommand=cmd(x,-128+16+8;y,-14+16*3); }; -- Center - CreatePaneDisplayItem( iPN, "MINES", 'RadarCategory_Mines' ) .. { + CreatePaneDisplayItem( iPN, "HANDS", 'RadarCategory_Hands' ) .. { InitCommand=cmd(x,-128+16+8+74;y,-14); }; - CreatePaneDisplayItem( iPN, "HANDS", 'RadarCategory_Hands' ) .. { + CreatePaneDisplayItem( iPN, "ROLLS", 'RadarCategory_Rolls' ) .. { InitCommand=cmd(x,-128+16+8+74;y,-14+16); }; - CreatePaneDisplayItem( iPN, "ROLLS", 'RadarCategory_Rolls' ) .. { + CreatePaneDisplayItem( iPN, "LIFTS", 'RadarCategory_Lifts' ) .. { InitCommand=cmd(x,-128+16+8+74;y,-14+16*2); }; - CreatePaneDisplayItem( iPN, "LIFTS", 'RadarCategory_Lifts' ) .. { + CreatePaneDisplayItem( iPN, "FAKES", 'RadarCategory_Fakes' ) .. { InitCommand=cmd(x,-128+16+8+74;y,-14+16*3); }; -- Right diff --git a/src/GameConstantsAndTypes.cpp b/src/GameConstantsAndTypes.cpp index bfc8dc2194..a5bcb68002 100644 --- a/src/GameConstantsAndTypes.cpp +++ b/src/GameConstantsAndTypes.cpp @@ -36,6 +36,7 @@ static const char *RadarCategoryNames[] = { "Hands", "Rolls", "Lifts", + "Fakes", }; XToString( RadarCategory ); XToLocalizedString( RadarCategory ); diff --git a/src/GameConstantsAndTypes.h b/src/GameConstantsAndTypes.h index ddd6bd2e91..b3696328a5 100644 --- a/src/GameConstantsAndTypes.h +++ b/src/GameConstantsAndTypes.h @@ -39,6 +39,7 @@ enum RadarCategory RadarCategory_Hands, /**< How many hands are in the song? */ RadarCategory_Rolls, /**< How many rolls are in the song? */ RadarCategory_Lifts, /**< How many lifts are in the song? */ + RadarCategory_Fakes, /**< How many fakes are in the song? */ NUM_RadarCategory, /**< The number of radar categories. */ RadarCategory_Invalid }; diff --git a/src/NoteData.cpp b/src/NoteData.cpp index 49449cc833..3c993235e6 100644 --- a/src/NoteData.cpp +++ b/src/NoteData.cpp @@ -635,6 +635,20 @@ int NoteData::GetNumLifts( int iStartIndex, int iEndIndex ) const return iNumLifts; } +int NoteData::GetNumFakes( int iStartIndex, int iEndIndex ) const +{ + int iNumFakes = 0; + + for( int t=0; t saValues; split( sRadarValues, ",", saValues, true ); - if( saValues.size() == NUM_RadarCategory * NUM_PLAYERS ) + int categories = NUM_RadarCategory - 1; // Fakes aren't counted in the radar values. + if( saValues.size() == (unsigned)categories * NUM_PLAYERS ) { RadarValues v[NUM_PLAYERS]; FOREACH_PlayerNumber( pn ) - FOREACH_ENUM( RadarCategory, rc ) - v[pn][rc] = StringToFloat( saValues[pn*NUM_RadarCategory + rc] ); + { + // Can't use the foreach anymore due to flexible radar lines. + for( RadarCategory rc = (RadarCategory)0; rc < categories; + enum_add( rc, 1 ) ) + { + v[pn][rc] = StringToFloat( saValues[pn*categories + rc] ); + } + } out.SetCachedRadarValues( v ); } diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index de6b5dffb9..1721e01dfa 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -658,12 +658,23 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach { vector saValues; split( sParams[1], ",", saValues, true ); - if( saValues.size() == NUM_RadarCategory * NUM_PLAYERS ) + + int categories = NUM_RadarCategory; + if( out.m_fVersion < VERSION_RADAR_FAKE ) + categories -= 1; + + if( saValues.size() == (unsigned)categories * NUM_PLAYERS ) { RadarValues v[NUM_PLAYERS]; FOREACH_PlayerNumber( pn ) - FOREACH_ENUM( RadarCategory, rc ) - v[pn][rc] = StringToFloat( saValues[pn*NUM_RadarCategory + rc] ); + { + // Can't use the foreach anymore due to flexible radar lines. + for( RadarCategory rc = (RadarCategory)0; rc < categories; + enum_add( rc, +1 ) ) + { + v[pn][rc] = StringToFloat( saValues[pn*categories + rc] ); + } + } pNewNotes->SetCachedRadarValues( v ); } } @@ -917,6 +928,7 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach } } } + out.m_fVersion = STEPFILE_VERSION_NUMBER; return true; } diff --git a/src/NotesLoaderSSC.h b/src/NotesLoaderSSC.h index 675a91a2e8..ae8f00bc9c 100644 --- a/src/NotesLoaderSSC.h +++ b/src/NotesLoaderSSC.h @@ -21,6 +21,8 @@ enum SSCLoadingStates NUM_SSCLoadingStates /**< The number of states used. */ }; +const float VERSION_RADAR_FAKE = 0.53f; + /** * @brief The SSCLoader handles all of the parsing needed for .ssc files. */ diff --git a/src/NotesWriterSM.cpp b/src/NotesWriterSM.cpp index f43643b343..df1ac5e87d 100644 --- a/src/NotesWriterSM.cpp +++ b/src/NotesWriterSM.cpp @@ -273,11 +273,17 @@ static RString GetSMNotesTag( const Song &song, const Steps &in ) lines.push_back( ssprintf( " %d:", in.GetMeter() ) ); vector asRadarValues; + // SM files don't use fakes for radar data. Keep it that way. + int categories = NUM_RadarCategory - 1; FOREACH_PlayerNumber( pn ) { const RadarValues &rv = in.GetRadarValues( pn ); - FOREACH_ENUM( RadarCategory, rc ) + // Can't use the foreach anymore due to flexible radar lines. + for( RadarCategory rc = (RadarCategory)0; rc < categories; + enum_add( rc, 1 ) ) + { asRadarValues.push_back( ssprintf("%.3f", rv[rc]) ); + } } lines.push_back( ssprintf( " %s:", join(",",asRadarValues).c_str() ) ); diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index 0a77bae975..e26d3d6c69 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -47,7 +47,7 @@ static RString BackgroundChangeToString( const BackgroundChange &bgc ) * @param out the Song in question. */ static void WriteGlobalTags( RageFile &f, const Song &out ) { - f.PutLine( ssprintf( "#VERSION:%.2f;", out.m_fVersion ) ); + f.PutLine( ssprintf( "#VERSION:%.2f;", STEPFILE_VERSION_NUMBER ) ); f.PutLine( ssprintf( "#TITLE:%s;", SmEscape(out.m_sMainTitle).c_str() ) ); f.PutLine( ssprintf( "#SUBTITLE:%s;", SmEscape(out.m_sSubTitle).c_str() ) ); f.PutLine( ssprintf( "#ARTIST:%s;", SmEscape(out.m_sArtist).c_str() ) ); diff --git a/src/PaneDisplay.cpp b/src/PaneDisplay.cpp index cdd89c681f..5e5aa7ae5f 100644 --- a/src/PaneDisplay.cpp +++ b/src/PaneDisplay.cpp @@ -26,6 +26,7 @@ static const char *PaneCategoryNames[] = { "Mines", "Hands", "Lifts", + "Fakes", "MachineHighScore", "MachineHighName", "ProfileHighScore", @@ -206,6 +207,7 @@ void PaneDisplay::SetContent( PaneCategory c ) 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_Fakes: val = rv[RadarCategory_Fakes]; break; case PaneCategory_ProfileHighScore: case PaneCategory_MachineHighName: // set val for color case PaneCategory_MachineHighScore: diff --git a/src/PaneDisplay.h b/src/PaneDisplay.h index aa5fa102d3..59765a582f 100644 --- a/src/PaneDisplay.h +++ b/src/PaneDisplay.h @@ -22,6 +22,7 @@ enum PaneCategory PaneCategory_Mines, PaneCategory_Hands, PaneCategory_Lifts, + PaneCategory_Fakes, PaneCategory_MachineHighScore, PaneCategory_MachineHighName, PaneCategory_ProfileHighScore, diff --git a/src/RadarValues.h b/src/RadarValues.h index 3305293674..560739c079 100644 --- a/src/RadarValues.h +++ b/src/RadarValues.h @@ -28,6 +28,7 @@ struct RadarValues float fNumHands; float fNumRolls; float fNumLifts; + float fNumFakes; } v; float f[NUM_RadarCategory]; } m_Values; diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 2ca5d26235..4f515bcea9 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -1027,6 +1027,8 @@ static LocalizedString HANDS("ScreenEdit", "Hands"); static LocalizedString HOLDS("ScreenEdit", "Holds"); static LocalizedString MINES("ScreenEdit", "Mines"); static LocalizedString ROLLS("ScreenEdit", "Rolls"); +static LocalizedString LIFTS("ScreenEdit", "Lifts"); +static LocalizedString FAKES("ScreenEdit", "Fakes"); static LocalizedString BEAT_0_OFFSET("ScreenEdit", "Beat 0 offset"); static LocalizedString PREVIEW_START("ScreenEdit", "Preview Start"); static LocalizedString PREVIEW_LENGTH("ScreenEdit", "Preview Length"); @@ -1049,6 +1051,8 @@ static ThemeMetric NUM_HOLDS_FORMAT("ScreenEdit", "NumHoldsFormat"); static ThemeMetric NUM_MINES_FORMAT("ScreenEdit", "NumMinesFormat"); static ThemeMetric NUM_HANDS_FORMAT("ScreenEdit", "NumHandsFormat"); static ThemeMetric NUM_ROLLS_FORMAT("ScreenEdit", "NumRollsFormat"); +static ThemeMetric NUM_LIFTS_FORMAT("ScreenEdit", "NumLiftsFormat"); +static ThemeMetric NUM_FAKES_FORMAT("ScreenEdit", "NumFakesFormat"); static ThemeMetric BEAT_0_OFFSET_FORMAT("ScreenEdit", "Beat0OffsetFormat"); static ThemeMetric PREVIEW_START_FORMAT("ScreenEdit", "PreviewStartFormat"); static ThemeMetric PREVIEW_LENGTH_FORMAT("ScreenEdit", "PreviewLengthFormat"); @@ -1117,6 +1121,8 @@ void ScreenEdit::UpdateTextInfo() sText += ssprintf( NUM_HOLDS_FORMAT.GetValue(), HOLDS.GetValue().c_str(), m_NoteDataEdit.GetNumHoldNotes() ); sText += ssprintf( NUM_MINES_FORMAT.GetValue(), MINES.GetValue().c_str(), m_NoteDataEdit.GetNumMines() ); sText += ssprintf( NUM_ROLLS_FORMAT.GetValue(), ROLLS.GetValue().c_str(), m_NoteDataEdit.GetNumRolls() ); + sText += ssprintf( NUM_LIFTS_FORMAT.GetValue(), LIFTS.GetValue().c_str(), m_NoteDataEdit.GetNumLifts() ); + sText += ssprintf( NUM_FAKES_FORMAT.GetValue(), FAKES.GetValue().c_str(), m_NoteDataEdit.GetNumFakes() ); switch( EDIT_MODE.GetValue() ) { DEFAULT_FAIL( EDIT_MODE.GetValue() ); diff --git a/src/ScreenEvaluation.cpp b/src/ScreenEvaluation.cpp index 55333bf14a..3a9da8b1d1 100644 --- a/src/ScreenEvaluation.cpp +++ b/src/ScreenEvaluation.cpp @@ -198,6 +198,7 @@ void ScreenEvaluation::Init() case RadarCategory_Hands: case RadarCategory_Rolls: case RadarCategory_Lifts: + case RadarCategory_Fakes: ss.m_player[p].m_radarPossible[rc] = 1 + (rand() % 200); ss.m_player[p].m_radarActual[rc] = rand() % (int)(ss.m_player[p].m_radarPossible[rc]); break; @@ -541,8 +542,8 @@ void ScreenEvaluation::Init() static const int indeces[NUM_DetailLine] = { - RadarCategory_TapsAndHolds, RadarCategory_Jumps, RadarCategory_Holds, RadarCategory_Mines, RadarCategory_Hands, RadarCategory_Rolls - //, RadarCategory_Lifts + RadarCategory_TapsAndHolds, RadarCategory_Jumps, RadarCategory_Holds, RadarCategory_Mines, + RadarCategory_Hands, RadarCategory_Rolls, RadarCategory_Lifts, RadarCategory_Fakes }; const int ind = indeces[l]; const int iActual = lrintf(m_pStageStats->m_player[p].m_radarActual[ind]); diff --git a/src/ScreenEvaluation.h b/src/ScreenEvaluation.h index 3e6c3f1280..d302e5b1bf 100644 --- a/src/ScreenEvaluation.h +++ b/src/ScreenEvaluation.h @@ -41,6 +41,8 @@ enum DetailLine DetailLine_Mines, /**< The number of mines avoided. */ DetailLine_Hands, /**< The number of hands hit (somehow) */ DetailLine_Rolls, /**< The number of rolls hit repeatedly. */ + DetailLine_Lifts, /**< The number of lifts lifted up. */ + DetailLine_Fakes, /**< The number of fakes to be ignored. */ NUM_DetailLine /**< The nuber of detailed lines. */ }; /** @brief Shows the player their score after gameplay has ended. */ diff --git a/src/Song.cpp b/src/Song.cpp index 7c648aaf8c..67b730ee61 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -36,13 +36,12 @@ #include #include -/** @brief The version of the .ssc file format. */ -const static float VERSION_NUMBER = 0.52f; + /** * @brief The internal version of the cache for StepMania. * * Increment this value to invalidate the current cache. */ -const int FILE_CACHE_VERSION = 164; +const int FILE_CACHE_VERSION = 165; /** @brief How long does a song sample last by default? */ const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f; @@ -66,7 +65,7 @@ Song::Song() m_ForegroundChanges = AutoPtrCopyOnWrite(new VBackgroundChange); m_LoadedFromProfile = ProfileSlot_Invalid; - m_fVersion = VERSION_NUMBER; + m_fVersion = STEPFILE_VERSION_NUMBER; m_fMusicSampleStartSeconds = -1; m_fMusicSampleLengthSeconds = DEFAULT_MUSIC_SAMPLE_LENGTH; m_fMusicLengthSeconds = 0; diff --git a/src/Song.h b/src/Song.h index aefc16f763..07d05a7742 100644 --- a/src/Song.h +++ b/src/Song.h @@ -16,6 +16,9 @@ class StepsID; struct lua_State; struct BackgroundChange; +/** @brief The version of the .ssc file format. */ +const static float STEPFILE_VERSION_NUMBER = 0.53f; + /** @brief How many edits for this song can each profile have? */ const int MAX_EDITS_PER_SONG_PER_PROFILE = 5; /** @brief How many edits for this song can be available? */ @@ -73,7 +76,7 @@ public: ~Song(); void Reset(); void DetachSteps(); - + /** * @brief Load a song from the chosen directory. * diff --git a/src/Steps.cpp b/src/Steps.cpp index 838d55704f..fb17405c61 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -123,7 +123,7 @@ float Steps::PredictMeter() const const float RadarCoeffs[NUM_RadarCategory] = { 10.1f, 5.27f,-0.905f, -1.10f, 2.86f, - 0,0,0,0,0,0 + 0,0,0,0,0,0,0,0 }; const RadarValues &rv = GetRadarValues( PLAYER_1 ); for( int r = 0; r < NUM_RadarCategory; ++r )