I should be using + instead of += apparently.
Yay for ##c++ for pointing this out.
This commit is contained in:
+1
-1
@@ -81,7 +81,7 @@ static void SplitWithQuotes( const RString sSource, const char Delimitor, vector
|
|||||||
|
|
||||||
RString Commands::GetOriginalCommandString() const
|
RString Commands::GetOriginalCommandString() const
|
||||||
{
|
{
|
||||||
return std::accumulate(v.begin(), v.end(), RString(), [](RString &res, Command const &c) { return res += c.GetOriginalCommandString(); });
|
return std::accumulate(v.begin(), v.end(), RString(), [](RString &res, Command const &c) { return res + c.GetOriginalCommandString(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void ParseCommands( const RString &sCommands, Commands &vCommandsOut )
|
void ParseCommands( const RString &sCommands, Commands &vCommandsOut )
|
||||||
|
|||||||
+1
-1
@@ -150,7 +150,7 @@ void AnimatedTexture::SetState( int iState )
|
|||||||
float AnimatedTexture::GetAnimationLengthSeconds() const
|
float AnimatedTexture::GetAnimationLengthSeconds() const
|
||||||
{
|
{
|
||||||
return std::accumulate(vFrames.begin(), vFrames.end(), 0.f,
|
return std::accumulate(vFrames.begin(), vFrames.end(), 0.f,
|
||||||
[](float total, AnimatedTextureState const &state) { return total += state.fDelaySecs; });
|
[](float total, AnimatedTextureState const &state) { return total + state.fDelaySecs; });
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimatedTexture::SetSecondsIntoAnimation( float fSeconds )
|
void AnimatedTexture::SetSecondsIntoAnimation( float fSeconds )
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ int PlayerStageStats::GetLessonScoreActual() const
|
|||||||
int PlayerStageStats::GetLessonScoreNeeded() const
|
int PlayerStageStats::GetLessonScoreNeeded() const
|
||||||
{
|
{
|
||||||
float score = std::accumulate(m_vpPossibleSteps.begin(), m_vpPossibleSteps.end(), 0.f,
|
float score = std::accumulate(m_vpPossibleSteps.begin(), m_vpPossibleSteps.end(), 0.f,
|
||||||
[](float total, Steps const *steps) { return total += steps->GetRadarValues(PLAYER_1).m_Values.v.fNumTapsAndHolds; });
|
[](float total, Steps const *steps) { return total + steps->GetRadarValues(PLAYER_1).m_Values.v.fNumTapsAndHolds; });
|
||||||
return lrintf( score * LESSON_PASS_THRESHOLD );
|
return lrintf( score * LESSON_PASS_THRESHOLD );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -743,7 +743,7 @@ void Sprite::SetState( int iNewState )
|
|||||||
|
|
||||||
float Sprite::GetAnimationLengthSeconds() const
|
float Sprite::GetAnimationLengthSeconds() const
|
||||||
{
|
{
|
||||||
return std::accumulate(m_States.begin(), m_States.end(), 0.f, [](float total, State const &s) { return total += s.fDelay; });
|
return std::accumulate(m_States.begin(), m_States.end(), 0.f, [](float total, State const &s) { return total + s.fDelay; });
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sprite::SetSecondsIntoAnimation( float fSeconds )
|
void Sprite::SetSecondsIntoAnimation( float fSeconds )
|
||||||
|
|||||||
+2
-2
@@ -159,14 +159,14 @@ int Trail::GetMeter() const
|
|||||||
int Trail::GetTotalMeter() const
|
int Trail::GetTotalMeter() const
|
||||||
{
|
{
|
||||||
return std::accumulate(m_vEntries.begin(), m_vEntries.end(), 0, [](int total, TrailEntry const &e) {
|
return std::accumulate(m_vEntries.begin(), m_vEntries.end(), 0, [](int total, TrailEntry const &e) {
|
||||||
return total += e.pSteps->GetMeter();
|
return total + e.pSteps->GetMeter();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
float Trail::GetLengthSeconds() const
|
float Trail::GetLengthSeconds() const
|
||||||
{
|
{
|
||||||
return std::accumulate(m_vEntries.begin(), m_vEntries.end(), 0.f, [](float total, TrailEntry const &e) {
|
return std::accumulate(m_vEntries.begin(), m_vEntries.end(), 0.f, [](float total, TrailEntry const &e) {
|
||||||
return total += e.pSong->m_fMusicLengthSeconds;
|
return total + e.pSong->m_fMusicLengthSeconds;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ int TrailUtil::GetNumSongs( const Trail *pTrail )
|
|||||||
float TrailUtil::GetTotalSeconds( const Trail *pTrail )
|
float TrailUtil::GetTotalSeconds( const Trail *pTrail )
|
||||||
{
|
{
|
||||||
auto const &entries = pTrail->m_vEntries;
|
auto const &entries = pTrail->m_vEntries;
|
||||||
return std::accumulate(entries.begin(), entries.end(), 0.f, [](float total, TrailEntry const &e) { return total += e.pSong->m_fMusicLengthSeconds; });
|
return std::accumulate(entries.begin(), entries.end(), 0.f, [](float total, TrailEntry const &e) { return total + e.pSong->m_fMusicLengthSeconds; });
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user