cleanup and comment part unknown of a trillion

This commit is contained in:
AJ Kelly
2010-03-09 12:21:56 -06:00
parent 31c69f1d9c
commit a7b52df0fa
12 changed files with 160 additions and 169 deletions
+4 -4
View File
@@ -127,7 +127,7 @@ void Bookkeeper::ReadFromDisk()
void Bookkeeper::WriteToDisk() 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; RageFile f;
if( !f.Open(COINS_DAT, RageFile::WRITE|RageFile::SLOW_FLUSH) ) if( !f.Open(COINS_DAT, RageFile::WRITE|RageFile::SLOW_FLUSH) )
{ {
@@ -147,7 +147,7 @@ void Bookkeeper::CoinInserted()
++m_mapCoinsForHour[d]; ++m_mapCoinsForHour[d];
} }
/* Return the number of coins between [beginning,ending). */ // Return the number of coins between [beginning,ending).
int Bookkeeper::GetNumCoinsInRange( map<Date,int>::const_iterator begin, map<Date,int>::const_iterator end ) const int Bookkeeper::GetNumCoinsInRange( map<Date,int>::const_iterator begin, map<Date,int>::const_iterator end ) const
{ {
int iCoins = 0; 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 /* iDay is days since Jan 1. iYear is eg. 2005. Return the day of the week,
* 0 is Sunday. */ * where 0 is Sunday. */
void Bookkeeper::GetCoinsByDayOfWeek( int coins[DAYS_IN_WEEK] ) const void Bookkeeper::GetCoinsByDayOfWeek( int coins[DAYS_IN_WEEK] ) const
{ {
for( int i=0; i<DAYS_IN_WEEK; i++ ) for( int i=0; i<DAYS_IN_WEEK; i++ )
+4 -4
View File
@@ -49,7 +49,7 @@ void ComboGraph::Set( const StageStats &s, const PlayerStageStats &pss )
const float fFirstSecond = 0; const float fFirstSecond = 0;
const float fLastSecond = s.GetTotalPossibleStepsSeconds(); const float fLastSecond = s.GetTotalPossibleStepsSeconds();
/* Find the largest combo. */ // Find the largest combo.
int iMaxComboSize = 0; int iMaxComboSize = 0;
for( unsigned i = 0; i < pss.m_ComboList.size(); ++i ) for( unsigned i = 0; i < pss.m_ComboList.size(); ++i )
iMaxComboSize = max( iMaxComboSize, pss.m_ComboList[i].GetStageCnt() ); 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]; const PlayerStageStats::Combo_t &combo = pss.m_ComboList[i];
if( combo.GetStageCnt() < MinComboSizeToShow ) if( combo.GetStageCnt() < MinComboSizeToShow )
continue; /* too small */ continue; // too small
const bool bIsMax = (combo.GetStageCnt() == iMaxComboSize); 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]; const PlayerStageStats::Combo_t &combo = pss.m_ComboList[i];
if( combo.GetStageCnt() < MinComboSizeToShow ) if( combo.GetStageCnt() < MinComboSizeToShow )
continue; /* too small */ continue; // too small
if( !iMaxComboSize ) if( !iMaxComboSize )
continue; continue;
@@ -103,7 +103,7 @@ void ComboGraph::Set( const StageStats &s, const PlayerStageStats &pss )
this->AddChild( pText ); this->AddChild( pText );
} }
/* Hide the templates. */ // Hide the templates.
m_pNormalCombo->SetVisible( false ); m_pNormalCombo->SetVisible( false );
m_pMaxCombo->SetVisible( false ); m_pMaxCombo->SetVisible( false );
m_pComboNumber->SetVisible( false ); m_pComboNumber->SetVisible( false );
-2
View File
@@ -18,9 +18,7 @@ public:
virtual ComboGraph *Copy() const; virtual ComboGraph *Copy() const;
virtual bool AutoLoadChildren() const { return true; } virtual bool AutoLoadChildren() const { return true; }
//
// Commands // Commands
//
virtual void PushSelf( lua_State *L ); virtual void PushSelf( lua_State *L );
private: private:
+4 -4
View File
@@ -40,11 +40,11 @@ public:
bool IsPlayable( RString *why = NULL ) const; bool IsPlayable( RString *why = NULL ) const;
bool IsZero() 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. */ * to do it yourself. */
void ApplyCommitsScreens( bool bOn ) { m_bApplyCommitsScreens = bOn; } 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. // so that we know the order of commands when it comes time to Apply.
Commands m_Commands; Commands m_Commands;
@@ -78,7 +78,7 @@ public:
GoalType m_GoalType; GoalType m_GoalType;
RString m_sProfileID; RString m_sProfileID;
RString m_sUrl; RString m_sUrl;
/* sm-ssc adds: */ // sm-ssc adds:
bool m_bUrlExits; // for making stepmania not exit on url bool m_bUrlExits; // for making stepmania not exit on url
bool m_bPushScreen; // for pushing a screen on top instead of as next bool m_bPushScreen; // for pushing a screen on top instead of as next
@@ -86,7 +86,7 @@ public:
bool m_bClearCredits; bool m_bClearCredits;
bool m_bStopMusic; bool m_bStopMusic;
bool m_bApplyDefaultOptions; bool m_bApplyDefaultOptions;
/* sm-ssc also adds: */ // sm-ssc also adds:
bool m_bFadeMusic; bool m_bFadeMusic;
float m_fMusicFadeOutVolume; float m_fMusicFadeOutVolume;
// currently, GameSoundManager uses consts for fade out/in times, so this // currently, GameSoundManager uses consts for fade out/in times, so this
+11 -11
View File
@@ -79,7 +79,7 @@ int GetSuccessfulMines( const NoteData &in, int iStartIndex = 0, int iEndIndex =
return iNumSuccessfulMinesNotes; return iNumSuccessfulMinesNotes;
} }
/* See NoteData::GetNumHands(). */ // See NoteData::GetNumHands().
int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW )
{ {
int iNum = 0; int iNum = 0;
@@ -105,7 +105,7 @@ int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex =
if( Missed ) if( Missed )
continue; continue;
/* Check hold scores. */ // Check hold scores.
for( int t=0; t<in.GetNumTracks(); ++t ) for( int t=0; t<in.GetNumTracks(); ++t )
{ {
int iHeadRow; int iHeadRow;
@@ -113,8 +113,8 @@ int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex =
continue; continue;
const TapNote &tn = in.GetTapNote( t, iHeadRow ); const TapNote &tn = in.GetTapNote( t, iHeadRow );
/* If a hold is released *after* a hands containing it, the hands is /* If a hold is released *after* a hand containing it, the hand is
* still good. So, ignore the judgement and only examine iLastHeldRow * still good. Ignore the judgement and only examine iLastHeldRow
* to be sure that the hold was still held at the point of this row. * to be sure that the hold was still held at the point of this row.
* (Note that if the hold head tap was missed, then iLastHeldRow == i * (Note that if the hold head tap was missed, then iLastHeldRow == i
* and this won't fail--but the tap check above will have already failed.) */ * and this won't fail--but the tap check above will have already failed.) */
@@ -227,7 +227,6 @@ const TapNote &NoteDataWithScoring::LastTapNoteWithResult( const NoteData &in, u
return in.GetTapNote( iTrack, iRow ); return in.GetTapNote( iTrack, iRow );
} }
/* Return the minimum tap score of a row. If the row isn't complete (not all /* Return the minimum tap score of a row. If the row isn't complete (not all
* taps have been hit), return TNS_None or TNS_Miss. */ * taps have been hit), return TNS_None or TNS_Miss. */
TapNoteScore NoteDataWithScoring::MinTapNoteScore( const NoteData &in, unsigned row ) TapNoteScore NoteDataWithScoring::MinTapNoteScore( const NoteData &in, unsigned row )
@@ -236,7 +235,7 @@ TapNoteScore NoteDataWithScoring::MinTapNoteScore( const NoteData &in, unsigned
TapNoteScore score = TNS_W1; TapNoteScore score = TNS_W1;
for( int t=0; t<in.GetNumTracks(); t++ ) for( int t=0; t<in.GetNumTracks(); t++ )
{ {
/* Ignore mines (and fake arrows), or the score will always be TNS_None. */ // Ignore mines (and fake arrows), or the score will always be TNS_None.
const TapNote &tn = in.GetTapNote( t, row ); const TapNote &tn = in.GetTapNote( t, row );
if( tn.type == TapNote::empty || tn.type == TapNote::mine || tn.type == TapNote::fake ) if( tn.type == TapNote::empty || tn.type == TapNote::mine || tn.type == TapNote::fake )
continue; continue;
@@ -254,7 +253,7 @@ bool NoteDataWithScoring::IsRowCompletelyJudged( const NoteData &in, unsigned ro
namespace namespace
{ {
/* Return the ratio of actual to possible Bs. */ // Return the ratio of actual to possible Bs.
float GetActualStreamRadarValue( const NoteData &in, float fSongSeconds ) float GetActualStreamRadarValue( const NoteData &in, float fSongSeconds )
{ {
int iTotalSteps = in.GetNumTapNotes(); int iTotalSteps = in.GetNumTapNotes();
@@ -268,10 +267,11 @@ float GetActualStreamRadarValue( const NoteData &in, float fSongSeconds )
/* Return the ratio of actual combo to max combo. */ /* Return the ratio of actual combo to max combo. */
float GetActualVoltageRadarValue( const NoteData &in, float fSongSeconds, const PlayerStageStats &pss ) float GetActualVoltageRadarValue( const NoteData &in, float fSongSeconds, const PlayerStageStats &pss )
{ {
/* STATSMAN->m_CurStageStats.iMaxCombo is unrelated to GetNumTapNotes: m_bComboContinuesBetweenSongs /* STATSMAN->m_CurStageStats.iMaxCombo is unrelated to GetNumTapNotes:
* might be on, and the way combo is counted varies depending on the mode and score * m_bComboContinuesBetweenSongs might be on, and the way combo is counted
* keeper. Instead, let's use the length of the longest recorded combo. This is * varies depending on the mode and score keeper. Instead, let's use the
* only subtly different: it's the percent of the song the longest combo took to get. */ * 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(); const PlayerStageStats::Combo_t MaxCombo = pss.GetMaxCombo();
float fComboPercent = SCALE( MaxCombo.m_fSizeSeconds, 0, pss.m_fLastSecond-pss.m_fFirstSecond, 0.0f, 1.0f ); float fComboPercent = SCALE( MaxCombo.m_fSizeSeconds, 0, pss.m_fLastSecond-pss.m_fFirstSecond, 0.0f, 1.0f );
return clamp( fComboPercent, 0.0f, 1.0f ); return clamp( fComboPercent, 0.0f, 1.0f );
+26 -24
View File
@@ -428,8 +428,8 @@ float PlayerStageStats::GetCurrentLife() const
return iter->second; return iter->second;
} }
/* If bRollover is true, we're being called before gameplay begins, so we can record /* If bRollover is true, we're being called before gameplay begins, so we can
* the amount of the first combo that comes from the previous song. */ * record the amount of the first combo that comes from the previous song. */
void PlayerStageStats::UpdateComboList( float fSecond, bool bRollover ) void PlayerStageStats::UpdateComboList( float fSecond, bool bRollover )
{ {
// Don't save combo stats in endless courses, or could run OOM in a few hours. // Don't save combo stats in endless courses, or could run OOM in a few hours.
@@ -448,21 +448,21 @@ void PlayerStageStats::UpdateComboList( float fSecond, bool bRollover )
int cnt = m_iCurCombo; int cnt = m_iCurCombo;
if( !cnt ) if( !cnt )
return; /* no combo */ return; // no combo
if( m_ComboList.size() == 0 || m_ComboList.back().m_cnt >= cnt ) 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 /* If the previous combo (if any) starts on -9999, then we rolled over
* combo, but missed the first step. Remove it. */ * some combo, but missed the first step. Remove it. */
if( m_ComboList.size() && m_ComboList.back().m_fStartSecond == -9999 ) if( m_ComboList.size() && m_ComboList.back().m_fStartSecond == -9999 )
m_ComboList.erase( m_ComboList.begin()+m_ComboList.size()-1, m_ComboList.end() ); 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; Combo_t NewCombo;
/* "start" is the position that the combo started within this song. If we're /* "start" is the position that the combo started within this song.
* recording rollover, the combo hasn't started yet (within this song), so put * If we're recording rollover, the combo hasn't started yet (within
* a placeholder in and set it on the next call. (Otherwise, start will be less * this song), so put a placeholder in and set it on the next call.
* than fFirstPos.) */ * (Otherwise, start will be less than fFirstPos.) */
if( bRollover ) if( bRollover )
NewCombo.m_fStartSecond = -9999; NewCombo.m_fStartSecond = -9999;
else else
@@ -656,20 +656,20 @@ LuaFunction( FormatPercentScore, PlayerStageStats::FormatPercentScore( FArg(1) )
class LunaPlayerStageStats: public Luna<PlayerStageStats> class LunaPlayerStageStats: public Luna<PlayerStageStats>
{ {
public: public:
DEFINE_METHOD( GetCaloriesBurned, m_fCaloriesBurned ) DEFINE_METHOD( GetCaloriesBurned, m_fCaloriesBurned )
DEFINE_METHOD( GetLifeRemainingSeconds, m_fLifeRemainingSeconds ) DEFINE_METHOD( GetLifeRemainingSeconds, m_fLifeRemainingSeconds )
DEFINE_METHOD( GetSurvivalSeconds, GetSurvivalSeconds() ) DEFINE_METHOD( GetSurvivalSeconds, GetSurvivalSeconds() )
DEFINE_METHOD( GetCurrentCombo, m_iCurCombo ) DEFINE_METHOD( GetCurrentCombo, m_iCurCombo )
DEFINE_METHOD( GetCurrentMissCombo, m_iCurMissCombo ) DEFINE_METHOD( GetCurrentMissCombo, m_iCurMissCombo )
DEFINE_METHOD( GetCurrentScoreMultiplier, m_iCurScoreMultiplier ) DEFINE_METHOD( GetCurrentScoreMultiplier, m_iCurScoreMultiplier )
DEFINE_METHOD( GetScore, m_iScore ) DEFINE_METHOD( GetScore, m_iScore )
DEFINE_METHOD( GetTapNoteScores, m_iTapNoteScores[Enum::Check<TapNoteScore>(L, 1)] ) DEFINE_METHOD( GetTapNoteScores, m_iTapNoteScores[Enum::Check<TapNoteScore>(L, 1)] )
DEFINE_METHOD( GetHoldNoteScores, m_iHoldNoteScores[Enum::Check<HoldNoteScore>(L, 1)] ) DEFINE_METHOD( GetHoldNoteScores, m_iHoldNoteScores[Enum::Check<HoldNoteScore>(L, 1)] )
DEFINE_METHOD( FullCombo, FullCombo() ) DEFINE_METHOD( FullCombo, FullCombo() )
DEFINE_METHOD( FullComboOfScore, FullComboOfScore( Enum::Check<TapNoteScore>(L, 1) ) ) DEFINE_METHOD( FullComboOfScore, FullComboOfScore( Enum::Check<TapNoteScore>(L, 1) ) )
DEFINE_METHOD( MaxCombo, GetMaxCombo().m_cnt ) DEFINE_METHOD( MaxCombo, GetMaxCombo().m_cnt )
DEFINE_METHOD( GetCurrentLife, GetCurrentLife() ) DEFINE_METHOD( GetCurrentLife, GetCurrentLife() )
DEFINE_METHOD( GetGrade, GetGrade() ) DEFINE_METHOD( GetGrade, GetGrade() )
DEFINE_METHOD( GetActualDancePoints, m_iActualDancePoints ) DEFINE_METHOD( GetActualDancePoints, m_iActualDancePoints )
DEFINE_METHOD( GetPossibleDancePoints, m_iPossibleDancePoints ) DEFINE_METHOD( GetPossibleDancePoints, m_iPossibleDancePoints )
DEFINE_METHOD( GetCurrentPossibleDancePoints, m_iCurPossibleDancePoints ) DEFINE_METHOD( GetCurrentPossibleDancePoints, m_iCurPossibleDancePoints )
@@ -678,10 +678,11 @@ public:
DEFINE_METHOD( GetLessonScoreNeeded, GetLessonScoreNeeded() ) DEFINE_METHOD( GetLessonScoreNeeded, GetLessonScoreNeeded() )
DEFINE_METHOD( GetPersonalHighScoreIndex, m_iPersonalHighScoreIndex ) DEFINE_METHOD( GetPersonalHighScoreIndex, m_iPersonalHighScoreIndex )
DEFINE_METHOD( GetMachineHighScoreIndex, m_iMachineHighScoreIndex ) DEFINE_METHOD( GetMachineHighScoreIndex, m_iMachineHighScoreIndex )
DEFINE_METHOD( GetStageAward, m_StageAward ) DEFINE_METHOD( GetStageAward, m_StageAward )
DEFINE_METHOD( GetPeakComboAward, m_PeakComboAward ) DEFINE_METHOD( GetPeakComboAward, m_PeakComboAward )
DEFINE_METHOD( IsDisqualified, IsDisqualified() ) DEFINE_METHOD( IsDisqualified, IsDisqualified() )
DEFINE_METHOD( GetAliveSeconds, m_fAliveSeconds ) DEFINE_METHOD( GetAliveSeconds, m_fAliveSeconds )
DEFINE_METHOD( GetPercentageOfTaps, GetPercentageOfTaps( Enum::Check<TapNoteScore>(L, 1) ) )
static int GetPlayedSteps( T* p, lua_State *L ) static int GetPlayedSteps( T* p, lua_State *L )
{ {
@@ -734,6 +735,7 @@ public:
ADD_METHOD( GetPlayedSteps ); ADD_METHOD( GetPlayedSteps );
ADD_METHOD( GetPossibleSteps ); ADD_METHOD( GetPossibleSteps );
ADD_METHOD( GetAliveSeconds ); ADD_METHOD( GetAliveSeconds );
ADD_METHOD( GetPercentageOfTaps );
} }
}; };
+11 -11
View File
@@ -72,33 +72,33 @@ public:
struct Combo_t struct Combo_t
{ {
/* Start and size of this combo, in the same scale as the combo list mapping and /* Start and size of this combo, in the same scale as the combo list
* the life record. */ * mapping and the life record. */
float m_fStartSecond, m_fSizeSeconds; float m_fStartSecond, m_fSizeSeconds;
/* Combo size, in steps. */ // Combo size, in steps.
int m_cnt; int m_cnt;
/* Size of the combo that didn't come from this stage (rollover from the last song). /* Size of the combo that didn't come from this stage (rollover from the
* (This is a subset of cnt.) */ * last song). (This is a subset of cnt.) */
int m_rollover; 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; } int GetStageCnt() const { return m_cnt - m_rollover; }
Combo_t(): m_fStartSecond(0), m_fSizeSeconds(0), m_cnt(0), m_rollover(0) { } Combo_t(): m_fStartSecond(0), m_fSizeSeconds(0), m_cnt(0), m_rollover(0) { }
bool IsZero() const { return m_fStartSecond < 0; } bool IsZero() const { return m_fStartSecond < 0; }
}; };
vector<Combo_t> m_ComboList; vector<Combo_t> m_ComboList;
float m_fFirstSecond; float m_fFirstSecond;
float m_fLastSecond; float m_fLastSecond;
int GetComboAtStartOfStage() const; int GetComboAtStartOfStage() const;
bool FullComboOfScore( TapNoteScore tnsAllGreaterOrEqual ) const; bool FullComboOfScore( TapNoteScore tnsAllGreaterOrEqual ) const;
bool FullCombo() const { return FullComboOfScore(TNS_W3); } bool FullCombo() const { return FullComboOfScore(TNS_W3); }
bool SingleDigitsOfScore( TapNoteScore tnsAllGreaterOrEqual ) const; bool SingleDigitsOfScore( TapNoteScore tnsAllGreaterOrEqual ) const;
bool OneOfScore( TapNoteScore tnsAllGreaterOrEqual ) const; bool OneOfScore( TapNoteScore tnsAllGreaterOrEqual ) const;
int GetTotalTaps() const; int GetTotalTaps() const;
float GetPercentageOfTaps( TapNoteScore tns ) const; float GetPercentageOfTaps( TapNoteScore tns ) const;
void UpdateComboList( float fSecond, bool rollover ); void UpdateComboList( float fSecond, bool rollover );
Combo_t GetMaxCombo() const; Combo_t GetMaxCombo() const;
@@ -112,8 +112,8 @@ public:
int m_iPersonalHighScoreIndex; int m_iPersonalHighScoreIndex;
int m_iMachineHighScoreIndex; int m_iMachineHighScoreIndex;
bool m_bDisqualified; bool m_bDisqualified;
bool IsDisqualified() const; bool IsDisqualified() const;
RankingCategory m_rc; RankingCategory m_rc;
HighScore m_HighScore; HighScore m_HighScore;
+10 -8
View File
@@ -62,12 +62,12 @@ void PlayerState::Update( float fDelta )
bool bRebuildPlayerOptions = false; 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; s<m_ActiveAttacks.size(); s++ ) for( unsigned s=0; s<m_ActiveAttacks.size(); s++ )
{ {
Attack &attack = m_ActiveAttacks[s]; Attack &attack = m_ActiveAttacks[s];
// -1 is the "starts now" sentinel value. You must add the attack // -1 is the "starts now" sentinel value. You must add the attack
// by calling GameState::LaunchAttack, or else the -1 won't be // by calling GameState::LaunchAttack, or else the -1 won't be
// converted into the current music time. // converted into the current music time.
ASSERT( attack.fStartSecond != -1 ); ASSERT( attack.fStartSecond != -1 );
@@ -78,7 +78,7 @@ void PlayerState::Update( float fDelta )
GAMESTATE->m_fMusicSeconds < attack.fStartSecond+attack.fSecsRemaining ); GAMESTATE->m_fMusicSeconds < attack.fStartSecond+attack.fSecsRemaining );
if( m_ActiveAttacks[s].bOn == bCurrentlyEnabled ) if( m_ActiveAttacks[s].bOn == bCurrentlyEnabled )
continue; /* OK */ continue; // OK
if( m_ActiveAttacks[s].bOn && !bCurrentlyEnabled ) if( m_ActiveAttacks[s].bOn && !bCurrentlyEnabled )
m_bAttackEndedThisUpdate = true; m_bAttackEndedThisUpdate = true;
@@ -93,7 +93,7 @@ void PlayerState::Update( float fDelta )
if( bRebuildPlayerOptions ) if( bRebuildPlayerOptions )
RebuildPlayerOptionsFromActiveAttacks(); 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 ); m_PlayerOptions.Update( fDelta );
if( m_fSecondsUntilAttacksPhasedOut > 0 ) if( m_fSecondsUntilAttacksPhasedOut > 0 )
@@ -135,10 +135,10 @@ void PlayerState::LaunchAttack( const Attack& a )
Attack attack = a; Attack attack = a;
/* If fStartSecond is -1, it means "launch as soon as possible". For m_ActiveAttacks, /* 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 * mark the real time it's starting (now), so Update() can know when the attack
* so it can be removed later. For m_ModsToApply, leave the -1 in, so Player::Update * started so it can be removed later. For m_ModsToApply, leave the -1 in,
* knows to apply attack transforms correctly. (yuck) */ * so Player::Update knows to apply attack transforms correctly. (yuck) */
m_ModsToApply.push_back( attack ); m_ModsToApply.push_back( attack );
if( attack.fStartSecond == -1 ) if( attack.fStartSecond == -1 )
attack.fStartSecond = GAMESTATE->m_fMusicSeconds; attack.fStartSecond = GAMESTATE->m_fMusicSeconds;
@@ -221,6 +221,7 @@ class LunaPlayerState: public Luna<PlayerState>
{ {
public: public:
DEFINE_METHOD( GetPlayerNumber, m_PlayerNumber ); DEFINE_METHOD( GetPlayerNumber, m_PlayerNumber );
DEFINE_METHOD( GetMultiPlayerNumber, m_mp );
DEFINE_METHOD( GetPlayerController, m_PlayerController ); DEFINE_METHOD( GetPlayerController, m_PlayerController );
static int SetPlayerOptions( T* p, lua_State *L ) static int SetPlayerOptions( T* p, lua_State *L )
{ {
@@ -241,6 +242,7 @@ public:
LunaPlayerState() LunaPlayerState()
{ {
ADD_METHOD( GetPlayerNumber ); ADD_METHOD( GetPlayerNumber );
ADD_METHOD( GetMultiPlayerNumber );
ADD_METHOD( SetPlayerOptions ); ADD_METHOD( SetPlayerOptions );
ADD_METHOD( GetPlayerOptions ); ADD_METHOD( GetPlayerOptions );
} }
+15 -17
View File
@@ -21,7 +21,7 @@ public:
// TODO: Remove use of PlayerNumber. All data about the player should live // TODO: Remove use of PlayerNumber. All data about the player should live
// in PlayerState and callers should not use PlayerNumber to index into // in PlayerState and callers should not use PlayerNumber to index into
// GameState. // GameState.
PlayerNumber m_PlayerNumber; PlayerNumber m_PlayerNumber;
MultiPlayer m_mp; MultiPlayer m_mp;
void ResetToDefaultPlayerOptions( ModsLevel l ); void ResetToDefaultPlayerOptions( ModsLevel l );
@@ -32,9 +32,9 @@ public:
HealthState m_HealthState; 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_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 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 int m_iLastHopoNoteCol; // if -1, then there is no current hopo chain
float m_fUpcomingMidiNote; float m_fUpcomingMidiNote;
float m_fWrappedMidiNote; float m_fWrappedMidiNote;
@@ -49,35 +49,33 @@ public:
SampleHistory m_EffectHistory; SampleHistory m_EffectHistory;
//
// Used in Battle and Rave // Used in Battle and Rave
//
void LaunchAttack( const Attack& a ); void LaunchAttack( const Attack& a );
void RemoveActiveAttacks( AttackLevel al=NUM_ATTACK_LEVELS /*all*/ ); void RemoveActiveAttacks( AttackLevel al=NUM_ATTACK_LEVELS /*all*/ );
void EndActiveAttacks(); void EndActiveAttacks();
void RebuildPlayerOptionsFromActiveAttacks(); void RebuildPlayerOptionsFromActiveAttacks();
int GetSumOfActiveAttackLevels() const; 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 // 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. // by still penalizing it for 1 second after the player options are rebuilt.
int m_iLastPositiveSumOfAttackLevels; int m_iLastPositiveSumOfAttackLevels;
float m_fSecondsUntilAttacksPhasedOut;// positive means PlayerAI is still affected float m_fSecondsUntilAttacksPhasedOut; // positive means PlayerAI is still affected
bool m_bAttackBeganThisUpdate; // flag for other objects to watch (play sounds) bool m_bAttackBeganThisUpdate; // flag for other objects to watch (play sounds)
bool m_bAttackEndedThisUpdate; // flag for other objects to watch (play sounds) bool m_bAttackEndedThisUpdate; // flag for other objects to watch (play sounds)
AttackArray m_ActiveAttacks; AttackArray m_ActiveAttacks;
vector<Attack> m_ModsToApply; vector<Attack> m_ModsToApply;
// Haste // Haste
int m_iTapsHitSinceLastHasteUpdate; int m_iTapsHitSinceLastHasteUpdate;
int m_iTapsMissedSinceLastHasteUpdate; int m_iTapsMissedSinceLastHasteUpdate;
// Used in Rave // Used in Rave
float m_fSuperMeter; // between 0 and NUM_ATTACK_LEVELS float m_fSuperMeter; // between 0 and NUM_ATTACK_LEVELS
float m_fSuperMeterGrowthScale; float m_fSuperMeterGrowthScale;
// Used in Battle // Used in Battle
void RemoveAllInventory(); void RemoveAllInventory();
Attack m_Inventory[NUM_INVENTORY_SLOTS]; Attack m_Inventory[NUM_INVENTORY_SLOTS];
// Lua // Lua
void PushSelf( lua_State *L ); void PushSelf( lua_State *L );
+43 -47
View File
@@ -147,15 +147,15 @@ protected:
public: public:
Preference<bool> m_bWindowed; Preference<bool> m_bWindowed;
Preference<int> m_iDisplayWidth; Preference<int> m_iDisplayWidth;
Preference<int> m_iDisplayHeight; Preference<int> m_iDisplayHeight;
Preference<float> m_fDisplayAspectRatio; Preference<float> m_fDisplayAspectRatio;
Preference<int> m_iDisplayColorDepth; Preference<int> m_iDisplayColorDepth;
Preference<int> m_iTextureColorDepth; Preference<int> m_iTextureColorDepth;
Preference<int> m_iMovieColorDepth; Preference<int> m_iMovieColorDepth;
Preference<HighResolutionTextures> m_HighResolutionTextures; Preference<HighResolutionTextures> m_HighResolutionTextures;
Preference<int> m_iMaxTextureResolution; Preference<int> m_iMaxTextureResolution;
Preference<int> m_iRefreshRate; Preference<int> m_iRefreshRate;
Preference<bool> m_bAllowMultitexture; Preference<bool> m_bAllowMultitexture;
Preference<bool> m_bShowStats; Preference<bool> m_bShowStats;
Preference<bool> m_bShowBanners; Preference<bool> m_bShowBanners;
@@ -169,7 +169,7 @@ public:
Preference<BannerCacheMode> m_BannerCache; Preference<BannerCacheMode> m_BannerCache;
Preference<BackgroundCacheMode> m_BackgroundCache; Preference<BackgroundCacheMode> m_BackgroundCache;
Preference<bool> m_bFastLoad; Preference<bool> m_bFastLoad;
Preference<bool> m_bFastLoadAdditionalSongs; Preference<bool> m_bFastLoadAdditionalSongs;
Preference<bool> m_bOnlyDedicatedMenuButtons; Preference<bool> m_bOnlyDedicatedMenuButtons;
Preference<bool> m_bMenuTimer; Preference<bool> m_bMenuTimer;
@@ -177,27 +177,27 @@ public:
Preference<float> m_fLifeDifficultyScale; Preference<float> m_fLifeDifficultyScale;
// Whoever added these: Please add a comment saying what they do. -Chris // Whoever added these: Please add a comment saying what they do. -Chris
Preference<int> m_iRegenComboAfterMiss; Preference<int> m_iRegenComboAfterMiss;
Preference<bool> m_bMercifulDrain; // negative life deltas are scaled by the players life percentage Preference<bool> m_bMercifulDrain; // negative life deltas are scaled by the players life percentage
Preference<bool> m_bMinimum1FullSongInCourses; // FEoS for 1st song, FailImmediate thereafter Preference<bool> m_bMinimum1FullSongInCourses; // FEoS for 1st song, FailImmediate thereafter
Preference<bool> m_bFailOffInBeginner; Preference<bool> m_bFailOffInBeginner;
Preference<bool> m_bFailOffForFirstStageEasy; Preference<bool> m_bFailOffForFirstStageEasy;
Preference<bool> m_bMercifulBeginner; // don't subtract from percent score or grade DP, larger W5 window Preference<bool> m_bMercifulBeginner; // don't subtract from percent score or grade DP, larger W5 window
Preference<bool> m_bMercifulSuperMeter; // negative super deltas are scaled by the players life percentage Preference<bool> m_bMercifulSuperMeter; // negative super deltas are scaled by the players life percentage
Preference<bool> m_bDelayedBack; Preference<bool> m_bDelayedBack;
Preference<bool> m_bShowInstructions; // how to play a mode Preference<bool> m_bShowInstructions; // how to play a mode
Preference<bool> m_bShowSelectGroup; // uh i thought we removed this shit Preference<bool> m_bShowSelectGroup; // uh i thought we removed this shit -aj
Preference<bool> m_bShowCaution; Preference<bool> m_bShowCaution;
Preference<bool> m_bShowNativeLanguage; Preference<bool> m_bShowNativeLanguage;
Preference<int> m_iArcadeOptionsNavigation; Preference<int> m_iArcadeOptionsNavigation;
Preference<MusicWheelUsesSections> m_MusicWheelUsesSections; Preference<MusicWheelUsesSections> m_MusicWheelUsesSections;
Preference<int> m_iMusicWheelSwitchSpeed; Preference<int> m_iMusicWheelSwitchSpeed;
Preference<AllowW1> m_AllowW1; // this should almost always be on, given use cases. Preference<AllowW1> m_AllowW1; // this should almost always be on, given use cases. -aj
Preference<bool> m_bEventMode; // IF THIS IS NOT TRUE I WILL SHIT IN YOUR MOUTH -aj Preference<bool> m_bEventMode;
Preference<int> m_iCoinsPerCredit; Preference<int> m_iCoinsPerCredit;
Preference<int> m_iSongsPerPlay; Preference<int> m_iSongsPerPlay;
Preference<bool> m_bDelayedCreditsReconcile; // zuh? Preference<bool> m_bDelayedCreditsReconcile; // zuh?
Preference<Maybe> m_ShowSongOptions; Preference<Maybe> m_ShowSongOptions;
Preference<bool> m_bDancePointsForOni; Preference<bool> m_bDancePointsForOni;
Preference<bool> m_bPercentageScoring; Preference<bool> m_bPercentageScoring;
Preference<float> m_fMinPercentageForMachineSongHighScore; Preference<float> m_fMinPercentageForMachineSongHighScore;
@@ -211,22 +211,22 @@ public:
Preference<ShowDancingCharacters> m_ShowDancingCharacters; Preference<ShowDancingCharacters> m_ShowDancingCharacters;
Preference<bool> m_bUseUnlockSystem; Preference<bool> m_bUseUnlockSystem;
Preference<float> m_fGlobalOffsetSeconds; Preference<float> m_fGlobalOffsetSeconds;
Preference<int> m_iProgressiveLifebar; Preference<int> m_iProgressiveLifebar;
Preference<int> m_iProgressiveStageLifebar; Preference<int> m_iProgressiveStageLifebar;
Preference<int> m_iProgressiveNonstopLifebar; Preference<int> m_iProgressiveNonstopLifebar;
Preference<bool> m_bShowBeginnerHelper; Preference<bool> m_bShowBeginnerHelper;
Preference<bool> m_bDisableScreenSaver; Preference<bool> m_bDisableScreenSaver;
Preference<RString> m_sLanguage; Preference<RString> m_sLanguage;
Preference<RString> m_sMemoryCardProfileSubdir; // the directory on a memory card to look in for a profile Preference<RString> m_sMemoryCardProfileSubdir; // the directory on a memory card to look in for a profile
Preference<int> m_iProductID; // Saved in HighScore to track what software version a score came from. Preference<int> m_iProductID; // Saved in HighScore to track what software version a score came from.
Preference<int> m_iCenterImageTranslateX; Preference<int> m_iCenterImageTranslateX;
Preference<int> m_iCenterImageTranslateY; Preference<int> m_iCenterImageTranslateY;
Preference<int> m_fCenterImageAddWidth; Preference<int> m_fCenterImageAddWidth;
Preference<int> m_fCenterImageAddHeight; Preference<int> m_fCenterImageAddHeight;
Preference<AttractSoundFrequency> m_AttractSoundFrequency; Preference<AttractSoundFrequency> m_AttractSoundFrequency;
Preference<bool> m_bAllowExtraStage; Preference<bool> m_bAllowExtraStage;
Preference<int> m_iMaxHighScoresPerListForMachine; Preference<int> m_iMaxHighScoresPerListForMachine;
Preference<int> m_iMaxHighScoresPerListForPlayer; Preference<int> m_iMaxHighScoresPerListForPlayer;
Preference<bool> m_bAllowMultipleHighScoreWithSameName; Preference<bool> m_bAllowMultipleHighScoreWithSameName;
Preference<bool> m_bCelShadeModels; Preference<bool> m_bCelShadeModels;
Preference<bool> m_bPreferredSortUsesGroups; Preference<bool> m_bPreferredSortUsesGroups;
@@ -241,10 +241,10 @@ public:
Preference<bool> m_bTrilinearFiltering; // has no effect without mipmaps on Preference<bool> m_bTrilinearFiltering; // has no effect without mipmaps on
Preference<bool> m_bAnisotropicFiltering; // has no effect without mipmaps on. Not mutually exclusive with trilinear. Preference<bool> m_bAnisotropicFiltering; // has no effect without mipmaps on. Not mutually exclusive with trilinear.
// If true, then signatures created when writing profile data // If true, then signatures created when writing profile data and verified
// and verified when reading profile data. Leave this false if // when reading profile data. Leave this false if you want to use a profile
// you want to use a profile on different machines that don't // on different machines that don't have the same key, or else the
// have the same key, or else the profile's data will be discarded. // profile's data will be discarded.
Preference<bool> m_bSignProfileData; Preference<bool> m_bSignProfileData;
// course ranking // course ranking
@@ -262,11 +262,11 @@ public:
Preference<RString> m_sDefaultTheme; Preference<RString> m_sDefaultTheme;
Preference<RString> m_sLastSeenVideoDriver; Preference<RString> m_sLastSeenVideoDriver;
Preference<RString> m_sVideoRenderers; // StepMania.cpp sets these on first run based on the card Preference<RString> m_sVideoRenderers; // StepMania.cpp sets these on first run based on the card
Preference<bool> m_bSmoothLines; Preference<bool> m_bSmoothLines;
Preference<int> m_iSoundWriteAhead; Preference<int> m_iSoundWriteAhead;
Preference<RString> m_iSoundDevice; Preference<RString> m_iSoundDevice;
Preference<int> m_iSoundPreferredSampleRate; Preference<int> m_iSoundPreferredSampleRate;
Preference<RString> m_sLightsStepsDifficulty; Preference<RString> m_sLightsStepsDifficulty;
Preference<bool> m_bAllowUnacceleratedRenderer; Preference<bool> m_bAllowUnacceleratedRenderer;
Preference<bool> m_bThreadedInput; Preference<bool> m_bThreadedInput;
@@ -277,9 +277,9 @@ public:
Preference<RString> m_sMachineName; Preference<RString> m_sMachineName;
Preference<RString> m_sCoursesToShowRanking; Preference<RString> m_sCoursesToShowRanking;
Preference<bool> m_bQuirksMode; // enable quirky behavior desired by users of microsoft stepmania explorer 6.9 Preference<bool> m_bQuirksMode; // enable quirky behavior desired by users of microsoft stepmania explorer 6.9
/* Debug: */ // Debug:
Preference<bool> m_bLogToDisk; Preference<bool> m_bLogToDisk;
Preference<bool> m_bForceLogFlush; Preference<bool> m_bForceLogFlush;
Preference<bool> m_bShowLogOutput; Preference<bool> m_bShowLogOutput;
@@ -292,7 +292,6 @@ public:
Preference<bool> m_bEnableScoreboard; //Alows disabling of scoreboard in network play Preference<bool> m_bEnableScoreboard; //Alows disabling of scoreboard in network play
#endif #endif
void ReadPrefsFromIni( const IniFile &ini, const RString &sSection, bool bIsStatic ); void ReadPrefsFromIni( const IniFile &ini, const RString &sSection, bool bIsStatic );
void ReadGamePrefsFromIni( const RString &sIni ); void ReadGamePrefsFromIni( const RString &sIni );
void ReadDefaultsFromIni( const IniFile &ini, const RString &sSection ); void ReadDefaultsFromIni( const IniFile &ini, const RString &sSection );
@@ -313,9 +312,6 @@ protected:
void ReadDefaultsFromFile( const RString &sIni, const RString &sSection ); void ReadDefaultsFromFile( const RString &sIni, const RString &sSection );
}; };
/* This is global, because it can be accessed by crash handlers and error handlers /* 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 * that are run after PREFSMAN shuts down (and probably don't want to deref that
* pointer anyway). */ * pointer anyway). */
+21 -26
View File
@@ -40,10 +40,8 @@ static float g_fImageScaleDestination = 1;
static const ThemeMetric<RageColor> LINE_ON_COLOR ("ScreenDebugOverlay", "LineOnColor"); static const ThemeMetric<RageColor> LINE_ON_COLOR ("ScreenDebugOverlay", "LineOnColor");
static const ThemeMetric<RageColor> LINE_OFF_COLOR ("ScreenDebugOverlay", "LineOffColor"); static const ThemeMetric<RageColor> LINE_OFF_COLOR ("ScreenDebugOverlay", "LineOffColor");
//
// self-registering debug lines // self-registering debug lines
// We don't use SubscriptionManager, because we want to keep the line order. // We don't use SubscriptionManager, because we want to keep the line order.
//
static LocalizedString ON ( "ScreenDebugOverlay", "on" ); static LocalizedString ON ( "ScreenDebugOverlay", "on" );
static LocalizedString OFF ( "ScreenDebugOverlay", "off" ); static LocalizedString OFF ( "ScreenDebugOverlay", "off" );
@@ -256,6 +254,7 @@ void ScreenDebugOverlay::Init()
p->SetName( "PageText" ); p->SetName( "PageText" );
p->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "page") ); p->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "page") );
LOAD_ALL_COMMANDS( p ); LOAD_ALL_COMMANDS( p );
// todo: be able to set different values? -aj
p->SetXY( SCREEN_CENTER_X-100+iPage*100, SCREEN_TOP+20 ); p->SetXY( SCREEN_CENTER_X-100+iPage*100, SCREEN_TOP+20 );
p->SetText( *s + " (" + sButton + ")" ); p->SetText( *s + " (" + sButton + ")" );
p->SetShadowLength( 1 ); p->SetShadowLength( 1 );
@@ -299,7 +298,7 @@ void ScreenDebugOverlay::Update( float fDeltaTime )
if( INPUTFILTER->IsBeingPressed(g_Mappings.holdForFast) ) if( INPUTFILTER->IsBeingPressed(g_Mappings.holdForFast) )
{ {
if( INPUTFILTER->IsBeingPressed(g_Mappings.holdForSlow) ) if( INPUTFILTER->IsBeingPressed(g_Mappings.holdForSlow) )
fRate = 0; /* both; stop time */ fRate = 0; // both; stop time
else else
fRate *= 4; fRate *= 4;
} }
@@ -352,6 +351,7 @@ void ScreenDebugOverlay::UpdateText()
m_vptextPages[iPage]->PlayCommand( (iPage == m_iCurrentPage) ? "GainFocus" : "LoseFocus" ); m_vptextPages[iPage]->PlayCommand( (iPage == m_iCurrentPage) ? "GainFocus" : "LoseFocus" );
} }
// todo: allow changing of various spacing/location things -aj
int iOffset = 0; int iOffset = 0;
FOREACH_CONST( IDebugLine*, *g_pvpSubscribers, p ) FOREACH_CONST( IDebugLine*, *g_pvpSubscribers, p )
{ {
@@ -442,7 +442,7 @@ bool ScreenDebugOverlay::OverlayInput( const InputEventPlus &input )
if( g_bIsDisplayed && GetValueFromMap(g_Mappings.pageButton, input.DeviceI, iPage) ) if( g_bIsDisplayed && GetValueFromMap(g_Mappings.pageButton, input.DeviceI, iPage) )
{ {
if( input.type != IET_FIRST_PRESS ) 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; m_iCurrentPage = iPage;
CLAMP( m_iCurrentPage, 0, (int) m_asPages.size()-1 ); CLAMP( m_iCurrentPage, 0, (int) m_asPages.size()-1 );
return true; return true;
@@ -454,8 +454,8 @@ bool ScreenDebugOverlay::OverlayInput( const InputEventPlus &input )
int i = p-g_pvpSubscribers->begin(); int i = p-g_pvpSubscribers->begin();
// Gameplay buttons are available only in gameplay. Non-gameplay buttons are // Gameplay buttons are available only in gameplay. Non-gameplay buttons
// only available when the screen is displayed. // are only available when the screen is displayed.
switch( (*p)->GetType() ) switch( (*p)->GetType() )
{ {
case IDebugLine::all_screens: case IDebugLine::all_screens:
@@ -475,7 +475,7 @@ bool ScreenDebugOverlay::OverlayInput( const InputEventPlus &input )
if( input.DeviceI == (*p)->m_Button ) if( input.DeviceI == (*p)->m_Button )
{ {
if( input.type != IET_FIRST_PRESS ) 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 // do the action
RString sMessage; RString sMessage;
@@ -509,9 +509,7 @@ bool ScreenDebugOverlay::OverlayInput( const InputEventPlus &input )
} }
//
// DebugLine helpers // DebugLine helpers
//
static void SetSpeed() static void SetSpeed()
{ {
// PauseMusic( g_bIsHalt ); // PauseMusic( g_bIsHalt );
@@ -537,36 +535,33 @@ void ChangeVisualDelay( float fDelta )
} }
//
// DebugLines // DebugLines
//
static LocalizedString AUTO_PLAY ( "ScreenDebugOverlay", "AutoPlay" ); static LocalizedString AUTO_PLAY ( "ScreenDebugOverlay", "AutoPlay" );
static LocalizedString ASSIST ( "ScreenDebugOverlay", "Assist" ); static LocalizedString ASSIST ( "ScreenDebugOverlay", "Assist" );
static LocalizedString AUTOSYNC ( "ScreenDebugOverlay", "Autosync" ); static LocalizedString AUTOSYNC ( "ScreenDebugOverlay", "Autosync" );
static LocalizedString COIN_MODE ( "ScreenDebugOverlay", "CoinMode" ); static LocalizedString COIN_MODE ( "ScreenDebugOverlay", "CoinMode" );
static LocalizedString HALT ( "ScreenDebugOverlay", "Halt" ); static LocalizedString HALT ( "ScreenDebugOverlay", "Halt" );
static LocalizedString LIGHTS_DEBUG ( "ScreenDebugOverlay", "Lights Debug" ); static LocalizedString LIGHTS_DEBUG ( "ScreenDebugOverlay", "Lights Debug" );
static LocalizedString MONKEY_INPUT ( "ScreenDebugOverlay", "Monkey Input" ); static LocalizedString MONKEY_INPUT ( "ScreenDebugOverlay", "Monkey Input" );
static LocalizedString RENDERING_STATS ( "ScreenDebugOverlay", "Rendering Stats" ); static LocalizedString RENDERING_STATS ( "ScreenDebugOverlay", "Rendering Stats" );
static LocalizedString VSYNC ( "ScreenDebugOverlay", "Vsync" ); static LocalizedString VSYNC ( "ScreenDebugOverlay", "Vsync" );
static LocalizedString MULTITEXTURE ( "ScreenDebugOverlay", "Multitexture" ); static LocalizedString MULTITEXTURE ( "ScreenDebugOverlay", "Multitexture" );
static LocalizedString SCREEN_TEST_MODE ( "ScreenDebugOverlay", "Screen Test Mode" ); static LocalizedString SCREEN_TEST_MODE ( "ScreenDebugOverlay", "Screen Test Mode" );
static LocalizedString SCREEN_SHOW_MASKS ( "ScreenDebugOverlay", "Show Masks" ); static LocalizedString SCREEN_SHOW_MASKS ( "ScreenDebugOverlay", "Show Masks" );
static LocalizedString PROFILE ( "ScreenDebugOverlay", "Profile" ); static LocalizedString PROFILE ( "ScreenDebugOverlay", "Profile" );
static LocalizedString CLEAR_PROFILE_STATS ( "ScreenDebugOverlay", "Clear Profile Stats" ); static LocalizedString CLEAR_PROFILE_STATS ( "ScreenDebugOverlay", "Clear Profile Stats" );
static LocalizedString FILL_PROFILE_STATS ( "ScreenDebugOverlay", "Fill 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 RELOAD ( "ScreenDebugOverlay", "Reload" );
static LocalizedString RESTART ( "ScreenDebugOverlay", "Restart" ); static LocalizedString RESTART ( "ScreenDebugOverlay", "Restart" );
static LocalizedString SCREEN_ON ( "ScreenDebugOverlay", "Send On To Screen" ); static LocalizedString SCREEN_ON ( "ScreenDebugOverlay", "Send On To Screen" );
static LocalizedString SCREEN_OFF ( "ScreenDebugOverlay", "Send Off To Screen" ); static LocalizedString SCREEN_OFF ( "ScreenDebugOverlay", "Send Off To Screen" );
static LocalizedString RELOAD_THEME_AND_TEXTURES( "ScreenDebugOverlay", "Reload Theme and Textures" ); 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 WRITE_PREFERENCES ( "ScreenDebugOverlay", "Write Preferences" );
static LocalizedString MENU_TIMER ( "ScreenDebugOverlay", "Menu Timer" ); static LocalizedString MENU_TIMER ( "ScreenDebugOverlay", "Menu Timer" );
static LocalizedString FLUSH_LOG ( "ScreenDebugOverlay", "Flush Log" ); 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_UP ( "ScreenDebugOverlay", "Visual Delay Up" );
static LocalizedString VISUAL_DELAY_DOWN ( "ScreenDebugOverlay", "Visual Delay Down" ); static LocalizedString VISUAL_DELAY_DOWN ( "ScreenDebugOverlay", "Visual Delay Down" );
static LocalizedString VOLUME_UP ( "ScreenDebugOverlay", "Volume Up" ); 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 UPTIME ( "ScreenDebugOverlay", "Uptime" );
static LocalizedString FORCE_CRASH ( "ScreenDebugOverlay", "Force Crash" ); static LocalizedString FORCE_CRASH ( "ScreenDebugOverlay", "Force Crash" );
static LocalizedString SLOW ( "ScreenDebugOverlay", "Slow" ); static LocalizedString SLOW ( "ScreenDebugOverlay", "Slow" );
static LocalizedString CPU ( "ScreenDebugOverlay", "CPU" ); static LocalizedString CPU ( "ScreenDebugOverlay", "CPU" );
static LocalizedString SONG ( "ScreenDebugOverlay", "Song" ); static LocalizedString SONG ( "ScreenDebugOverlay", "Song" );
static LocalizedString MACHINE ( "ScreenDebugOverlay", "Machine" ); static LocalizedString MACHINE ( "ScreenDebugOverlay", "Machine" );
static LocalizedString SYNC_TEMPO ( "ScreenDebugOverlay", "Tempo" ); static LocalizedString SYNC_TEMPO ( "ScreenDebugOverlay", "Tempo" );
class DebugLineAutoplay : public IDebugLine class DebugLineAutoplay : public IDebugLine
@@ -882,8 +877,8 @@ static void FillProfileStats( Profile *pProfile )
pProfile->InitCourseScores(); pProfile->InitCourseScores();
static int s_iCount = 0; static int s_iCount = 0;
// Choose a percent for all scores. This is useful for testing unlocks // Choose a percent for all scores. This is useful for testing unlocks
// where some elements are unlocked at a certain percent complete // where some elements are unlocked at a certain percent complete.
float fPercentDP = s_iCount ? randomf( 0.6f, 1.0f ) : 1.0f; float fPercentDP = s_iCount ? randomf( 0.6f, 1.0f ) : 1.0f;
s_iCount = (s_iCount+1)%2; s_iCount = (s_iCount+1)%2;
@@ -1032,7 +1027,7 @@ class DebugLineReloadTheme : public IDebugLine
TEXTUREMAN->ReloadAll(); TEXTUREMAN->ReloadAll();
NOTESKIN->RefreshNoteSkinData( GAMESTATE->m_pCurGame ); NOTESKIN->RefreshNoteSkinData( GAMESTATE->m_pCurGame );
CodeDetector::RefreshCacheItems(); 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. // was just destroyed as part of the theme reload.
IDebugLine::DoAndLog( sMessageOut ); IDebugLine::DoAndLog( sMessageOut );
} }
+1 -1
View File
@@ -66,7 +66,7 @@ void StepsDisplay::Load( const RString &sMetricsGroup, const PlayerState *pPlaye
if( m_bShowTicks ) 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.SetName( "Ticks" );
m_textTicks.LoadFromTextureAndChars( THEME->GetPathF(m_sMetricsGroup,"ticks"), sChars ); m_textTicks.LoadFromTextureAndChars( THEME->GetPathF(m_sMetricsGroup,"ticks"), sChars );
ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textTicks, m_sMetricsGroup ); ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textTicks, m_sMetricsGroup );