From a7b52df0fa8e246971aa435119cc17aea1004edb Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Tue, 9 Mar 2010 12:21:56 -0600 Subject: [PATCH] cleanup and comment part unknown of a trillion --- src/Bookkeeper.cpp | 8 ++-- src/ComboGraph.cpp | 10 ++-- src/ComboGraph.h | 2 - src/GameCommand.h | 12 ++--- src/NoteDataWithScoring.cpp | 28 +++++------ src/PlayerStageStats.cpp | 52 ++++++++++---------- src/PlayerStageStats.h | 22 ++++----- src/PlayerState.cpp | 18 +++---- src/PlayerState.h | 32 ++++++------- src/PrefsManager.h | 94 ++++++++++++++++++------------------- src/ScreenDebugOverlay.cpp | 49 +++++++++---------- src/StepsDisplay.cpp | 2 +- 12 files changed, 160 insertions(+), 169 deletions(-) diff --git a/src/Bookkeeper.cpp b/src/Bookkeeper.cpp index 938b6f0b43..89b6dc18b6 100644 --- a/src/Bookkeeper.cpp +++ b/src/Bookkeeper.cpp @@ -127,7 +127,7 @@ void Bookkeeper::ReadFromDisk() void Bookkeeper::WriteToDisk() { - // Write data. Use SLOW_FLUSH, to help ensure that we don't lose coin data. + // Write data. Use SLOW_FLUSH, to help ensure that we don't lose coin data. RageFile f; if( !f.Open(COINS_DAT, RageFile::WRITE|RageFile::SLOW_FLUSH) ) { @@ -147,7 +147,7 @@ void Bookkeeper::CoinInserted() ++m_mapCoinsForHour[d]; } -/* Return the number of coins between [beginning,ending). */ +// Return the number of coins between [beginning,ending). int Bookkeeper::GetNumCoinsInRange( map::const_iterator begin, map::const_iterator end ) const { int iCoins = 0; @@ -206,8 +206,8 @@ void Bookkeeper::GetCoinsLastWeeks( int coins[NUM_LAST_WEEKS] ) const } } -/* iDay is days since Jan 1. iYear is eg. 2005. Return the day of the week, where - * 0 is Sunday. */ +/* iDay is days since Jan 1. iYear is eg. 2005. Return the day of the week, + * where 0 is Sunday. */ void Bookkeeper::GetCoinsByDayOfWeek( int coins[DAYS_IN_WEEK] ) const { for( int i=0; iGetPathG(sMetricsGroup,"Backing") ); m_pBacking->ZoomToWidth( BODY_WIDTH ); this->AddChild( m_pBacking ); @@ -49,7 +49,7 @@ void ComboGraph::Set( const StageStats &s, const PlayerStageStats &pss ) const float fFirstSecond = 0; const float fLastSecond = s.GetTotalPossibleStepsSeconds(); - /* Find the largest combo. */ + // Find the largest combo. int iMaxComboSize = 0; for( unsigned i = 0; i < pss.m_ComboList.size(); ++i ) iMaxComboSize = max( iMaxComboSize, pss.m_ComboList[i].GetStageCnt() ); @@ -58,7 +58,7 @@ void ComboGraph::Set( const StageStats &s, const PlayerStageStats &pss ) { const PlayerStageStats::Combo_t &combo = pss.m_ComboList[i]; if( combo.GetStageCnt() < MinComboSizeToShow ) - continue; /* too small */ + continue; // too small const bool bIsMax = (combo.GetStageCnt() == iMaxComboSize); @@ -80,7 +80,7 @@ void ComboGraph::Set( const StageStats &s, const PlayerStageStats &pss ) { const PlayerStageStats::Combo_t &combo = pss.m_ComboList[i]; if( combo.GetStageCnt() < MinComboSizeToShow ) - continue; /* too small */ + continue; // too small if( !iMaxComboSize ) continue; @@ -103,7 +103,7 @@ void ComboGraph::Set( const StageStats &s, const PlayerStageStats &pss ) this->AddChild( pText ); } - /* Hide the templates. */ + // Hide the templates. m_pNormalCombo->SetVisible( false ); m_pMaxCombo->SetVisible( false ); m_pComboNumber->SetVisible( false ); diff --git a/src/ComboGraph.h b/src/ComboGraph.h index 08bf5d06c4..fe480a9bcf 100644 --- a/src/ComboGraph.h +++ b/src/ComboGraph.h @@ -18,9 +18,7 @@ public: virtual ComboGraph *Copy() const; virtual bool AutoLoadChildren() const { return true; } - // // Commands - // virtual void PushSelf( lua_State *L ); private: diff --git a/src/GameCommand.h b/src/GameCommand.h index 8d02e50f08..a658eb904a 100644 --- a/src/GameCommand.h +++ b/src/GameCommand.h @@ -27,7 +27,7 @@ public: void Load( int iIndex, const Commands& cmds ); void LoadOne( const Command& cmd ); - + void ApplyToAllPlayers() const; void Apply( PlayerNumber pn ) const; private: @@ -39,12 +39,12 @@ public: bool DescribesCurrentModeForAllPlayers() const; bool IsPlayable( RString *why = NULL ) const; bool IsZero() const; - - /* If true, Apply() will apply m_sScreen. If false, it won't, and you need + + /* If true, Apply() will apply m_sScreen. If false, it won't, and you need * to do it yourself. */ void ApplyCommitsScreens( bool bOn ) { m_bApplyCommitsScreens = bOn; } - // Same as what was passed to Load. We need to keep the original commands + // Same as what was passed to Load. We need to keep the original commands // so that we know the order of commands when it comes time to Apply. Commands m_Commands; @@ -78,7 +78,7 @@ public: GoalType m_GoalType; RString m_sProfileID; RString m_sUrl; - /* sm-ssc adds: */ + // sm-ssc adds: bool m_bUrlExits; // for making stepmania not exit on url bool m_bPushScreen; // for pushing a screen on top instead of as next @@ -86,7 +86,7 @@ public: bool m_bClearCredits; bool m_bStopMusic; bool m_bApplyDefaultOptions; - /* sm-ssc also adds: */ + // sm-ssc also adds: bool m_bFadeMusic; float m_fMusicFadeOutVolume; // currently, GameSoundManager uses consts for fade out/in times, so this diff --git a/src/NoteDataWithScoring.cpp b/src/NoteDataWithScoring.cpp index de30070c59..0cce913171 100644 --- a/src/NoteDataWithScoring.cpp +++ b/src/NoteDataWithScoring.cpp @@ -23,7 +23,7 @@ int GetNumTapNotesWithScore( const NoteData &in, TapNoteScore tns, int iStartInd iNumSuccessfulTapNotes++; } } - + return iNumSuccessfulTapNotes; } @@ -38,7 +38,7 @@ int GetNumNWithScore( const NoteData &in, TapNoteScore tns, int MinTaps, int iSt if( iNumNotesInRow >= MinTaps && tnsRow >= tns ) iNumSuccessfulDoubles++; } - + return iNumSuccessfulDoubles; } @@ -79,7 +79,7 @@ int GetSuccessfulMines( const NoteData &in, int iStartIndex = 0, int iEndIndex = return iNumSuccessfulMinesNotes; } -/* See NoteData::GetNumHands(). */ +// See NoteData::GetNumHands(). int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) { int iNum = 0; @@ -105,7 +105,7 @@ int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex = if( Missed ) continue; - /* Check hold scores. */ + // Check hold scores. for( int t=0; tm_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. */ + /* STATSMAN->m_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. */ const PlayerStageStats::Combo_t MaxCombo = pss.GetMaxCombo(); float fComboPercent = SCALE( MaxCombo.m_fSizeSeconds, 0, pss.m_fLastSecond-pss.m_fFirstSecond, 0.0f, 1.0f ); return clamp( fComboPercent, 0.0f, 1.0f ); diff --git a/src/PlayerStageStats.cpp b/src/PlayerStageStats.cpp index 98b33ff525..91c88f08ef 100644 --- a/src/PlayerStageStats.cpp +++ b/src/PlayerStageStats.cpp @@ -428,14 +428,14 @@ float PlayerStageStats::GetCurrentLife() const return iter->second; } -/* If bRollover is true, we're being called before gameplay begins, so we can record - * the amount of the first combo that comes from the previous song. */ +/* If bRollover is true, we're being called before gameplay begins, so we can + * record the amount of the first combo that comes from the previous song. */ void PlayerStageStats::UpdateComboList( float fSecond, bool bRollover ) { // Don't save combo stats in endless courses, or could run OOM in a few hours. if( GAMESTATE->m_pCurCourse && GAMESTATE->m_pCurCourse->IsEndless() ) return; - + if( fSecond < 0 ) return; @@ -448,21 +448,21 @@ void PlayerStageStats::UpdateComboList( float fSecond, bool bRollover ) int cnt = m_iCurCombo; if( !cnt ) - return; /* no combo */ + return; // no combo if( m_ComboList.size() == 0 || m_ComboList.back().m_cnt >= cnt ) { - /* If the previous combo (if any) starts on -9999, then we rolled over some - * combo, but missed the first step. Remove it. */ + /* If the previous combo (if any) starts on -9999, then we rolled over + * some combo, but missed the first step. Remove it. */ if( m_ComboList.size() && m_ComboList.back().m_fStartSecond == -9999 ) m_ComboList.erase( m_ComboList.begin()+m_ComboList.size()-1, m_ComboList.end() ); - /* This is a new combo. */ + // This is a new combo. Combo_t NewCombo; - /* "start" is the position that the combo started within this song. If we're - * recording rollover, the combo hasn't started yet (within this song), so put - * a placeholder in and set it on the next call. (Otherwise, start will be less - * than fFirstPos.) */ + /* "start" is the position that the combo started within this song. + * If we're recording rollover, the combo hasn't started yet (within + * this song), so put a placeholder in and set it on the next call. + * (Otherwise, start will be less than fFirstPos.) */ if( bRollover ) NewCombo.m_fStartSecond = -9999; else @@ -656,20 +656,20 @@ LuaFunction( FormatPercentScore, PlayerStageStats::FormatPercentScore( FArg(1) ) class LunaPlayerStageStats: public Luna { public: - DEFINE_METHOD( GetCaloriesBurned, m_fCaloriesBurned ) + DEFINE_METHOD( GetCaloriesBurned, m_fCaloriesBurned ) DEFINE_METHOD( GetLifeRemainingSeconds, m_fLifeRemainingSeconds ) - DEFINE_METHOD( GetSurvivalSeconds, GetSurvivalSeconds() ) - DEFINE_METHOD( GetCurrentCombo, m_iCurCombo ) + DEFINE_METHOD( GetSurvivalSeconds, GetSurvivalSeconds() ) + DEFINE_METHOD( GetCurrentCombo, m_iCurCombo ) DEFINE_METHOD( GetCurrentMissCombo, m_iCurMissCombo ) DEFINE_METHOD( GetCurrentScoreMultiplier, m_iCurScoreMultiplier ) - DEFINE_METHOD( GetScore, m_iScore ) - DEFINE_METHOD( GetTapNoteScores, m_iTapNoteScores[Enum::Check(L, 1)] ) - DEFINE_METHOD( GetHoldNoteScores, m_iHoldNoteScores[Enum::Check(L, 1)] ) - DEFINE_METHOD( FullCombo, FullCombo() ) + DEFINE_METHOD( GetScore, m_iScore ) + DEFINE_METHOD( GetTapNoteScores, m_iTapNoteScores[Enum::Check(L, 1)] ) + DEFINE_METHOD( GetHoldNoteScores, m_iHoldNoteScores[Enum::Check(L, 1)] ) + DEFINE_METHOD( FullCombo, FullCombo() ) DEFINE_METHOD( FullComboOfScore, FullComboOfScore( Enum::Check(L, 1) ) ) - DEFINE_METHOD( MaxCombo, GetMaxCombo().m_cnt ) - DEFINE_METHOD( GetCurrentLife, GetCurrentLife() ) - DEFINE_METHOD( GetGrade, GetGrade() ) + DEFINE_METHOD( MaxCombo, GetMaxCombo().m_cnt ) + DEFINE_METHOD( GetCurrentLife, GetCurrentLife() ) + DEFINE_METHOD( GetGrade, GetGrade() ) DEFINE_METHOD( GetActualDancePoints, m_iActualDancePoints ) DEFINE_METHOD( GetPossibleDancePoints, m_iPossibleDancePoints ) DEFINE_METHOD( GetCurrentPossibleDancePoints, m_iCurPossibleDancePoints ) @@ -678,10 +678,11 @@ public: DEFINE_METHOD( GetLessonScoreNeeded, GetLessonScoreNeeded() ) DEFINE_METHOD( GetPersonalHighScoreIndex, m_iPersonalHighScoreIndex ) DEFINE_METHOD( GetMachineHighScoreIndex, m_iMachineHighScoreIndex ) - DEFINE_METHOD( GetStageAward, m_StageAward ) - DEFINE_METHOD( GetPeakComboAward, m_PeakComboAward ) - DEFINE_METHOD( IsDisqualified, IsDisqualified() ) - DEFINE_METHOD( GetAliveSeconds, m_fAliveSeconds ) + DEFINE_METHOD( GetStageAward, m_StageAward ) + DEFINE_METHOD( GetPeakComboAward, m_PeakComboAward ) + DEFINE_METHOD( IsDisqualified, IsDisqualified() ) + DEFINE_METHOD( GetAliveSeconds, m_fAliveSeconds ) + DEFINE_METHOD( GetPercentageOfTaps, GetPercentageOfTaps( Enum::Check(L, 1) ) ) static int GetPlayedSteps( T* p, lua_State *L ) { @@ -734,6 +735,7 @@ public: ADD_METHOD( GetPlayedSteps ); ADD_METHOD( GetPossibleSteps ); ADD_METHOD( GetAliveSeconds ); + ADD_METHOD( GetPercentageOfTaps ); } }; diff --git a/src/PlayerStageStats.h b/src/PlayerStageStats.h index 7f7158110e..696aa60d11 100644 --- a/src/PlayerStageStats.h +++ b/src/PlayerStageStats.h @@ -72,33 +72,33 @@ public: struct Combo_t { - /* Start and size of this combo, in the same scale as the combo list mapping and - * the life record. */ + /* Start and size of this combo, in the same scale as the combo list + * mapping and the life record. */ float m_fStartSecond, m_fSizeSeconds; - /* Combo size, in steps. */ + // Combo size, in steps. int m_cnt; - /* Size of the combo that didn't come from this stage (rollover from the last song). - * (This is a subset of cnt.) */ + /* Size of the combo that didn't come from this stage (rollover from the + * last song). (This is a subset of cnt.) */ int m_rollover; - /* Get the size of the combo that came from this song. */ + // Get the size of the combo that came from this song. int GetStageCnt() const { return m_cnt - m_rollover; } Combo_t(): m_fStartSecond(0), m_fSizeSeconds(0), m_cnt(0), m_rollover(0) { } bool IsZero() const { return m_fStartSecond < 0; } }; vector m_ComboList; - float m_fFirstSecond; - float m_fLastSecond; + float m_fFirstSecond; + float m_fLastSecond; int GetComboAtStartOfStage() const; bool FullComboOfScore( TapNoteScore tnsAllGreaterOrEqual ) const; bool FullCombo() const { return FullComboOfScore(TNS_W3); } bool SingleDigitsOfScore( TapNoteScore tnsAllGreaterOrEqual ) const; bool OneOfScore( TapNoteScore tnsAllGreaterOrEqual ) const; - int GetTotalTaps() const; + int GetTotalTaps() const; float GetPercentageOfTaps( TapNoteScore tns ) const; void UpdateComboList( float fSecond, bool rollover ); Combo_t GetMaxCombo() const; @@ -112,8 +112,8 @@ public: int m_iPersonalHighScoreIndex; int m_iMachineHighScoreIndex; - bool m_bDisqualified; - bool IsDisqualified() const; + bool m_bDisqualified; + bool IsDisqualified() const; RankingCategory m_rc; HighScore m_HighScore; diff --git a/src/PlayerState.cpp b/src/PlayerState.cpp index bb57ed69aa..49d008cbf8 100644 --- a/src/PlayerState.cpp +++ b/src/PlayerState.cpp @@ -62,12 +62,12 @@ void PlayerState::Update( float fDelta ) bool bRebuildPlayerOptions = false; - /* See if any delayed attacks are starting or ending. */ + // See if any delayed attacks are starting or ending. for( unsigned s=0; sm_fMusicSeconds < attack.fStartSecond+attack.fSecsRemaining ); if( m_ActiveAttacks[s].bOn == bCurrentlyEnabled ) - continue; /* OK */ + continue; // OK if( m_ActiveAttacks[s].bOn && !bCurrentlyEnabled ) m_bAttackEndedThisUpdate = true; @@ -93,7 +93,7 @@ void PlayerState::Update( float fDelta ) if( bRebuildPlayerOptions ) RebuildPlayerOptionsFromActiveAttacks(); - /* Update after enabling attacks, so we appraoch the new state. */ + // Update after enabling attacks, so we approach the new state. m_PlayerOptions.Update( fDelta ); if( m_fSecondsUntilAttacksPhasedOut > 0 ) @@ -135,10 +135,10 @@ void PlayerState::LaunchAttack( const Attack& a ) Attack attack = a; - /* If fStartSecond is -1, it means "launch as soon as possible". For m_ActiveAttacks, - * mark the real time it's starting (now), so Update() can know when the attack started - * so it can be removed later. For m_ModsToApply, leave the -1 in, so Player::Update - * knows to apply attack transforms correctly. (yuck) */ + /* If fStartSecond is -1, it means "launch as soon as possible". For m_ActiveAttacks, + * mark the real time it's starting (now), so Update() can know when the attack + * started so it can be removed later. For m_ModsToApply, leave the -1 in, + * so Player::Update knows to apply attack transforms correctly. (yuck) */ m_ModsToApply.push_back( attack ); if( attack.fStartSecond == -1 ) attack.fStartSecond = GAMESTATE->m_fMusicSeconds; @@ -221,6 +221,7 @@ class LunaPlayerState: public Luna { public: DEFINE_METHOD( GetPlayerNumber, m_PlayerNumber ); + DEFINE_METHOD( GetMultiPlayerNumber, m_mp ); DEFINE_METHOD( GetPlayerController, m_PlayerController ); static int SetPlayerOptions( T* p, lua_State *L ) { @@ -241,6 +242,7 @@ public: LunaPlayerState() { ADD_METHOD( GetPlayerNumber ); + ADD_METHOD( GetMultiPlayerNumber ); ADD_METHOD( SetPlayerOptions ); ADD_METHOD( GetPlayerOptions ); } diff --git a/src/PlayerState.h b/src/PlayerState.h index a485e12761..df5fdcf756 100644 --- a/src/PlayerState.h +++ b/src/PlayerState.h @@ -21,7 +21,7 @@ public: // TODO: Remove use of PlayerNumber. All data about the player should live // in PlayerState and callers should not use PlayerNumber to index into // GameState. - PlayerNumber m_PlayerNumber; + PlayerNumber m_PlayerNumber; MultiPlayer m_mp; void ResetToDefaultPlayerOptions( ModsLevel l ); @@ -32,9 +32,9 @@ public: HealthState m_HealthState; - float m_fLastStrumMusicSeconds; // Set to the MusicSeconds of when the a strum button was pressed. If -1, the strum window has passed. - float m_fLastHopoNoteMusicSeconds; // Set to the MusicSeconds of the last note successfully strummed or hammered in a hopochain, -1, then there is no current hopo chain - int m_iLastHopoNoteCol; // if -1, then there is no current hopo chain + float m_fLastStrumMusicSeconds; // Set to the MusicSeconds of when the a strum button was pressed. If -1, the strum window has passed. + float m_fLastHopoNoteMusicSeconds; // Set to the MusicSeconds of the last note successfully strummed or hammered in a hopochain, -1, then there is no current hopo chain + int m_iLastHopoNoteCol; // if -1, then there is no current hopo chain float m_fUpcomingMidiNote; float m_fWrappedMidiNote; @@ -49,35 +49,33 @@ public: SampleHistory m_EffectHistory; - // // Used in Battle and Rave - // void LaunchAttack( const Attack& a ); void RemoveActiveAttacks( AttackLevel al=NUM_ATTACK_LEVELS /*all*/ ); void EndActiveAttacks(); void RebuildPlayerOptionsFromActiveAttacks(); int GetSumOfActiveAttackLevels() const; - int m_iCpuSkill; // only used when m_PlayerController is PC_CPU + int m_iCpuSkill; // only used when m_PlayerController is PC_CPU // Attacks take a while to transition out of use. Account for this in PlayerAI // by still penalizing it for 1 second after the player options are rebuilt. - int m_iLastPositiveSumOfAttackLevels; - float m_fSecondsUntilAttacksPhasedOut;// positive means PlayerAI is still affected - bool m_bAttackBeganThisUpdate; // flag for other objects to watch (play sounds) - bool m_bAttackEndedThisUpdate; // flag for other objects to watch (play sounds) + int m_iLastPositiveSumOfAttackLevels; + float m_fSecondsUntilAttacksPhasedOut; // positive means PlayerAI is still affected + bool m_bAttackBeganThisUpdate; // flag for other objects to watch (play sounds) + bool m_bAttackEndedThisUpdate; // flag for other objects to watch (play sounds) AttackArray m_ActiveAttacks; - vector m_ModsToApply; + vector m_ModsToApply; // Haste - int m_iTapsHitSinceLastHasteUpdate; - int m_iTapsMissedSinceLastHasteUpdate; + int m_iTapsHitSinceLastHasteUpdate; + int m_iTapsMissedSinceLastHasteUpdate; // Used in Rave - float m_fSuperMeter; // between 0 and NUM_ATTACK_LEVELS - float m_fSuperMeterGrowthScale; + float m_fSuperMeter; // between 0 and NUM_ATTACK_LEVELS + float m_fSuperMeterGrowthScale; // Used in Battle void RemoveAllInventory(); - Attack m_Inventory[NUM_INVENTORY_SLOTS]; + Attack m_Inventory[NUM_INVENTORY_SLOTS]; // Lua void PushSelf( lua_State *L ); diff --git a/src/PrefsManager.h b/src/PrefsManager.h index 4db54c9598..7146c00f7e 100644 --- a/src/PrefsManager.h +++ b/src/PrefsManager.h @@ -147,15 +147,15 @@ protected: public: Preference m_bWindowed; - Preference m_iDisplayWidth; - Preference m_iDisplayHeight; + Preference m_iDisplayWidth; + Preference m_iDisplayHeight; Preference m_fDisplayAspectRatio; - Preference m_iDisplayColorDepth; - Preference m_iTextureColorDepth; - Preference m_iMovieColorDepth; + Preference m_iDisplayColorDepth; + Preference m_iTextureColorDepth; + Preference m_iMovieColorDepth; Preference m_HighResolutionTextures; - Preference m_iMaxTextureResolution; - Preference m_iRefreshRate; + Preference m_iMaxTextureResolution; + Preference m_iRefreshRate; Preference m_bAllowMultitexture; Preference m_bShowStats; Preference m_bShowBanners; @@ -169,7 +169,7 @@ public: Preference m_BannerCache; Preference m_BackgroundCache; Preference m_bFastLoad; - Preference m_bFastLoadAdditionalSongs; + Preference m_bFastLoadAdditionalSongs; Preference m_bOnlyDedicatedMenuButtons; Preference m_bMenuTimer; @@ -177,27 +177,27 @@ public: Preference m_fLifeDifficultyScale; // Whoever added these: Please add a comment saying what they do. -Chris - Preference m_iRegenComboAfterMiss; - Preference m_bMercifulDrain; // negative life deltas are scaled by the players life percentage - Preference m_bMinimum1FullSongInCourses; // FEoS for 1st song, FailImmediate thereafter + Preference m_iRegenComboAfterMiss; + Preference m_bMercifulDrain; // negative life deltas are scaled by the players life percentage + Preference m_bMinimum1FullSongInCourses; // FEoS for 1st song, FailImmediate thereafter Preference m_bFailOffInBeginner; Preference m_bFailOffForFirstStageEasy; - Preference m_bMercifulBeginner; // don't subtract from percent score or grade DP, larger W5 window - Preference m_bMercifulSuperMeter; // negative super deltas are scaled by the players life percentage + Preference m_bMercifulBeginner; // don't subtract from percent score or grade DP, larger W5 window + Preference m_bMercifulSuperMeter; // negative super deltas are scaled by the players life percentage Preference m_bDelayedBack; - Preference m_bShowInstructions; // how to play a mode - Preference m_bShowSelectGroup; // uh i thought we removed this shit + Preference m_bShowInstructions; // how to play a mode + Preference m_bShowSelectGroup; // uh i thought we removed this shit -aj Preference m_bShowCaution; Preference m_bShowNativeLanguage; - Preference m_iArcadeOptionsNavigation; + Preference m_iArcadeOptionsNavigation; Preference m_MusicWheelUsesSections; - Preference m_iMusicWheelSwitchSpeed; - Preference m_AllowW1; // this should almost always be on, given use cases. - Preference m_bEventMode; // IF THIS IS NOT TRUE I WILL SHIT IN YOUR MOUTH -aj - Preference m_iCoinsPerCredit; - Preference m_iSongsPerPlay; - Preference m_bDelayedCreditsReconcile; // zuh? - Preference m_ShowSongOptions; + Preference m_iMusicWheelSwitchSpeed; + Preference m_AllowW1; // this should almost always be on, given use cases. -aj + Preference m_bEventMode; + Preference m_iCoinsPerCredit; + Preference m_iSongsPerPlay; + Preference m_bDelayedCreditsReconcile; // zuh? + Preference m_ShowSongOptions; Preference m_bDancePointsForOni; Preference m_bPercentageScoring; Preference m_fMinPercentageForMachineSongHighScore; @@ -211,22 +211,22 @@ public: Preference m_ShowDancingCharacters; Preference m_bUseUnlockSystem; Preference m_fGlobalOffsetSeconds; - Preference m_iProgressiveLifebar; - Preference m_iProgressiveStageLifebar; - Preference m_iProgressiveNonstopLifebar; + Preference m_iProgressiveLifebar; + Preference m_iProgressiveStageLifebar; + Preference m_iProgressiveNonstopLifebar; Preference m_bShowBeginnerHelper; Preference m_bDisableScreenSaver; Preference m_sLanguage; - Preference m_sMemoryCardProfileSubdir; // the directory on a memory card to look in for a profile - Preference m_iProductID; // Saved in HighScore to track what software version a score came from. - Preference m_iCenterImageTranslateX; - Preference m_iCenterImageTranslateY; - Preference m_fCenterImageAddWidth; - Preference m_fCenterImageAddHeight; + Preference m_sMemoryCardProfileSubdir; // the directory on a memory card to look in for a profile + Preference m_iProductID; // Saved in HighScore to track what software version a score came from. + Preference m_iCenterImageTranslateX; + Preference m_iCenterImageTranslateY; + Preference m_fCenterImageAddWidth; + Preference m_fCenterImageAddHeight; Preference m_AttractSoundFrequency; Preference m_bAllowExtraStage; - Preference m_iMaxHighScoresPerListForMachine; - Preference m_iMaxHighScoresPerListForPlayer; + Preference m_iMaxHighScoresPerListForMachine; + Preference m_iMaxHighScoresPerListForPlayer; Preference m_bAllowMultipleHighScoreWithSameName; Preference m_bCelShadeModels; Preference m_bPreferredSortUsesGroups; @@ -241,15 +241,15 @@ public: Preference m_bTrilinearFiltering; // has no effect without mipmaps on Preference m_bAnisotropicFiltering; // has no effect without mipmaps on. Not mutually exclusive with trilinear. - // If true, then signatures created when writing profile data - // and verified when reading profile data. Leave this false if - // you want to use a profile on different machines that don't - // have the same key, or else the profile's data will be discarded. + // If true, then signatures created when writing profile data and verified + // when reading profile data. Leave this false if you want to use a profile + // on different machines that don't have the same key, or else the + // profile's data will be discarded. Preference m_bSignProfileData; - + // course ranking Preference m_CourseSortOrder; - Preference m_bSubSortByNumSteps; + Preference m_bSubSortByNumSteps; Preference m_GetRankingName; Preference m_ScoringType; @@ -262,11 +262,11 @@ public: Preference m_sDefaultTheme; Preference m_sLastSeenVideoDriver; - Preference m_sVideoRenderers; // StepMania.cpp sets these on first run based on the card + Preference m_sVideoRenderers; // StepMania.cpp sets these on first run based on the card Preference m_bSmoothLines; - Preference m_iSoundWriteAhead; + Preference m_iSoundWriteAhead; Preference m_iSoundDevice; - Preference m_iSoundPreferredSampleRate; + Preference m_iSoundPreferredSampleRate; Preference m_sLightsStepsDifficulty; Preference m_bAllowUnacceleratedRenderer; Preference m_bThreadedInput; @@ -277,9 +277,9 @@ public: Preference m_sMachineName; Preference m_sCoursesToShowRanking; - Preference m_bQuirksMode; // enable quirky behavior desired by users of microsoft stepmania explorer 6.9 + Preference m_bQuirksMode; // enable quirky behavior desired by users of microsoft stepmania explorer 6.9 - /* Debug: */ + // Debug: Preference m_bLogToDisk; Preference m_bForceLogFlush; Preference m_bShowLogOutput; @@ -292,7 +292,6 @@ public: Preference m_bEnableScoreboard; //Alows disabling of scoreboard in network play #endif - void ReadPrefsFromIni( const IniFile &ini, const RString &sSection, bool bIsStatic ); void ReadGamePrefsFromIni( const RString &sIni ); void ReadDefaultsFromIni( const IniFile &ini, const RString &sSection ); @@ -313,9 +312,6 @@ protected: void ReadDefaultsFromFile( const RString &sIni, const RString &sSection ); }; - - - /* This is global, because it can be accessed by crash handlers and error handlers * that are run after PREFSMAN shuts down (and probably don't want to deref that * pointer anyway). */ diff --git a/src/ScreenDebugOverlay.cpp b/src/ScreenDebugOverlay.cpp index ace7c03612..38720efaf6 100644 --- a/src/ScreenDebugOverlay.cpp +++ b/src/ScreenDebugOverlay.cpp @@ -40,10 +40,8 @@ static float g_fImageScaleDestination = 1; static const ThemeMetric LINE_ON_COLOR ("ScreenDebugOverlay", "LineOnColor"); static const ThemeMetric LINE_OFF_COLOR ("ScreenDebugOverlay", "LineOffColor"); -// // self-registering debug lines // We don't use SubscriptionManager, because we want to keep the line order. -// static LocalizedString ON ( "ScreenDebugOverlay", "on" ); static LocalizedString OFF ( "ScreenDebugOverlay", "off" ); @@ -256,6 +254,7 @@ void ScreenDebugOverlay::Init() p->SetName( "PageText" ); p->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "page") ); LOAD_ALL_COMMANDS( p ); + // todo: be able to set different values? -aj p->SetXY( SCREEN_CENTER_X-100+iPage*100, SCREEN_TOP+20 ); p->SetText( *s + " (" + sButton + ")" ); p->SetShadowLength( 1 ); @@ -299,7 +298,7 @@ void ScreenDebugOverlay::Update( float fDeltaTime ) if( INPUTFILTER->IsBeingPressed(g_Mappings.holdForFast) ) { if( INPUTFILTER->IsBeingPressed(g_Mappings.holdForSlow) ) - fRate = 0; /* both; stop time */ + fRate = 0; // both; stop time else fRate *= 4; } @@ -352,6 +351,7 @@ void ScreenDebugOverlay::UpdateText() m_vptextPages[iPage]->PlayCommand( (iPage == m_iCurrentPage) ? "GainFocus" : "LoseFocus" ); } + // todo: allow changing of various spacing/location things -aj int iOffset = 0; FOREACH_CONST( IDebugLine*, *g_pvpSubscribers, p ) { @@ -395,7 +395,7 @@ void ScreenDebugOverlay::UpdateText() s1 += " - "; txt2.SetText( s1 + s2 ); } - + if( g_bIsHalt ) { /* More than once I've paused the game accidentally and wasted time @@ -442,7 +442,7 @@ bool ScreenDebugOverlay::OverlayInput( const InputEventPlus &input ) if( g_bIsDisplayed && GetValueFromMap(g_Mappings.pageButton, input.DeviceI, iPage) ) { if( input.type != IET_FIRST_PRESS ) - return true; /* eat the input but do nothing */ + return true; // eat the input but do nothing m_iCurrentPage = iPage; CLAMP( m_iCurrentPage, 0, (int) m_asPages.size()-1 ); return true; @@ -454,8 +454,8 @@ bool ScreenDebugOverlay::OverlayInput( const InputEventPlus &input ) int i = p-g_pvpSubscribers->begin(); - // Gameplay buttons are available only in gameplay. Non-gameplay buttons are - // only available when the screen is displayed. + // Gameplay buttons are available only in gameplay. Non-gameplay buttons + // are only available when the screen is displayed. switch( (*p)->GetType() ) { case IDebugLine::all_screens: @@ -475,7 +475,7 @@ bool ScreenDebugOverlay::OverlayInput( const InputEventPlus &input ) if( input.DeviceI == (*p)->m_Button ) { if( input.type != IET_FIRST_PRESS ) - return true; /* eat the input but do nothing */ + return true; // eat the input but do nothing // do the action RString sMessage; @@ -509,9 +509,7 @@ bool ScreenDebugOverlay::OverlayInput( const InputEventPlus &input ) } -// // DebugLine helpers -// static void SetSpeed() { // PauseMusic( g_bIsHalt ); @@ -537,36 +535,33 @@ void ChangeVisualDelay( float fDelta ) } - -// // DebugLines -// static LocalizedString AUTO_PLAY ( "ScreenDebugOverlay", "AutoPlay" ); static LocalizedString ASSIST ( "ScreenDebugOverlay", "Assist" ); -static LocalizedString AUTOSYNC ( "ScreenDebugOverlay", "Autosync" ); +static LocalizedString AUTOSYNC ( "ScreenDebugOverlay", "Autosync" ); static LocalizedString COIN_MODE ( "ScreenDebugOverlay", "CoinMode" ); static LocalizedString HALT ( "ScreenDebugOverlay", "Halt" ); -static LocalizedString LIGHTS_DEBUG ( "ScreenDebugOverlay", "Lights Debug" ); -static LocalizedString MONKEY_INPUT ( "ScreenDebugOverlay", "Monkey Input" ); -static LocalizedString RENDERING_STATS ( "ScreenDebugOverlay", "Rendering Stats" ); +static LocalizedString LIGHTS_DEBUG ( "ScreenDebugOverlay", "Lights Debug" ); +static LocalizedString MONKEY_INPUT ( "ScreenDebugOverlay", "Monkey Input" ); +static LocalizedString RENDERING_STATS ( "ScreenDebugOverlay", "Rendering Stats" ); static LocalizedString VSYNC ( "ScreenDebugOverlay", "Vsync" ); -static LocalizedString MULTITEXTURE ( "ScreenDebugOverlay", "Multitexture" ); -static LocalizedString SCREEN_TEST_MODE ( "ScreenDebugOverlay", "Screen Test Mode" ); +static LocalizedString MULTITEXTURE ( "ScreenDebugOverlay", "Multitexture" ); +static LocalizedString SCREEN_TEST_MODE ( "ScreenDebugOverlay", "Screen Test Mode" ); static LocalizedString SCREEN_SHOW_MASKS ( "ScreenDebugOverlay", "Show Masks" ); static LocalizedString PROFILE ( "ScreenDebugOverlay", "Profile" ); static LocalizedString CLEAR_PROFILE_STATS ( "ScreenDebugOverlay", "Clear Profile Stats" ); static LocalizedString FILL_PROFILE_STATS ( "ScreenDebugOverlay", "Fill Profile Stats" ); -static LocalizedString SEND_NOTES_ENDED ( "ScreenDebugOverlay", "Send Notes Ended" ); +static LocalizedString SEND_NOTES_ENDED ( "ScreenDebugOverlay", "Send Notes Ended" ); static LocalizedString RELOAD ( "ScreenDebugOverlay", "Reload" ); static LocalizedString RESTART ( "ScreenDebugOverlay", "Restart" ); static LocalizedString SCREEN_ON ( "ScreenDebugOverlay", "Send On To Screen" ); static LocalizedString SCREEN_OFF ( "ScreenDebugOverlay", "Send Off To Screen" ); static LocalizedString RELOAD_THEME_AND_TEXTURES( "ScreenDebugOverlay", "Reload Theme and Textures" ); -static LocalizedString WRITE_PROFILES ( "ScreenDebugOverlay", "Write Profiles" ); +static LocalizedString WRITE_PROFILES ( "ScreenDebugOverlay", "Write Profiles" ); static LocalizedString WRITE_PREFERENCES ( "ScreenDebugOverlay", "Write Preferences" ); static LocalizedString MENU_TIMER ( "ScreenDebugOverlay", "Menu Timer" ); static LocalizedString FLUSH_LOG ( "ScreenDebugOverlay", "Flush Log" ); -static LocalizedString PULL_BACK_CAMERA ( "ScreenDebugOverlay", "Pull Back Camera" ); +static LocalizedString PULL_BACK_CAMERA ( "ScreenDebugOverlay", "Pull Back Camera" ); static LocalizedString VISUAL_DELAY_UP ( "ScreenDebugOverlay", "Visual Delay Up" ); static LocalizedString VISUAL_DELAY_DOWN ( "ScreenDebugOverlay", "Visual Delay Down" ); static LocalizedString VOLUME_UP ( "ScreenDebugOverlay", "Volume Up" ); @@ -574,10 +569,10 @@ static LocalizedString VOLUME_DOWN ( "ScreenDebugOverlay", "Volume Down" ); static LocalizedString UPTIME ( "ScreenDebugOverlay", "Uptime" ); static LocalizedString FORCE_CRASH ( "ScreenDebugOverlay", "Force Crash" ); static LocalizedString SLOW ( "ScreenDebugOverlay", "Slow" ); -static LocalizedString CPU ( "ScreenDebugOverlay", "CPU" ); +static LocalizedString CPU ( "ScreenDebugOverlay", "CPU" ); static LocalizedString SONG ( "ScreenDebugOverlay", "Song" ); static LocalizedString MACHINE ( "ScreenDebugOverlay", "Machine" ); -static LocalizedString SYNC_TEMPO ( "ScreenDebugOverlay", "Tempo" ); +static LocalizedString SYNC_TEMPO ( "ScreenDebugOverlay", "Tempo" ); class DebugLineAutoplay : public IDebugLine @@ -882,8 +877,8 @@ static void FillProfileStats( Profile *pProfile ) pProfile->InitCourseScores(); static int s_iCount = 0; - // Choose a percent for all scores. This is useful for testing unlocks - // where some elements are unlocked at a certain percent complete + // Choose a percent for all scores. This is useful for testing unlocks + // where some elements are unlocked at a certain percent complete. float fPercentDP = s_iCount ? randomf( 0.6f, 1.0f ) : 1.0f; s_iCount = (s_iCount+1)%2; @@ -1032,7 +1027,7 @@ class DebugLineReloadTheme : public IDebugLine TEXTUREMAN->ReloadAll(); NOTESKIN->RefreshNoteSkinData( GAMESTATE->m_pCurGame ); CodeDetector::RefreshCacheItems(); - // HACK: Don't update text below. Return immediately because this screen + // HACK: Don't update text below. Return immediately because this screen // was just destroyed as part of the theme reload. IDebugLine::DoAndLog( sMessageOut ); } diff --git a/src/StepsDisplay.cpp b/src/StepsDisplay.cpp index 7a839d60df..e78bebf294 100644 --- a/src/StepsDisplay.cpp +++ b/src/StepsDisplay.cpp @@ -66,7 +66,7 @@ void StepsDisplay::Load( const RString &sMetricsGroup, const PlayerState *pPlaye if( m_bShowTicks ) { - RString sChars = "10"; // on, off (todo: make this metricable -aj) + RString sChars = "10"; // on, off (todo: make this metricable -aj) m_textTicks.SetName( "Ticks" ); m_textTicks.LoadFromTextureAndChars( THEME->GetPathF(m_sMetricsGroup,"ticks"), sChars ); ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textTicks, m_sMetricsGroup );