comment/cleanup
This commit is contained in:
+16
-23
@@ -287,11 +287,9 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
// Somthing below may set m_pTempState to tempState
|
||||
m_pTempState = &m_current;
|
||||
|
||||
|
||||
//
|
||||
// set temporary drawing properties based on Effects
|
||||
//
|
||||
// set temporary drawing properties based on Effects
|
||||
static TweenState tempState;
|
||||
|
||||
// todo: account for SSC_FUTURES -aj
|
||||
if( m_Effect == no_effect )
|
||||
{
|
||||
@@ -305,7 +303,6 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
ASSERT( fTotalPeriod > 0 );
|
||||
const float fTimeIntoEffect = fmodfp( m_fSecsIntoEffect+m_fEffectOffset, fTotalPeriod );
|
||||
|
||||
|
||||
float fPercentThroughEffect;
|
||||
if( fTimeIntoEffect < m_fEffectRampUp )
|
||||
{
|
||||
@@ -336,7 +333,6 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
ASSERT_M( fPercentThroughEffect >= 0 && fPercentThroughEffect <= 1,
|
||||
ssprintf("PercentThroughEffect: %f", fPercentThroughEffect) );
|
||||
|
||||
|
||||
bool bBlinkOn = fPercentThroughEffect > 0.5f;
|
||||
float fPercentBetweenColors = RageFastSin( (fPercentThroughEffect + 0.25f) * 2 * PI ) / 2 + 0.5f;
|
||||
ASSERT_M( fPercentBetweenColors >= 0 && fPercentBetweenColors <= 1,
|
||||
@@ -440,7 +436,6 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( m_fBaseAlpha != 1 )
|
||||
{
|
||||
if( m_pTempState != &tempState )
|
||||
@@ -453,7 +448,6 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
tempState.diffuse[i].a *= m_fBaseAlpha;
|
||||
}
|
||||
|
||||
|
||||
if( m_pTempState->pos.x != 0 || m_pTempState->pos.y != 0 || m_pTempState->pos.z != 0 )
|
||||
{
|
||||
RageMatrix m;
|
||||
@@ -468,7 +462,7 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
|
||||
{
|
||||
/* The only time rotation and quat should normally be used simultaneously
|
||||
* is for m_baseRotation. Most objects aren't rotated at all, so optimize
|
||||
* is for m_baseRotation. Most objects aren't rotated at all, so optimize
|
||||
* that case. */
|
||||
const float fRotateX = m_pTempState->rotation.x + m_baseRotation.x;
|
||||
const float fRotateY = m_pTempState->rotation.y + m_baseRotation.y;
|
||||
@@ -580,7 +574,7 @@ void Actor::UpdateTweening( float fDeltaTime )
|
||||
|
||||
// update current tween state
|
||||
// earliest tween
|
||||
TweenState &TS = m_Tweens[0]->state;
|
||||
TweenState &TS = m_Tweens[0]->state;
|
||||
TweenInfo &TI = m_Tweens[0]->info;
|
||||
|
||||
bool bBeginning = TI.m_fTimeLeftInTween == TI.m_fTweenTime;
|
||||
@@ -591,7 +585,7 @@ void Actor::UpdateTweening( float fDeltaTime )
|
||||
|
||||
RString sCommand = TI.m_sCommandName;
|
||||
if( bBeginning ) // we are just beginning this tween
|
||||
m_start = m_current; // set the start position
|
||||
m_start = m_current; // set the start position
|
||||
|
||||
if( TI.m_fTimeLeftInTween == 0 ) // Current tween is over. Stop.
|
||||
{
|
||||
@@ -601,7 +595,7 @@ void Actor::UpdateTweening( float fDeltaTime )
|
||||
delete m_Tweens.front();
|
||||
m_Tweens.erase( m_Tweens.begin() );
|
||||
}
|
||||
else // in the middle of tweening. Recalcute the current position.
|
||||
else // in the middle of tweening. Recalcute the current position.
|
||||
{
|
||||
const float fPercentThroughTween = 1-(TI.m_fTimeLeftInTween / TI.m_fTweenTime);
|
||||
|
||||
@@ -612,8 +606,8 @@ void Actor::UpdateTweening( float fDeltaTime )
|
||||
|
||||
if( bBeginning )
|
||||
{
|
||||
// Execute the command in this tween (if any). Do this last, and don't access
|
||||
// TI or TS after, since this may modify the tweening queue.
|
||||
// Execute the command in this tween (if any). Do this last, and don't
|
||||
// access TI or TS after, since this may modify the tweening queue.
|
||||
if( !sCommand.empty() )
|
||||
{
|
||||
if( sCommand.Left(1) == "!" )
|
||||
@@ -641,7 +635,7 @@ void Actor::Update( float fDeltaTime )
|
||||
if( m_fHibernateSecondsLeft > 0 )
|
||||
return;
|
||||
|
||||
/* Grab the leftover time. */
|
||||
// Grab the leftover time.
|
||||
fDeltaTime = -m_fHibernateSecondsLeft;
|
||||
m_fHibernateSecondsLeft = 0;
|
||||
}
|
||||
@@ -660,8 +654,8 @@ void Actor::UpdateInternal( float fDeltaTime )
|
||||
m_fSecsIntoEffect += fDeltaTime;
|
||||
m_fEffectDelta = fDeltaTime;
|
||||
|
||||
/* Wrap the counter, so it doesn't increase indefinitely (causing loss of
|
||||
* precision if a screen is left to sit for a day). */
|
||||
/* Wrap the counter, so it doesn't increase indefinitely (causing loss
|
||||
* of precision if a screen is left to sit for a day). */
|
||||
if( m_fSecsIntoEffect >= GetEffectPeriod() )
|
||||
m_fSecsIntoEffect -= GetEffectPeriod();
|
||||
break;
|
||||
@@ -1094,18 +1088,16 @@ float Actor::GetTweenTimeLeft() const
|
||||
return tot;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a hack to change all tween states while leaving existing tweens alone.
|
||||
/* This is a hack to change all tween states while leaving existing tweens alone.
|
||||
*
|
||||
* Hmm. Most commands actually act on a TweenStateAndInfo, not the Actor itself.
|
||||
* Hmm. Most commands actually act on a TweenStateAndInfo, not the Actor itself.
|
||||
* Conceptually, it wouldn't be hard to give TweenState a presence in Lua, so
|
||||
* we can simply say eg. "for x in states(Actor) do x.SetDiffuseColor(c) end".
|
||||
* However, we'd then have to give every TweenState a userdata in Lua while it's
|
||||
* being manipulated, which would add overhead ...
|
||||
*/
|
||||
* being manipulated, which would add overhead ... */
|
||||
void Actor::SetGlobalDiffuseColor( RageColor c )
|
||||
{
|
||||
for( int i=0; i<4; i++ ) /* color, not alpha */
|
||||
for( int i=0; i<4; i++ ) // color, not alpha
|
||||
{
|
||||
for( unsigned ts = 0; ts < m_Tweens.size(); ++ts )
|
||||
{
|
||||
@@ -1189,6 +1181,7 @@ void Actor::TweenState::MakeWeightedAverage( TweenState& average_out, const Twee
|
||||
|
||||
for( int i=0; i<4; ++i )
|
||||
average_out.diffuse[i] = lerp( fPercentBetween, ts1.diffuse[i], ts2.diffuse[i] );
|
||||
|
||||
average_out.glow = lerp( fPercentBetween, ts1.glow, ts2.glow );
|
||||
average_out.aux = lerp( fPercentBetween, ts1.aux, ts2.aux );
|
||||
}
|
||||
|
||||
@@ -541,7 +541,7 @@ void BGAnimationLayer::UpdateInternal( float fDeltaTime )
|
||||
{
|
||||
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
||||
{
|
||||
/* XXX: there's no longer any guarantee that this is a Sprite */
|
||||
// XXX: there's no longer any guarantee that this is a Sprite
|
||||
Sprite *pSprite = (Sprite*)m_SubActors[i];
|
||||
pSprite->StretchTexCoords(
|
||||
fDeltaTime*m_fTexCoordVelocityX,
|
||||
|
||||
+5
-7
@@ -13,19 +13,17 @@
|
||||
|
||||
REGISTER_ACTOR_CLASS( BitmapText )
|
||||
|
||||
/*
|
||||
* XXX: Changing a whole array of diffuse colors every frame (several times) is a waste,
|
||||
* when we're usually setting them all to the same value. Rainbow and fading are annoying
|
||||
* to optimize, but rarely used. Iterating over every character in Draw() is dumb.
|
||||
*/
|
||||
/* XXX: Changing a whole array of diffuse colors every frame (several times) is
|
||||
* a waste, when we're usually setting them all to the same value. Rainbow and
|
||||
* fading are annoying to optimize, but rarely used. Iterating over every
|
||||
* character in Draw() is dumb. */
|
||||
|
||||
/* XXX:
|
||||
* We need some kind of font modifier string for metrics. For example,
|
||||
* "valign=top;spacing = x+5,y+2"
|
||||
*
|
||||
* Better, we could go all the way, drop all of the actor-specific font aliases,
|
||||
* and do "font=header2;valign=top;...".
|
||||
*/
|
||||
* and do "font=header2;valign=top;...". */
|
||||
#define NUM_RAINBOW_COLORS THEME->GetMetricI("BitmapText","NumRainbowColors")
|
||||
#define RAINBOW_COLOR(n) THEME->GetMetricC("BitmapText",ssprintf("RainbowColor%i", n+1))
|
||||
|
||||
|
||||
+2
-2
@@ -669,8 +669,8 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
|
||||
}
|
||||
|
||||
/* Hack: If any entry was non-FIXED, or m_bShuffle is set, then radar values
|
||||
* for this trail will be meaningless as they'll change every time. Pre-cache
|
||||
* empty data. XXX: How can we do this cleanly, without propagating lots of
|
||||
* for this trail will be meaningless as they'll change every time. Pre-cache
|
||||
* empty data. XXX: How can we do this cleanly, without propagating lots of
|
||||
* otherwise unnecessary data (course entry types, m_bShuffle) to Trail, or
|
||||
* storing a Course pointer in Trail (yuck)? */
|
||||
if( !AllSongsAreFixed() || m_bShuffle )
|
||||
|
||||
+14
-16
@@ -13,14 +13,12 @@
|
||||
|
||||
REGISTER_ACTOR_CLASS( FadingBanner )
|
||||
|
||||
/*
|
||||
* Allow fading from one banner to another. We can handle two fades at once;
|
||||
/* Allow fading from one banner to another. We can handle two fades at once;
|
||||
* this is used to fade from an old banner to a low-quality banner to a high-
|
||||
* quality banner smoothly.
|
||||
*
|
||||
* m_iIndexLatest is the latest banner loaded, and the one that we'll end up
|
||||
* displaying when the fades stop.
|
||||
*/
|
||||
* displaying when the fades stop. */
|
||||
FadingBanner::FadingBanner()
|
||||
{
|
||||
m_bMovingFast = false;
|
||||
@@ -60,7 +58,7 @@ void FadingBanner::DrawPrimitives()
|
||||
// draw manually
|
||||
// ActorFrame::DrawPrimitives();
|
||||
|
||||
/* Render the latest banner first. */
|
||||
// Render the latest banner first.
|
||||
for( int i = 0; i < NUM_BANNERS; ++i )
|
||||
{
|
||||
int index = m_iIndexLatest - i;
|
||||
@@ -73,7 +71,7 @@ void FadingBanner::Load( RageTextureID ID, bool bLowResToHighRes )
|
||||
{
|
||||
BeforeChange( bLowResToHighRes );
|
||||
m_Banner[m_iIndexLatest].Load(ID);
|
||||
|
||||
|
||||
/* XXX: Hack to keep movies from updating multiple times.
|
||||
* We need to either completely disallow movies in banners or support
|
||||
* them. There are a number of files that use them currently in the
|
||||
@@ -89,7 +87,7 @@ void FadingBanner::Load( RageTextureID ID, bool bLowResToHighRes )
|
||||
wrap( index, NUM_BANNERS );
|
||||
if( m_Banner[index].GetTexturePath() == ID.filename )
|
||||
m_Banner[index].UnloadTexture();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If bLowResToHighRes is true, we're fading from a low-res banner to the
|
||||
@@ -108,8 +106,8 @@ void FadingBanner::BeforeChange( bool bLowResToHighRes )
|
||||
|
||||
m_Banner[m_iIndexLatest].PlayCommand( "ResetFade" );
|
||||
|
||||
/* We're about to load a banner. It'll probably cause a frame skip or
|
||||
* two. Skip an update, so the fade-in doesn't skip. */
|
||||
/* We're about to load a banner. It'll probably cause a frame skip or two.
|
||||
* Skip an update, so the fade-in doesn't skip. */
|
||||
m_bSkipNextBannerUpdate = true;
|
||||
}
|
||||
|
||||
@@ -117,7 +115,7 @@ void FadingBanner::BeforeChange( bool bLowResToHighRes )
|
||||
* banner should be loaded later. */
|
||||
bool FadingBanner::LoadFromCachedBanner( const RString &path )
|
||||
{
|
||||
/* If we're already on the given banner, don't fade again. */
|
||||
// If we're already on the given banner, don't fade again.
|
||||
if( path != "" && m_Banner[m_iIndexLatest].GetTexturePath() == path )
|
||||
return false;
|
||||
|
||||
@@ -138,16 +136,16 @@ bool FadingBanner::LoadFromCachedBanner( const RString &path )
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Try to load the low quality version. */
|
||||
// Try to load the low quality version.
|
||||
ID = BANNERCACHE->LoadCachedBanner( path );
|
||||
}
|
||||
|
||||
if( !TEXTUREMAN->IsTextureRegistered(ID) )
|
||||
{
|
||||
/* Oops. We couldn't load a banner quickly. We can load the actual
|
||||
/* Oops. We couldn't load a banner quickly. We can load the actual
|
||||
* banner, but that's slow, so we don't want to do that when we're moving
|
||||
* fast on the music wheel. In that case, we should just keep the banner
|
||||
* that's there (or load a "moving fast" banner). Once we settle down,
|
||||
* fast on the music wheel. In that case, we should just keep the banner
|
||||
* that's there (or load a "moving fast" banner). Once we settle down,
|
||||
* we'll get called again and load the real banner. */
|
||||
|
||||
if( m_bMovingFast )
|
||||
@@ -174,7 +172,7 @@ void FadingBanner::LoadFromSong( const Song* pSong )
|
||||
return;
|
||||
}
|
||||
|
||||
/* Don't call HasBanner. That'll do disk access and cause the music wheel
|
||||
/* Don't call HasBanner. That'll do disk access and cause the music wheel
|
||||
* to skip. */
|
||||
RString sPath = pSong->GetBannerPath();
|
||||
if( sPath.empty() )
|
||||
@@ -209,7 +207,7 @@ void FadingBanner::LoadFromCourse( const Course* pCourse )
|
||||
return;
|
||||
}
|
||||
|
||||
/* Don't call HasBanner. That'll do disk access and cause the music wheel
|
||||
/* Don't call HasBanner. That'll do disk access and cause the music wheel
|
||||
* to skip. */
|
||||
RString sPath = pCourse->GetBannerPath();
|
||||
if( sPath.empty() )
|
||||
|
||||
+38
-40
@@ -107,24 +107,24 @@ static Preference<Premium> g_Premium( "Premium", Premium_Off );
|
||||
Preference<bool> GameState::m_bAutoJoin( "AutoJoin", false );
|
||||
|
||||
GameState::GameState() :
|
||||
m_pCurGame( Message_CurrentGameChanged ),
|
||||
m_pCurGame( Message_CurrentGameChanged ),
|
||||
m_pCurStyle( Message_CurrentStyleChanged ),
|
||||
m_PlayMode( Message_PlayModeChanged ),
|
||||
m_iCoins( Message_CoinsChanged ),
|
||||
m_sPreferredSongGroup( Message_PreferredSongGroupChanged ),
|
||||
m_PlayMode( Message_PlayModeChanged ),
|
||||
m_iCoins( Message_CoinsChanged ),
|
||||
m_sPreferredSongGroup( Message_PreferredSongGroupChanged ),
|
||||
m_sPreferredCourseGroup( Message_PreferredCourseGroupChanged ),
|
||||
m_PreferredStepsType( Message_PreferredStepsTypeChanged ),
|
||||
m_PreferredDifficulty( Message_PreferredDifficultyP1Changed ),
|
||||
m_PreferredStepsType( Message_PreferredStepsTypeChanged ),
|
||||
m_PreferredDifficulty( Message_PreferredDifficultyP1Changed ),
|
||||
m_PreferredCourseDifficulty( Message_PreferredCourseDifficultyP1Changed ),
|
||||
m_SortOrder( Message_SortOrderChanged ),
|
||||
m_pCurSong( Message_CurrentSongChanged ),
|
||||
m_pCurSong( Message_CurrentSongChanged ),
|
||||
m_pCurSteps( Message_CurrentStepsP1Changed ),
|
||||
m_pCurCourse( Message_CurrentCourseChanged ),
|
||||
m_pCurTrail( Message_CurrentTrailP1Changed ),
|
||||
m_bGameplayLeadIn( Message_GameplayLeadInChanged ),
|
||||
m_bDidModeChangeNoteSkin( false ),
|
||||
m_stEdit( Message_EditStepsTypeChanged ),
|
||||
m_cdEdit( Message_EditCourseDifficultyChanged ),
|
||||
m_stEdit( Message_EditStepsTypeChanged ),
|
||||
m_cdEdit( Message_EditCourseDifficultyChanged ),
|
||||
m_pEditSourceSteps( Message_EditSourceStepsChanged ),
|
||||
m_stEditSource( Message_EditSourceStepsTypeChanged ),
|
||||
m_iEditCourseEntryIndex( Message_EditCourseEntryIndexChanged ),
|
||||
@@ -160,8 +160,7 @@ GameState::GameState() :
|
||||
|
||||
m_Environment = new LuaTable;
|
||||
|
||||
/* Don't reset yet; let the first screen do it, so we can
|
||||
* use PREFSMAN and THEME. */
|
||||
// Don't reset yet; let the first screen do it, so we can use PREFSMAN and THEME.
|
||||
// Reset();
|
||||
|
||||
// Register with Lua.
|
||||
@@ -296,8 +295,8 @@ void GameState::Reset()
|
||||
SONGMAN->UpdatePopular();
|
||||
SONGMAN->UpdateShuffled();
|
||||
|
||||
/* We may have cached trails from before everything was loaded (eg. from before
|
||||
* SongManager::UpdatePopular could be called). Erase the cache. */
|
||||
/* We may have cached trails from before everything was loaded (eg. from
|
||||
* before SongManager::UpdatePopular could be called). Erase the cache. */
|
||||
SONGMAN->RegenerateNonFixedCourses();
|
||||
|
||||
STATSMAN->Reset();
|
||||
@@ -391,7 +390,7 @@ void GameState::UnjoinPlayer( PlayerNumber pn )
|
||||
msg.SetParam( "Player", pn );
|
||||
MESSAGEMAN->Broadcast( msg );
|
||||
|
||||
/* If there are no players left, reset some non-player-specific stuff, too. */
|
||||
// If there are no players left, reset some non-player-specific stuff, too.
|
||||
if( m_MasterPlayerNumber == PLAYER_INVALID )
|
||||
{
|
||||
SongOptions so;
|
||||
@@ -401,7 +400,7 @@ void GameState::UnjoinPlayer( PlayerNumber pn )
|
||||
}
|
||||
}
|
||||
|
||||
/* multiplayer join? */
|
||||
/* handle multiplayer join? */
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -410,11 +409,11 @@ namespace
|
||||
if( !GAMESTATE->PlayersCanJoin() )
|
||||
return false;
|
||||
|
||||
/* If this side is already in, don't re-join. */
|
||||
// If this side is already in, don't re-join.
|
||||
if( GAMESTATE->m_bSideIsJoined[pn] )
|
||||
return false;
|
||||
|
||||
/* subtract coins */
|
||||
// subtract coins
|
||||
int iCoinsNeededToJoin = GAMESTATE->GetCoinsNeededToJoin();
|
||||
|
||||
if( GAMESTATE->m_iCoins < iCoinsNeededToJoin )
|
||||
@@ -428,17 +427,17 @@ namespace
|
||||
}
|
||||
};
|
||||
|
||||
/* Handle an input that can join a player. Return true if the player joined. */
|
||||
// Handle an input that can join a player. Return true if the player joined
|
||||
bool GameState::JoinInput( PlayerNumber pn )
|
||||
{
|
||||
/* When AutoJoin is enabled, join all players on a single start press. */
|
||||
// When AutoJoin is enabled, join all players on a single start press.
|
||||
if( GAMESTATE->m_bAutoJoin.Get() )
|
||||
return JoinPlayers();
|
||||
else
|
||||
return JoinInputInternal( pn );
|
||||
}
|
||||
|
||||
/* Attempt to join all players, as if each player pressed Start. */
|
||||
// Attempt to join all players, as if each player pressed Start.
|
||||
bool GameState::JoinPlayers()
|
||||
{
|
||||
bool bJoined = false;
|
||||
@@ -465,8 +464,7 @@ int GameState::GetCoinsNeededToJoin() const
|
||||
return iCoinsToCharge;
|
||||
}
|
||||
|
||||
/*
|
||||
* Game flow:
|
||||
/* Game flow:
|
||||
*
|
||||
* BeginGame() - the first player has joined; the game is starting.
|
||||
*
|
||||
@@ -481,8 +479,7 @@ int GameState::GetCoinsNeededToJoin() const
|
||||
* is up-to-date for Evaluation.
|
||||
*
|
||||
* FinishStage() - gameplay and evaluation is finished
|
||||
* Clears data which was stored by CommitStageStats.
|
||||
*/
|
||||
* Clears data which was stored by CommitStageStats. */
|
||||
void GameState::BeginGame()
|
||||
{
|
||||
m_timeGameStarted.Touch();
|
||||
@@ -499,7 +496,7 @@ void GameState::BeginGame()
|
||||
|
||||
void GameState::LoadProfiles( bool bLoadEdits )
|
||||
{
|
||||
/* Unlock any cards that we might want to load. */
|
||||
// Unlock any cards that we might want to load.
|
||||
FOREACH_HumanPlayer( pn )
|
||||
if( !PROFILEMAN->IsPersistentProfile(pn) )
|
||||
MEMCARDMAN->UnlockCard( pn );
|
||||
@@ -519,7 +516,7 @@ void GameState::LoadProfiles( bool bLoadEdits )
|
||||
if( !bSuccess )
|
||||
continue;
|
||||
|
||||
/* Lock the card on successful load, so we won't allow it to be changed. */
|
||||
// Lock the card on successful load, so we won't allow it to be changed.
|
||||
MEMCARDMAN->LockCard( pn );
|
||||
|
||||
LoadCurrentSettingsFromProfile( pn );
|
||||
@@ -540,6 +537,7 @@ void GameState::SavePlayerProfile( PlayerNumber pn )
|
||||
{
|
||||
if( !PROFILEMAN->IsPersistentProfile(pn) )
|
||||
return;
|
||||
|
||||
// AutoplayCPU should not save scores. -aj
|
||||
// xxx: this MAY cause issues with Multiplayer. However, without a working
|
||||
// Multiplayer build, we'll never know. -aj
|
||||
@@ -558,11 +556,11 @@ bool GameState::HaveProfileToLoad()
|
||||
{
|
||||
FOREACH_HumanPlayer( pn )
|
||||
{
|
||||
/* We won't load this profile if it's already loaded. */
|
||||
// We won't load this profile if it's already loaded.
|
||||
if( PROFILEMAN->IsPersistentProfile(pn) )
|
||||
continue;
|
||||
|
||||
/* If a memory card is inserted, we'l try to load it. */
|
||||
// If a memory card is inserted, we'l try to load it.
|
||||
if( MEMCARDMAN->CardInserted(pn) )
|
||||
return true;
|
||||
if( !PROFILEMAN->m_sDefaultLocalProfileID[pn].Get().empty() )
|
||||
@@ -637,7 +635,7 @@ int GameState::GetNumStagesForCurrentSongAndStepsOrCourse() const
|
||||
// pCurSteps will still be set while no players are joined. -Chris
|
||||
if( pSteps && numSidesJoined > 0 )
|
||||
{
|
||||
/* If a style isn't set, use the style of the selected steps. */
|
||||
// If a style isn't set, use the style of the selected steps.
|
||||
StepsType st = pSteps->m_StepsType;
|
||||
pStyle = GAMEMAN->GetFirstCompatibleStyle( m_pCurGame, numSidesJoined, st );
|
||||
}
|
||||
@@ -652,7 +650,8 @@ int GameState::GetNumStagesForCurrentSongAndStepsOrCourse() const
|
||||
pStyle = vpStyles[0];
|
||||
}
|
||||
}
|
||||
/* Extra stages need to only count as one stage in case a multistage song is chosen. */
|
||||
/* Extra stages need to only count as one stage in case a multi-stage
|
||||
* song is chosen. */
|
||||
if( IsAnExtraStage() )
|
||||
iNumStagesOfThisSong = 1;
|
||||
else
|
||||
@@ -668,13 +667,13 @@ int GameState::GetNumStagesForCurrentSongAndStepsOrCourse() const
|
||||
return iNumStagesOfThisSong;
|
||||
}
|
||||
|
||||
/* Called by ScreenGameplay. Set the length of the current song. */
|
||||
// Called by ScreenGameplay. Set the length of the current song.
|
||||
void GameState::BeginStage()
|
||||
{
|
||||
if( m_bDemonstrationOrJukebox )
|
||||
return;
|
||||
|
||||
/* This should only be called once per stage. */
|
||||
// This should only be called once per stage.
|
||||
if( m_iNumStagesOfThisSong != 0 )
|
||||
LOG->Warn( "XXX: m_iNumStagesOfThisSong == %i?", m_iNumStagesOfThisSong );
|
||||
|
||||
@@ -746,8 +745,8 @@ void GameState::CommitStageStats()
|
||||
}
|
||||
}
|
||||
|
||||
/* Called by ScreenSelectMusic (etc). Increment the stage counter if we just played a
|
||||
* song. Might be called more than once. */
|
||||
/* Called by ScreenSelectMusic (etc). Increment the stage counter if we just
|
||||
* played a song. Might be called more than once. */
|
||||
void GameState::FinishStage()
|
||||
{
|
||||
// Increment the stage counter.
|
||||
@@ -800,9 +799,9 @@ void GameState::LoadCurrentSettingsFromProfile( PlayerNumber pn )
|
||||
RString sModifiers;
|
||||
if( pProfile->GetDefaultModifiers( m_pCurGame, sModifiers ) )
|
||||
{
|
||||
/* We don't save negative preferences (eg. "no reverse"). If the theme
|
||||
/* We don't save negative preferences (eg. "no reverse"). If the theme
|
||||
* sets a default of "reverse", and the player turns it off, we should
|
||||
* set it off. However, don't reset modifiers that aren't saved by the
|
||||
* set it off. However, don't reset modifiers that aren't saved by the
|
||||
* profile, so we don't ignore unsaved modifiers when a profile is in use. */
|
||||
PO_GROUP_CALL( m_pPlayerState[pn]->m_PlayerOptions, ModsLevel_Preferred, ResetSavedPrefs );
|
||||
ApplyPreferredModifiers( pn, sModifiers );
|
||||
@@ -966,7 +965,7 @@ void GameState::UpdateSongPosition( float fPositionSeconds, const TimingData &ti
|
||||
{
|
||||
// we got a warp in this section.
|
||||
LOG->Trace("warp at %i jumps to %i",m_iWarpBeginRow,m_iWarpEndRow);
|
||||
// i hate this part because how the shit do i convert rows to seconds?
|
||||
// i hate this part because how the hell do i convert rows to seconds?
|
||||
}
|
||||
/*
|
||||
// xxx testing: only do this on monotune survivor
|
||||
@@ -1083,7 +1082,6 @@ Stage GameState::GetCurrentStage() const
|
||||
// above function behaves weirdly, it will always return final stage if any player is
|
||||
// on final stage, rather than the last remaining player. The below method seems to make a bit more sense.
|
||||
else if(m_iPlayerStageTokens[PLAYER_1] == 0 && m_iPlayerStageTokens[PLAYER_2] == 0) return Stage_Final;
|
||||
// who gives a shit about stages -aj
|
||||
else
|
||||
{
|
||||
switch( this->m_iCurrentStageIndex )
|
||||
@@ -1101,7 +1099,7 @@ Stage GameState::GetCurrentStage() const
|
||||
|
||||
int GameState::GetCourseSongIndex() const
|
||||
{
|
||||
/* iSongsPlayed includes the current song, so it's 1-based; subtract one. */
|
||||
// iSongsPlayed includes the current song, so it's 1-based; subtract one.
|
||||
if( GAMESTATE->m_bMultiplayer )
|
||||
{
|
||||
FOREACH_EnabledMultiPlayer(mp)
|
||||
@@ -1472,7 +1470,7 @@ void GameState::GetAllUsedNoteSkins( vector<RString> &out ) const
|
||||
{
|
||||
out.push_back( m_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_sNoteSkin );
|
||||
|
||||
// Add note skins that are used in courses.
|
||||
// Add noteskins that are used in courses.
|
||||
if( IsCourseMode() )
|
||||
{
|
||||
const Trail *pTrail = m_pCurTrail[pn];
|
||||
|
||||
+4
-14
@@ -136,16 +136,14 @@ float LightsManager::GetActorLightLatencySeconds() const
|
||||
|
||||
void LightsManager::Update( float fDeltaTime )
|
||||
{
|
||||
//
|
||||
// Update actor effect lights.
|
||||
//
|
||||
FOREACH_CabinetLight( cl )
|
||||
{
|
||||
float fTime = fDeltaTime;
|
||||
float &fDuration = m_fSecsLeftInActorLightBlink[cl];
|
||||
if( fDuration > 0 )
|
||||
{
|
||||
/* The light has power left. Brighten it. */
|
||||
// The light has power left. Brighten it.
|
||||
float fSeconds = min( fDuration, fTime );
|
||||
fDuration -= fSeconds;
|
||||
fTime -= fSeconds;
|
||||
@@ -154,7 +152,7 @@ void LightsManager::Update( float fDeltaTime )
|
||||
|
||||
if( fTime > 0 )
|
||||
{
|
||||
/* The light is out of power. Dim it. */
|
||||
// The light is out of power. Dim it.
|
||||
fapproach( m_fActorLights[cl], 0, fTime / g_fLightEffectFalloffSeconds );
|
||||
}
|
||||
|
||||
@@ -173,9 +171,7 @@ void LightsManager::Update( float fDeltaTime )
|
||||
fapproach( m_fSecsLeftInGameButtonBlink[gc][gb], 0, fDeltaTime );
|
||||
}
|
||||
|
||||
//
|
||||
// Set new lights state cabinet lights
|
||||
//
|
||||
{
|
||||
ZERO( m_LightsState.m_bCabinetLights );
|
||||
ZERO( m_LightsState.m_bGameButtonLights );
|
||||
@@ -249,7 +245,7 @@ void LightsManager::Update( float fDeltaTime )
|
||||
default: ASSERT(0);
|
||||
}
|
||||
|
||||
/* Light the menu buttons. */
|
||||
// Light the menu buttons.
|
||||
switch( m_LightsMode )
|
||||
{
|
||||
DEFAULT_FAIL(m_LightsMode);
|
||||
@@ -275,7 +271,7 @@ void LightsManager::Update( float fDeltaTime )
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LIGHTSMODE_JOINING:
|
||||
@@ -324,9 +320,7 @@ void LightsManager::Update( float fDeltaTime )
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Update game controller lights
|
||||
//
|
||||
switch( m_LightsMode )
|
||||
{
|
||||
case LIGHTSMODE_ATTRACT:
|
||||
@@ -351,9 +345,7 @@ void LightsManager::Update( float fDeltaTime )
|
||||
{
|
||||
if( m_LightsMode == LIGHTSMODE_GAMEPLAY && g_bBlinkGameplayButtonLightsOnNote )
|
||||
{
|
||||
//
|
||||
// Blink on notes.
|
||||
//
|
||||
FOREACH_ENUM( GameController, gc )
|
||||
{
|
||||
FOREACH_ENUM( GameButton, gb )
|
||||
@@ -364,9 +356,7 @@ void LightsManager::Update( float fDeltaTime )
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Blink on button presses.
|
||||
//
|
||||
FOREACH_ENUM( GameController, gc )
|
||||
{
|
||||
FOREACH_GameButton_Custom( gb )
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ protected:
|
||||
bool IsOnScreen( float fBeat, int iCol, int iDrawDistanceAfterTargetsPixels, int iDrawDistanceBeforeTargetsPixels ) const;
|
||||
|
||||
void DrawBoard( int iDrawDistanceAfterTargetsPixels, int iDrawDistanceBeforeTargetsPixels );
|
||||
|
||||
|
||||
enum BeatBarType { measure, beat, half_beat, quarter_beat };
|
||||
void DrawBeatBar( const float fBeat, BeatBarType type, int iMeasureIndex );
|
||||
void DrawMarkerBar( int fBeat );
|
||||
|
||||
Reference in New Issue
Block a user