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()
{
// 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<Date,int>::const_iterator begin, map<Date,int>::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; i<DAYS_IN_WEEK; i++ )
+5 -5
View File
@@ -24,7 +24,7 @@ void ComboGraph::Load( RString sMetricsGroup )
BODY_WIDTH.Load( sMetricsGroup, "BodyWidth" );
Actor *pActor = NULL;
m_pBacking = ActorUtil::MakeActor( THEME->GetPathG(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 );
-2
View File
@@ -18,9 +18,7 @@ public:
virtual ComboGraph *Copy() const;
virtual bool AutoLoadChildren() const { return true; }
//
// Commands
//
virtual void PushSelf( lua_State *L );
private:
+6 -6
View File
@@ -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
+14 -14
View File
@@ -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; t<in.GetNumTracks(); ++t )
{
int iHeadRow;
@@ -113,8 +113,8 @@ int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex =
continue;
const TapNote &tn = in.GetTapNote( t, iHeadRow );
/* If a hold is released *after* a hands containing it, the hands is
* still good. So, ignore the judgement and only examine iLastHeldRow
/* If a hold is released *after* a hand containing it, the hand is
* still good. Ignore the judgement and only examine iLastHeldRow
* 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
* and this won't fail--but the tap check above will have already failed.) */
@@ -152,7 +152,7 @@ int LastTapNoteScoreTrack( const NoteData &in, unsigned iRow, PlayerNumber pn )
float tm = tn.result.fTapNoteOffset;
if(tm < scoretime) continue;
scoretime = tm;
best_track = t;
}
@@ -227,7 +227,6 @@ const TapNote &NoteDataWithScoring::LastTapNoteWithResult( const NoteData &in, u
return in.GetTapNote( iTrack, iRow );
}
/* 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. */
TapNoteScore NoteDataWithScoring::MinTapNoteScore( const NoteData &in, unsigned row )
@@ -236,7 +235,7 @@ TapNoteScore NoteDataWithScoring::MinTapNoteScore( const NoteData &in, unsigned
TapNoteScore score = TNS_W1;
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 );
if( tn.type == TapNote::empty || tn.type == TapNote::mine || tn.type == TapNote::fake )
continue;
@@ -254,7 +253,7 @@ bool NoteDataWithScoring::IsRowCompletelyJudged( const NoteData &in, unsigned ro
namespace
{
/* Return the ratio of actual to possible Bs. */
// Return the ratio of actual to possible Bs.
float GetActualStreamRadarValue( const NoteData &in, float fSongSeconds )
{
int iTotalSteps = in.GetNumTapNotes();
@@ -268,10 +267,11 @@ float GetActualStreamRadarValue( const NoteData &in, float fSongSeconds )
/* Return the ratio of actual combo to max combo. */
float GetActualVoltageRadarValue( const NoteData &in, float fSongSeconds, const PlayerStageStats &pss )
{
/* 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. */
/* 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 );
+27 -25
View File
@@ -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<PlayerStageStats>
{
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<TapNoteScore>(L, 1)] )
DEFINE_METHOD( GetHoldNoteScores, m_iHoldNoteScores[Enum::Check<HoldNoteScore>(L, 1)] )
DEFINE_METHOD( FullCombo, FullCombo() )
DEFINE_METHOD( GetScore, m_iScore )
DEFINE_METHOD( GetTapNoteScores, m_iTapNoteScores[Enum::Check<TapNoteScore>(L, 1)] )
DEFINE_METHOD( GetHoldNoteScores, m_iHoldNoteScores[Enum::Check<HoldNoteScore>(L, 1)] )
DEFINE_METHOD( FullCombo, FullCombo() )
DEFINE_METHOD( FullComboOfScore, FullComboOfScore( Enum::Check<TapNoteScore>(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<TapNoteScore>(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 );
}
};
+11 -11
View File
@@ -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<Combo_t> 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;
+10 -8
View File
@@ -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; s<m_ActiveAttacks.size(); 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
// converted into the current music time.
ASSERT( attack.fStartSecond != -1 );
@@ -78,7 +78,7 @@ void PlayerState::Update( float fDelta )
GAMESTATE->m_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<PlayerState>
{
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 );
}
+15 -17
View File
@@ -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<Attack> m_ModsToApply;
vector<Attack> 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 );
+45 -49
View File
@@ -147,15 +147,15 @@ protected:
public:
Preference<bool> m_bWindowed;
Preference<int> m_iDisplayWidth;
Preference<int> m_iDisplayHeight;
Preference<int> m_iDisplayWidth;
Preference<int> m_iDisplayHeight;
Preference<float> m_fDisplayAspectRatio;
Preference<int> m_iDisplayColorDepth;
Preference<int> m_iTextureColorDepth;
Preference<int> m_iMovieColorDepth;
Preference<int> m_iDisplayColorDepth;
Preference<int> m_iTextureColorDepth;
Preference<int> m_iMovieColorDepth;
Preference<HighResolutionTextures> m_HighResolutionTextures;
Preference<int> m_iMaxTextureResolution;
Preference<int> m_iRefreshRate;
Preference<int> m_iMaxTextureResolution;
Preference<int> m_iRefreshRate;
Preference<bool> m_bAllowMultitexture;
Preference<bool> m_bShowStats;
Preference<bool> m_bShowBanners;
@@ -169,7 +169,7 @@ public:
Preference<BannerCacheMode> m_BannerCache;
Preference<BackgroundCacheMode> m_BackgroundCache;
Preference<bool> m_bFastLoad;
Preference<bool> m_bFastLoadAdditionalSongs;
Preference<bool> m_bFastLoadAdditionalSongs;
Preference<bool> m_bOnlyDedicatedMenuButtons;
Preference<bool> m_bMenuTimer;
@@ -177,27 +177,27 @@ public:
Preference<float> m_fLifeDifficultyScale;
// Whoever added these: Please add a comment saying what they do. -Chris
Preference<int> m_iRegenComboAfterMiss;
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<int> m_iRegenComboAfterMiss;
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_bFailOffInBeginner;
Preference<bool> m_bFailOffForFirstStageEasy;
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_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_bDelayedBack;
Preference<bool> m_bShowInstructions; // how to play a mode
Preference<bool> m_bShowSelectGroup; // uh i thought we removed this shit
Preference<bool> m_bShowInstructions; // how to play a mode
Preference<bool> m_bShowSelectGroup; // uh i thought we removed this shit -aj
Preference<bool> m_bShowCaution;
Preference<bool> m_bShowNativeLanguage;
Preference<int> m_iArcadeOptionsNavigation;
Preference<int> m_iArcadeOptionsNavigation;
Preference<MusicWheelUsesSections> m_MusicWheelUsesSections;
Preference<int> m_iMusicWheelSwitchSpeed;
Preference<AllowW1> m_AllowW1; // this should almost always be on, given use cases.
Preference<bool> m_bEventMode; // IF THIS IS NOT TRUE I WILL SHIT IN YOUR MOUTH -aj
Preference<int> m_iCoinsPerCredit;
Preference<int> m_iSongsPerPlay;
Preference<bool> m_bDelayedCreditsReconcile; // zuh?
Preference<Maybe> m_ShowSongOptions;
Preference<int> m_iMusicWheelSwitchSpeed;
Preference<AllowW1> m_AllowW1; // this should almost always be on, given use cases. -aj
Preference<bool> m_bEventMode;
Preference<int> m_iCoinsPerCredit;
Preference<int> m_iSongsPerPlay;
Preference<bool> m_bDelayedCreditsReconcile; // zuh?
Preference<Maybe> m_ShowSongOptions;
Preference<bool> m_bDancePointsForOni;
Preference<bool> m_bPercentageScoring;
Preference<float> m_fMinPercentageForMachineSongHighScore;
@@ -211,22 +211,22 @@ public:
Preference<ShowDancingCharacters> m_ShowDancingCharacters;
Preference<bool> m_bUseUnlockSystem;
Preference<float> m_fGlobalOffsetSeconds;
Preference<int> m_iProgressiveLifebar;
Preference<int> m_iProgressiveStageLifebar;
Preference<int> m_iProgressiveNonstopLifebar;
Preference<int> m_iProgressiveLifebar;
Preference<int> m_iProgressiveStageLifebar;
Preference<int> m_iProgressiveNonstopLifebar;
Preference<bool> m_bShowBeginnerHelper;
Preference<bool> m_bDisableScreenSaver;
Preference<RString> m_sLanguage;
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_iCenterImageTranslateX;
Preference<int> m_iCenterImageTranslateY;
Preference<int> m_fCenterImageAddWidth;
Preference<int> m_fCenterImageAddHeight;
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_iCenterImageTranslateX;
Preference<int> m_iCenterImageTranslateY;
Preference<int> m_fCenterImageAddWidth;
Preference<int> m_fCenterImageAddHeight;
Preference<AttractSoundFrequency> m_AttractSoundFrequency;
Preference<bool> m_bAllowExtraStage;
Preference<int> m_iMaxHighScoresPerListForMachine;
Preference<int> m_iMaxHighScoresPerListForPlayer;
Preference<int> m_iMaxHighScoresPerListForMachine;
Preference<int> m_iMaxHighScoresPerListForPlayer;
Preference<bool> m_bAllowMultipleHighScoreWithSameName;
Preference<bool> m_bCelShadeModels;
Preference<bool> m_bPreferredSortUsesGroups;
@@ -241,15 +241,15 @@ public:
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.
// 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<bool> m_bSignProfileData;
// course ranking
Preference<CourseSortOrders> m_CourseSortOrder;
Preference<bool> m_bSubSortByNumSteps;
Preference<bool> m_bSubSortByNumSteps;
Preference<GetRankingName> m_GetRankingName;
Preference<ScoringType> m_ScoringType;
@@ -262,11 +262,11 @@ public:
Preference<RString> m_sDefaultTheme;
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<int> m_iSoundWriteAhead;
Preference<int> m_iSoundWriteAhead;
Preference<RString> m_iSoundDevice;
Preference<int> m_iSoundPreferredSampleRate;
Preference<int> m_iSoundPreferredSampleRate;
Preference<RString> m_sLightsStepsDifficulty;
Preference<bool> m_bAllowUnacceleratedRenderer;
Preference<bool> m_bThreadedInput;
@@ -277,9 +277,9 @@ public:
Preference<RString> m_sMachineName;
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_bForceLogFlush;
Preference<bool> m_bShowLogOutput;
@@ -292,7 +292,6 @@ public:
Preference<bool> 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). */
+22 -27
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_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 );
}
+1 -1
View File
@@ -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 );