Let Mac OS X have goodies.
This commit is contained in:
@@ -8317,6 +8317,7 @@
|
||||
baseConfigurationReference = AA8B8C49091F48C000D14C5F /* product.xcconfig */;
|
||||
buildSettings = {
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
|
||||
FULL_NAME = "$(PRODUCT_NAME).$(WRAPPER_EXTENSION)";
|
||||
@@ -8819,6 +8820,7 @@
|
||||
baseConfigurationReference = AA8B8C49091F48C000D14C5F /* product.xcconfig */;
|
||||
buildSettings = {
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
@@ -9075,6 +9077,7 @@
|
||||
baseConfigurationReference = AA8B8C49091F48C000D14C5F /* product.xcconfig */;
|
||||
buildSettings = {
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
|
||||
FULL_NAME = "$(PRODUCT_NAME).$(WRAPPER_EXTENSION)";
|
||||
|
||||
@@ -90,16 +90,7 @@ int Attack::GetNumAttacks() const
|
||||
|
||||
bool AttackArray::ContainsTransformOrTurn() const
|
||||
{
|
||||
#ifdef MACOSX
|
||||
for (Attack const &a : *this)
|
||||
{
|
||||
if( a.ContainsTransformOrTurn() )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
#else
|
||||
return std::any_of((*this).begin(), (*this).end(), [](Attack const &a) { return a.ContainsTransformOrTurn(); });
|
||||
#endif
|
||||
}
|
||||
|
||||
vector<RString> AttackArray::ToVectorString() const
|
||||
|
||||
@@ -81,14 +81,7 @@ static void SplitWithQuotes( const RString sSource, const char Delimitor, vector
|
||||
|
||||
RString Commands::GetOriginalCommandString() const
|
||||
{
|
||||
#ifdef MACOSX
|
||||
RString s;
|
||||
for (Command const &c : v)
|
||||
s += c.GetOriginalCommandString();
|
||||
return s;
|
||||
#else
|
||||
return std::accumulate(v.begin(), v.end(), RString(), [](RString &res, Command const &c) { return res += c.GetOriginalCommandString(); });
|
||||
#endif
|
||||
}
|
||||
|
||||
void ParseCommands( const RString &sCommands, Commands &vCommandsOut )
|
||||
|
||||
@@ -697,17 +697,7 @@ int Course::GetMeter( StepsType st, CourseDifficulty cd ) const
|
||||
|
||||
bool Course::HasMods() const
|
||||
{
|
||||
#ifdef MACOSX
|
||||
for (CourseEntry const &e : m_vEntries)
|
||||
{
|
||||
if( !e.attacks.empty() )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
#else
|
||||
return std::any_of(m_vEntries.begin(), m_vEntries.end(), [](CourseEntry const &e) { return !e.attacks.empty(); });
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Course::HasTimedMods() const
|
||||
@@ -722,34 +712,17 @@ bool Course::HasTimedMods() const
|
||||
{
|
||||
continue;
|
||||
}
|
||||
#ifdef MACOSX
|
||||
for (Attack const &attack : e.attacks)
|
||||
{
|
||||
if(!attack.bGlobal)
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
if (std::any_of(e.attacks.begin(), e.attacks.end(), [](Attack const &a) { return !a.bGlobal; }))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Course::AllSongsAreFixed() const
|
||||
{
|
||||
#ifdef MACOSX
|
||||
for (CourseEntry const &e : m_vEntries)
|
||||
{
|
||||
if( !e.IsFixedSong() )
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
return std::all_of(m_vEntries.begin(), m_vEntries.end(), [](CourseEntry const &e) { return e.IsFixedSong(); });
|
||||
#endif
|
||||
}
|
||||
|
||||
const Style *Course::GetCourseStyle( const Game *pGame, int iNumPlayers ) const
|
||||
|
||||
@@ -493,21 +493,7 @@ void EditCourseUtil::LoadDefaults( Course &out )
|
||||
vector<Course*> vpCourses;
|
||||
EditCourseUtil::GetAllEditCourses( vpCourses );
|
||||
|
||||
#ifdef MACOSX
|
||||
bool bNameInUse = false;
|
||||
for (Course const *p : vpCourses)
|
||||
{
|
||||
if( out.m_sMainTitle == p->m_sMainTitle )
|
||||
{
|
||||
bNameInUse = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( !bNameInUse )
|
||||
#else
|
||||
if (std::any_of(vpCourses.begin(), vpCourses.end(), [&](Course const *p) { return out.m_sMainTitle == p->m_sMainTitle; }))
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -388,16 +388,7 @@ bool DisplayBpms::BpmIsConstant() const
|
||||
|
||||
bool DisplayBpms::IsSecret() const
|
||||
{
|
||||
#ifdef MACOSX
|
||||
for (float const &f : vfBpms)
|
||||
{
|
||||
if( f == -1 )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
#else
|
||||
return std::any_of(vfBpms.begin(), vfBpms.end(), [](float const &f) { return f == -1; });
|
||||
#endif
|
||||
}
|
||||
|
||||
static const char *StyleTypeNames[] = {
|
||||
|
||||
@@ -760,16 +760,7 @@ void Model::SetSecondsIntoAnimation( float fSeconds )
|
||||
|
||||
bool Model::MaterialsNeedNormals() const
|
||||
{
|
||||
#ifdef MACOSX
|
||||
for (msMaterial const &m : m_Materials)
|
||||
{
|
||||
if( m.NeedsNormals() )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
#else
|
||||
return std::any_of(m_Materials.begin(), m_Materials.end(), [](msMaterial const &m) { return m.NeedsNormals(); });
|
||||
#endif
|
||||
}
|
||||
|
||||
// lua start
|
||||
|
||||
@@ -314,15 +314,8 @@ int PlayerStageStats::GetLessonScoreActual() const
|
||||
|
||||
int PlayerStageStats::GetLessonScoreNeeded() const
|
||||
{
|
||||
#ifdef MACOSX
|
||||
float score = 0;
|
||||
|
||||
for (Steps const *steps : m_vpPossibleSteps)
|
||||
score += steps->GetRadarValues( PLAYER_1 ).m_Values.v.fNumTapsAndHolds;
|
||||
#else
|
||||
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; });
|
||||
#endif
|
||||
return lrintf( score * LESSON_PASS_THRESHOLD );
|
||||
}
|
||||
|
||||
|
||||
@@ -1203,21 +1203,8 @@ bool Song::IsTutorial() const
|
||||
|
||||
bool Song::HasEdits( StepsType st ) const
|
||||
{
|
||||
#ifdef MACOSX
|
||||
for (Steps const *pSteps : m_vpSteps)
|
||||
{
|
||||
if( pSteps->m_StepsType == st &&
|
||||
pSteps->GetDifficulty() == Difficulty_Edit )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
#else
|
||||
return std::any_of(m_vpSteps.begin(), m_vpSteps.end(),
|
||||
[&](Steps const *step) { return step->m_StepsType == st && step->GetDifficulty() == Difficulty_Edit; });
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Song::NormallyDisplayed() const
|
||||
|
||||
@@ -410,22 +410,8 @@ public:
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
// If this player failed any stage, then their final grade is an F.
|
||||
#ifdef MACOSX
|
||||
bool bPlayerFailedOneStage = false;
|
||||
for (StageStats const &ss : STATSMAN->m_vPlayedStageStats)
|
||||
{
|
||||
if( ss.m_player[p].m_bFailed )
|
||||
{
|
||||
bPlayerFailedOneStage = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( bPlayerFailedOneStage )
|
||||
#else
|
||||
if (std::any_of(STATSMAN->m_vPlayedStageStats.begin(), STATSMAN->m_vPlayedStageStats.end(),
|
||||
[&](StageStats const &ss) { return ss.m_player[p].m_bFailed; }))
|
||||
#endif
|
||||
continue;
|
||||
|
||||
top_grade = min( top_grade, stats.m_player[p].GetGrade() );
|
||||
|
||||
@@ -14,15 +14,8 @@ int TrailUtil::GetNumSongs( const Trail *pTrail )
|
||||
|
||||
float TrailUtil::GetTotalSeconds( const Trail *pTrail )
|
||||
{
|
||||
#ifdef MACOSX
|
||||
float fSecs = 0;
|
||||
for (TrailEntry const &e : pTrail->m_vEntries)
|
||||
fSecs += e.pSong->m_fMusicLengthSeconds;
|
||||
return fSecs;
|
||||
#else
|
||||
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; });
|
||||
#endif
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user