From ee84f9263c654cab9448d3d3c9d830787da6dd32 Mon Sep 17 00:00:00 2001 From: "Ben \"root\" Anderson" Date: Thu, 19 Dec 2013 18:06:07 -0600 Subject: [PATCH] Make hold checkpoints a struct Game member, not a metric. It CANNOT be a metric because it affects max DP. --- Themes/_fallback/metrics.ini | 4 ---- src/Game.h | 1 + src/GameManager.cpp | 11 +++++++++ src/Player.cpp | 46 +++++++----------------------------- src/Player.h | 1 + 5 files changed, 22 insertions(+), 41 deletions(-) diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index a1cdd662d8..b23d6ef816 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -1149,10 +1149,6 @@ HoldJudgmentsUnderField=false ComboUnderField=false PenalizeTapScoreNone=false JudgeHoldNotesOnSameRowTogether=false -HoldCheckpoints=IsGame("pump") -CheckpointsUseTickcounts=IsGame("pump") -; deprecated? -CheckpointsUseTimeSignatures=false CheckpointsTapsSeparateJudgment=not IsGame("pump") ; someone misunderstood me :x -Daisu CheckpointsFlashOnHold=IsGame("pump") diff --git a/src/Game.h b/src/Game.h index 8f988e3b4a..04ea672384 100644 --- a/src/Game.h +++ b/src/Game.h @@ -34,6 +34,7 @@ public: /** @brief Do we count multiple notes in a row as separate notes, or as one note? */ bool m_bCountNotesSeparately; + bool m_bTickHolds; InputScheme m_InputScheme; diff --git a/src/GameManager.cpp b/src/GameManager.cpp index 68c40e5a76..9328a5b468 100644 --- a/src/GameManager.cpp +++ b/src/GameManager.cpp @@ -503,6 +503,7 @@ static const Game g_Game_Dance = "dance", // m_szName g_apGame_Dance_Styles, // m_apStyles false, // m_bCountNotesSeparately + false, // m_bTickHolds { // m_InputScheme "dance", // m_szName NUM_DANCE_BUTTONS, // m_iButtonsPerController @@ -873,6 +874,7 @@ static const Game g_Game_Pump = "pump", // m_szName g_apGame_Pump_Styles, // m_apStyles false, // m_bCountNotesSeparately + true, // m_bTickHolds { // m_InputScheme "pump", // m_szName NUM_PUMP_BUTTONS, // m_iButtonsPerController @@ -1055,6 +1057,7 @@ static const Game g_Game_KB7 = "kb7", // m_szName g_apGame_KB7_Styles, // m_apStyles true, // m_bCountNotesSeparately + false, // m_bTickHolds { // m_InputScheme "kb7", // m_szName NUM_KB7_BUTTONS, // m_iButtonsPerController @@ -1326,6 +1329,7 @@ static const Game g_Game_Ez2 = "ez2", // m_szName g_apGame_Ez2_Styles, // m_apStyles true, // m_bCountNotesSeparately + false, // m_bTickHolds { // m_InputScheme "ez2", // m_szName NUM_EZ2_BUTTONS, // m_iButtonsPerController @@ -1458,6 +1462,7 @@ static const Game g_Game_Para = "para", // m_szName g_apGame_Para_Styles, // m_apStyles false, // m_bCountNotesSeparately + false, // m_bTickHolds { // m_InputScheme "para", // m_szName NUM_PARA_BUTTONS, // m_iButtonsPerController @@ -1555,6 +1560,7 @@ static const Game g_Game_DS3DDX = "ds3ddx", // m_szName g_apGame_DS3DDX_Styles, // m_apStyles false, // m_bCountNotesSeparately + false, // m_bTickHolds { // m_InputScheme "ds3ddx", // m_szName NUM_DS3DDX_BUTTONS, // m_iButtonsPerController @@ -1900,6 +1906,7 @@ static const Game g_Game_Beat = "beat", // m_szName g_apGame_Beat_Styles, // m_apStyles true, // m_bCountNotesSeparately + false, // m_bTickHolds { // m_InputScheme "beat", // m_szName NUM_BEAT_BUTTONS, // m_iButtonsPerController @@ -2079,6 +2086,7 @@ static const Game g_Game_Maniax = "maniax", // m_szName g_apGame_Maniax_Styles, // m_apStyles false, // m_bCountNotesSeparately + false, // m_bTickHolds { // m_InputScheme "maniax", // m_szName NUM_MANIAX_BUTTONS, // m_iButtonsPerController @@ -2558,6 +2566,7 @@ static const Game g_Game_Techno = "techno", // m_szName g_apGame_Techno_Styles, // m_apStyles false, // m_bCountNotesSeparately + false, // m_bTickHolds { // m_InputScheme "techno", // m_szName NUM_TECHNO_BUTTONS, // m_iButtonsPerController @@ -2708,6 +2717,7 @@ static const Game g_Game_Popn = "popn", // m_szName g_apGame_Popn_Styles, // m_apStyles true, // m_bCountNotesSeparately + false, // m_bTickHolds { // m_InputScheme "popn", // m_szName NUM_POPN_BUTTONS, // m_iButtonsPerController @@ -2813,6 +2823,7 @@ static const Game g_Game_Lights = "lights", // m_szName g_apGame_Lights_Styles, // m_apStyles false, // m_bCountNotesSeparately + false, // m_bTickHolds { // m_InputScheme "lights", // m_szName NUM_LIGHTS_BUTTONS, // m_iButtonsPerController diff --git a/src/Player.cpp b/src/Player.cpp index bf6a551277..c32bfe0e35 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -140,26 +140,6 @@ ThemeMetric INITIAL_HOLD_LIFE ( "Player", "InitialHoldLife" ); ThemeMetric MAX_HOLD_LIFE ( "Player", "MaxHoldLife" ); ThemeMetric PENALIZE_TAP_SCORE_NONE ( "Player", "PenalizeTapScoreNone" ); ThemeMetric JUDGE_HOLD_NOTES_ON_SAME_ROW_TOGETHER ( "Player", "JudgeHoldNotesOnSameRowTogether" ); -/** - * @brief Does StepMania use checkpoint judgments when interacting with holds? - * - * If set to true, checkpoint judgments are in use, similar to the Pump It Up - * series. If set to false, no such judgments are used. */ -ThemeMetric HOLD_CHECKPOINTS ( "Player", "HoldCheckpoints" ); -/** - * @brief If using checkpoints, are the song's TickcountSegments used? - * - * If set to true, the checkpoints rely on the data found in the TickcountSegments. - * This is used via the #%TICKCOUNTS tag. */ -ThemeMetric CHECKPOINTS_USE_TICKCOUNTS ( "Player", "CheckpointsUseTickcounts" ); -/** - * @brief If using checkpoints, are the song's TimeSignatureSegments used? - * - * If set to true AND CheckpointsUseTickcounts is set to false, the TimeSignatureSegments - * are used to determine how often the checkpoints are found. - * - * It should be noted that this is a deprecated metric. */ -ThemeMetric CHECKPOINTS_USE_TIME_SIGNATURES ( "Player", "CheckpointsUseTimeSignatures" ); ThemeMetric CHECKPOINTS_FLASH_ON_HOLD ( "Player", "CheckpointsFlashOnHold" ); // sm-ssc addition ThemeMetric IMMEDIATE_HOLD_LET_GO ( "Player", "ImmediateHoldLetGo" ); /** @@ -636,6 +616,9 @@ void Player::Load() { m_bLoaded = true; + // Figured this is probably a little expensive so let's cache it + m_bTickHolds = GAMESTATE->GetCurrentGame()->m_bTickHolds; + m_LastTapNoteScore = TNS_None; // The editor can start playing in the middle of the song. const int iNoteRow = BeatToNoteRowNotRounded( m_pPlayerState->m_Position.m_fSongBeat ); @@ -1359,7 +1342,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vectorTrace("(hold checkpoints are allowed and enabled.)"); int iCheckpointsHit = 0; @@ -3024,22 +3007,11 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) /* Update hold checkpoints * * TODO: Move this to a separate function. */ - if( HOLD_CHECKPOINTS && m_pPlayerState->m_PlayerController != PC_AUTOPLAY ) + if( m_bTickHolds && m_pPlayerState->m_PlayerController != PC_AUTOPLAY ) { - int iCheckpointFrequencyRows = ROWS_PER_BEAT/2; - if( CHECKPOINTS_USE_TICKCOUNTS ) - { - int tickCurrent = m_Timing->GetTickcountAtRow( iLastRowCrossed ); - // There are some charts that don't want tickcounts involved at all. - iCheckpointFrequencyRows = (tickCurrent > 0 ? ROWS_PER_BEAT / tickCurrent : 0); - } - else if( CHECKPOINTS_USE_TIME_SIGNATURES ) - { - TimeSignatureSegment * tSignature = m_Timing->GetTimeSignatureSegmentAtRow( iLastRowCrossed ); - - // Most songs are in 4/4 time. The frequency for checking tick counts should reflect that. - iCheckpointFrequencyRows = ROWS_PER_BEAT * tSignature->GetDen() / (tSignature->GetNum() * 4); - } + // There are some charts that don't want tickcounts involved at all. + int tickCurrent = m_Timing->GetTickcountAtRow( iLastRowCrossed ); + int iCheckpointFrequencyRows = ( tickCurrent > 0 ? ROWS_PER_BEAT / tickCurrent : 0 ); if( iCheckpointFrequencyRows > 0 ) { diff --git a/src/Player.h b/src/Player.h index 9f75b1863f..3d271eda49 100644 --- a/src/Player.h +++ b/src/Player.h @@ -226,6 +226,7 @@ protected: TweenState m_tsCombo[NUM_REVERSE][NUM_CENTERED]; bool m_bSendJudgmentAndComboMessages; + bool m_bTickHolds; }; class PlayerPlus