From 2fa39fed8a7f3fb4c82a62086b6d6cf83ee5245e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 28 Feb 2003 08:12:47 +0000 Subject: [PATCH] Deal with determining whether to use Marv. timing within TNStoDP. Use IsCourseMode. Remove old comment. --- stepmania/src/GameConstantsAndTypes.cpp | 11 +++++++++-- stepmania/src/GameConstantsAndTypes.h | 2 +- stepmania/src/NoteData.cpp | 22 +++------------------- stepmania/src/ScoreKeeperMAX2.cpp | 2 +- 4 files changed, 14 insertions(+), 23 deletions(-) diff --git a/stepmania/src/GameConstantsAndTypes.cpp b/stepmania/src/GameConstantsAndTypes.cpp index 5148b3a526..d47c86f3bc 100644 --- a/stepmania/src/GameConstantsAndTypes.cpp +++ b/stepmania/src/GameConstantsAndTypes.cpp @@ -11,10 +11,17 @@ */ #include "GameConstantsAndTypes.h" +#include "PrefsManager.h" +#include "GameState.h" - -int TapNoteScoreToDancePoints( TapNoteScore tns, bool bOni ) +/* XXX: Should this be in GAMESTATE? It's not really a constant anymore. */ +int TapNoteScoreToDancePoints( TapNoteScore tns ) { + const bool bOni = GAMESTATE->IsCourseMode(); + + if(!PREFSMAN->m_bMarvelousTiming && tns == TNS_MARVELOUS) + tns = TNS_PERFECT; + switch( tns ) { case TNS_MARVELOUS: return bOni ? +3 : +2; diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index b0317fa55d..b793905fe9 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -124,7 +124,7 @@ enum TapNoteScore { NUM_TAP_NOTE_SCORES }; -int TapNoteScoreToDancePoints( TapNoteScore tns, bool bOni = false ); +int TapNoteScoreToDancePoints( TapNoteScore tns ); //enum TapNoteTiming { // TNT_NONE, diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index 5d0c72c0c6..d88067db73 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -327,28 +327,12 @@ int NoteData::GetPossibleDancePoints() //An "OK" (Successful Freeze step) will add 6 points //A "NG" (Unsuccessful Freeze step) is worth 0 points - if(PREFSMAN->m_bMarvelousTiming && ( GAMESTATE->m_PlayMode == PLAY_MODE_ONI || GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP || GAMESTATE->m_PlayMode == PLAY_MODE_ENDLESS ) ) // score out of marvelous for course modes, unless marvelous timing is off - { - return GetNumTapNotes()*TapNoteScoreToDancePoints(TNS_MARVELOUS) + // Marvelous for oni - GetNumHoldNotes()*HoldNoteScoreToDancePoints(HNS_OK); - } - - return GetNumTapNotes()*TapNoteScoreToDancePoints(TNS_PERFECT) + // not Marvelous + /* Note that, if Marvelous timing is disabled or not active (not course mode), + * PERFECT will be used instead. */ + return GetNumTapNotes()*TapNoteScoreToDancePoints(TNS_MARVELOUS)+ GetNumHoldNotes()*HoldNoteScoreToDancePoints(HNS_OK); } -/* ConvertHoldNotesTo2sAnd3s also clears m_iHoldNotes; - * shouldn't this do likewise and set all 2/3's to 0? - * -glenn - * - * Other code assumes != TAP_EMPTY means there's a tap note, so I changed - * this to do this. -glenn - * - - * This code intentially leaves the TAP_HOLD_HEAD behind because a hold head is - * treated exactly like a tap note for scoring purposes. - - */ void NoteData::Convert2sAnd3sToHoldNotes() { // Any note will end a hold (not just a TAP_HOLD_TAIL). This makes parsing DWIs much easier. diff --git a/stepmania/src/ScoreKeeperMAX2.cpp b/stepmania/src/ScoreKeeperMAX2.cpp index 97bbc8fbd4..6e5dad3877 100644 --- a/stepmania/src/ScoreKeeperMAX2.cpp +++ b/stepmania/src/ScoreKeeperMAX2.cpp @@ -51,7 +51,7 @@ void ScoreKeeperMAX2::HandleTapScore( TapNoteScore score, int iNumTapsInRow ) ASSERT( iNumTapsInRow >= 1 ); // update dance points for Oni lifemeter - GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += iNumTapsInRow * TapNoteScoreToDancePoints( score, GAMESTATE->m_PlayMode == PLAY_MODE_ONI || GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP || GAMESTATE->m_PlayMode == PLAY_MODE_ENDLESS ); + GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += iNumTapsInRow * TapNoteScoreToDancePoints( score ); GAMESTATE->m_CurStageStats.iTapNoteScores[m_PlayerNumber][score] += iNumTapsInRow; /*