diff --git a/stepmania/src/ArrowEffects.cpp b/stepmania/src/ArrowEffects.cpp index cb0b0a9538..3340a89611 100644 --- a/stepmania/src/ArrowEffects.cpp +++ b/stepmania/src/ArrowEffects.cpp @@ -12,6 +12,7 @@ #include "PlayerState.h" #include "GameState.h" #include "Style.h" +#include const float ARROW_SPACING = ARROW_SIZE;// + 2; @@ -195,8 +196,8 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float CLAMP( iStartCol, 0, pStyle->m_iColsPerPlayer-1 ); CLAMP( iEndCol, 0, pStyle->m_iColsPerPlayer-1 ); - float fMinX = +100000; - float fMaxX = -100000; + float fMinX = FLT_MAX; + float fMaxX = FLT_MIN; // TODO: Don't index by PlayerNumber. PlayerNumber pn = pPlayerState->m_PlayerNumber; diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 321b1d8908..23440b9329 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -1069,7 +1069,7 @@ void Song::AddAutoGenNotes() // look for closest match StepsType stBestMatch = (StepsType)-1; - int iBestTrackDifference = 10000; // inf + int iBestTrackDifference = INT_MAX; FOREACH_StepsType( st ) { diff --git a/stepmania/src/SongManager.h b/stepmania/src/SongManager.h index 87a8883484..45bb2016aa 100644 --- a/stepmania/src/SongManager.h +++ b/stepmania/src/SongManager.h @@ -63,12 +63,12 @@ public: // Lookup const vector &GetAllSongs() const { return m_pSongs; } - void GetBestSongs( vector &AddTo, CString sGroupName, int iMaxStages = 100000 /*inf*/, ProfileSlot slot=PROFILE_SLOT_MACHINE ) const; + void GetBestSongs( vector &AddTo, CString sGroupName, int iMaxStages = INT_MAX, ProfileSlot slot=PROFILE_SLOT_MACHINE ) const; const vector &GetBestSongs( ProfileSlot slot=PROFILE_SLOT_MACHINE ) const { return m_pBestSongs[slot]; } const vector &GetBestCourses( ProfileSlot slot=PROFILE_SLOT_MACHINE ) const { return m_pBestCourses[slot]; } - void GetSongs( vector &AddTo, CString sGroupName, int iMaxStages = 100000 /*inf*/ ) const; + void GetSongs( vector &AddTo, CString sGroupName, int iMaxStages = INT_MAX ) const; void GetSongs( vector &AddTo, int iMaxStages ) const { GetSongs(AddTo,GROUP_ALL_MUSIC,iMaxStages); } - void GetSongs( vector &AddTo ) const { GetSongs(AddTo,GROUP_ALL_MUSIC,100000 /*inf*/ ); } + void GetSongs( vector &AddTo ) const { GetSongs(AddTo,GROUP_ALL_MUSIC,INT_MAX); } Song *FindSong( CString sPath ); Course *FindCourse( CString sName ); int GetNumSongs() const; diff --git a/stepmania/src/Style.cpp b/stepmania/src/Style.cpp index b7afd6fa06..aef20a7815 100644 --- a/stepmania/src/Style.cpp +++ b/stepmania/src/Style.cpp @@ -20,6 +20,7 @@ #include "IniFile.h" #include "GameState.h" #include "NoteData.h" +#include void Style::GetTransformedNoteDataForStyle( PlayerNumber pn, const NoteData& original, NoteData& noteDataOut ) const @@ -95,8 +96,8 @@ bool Style::MatchesStepsType( StepsType type ) const void Style::GetMinAndMaxColX( PlayerNumber pn, float& fMixXOut, float& fMaxXOut ) const { - fMixXOut = +100000; - fMaxXOut = -100000; + fMixXOut = FLT_MAX; + fMaxXOut = FLT_MIN; for( int i=0; i UnlockManager* UNLOCKMAN = NULL; // global and accessable from anywhere in our program @@ -330,12 +331,12 @@ float UnlockManager::PointsUntilNextUnlock( UnlockType t ) const float fScores[NUM_UNLOCK_TYPES]; UNLOCKMAN->GetPoints( PROFILEMAN->GetMachineProfile(), fScores ); - float fSmallestPoints = 400000000; // or an arbitrarily large value + float fSmallestPoints = FLT_MAX; // or an arbitrarily large value for( unsigned a=0; a fScores[t] ) fSmallestPoints = min( fSmallestPoints, m_UnlockEntries[a].m_fRequired[t] ); - if( fSmallestPoints == 400000000 ) + if( fSmallestPoints == FLT_MAX ) return 0; // no match found return fSmallestPoints - fScores[t]; }