diff --git a/src/ActiveAttackList.cpp b/src/ActiveAttackList.cpp index 72fe7ba585..342f3accac 100644 --- a/src/ActiveAttackList.cpp +++ b/src/ActiveAttackList.cpp @@ -33,7 +33,7 @@ void ActiveAttackList::Refresh() { const AttackArray& attacks = m_pPlayerState->m_ActiveAttacks; - vector vsThemedMods; + std::vector vsThemedMods; for( unsigned i=0; i Actor::g_vfCurrentBGMBeatPlayer(NUM_PlayerNumber, 0); -vector Actor::g_vfCurrentBGMBeatPlayerNoOffset(NUM_PlayerNumber, 0); +std::vector Actor::g_vfCurrentBGMBeatPlayer(NUM_PlayerNumber, 0); +std::vector Actor::g_vfCurrentBGMBeatPlayerNoOffset(NUM_PlayerNumber, 0); Actor *Actor::Copy() const { return new Actor(*this); } @@ -822,7 +822,7 @@ void Actor::UpdateTweening( float fDeltaTime ) bool bBeginning = TI.m_fTimeLeftInTween == TI.m_fTweenTime; - float fSecsToSubtract = min( TI.m_fTimeLeftInTween, fDeltaTime ); + float fSecsToSubtract = std::min( TI.m_fTimeLeftInTween, fDeltaTime ); TI.m_fTimeLeftInTween -= fSecsToSubtract; fDeltaTime -= fSecsToSubtract; @@ -1537,7 +1537,7 @@ bool Actor::HasCommand( const RString &sCmdName ) const const apActorCommands *Actor::GetCommand( const RString &sCommandName ) const { - map::const_iterator it = m_mapNameToCommands.find( sCommandName ); + std::map::const_iterator it = m_mapNameToCommands.find( sCommandName ); if( it == m_mapNameToCommands.end() ) return nullptr; return &it->second; diff --git a/src/Actor.h b/src/Actor.h index 50de27d4a3..918d25c8da 100644 --- a/src/Actor.h +++ b/src/Actor.h @@ -632,7 +632,7 @@ protected: Actor* m_FakeParent; // WrapperStates provides a way to wrap the actor inside ActorFrames, // applicable to any actor, not just ones the theme creates. - vector m_WrapperStates; + std::vector m_WrapperStates; /** @brief Some general information about the Tween. */ struct TweenInfo @@ -667,7 +667,7 @@ protected: TweenState state; TweenInfo info; }; - vector m_Tweens; + std::vector m_Tweens; /** @brief Temporary variables that are filled just before drawing */ TweenState *m_pTempState; @@ -686,7 +686,7 @@ protected: // Stuff for effects #if defined(SSC_FUTURES) // be able to stack effects - vector m_Effects; + std::vector m_Effects; #else // compatibility Effect m_Effect; #endif @@ -746,12 +746,12 @@ protected: // global state static float g_fCurrentBGMTime, g_fCurrentBGMBeat; static float g_fCurrentBGMTimeNoOffset, g_fCurrentBGMBeatNoOffset; - static vector g_vfCurrentBGMBeatPlayer; - static vector g_vfCurrentBGMBeatPlayerNoOffset; + static std::vector g_vfCurrentBGMBeatPlayer; + static std::vector g_vfCurrentBGMBeatPlayerNoOffset; private: // commands - map m_mapNameToCommands; + std::map m_mapNameToCommands; }; #endif diff --git a/src/ActorFrame.cpp b/src/ActorFrame.cpp index 97b9433306..14f5f5918a 100644 --- a/src/ActorFrame.cpp +++ b/src/ActorFrame.cpp @@ -140,7 +140,7 @@ void ActorFrame::AddChild( Actor *pActor ) { #ifdef DEBUG // check that this Actor isn't already added. - vector::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor ); + std::vector::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor ); if( iter != m_SubActors.end() ) Dialog::OK( ssprintf("Actor \"%s\" adds child \"%s\" more than once", GetLineage().c_str(), pActor->GetName().c_str()) ); #endif @@ -154,7 +154,7 @@ void ActorFrame::AddChild( Actor *pActor ) void ActorFrame::RemoveChild( Actor *pActor ) { - vector::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor ); + std::vector::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor ); if( iter != m_SubActors.end() ) m_SubActors.erase( iter ); } @@ -182,7 +182,7 @@ void ActorFrame::RemoveAllChildren() void ActorFrame::MoveToTail( Actor* pActor ) { - vector::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor ); + std::vector::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor ); if( iter == m_SubActors.end() ) // didn't find FAIL_M("Nonexistent actor"); @@ -192,7 +192,7 @@ void ActorFrame::MoveToTail( Actor* pActor ) void ActorFrame::MoveToHead( Actor* pActor ) { - vector::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor ); + std::vector::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor ); if( iter == m_SubActors.end() ) // didn't find FAIL_M("Nonexistent actor"); @@ -259,7 +259,7 @@ void ActorFrame::DrawPrimitives() // draw all sub-ActorFrames while we're in the ActorFrame's local coordinate space if( m_bDrawByZPosition ) { - vector subs = m_SubActors; + std::vector subs = m_SubActors; ActorUtil::SortByZPosition( subs ); for( unsigned i=0; i::iterator it=m_SubActors.begin(); it!=m_SubActors.end(); it++ ) + for( std::vector::iterator it=m_SubActors.begin(); it!=m_SubActors.end(); it++ ) { Actor *pActor = *it; pActor->Update(fDeltaTime); @@ -531,7 +531,7 @@ float ActorFrame::GetTweenTimeLeft() const for( unsigned i=0; iGetTweenTimeLeft()); + m = std::max(m, m_fHibernateSecondsLeft + pActor->GetTweenTimeLeft()); } return m; @@ -702,7 +702,7 @@ public: { luaL_checktype( L, 1, LUA_TTABLE ); lua_pushvalue( L, 1 ); - vector coords; + std::vector coords; LuaHelpers::ReadArrayFromTable( coords, L ); lua_pop( L, 1 ); if( coords.size() !=3 ) diff --git a/src/ActorFrame.h b/src/ActorFrame.h index 2d86c64af0..d0b59101c6 100644 --- a/src/ActorFrame.h +++ b/src/ActorFrame.h @@ -26,7 +26,7 @@ public: virtual void RemoveChild( Actor *pActor ); void TransferChildren( ActorFrame *pTo ); Actor* GetChild( const RString &sName ); - vector GetChildren() { return m_SubActors; } + std::vector GetChildren() { return m_SubActors; } int GetNumChildren() const { return m_SubActors.size(); } /** @brief Remove all of the children from the frame. */ @@ -99,7 +99,7 @@ protected: void LoadChildrenFromNode( const XNode* pNode ); /** @brief The children Actors used by the ActorFrame. */ - vector m_SubActors; + std::vector m_SubActors; bool m_bPropagateCommands; bool m_bDeleteChildren; bool m_bDrawByZPosition; diff --git a/src/ActorMultiTexture.h b/src/ActorMultiTexture.h index 5b3c34333e..2a4c5a65d0 100644 --- a/src/ActorMultiTexture.h +++ b/src/ActorMultiTexture.h @@ -39,7 +39,7 @@ private: RageTexture *m_pTexture; TextureMode m_TextureMode; }; - vector m_aTextureUnits; + std::vector m_aTextureUnits; RectF m_Rect; }; diff --git a/src/ActorMultiVertex.cpp b/src/ActorMultiVertex.cpp index 34fefe0ba7..45bcf1c392 100644 --- a/src/ActorMultiVertex.cpp +++ b/src/ActorMultiVertex.cpp @@ -345,10 +345,10 @@ bool ActorMultiVertex::EarlyAbortDraw() const void ActorMultiVertex::SetVertsFromSplinesInternal(size_t num_splines, size_t offset) { - vector& verts= AMV_DestTweenState().vertices; + std::vector& verts= AMV_DestTweenState().vertices; size_t first= AMV_DestTweenState().FirstToDraw + offset; size_t num_verts= AMV_DestTweenState().GetSafeNumToDraw(AMV_DestTweenState()._DrawMode, AMV_DestTweenState().NumToDraw) - offset; - vector tper(num_splines, 0.0f); + std::vector tper(num_splines, 0.0f); float num_parts= (static_cast(num_verts) / static_cast(num_splines)) - 1.0f; for(size_t i= 0; i < num_splines; ++i) @@ -357,7 +357,7 @@ void ActorMultiVertex::SetVertsFromSplinesInternal(size_t num_splines, size_t of } for(size_t v= 0; v < num_verts; ++v) { - vector pos; + std::vector pos; const int spi= v%num_splines; float part= static_cast(v/num_splines); _splines[spi].evaluate(part * tper[spi], pos); @@ -438,8 +438,8 @@ void ActorMultiVertex::SetSecondsIntoAnimation(float seconds) void ActorMultiVertex::UpdateAnimationState(bool force_update) { AMV_TweenState& dest= AMV_DestTweenState(); - vector& verts= dest.vertices; - vector& qs= dest.quad_states; + std::vector& verts= dest.vertices; + std::vector& qs= dest.quad_states; if(!_use_animation_state || _states.empty() || dest._DrawMode == DrawMode_LineStrip || qs.empty()) { return; } @@ -590,7 +590,7 @@ void ActorMultiVertex::Update(float fDelta) UpdateAnimationState(); if(!skip_this_movie_update && _decode_movie) { - _Texture->DecodeSeconds(max(0, time_passed)); + _Texture->DecodeSeconds(std::max(0.0f, time_passed)); } } @@ -1068,7 +1068,7 @@ public: { luaL_error(L, "The texture must be set before adding states."); } - vector new_states; + std::vector new_states; size_t num_states= lua_objlen(L, 1); new_states.resize(num_states); for(size_t i= 0; i < num_states; ++i) diff --git a/src/ActorMultiVertex.h b/src/ActorMultiVertex.h index f0c0fc6b93..42c8db9523 100644 --- a/src/ActorMultiVertex.h +++ b/src/ActorMultiVertex.h @@ -48,8 +48,8 @@ public: void SetDrawState( DrawMode dm, int first, int num ); int GetSafeNumToDraw( DrawMode dm, int num ) const; - vector vertices; - vector quad_states; + std::vector vertices; + std::vector quad_states; DrawMode _DrawMode; int FirstToDraw; @@ -128,7 +128,7 @@ public: { ASSERT(i < _states.size()); return _states[i]; } void SetStateData(size_t i, const State& s) { ASSERT(i < _states.size()); _states[i]= s; } - void SetStateProperties(const vector& new_states) + void SetStateProperties(const std::vector& new_states) { _states= new_states; SetState(0); } void SetState(size_t i); void SetAllStateDelays(float delay); @@ -153,8 +153,8 @@ public: private: RageTexture* _Texture; - vector _Vertices; - vector AMV_Tweens; + std::vector _Vertices; + std::vector AMV_Tweens; AMV_TweenState AMV_current; AMV_TweenState AMV_start; @@ -166,12 +166,12 @@ private: // Four splines for controlling vert positions, because quads drawmode // requires four. -Kyz - vector _splines; + std::vector _splines; bool _skip_next_update; float _secs_into_state; size_t _cur_state; - vector _states; + std::vector _states; }; /** diff --git a/src/ActorScroller.cpp b/src/ActorScroller.cpp index 794f40372b..95a3fa3859 100644 --- a/src/ActorScroller.cpp +++ b/src/ActorScroller.cpp @@ -269,7 +269,7 @@ void ActorScroller::PositionItemsAndDrawPrimitives( bool bDrawPrimitives ) iLastItemToDraw = clamp( iLastItemToDraw, 0, m_iNumItems ); } - vector subs; + std::vector subs; { // Shift m_SubActors so iFirstItemToDraw is at the beginning. diff --git a/src/ActorUtil.cpp b/src/ActorUtil.cpp index 4470a1eea5..67040dfe13 100644 --- a/src/ActorUtil.cpp +++ b/src/ActorUtil.cpp @@ -18,7 +18,7 @@ // Actor registration -static map *g_pmapRegistrees = nullptr; +static std::map *g_pmapRegistrees = nullptr; static bool IsRegistered( const RString& sClassName ) { @@ -28,9 +28,9 @@ static bool IsRegistered( const RString& sClassName ) void ActorUtil::Register( const RString& sClassName, CreateActorFn pfn ) { if( g_pmapRegistrees == nullptr ) - g_pmapRegistrees = new map; + g_pmapRegistrees = new std::map; - map::iterator iter = g_pmapRegistrees->find( sClassName ); + std::map::iterator iter = g_pmapRegistrees->find( sClassName ); ASSERT_M( iter == g_pmapRegistrees->end(), ssprintf("Actor class '%s' already registered.", sClassName.c_str()) ); (*g_pmapRegistrees)[sClassName] = pfn; @@ -48,7 +48,7 @@ bool ActorUtil::ResolvePath( RString &sPath, const RString &sName, bool optional RageFileManager::FileType ft = FILEMAN->GetFileType( sPath ); if( ft != RageFileManager::TYPE_FILE && ft != RageFileManager::TYPE_DIR ) { - vector asPaths; + std::vector asPaths; GetDirListing( sPath + "*", asPaths, false, true ); // return path too if( asPaths.empty() ) @@ -193,7 +193,7 @@ Actor *ActorUtil::LoadFromNode( const XNode* _pNode, Actor *pParentActor ) if( !bHasClass && bLegacy ) sClass = GetLegacyActorClass( &node ); - map::iterator iter = g_pmapRegistrees->find( sClass ); + std::map::iterator iter = g_pmapRegistrees->find( sClass ); if( iter == g_pmapRegistrees->end() ) { RString sFile; @@ -305,7 +305,7 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, Actor *pParentActor ) { case FT_Lua: { - unique_ptr pNode( LoadXNodeFromLuaShowErrors(sPath) ); + std::unique_ptr pNode( LoadXNodeFromLuaShowErrors(sPath) ); if( pNode.get() == nullptr ) { // XNode will warn about the error @@ -471,7 +471,7 @@ void ActorUtil::LoadAllCommands( Actor& actor, const RString &sMetricsGroup ) void ActorUtil::LoadAllCommandsFromName( Actor& actor, const RString &sMetricsGroup, const RString &sName ) { - set vsValueNames; + std::set vsValueNames; THEME->GetMetricsThatBeginWith( sMetricsGroup, sName, vsValueNames ); for (RString const & sv : vsValueNames) @@ -490,7 +490,7 @@ static bool CompareActorsByZPosition(const Actor *p1, const Actor *p2) return p1->GetZ() < p2->GetZ(); } -void ActorUtil::SortByZPosition( vector &vActors ) +void ActorUtil::SortByZPosition( std::vector &vActors ) { // Preserve ordering of Actors with equal Z positions. stable_sort( vActors.begin(), vActors.end(), CompareActorsByZPosition ); @@ -511,8 +511,8 @@ XToString( FileType ); LuaXType( FileType ); // convenience so the for-loop lines can be shorter. -typedef map etft_cont_t; -typedef map > fttel_cont_t; +typedef std::map etft_cont_t; +typedef std::map > fttel_cont_t; etft_cont_t ExtensionToFileType; fttel_cont_t FileTypeToExtensionList; @@ -569,18 +569,18 @@ void ActorUtil::InitFileTypeLists() } } -vector const& ActorUtil::GetTypeExtensionList(FileType ft) +std::vector const& ActorUtil::GetTypeExtensionList(FileType ft) { return FileTypeToExtensionList[ft]; } -void ActorUtil::AddTypeExtensionsToList(FileType ft, vector& add_to) +void ActorUtil::AddTypeExtensionsToList(FileType ft, std::vector& add_to) { fttel_cont_t::iterator ext_list= FileTypeToExtensionList.find(ft); if(ext_list != FileTypeToExtensionList.end()) { add_to.reserve(add_to.size() + ext_list->second.size()); - for(vector::iterator curr= ext_list->second.begin(); + for(std::vector::iterator curr= ext_list->second.begin(); curr != ext_list->second.end(); ++curr) { add_to.push_back(*curr); diff --git a/src/ActorUtil.h b/src/ActorUtil.h index 16163588cf..f3b461080b 100644 --- a/src/ActorUtil.h +++ b/src/ActorUtil.h @@ -48,8 +48,8 @@ const RString& FileTypeToString( FileType ft ); namespace ActorUtil { void InitFileTypeLists(); - vector const& GetTypeExtensionList(FileType ft); - void AddTypeExtensionsToList(FileType ft, vector& add_to); + std::vector const& GetTypeExtensionList(FileType ft); + void AddTypeExtensionsToList(FileType ft, std::vector& add_to); // Every screen should register its class at program initialization. void Register( const RString& sClassName, CreateActorFn pfn ); @@ -124,7 +124,7 @@ namespace ActorUtil bool ResolvePath( RString &sPath, const RString &sName, bool optional= false ); - void SortByZPosition( vector &vActors ); + void SortByZPosition( std::vector &vActors ); FileType GetFileType( const RString &sPath ); }; diff --git a/src/AdjustSync.cpp b/src/AdjustSync.cpp index b217d6ece9..b7b54f0129 100644 --- a/src/AdjustSync.cpp +++ b/src/AdjustSync.cpp @@ -43,12 +43,12 @@ #include "ScreenManager.h" -vector AdjustSync::s_vpTimingDataOriginal; +std::vector AdjustSync::s_vpTimingDataOriginal; float AdjustSync::s_fGlobalOffsetSecondsOriginal = 0.0f; int AdjustSync::s_iAutosyncOffsetSample = 0; float AdjustSync::s_fAutosyncOffset[AdjustSync::OFFSET_SAMPLE_COUNT]; float AdjustSync::s_fStandardDeviation = 0.0f; -vector< pair > AdjustSync::s_vAutosyncTempoData; +std::vector> AdjustSync::s_vAutosyncTempoData; float AdjustSync::s_fAverageError = 0.0f; const float AdjustSync::ERROR_TOO_HIGH = 0.025f; int AdjustSync::s_iStepsFiltered = 0; @@ -60,7 +60,7 @@ void AdjustSync::ResetOriginalSyncData() if( GAMESTATE->m_pCurSong ) { s_vpTimingDataOriginal.push_back(GAMESTATE->m_pCurSong->m_SongTiming); - const vector& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps(); + const std::vector& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps(); for (Steps const *s : vpSteps) { s_vpTimingDataOriginal.push_back(s->m_Timing); @@ -86,7 +86,7 @@ bool AdjustSync::IsSyncDataChanged() // Can't sync in course modes if( GAMESTATE->IsCourseMode() ) return false; - vector vs; + std::vector vs; AdjustSync::GetSyncChangeTextGlobal( vs ); AdjustSync::GetSyncChangeTextSong( vs ); return !vs.empty(); @@ -127,7 +127,7 @@ void AdjustSync::RevertSyncChanges() GAMESTATE->m_pCurSong->m_SongTiming = s_vpTimingDataOriginal[0]; unsigned location = 1; - const vector& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps(); + const std::vector& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps(); for (Steps *s : vpSteps) { s->m_Timing = s_vpTimingDataOriginal[location]; @@ -152,7 +152,7 @@ void AdjustSync::HandleAutosync( float fNoteOffBySeconds, float fStepTime ) case AutosyncType_Tempo: { // We collect all of the data and process it at the end - s_vAutosyncTempoData.push_back( make_pair(fStepTime, fNoteOffBySeconds) ); + s_vAutosyncTempoData.push_back( std::make_pair(fStepTime, fNoteOffBySeconds) ); break; } case AutosyncType_Machine: @@ -198,7 +198,7 @@ void AdjustSync::AutosyncOffset() case AutosyncType_Song: { GAMESTATE->m_pCurSong->m_SongTiming.m_fBeat0OffsetInSeconds += mean; - const vector& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps(); + const std::vector& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps(); for (Steps *s : vpSteps) { // Empty TimingData means it's inherited @@ -257,7 +257,7 @@ void AdjustSync::AutosyncTempo() const float fScaleBPM = 1.0f/(1.0f - fSlope); TimingData &timing = GAMESTATE->m_pCurSong->m_SongTiming; - const vector &bpms = timing.GetTimingSegments(SEGMENT_BPM); + const std::vector &bpms = timing.GetTimingSegments(SEGMENT_BPM); for (unsigned i = 0; i < bpms.size(); i++) { const BPMSegment *b = ToBPM( bpms[i] ); @@ -267,14 +267,14 @@ void AdjustSync::AutosyncTempo() /* We assume that the stops were measured as a number of beats. * Therefore, if we change the bpms, we need to make a similar * change to the stops. */ - const vector &stops = timing.GetTimingSegments(SEGMENT_STOP); + const std::vector &stops = timing.GetTimingSegments(SEGMENT_STOP); for (unsigned i = 0; i < stops.size(); i++) { const StopSegment *s = ToStop( stops[i] ); timing.AddSegment( StopSegment(s->GetRow(), s->GetPause() * (1.0f - fSlope)) ); } // Do the same for delays. - const vector &delays = timing.GetTimingSegments(SEGMENT_DELAY); + const std::vector &delays = timing.GetTimingSegments(SEGMENT_DELAY); for (unsigned i = 0; i < delays.size(); i++) { const DelaySegment *s = ToDelay( delays[i] ); @@ -307,7 +307,7 @@ static LocalizedString ERROR ("AdjustSync", "Average Error %.5fs"); static LocalizedString ETC ("AdjustSync", "Etc."); static LocalizedString TAPS_IGNORED ("AdjustSync", "%d taps ignored."); -void AdjustSync::GetSyncChangeTextGlobal( vector &vsAddTo ) +void AdjustSync::GetSyncChangeTextGlobal( std::vector &vsAddTo ) { { float fOld = Quantize( AdjustSync::s_fGlobalOffsetSecondsOriginal, 0.001f ); @@ -325,7 +325,7 @@ void AdjustSync::GetSyncChangeTextGlobal( vector &vsAddTo ) } // XXX: needs cleanup still -- vyhd -void AdjustSync::GetSyncChangeTextSong( vector &vsAddTo ) +void AdjustSync::GetSyncChangeTextSong( std::vector &vsAddTo ) { if( GAMESTATE->m_pCurSong.Get() ) { @@ -354,8 +354,8 @@ void AdjustSync::GetSyncChangeTextSong( vector &vsAddTo ) } } - const vector &bpmTest = testing.GetTimingSegments(SEGMENT_BPM); - const vector &bpmOrig = original.GetTimingSegments(SEGMENT_BPM); + const std::vector &bpmTest = testing.GetTimingSegments(SEGMENT_BPM); + const std::vector &bpmOrig = original.GetTimingSegments(SEGMENT_BPM); SEGMENTS_MISMATCH_MESSAGE(bpmOrig, bpmTest, bpm); for(size_t i= 0; i < bpmTest.size() && i < bpmOrig.size(); i++) { @@ -377,8 +377,8 @@ void AdjustSync::GetSyncChangeTextSong( vector &vsAddTo ) vsAddTo.push_back( s ); } - const vector &stopTest = testing.GetTimingSegments(SEGMENT_STOP); - const vector &stopOrig = original.GetTimingSegments(SEGMENT_STOP); + const std::vector &stopTest = testing.GetTimingSegments(SEGMENT_STOP); + const std::vector &stopOrig = original.GetTimingSegments(SEGMENT_STOP); SEGMENTS_MISMATCH_MESSAGE(stopOrig, stopTest, stop); for(size_t i= 0; i < stopTest.size() && i < stopOrig.size(); i++) @@ -400,8 +400,8 @@ void AdjustSync::GetSyncChangeTextSong( vector &vsAddTo ) vsAddTo.push_back( s ); } - const vector &delyTest = testing.GetTimingSegments(SEGMENT_DELAY); - const vector &delyOrig = original.GetTimingSegments(SEGMENT_DELAY); + const std::vector &delyTest = testing.GetTimingSegments(SEGMENT_DELAY); + const std::vector &delyOrig = original.GetTimingSegments(SEGMENT_DELAY); SEGMENTS_MISMATCH_MESSAGE(delyOrig, delyTest, delay); for(size_t i= 0; i < delyTest.size() && i < delyOrig.size(); i++) diff --git a/src/AdjustSync.h b/src/AdjustSync.h index f2257c8f5e..4de471675c 100644 --- a/src/AdjustSync.h +++ b/src/AdjustSync.h @@ -17,7 +17,7 @@ public: * @brief The original TimingData before adjustments were made. * * This is designed to work with Split Timing. */ - static vector s_vpTimingDataOriginal; + static std::vector s_vpTimingDataOriginal; static float s_fGlobalOffsetSecondsOriginal; /* We only want to call the Reset methods before a song, not immediately after @@ -35,8 +35,8 @@ public: static void HandleSongEnd(); static void AutosyncOffset(); static void AutosyncTempo(); - static void GetSyncChangeTextGlobal( vector &vsAddTo ); - static void GetSyncChangeTextSong( vector &vsAddTo ); + static void GetSyncChangeTextGlobal( std::vector &vsAddTo ); + static void GetSyncChangeTextSong( std::vector &vsAddTo ); /** @brief The minimum number of steps to hit for syncing purposes. */ static const int OFFSET_SAMPLE_COUNT = 24; @@ -49,7 +49,7 @@ public: // reject the recorded data for the Least Squares Regression. static const float ERROR_TOO_HIGH; - static vector< pair > s_vAutosyncTempoData; + static std::vector> s_vAutosyncTempoData; static float s_fAverageError; static int s_iStepsFiltered; }; diff --git a/src/AnnouncerManager.cpp b/src/AnnouncerManager.cpp index f116257673..046622f670 100644 --- a/src/AnnouncerManager.cpp +++ b/src/AnnouncerManager.cpp @@ -29,7 +29,7 @@ AnnouncerManager::~AnnouncerManager() LUA->UnsetGlobal( "ANNOUNCER" ); } -void AnnouncerManager::GetAnnouncerNames( vector& AddTo ) +void AnnouncerManager::GetAnnouncerNames( std::vector& AddTo ) { GetDirListing( ANNOUNCERS_DIR+"*", AddTo, true ); @@ -47,7 +47,7 @@ bool AnnouncerManager::DoesAnnouncerExist( RString sAnnouncerName ) if( sAnnouncerName == "" ) return true; - vector asAnnouncerNames; + std::vector asAnnouncerNames; GetAnnouncerNames( asAnnouncerNames ); for( unsigned i=0; i as; + std::vector as; GetAnnouncerNames( as ); if( as.size()==0 ) return; @@ -186,7 +186,7 @@ public: static int DoesAnnouncerExist( T* p, lua_State *L ) { lua_pushboolean(L, p->DoesAnnouncerExist( SArg(1) )); return 1; } static int GetAnnouncerNames( T* p, lua_State *L ) { - vector vAnnouncers; + std::vector vAnnouncers; p->GetAnnouncerNames( vAnnouncers ); LuaHelpers::CreateTableFromArray(vAnnouncers, L); return 1; diff --git a/src/AnnouncerManager.h b/src/AnnouncerManager.h index 645acbff55..51fbeee448 100644 --- a/src/AnnouncerManager.h +++ b/src/AnnouncerManager.h @@ -12,7 +12,7 @@ public: /** * @brief Retrieve the announcer names. * @param AddTo the list of announcer names. */ - void GetAnnouncerNames( vector& AddTo ); + void GetAnnouncerNames( std::vector& AddTo ); /** * @brief Determine if the specified announcer exists. * @param sAnnouncerName the announcer we're checking for. diff --git a/src/ArrowEffects.cpp b/src/ArrowEffects.cpp index c7fae1de4c..2dfb3fe937 100644 --- a/src/ArrowEffects.cpp +++ b/src/ArrowEffects.cpp @@ -295,8 +295,8 @@ void ArrowEffects::Init(PlayerNumber pn) // Using the x offset when the dimension might be y or z feels so // wrong, but it provides min and max values when otherwise the // limits would just be zero, which would make it do nothing. -Kyz - data.m_MinTornado[dimension][col_id] = min(pCols[i].fXOffset, data.m_MinTornado[dimension][col_id]); - data.m_MaxTornado[dimension][col_id] = max(pCols[i].fXOffset, data.m_MaxTornado[dimension][col_id]); + data.m_MinTornado[dimension][col_id] = std::min(pCols[i].fXOffset, data.m_MinTornado[dimension][col_id]); + data.m_MaxTornado[dimension][col_id] = std::max(pCols[i].fXOffset, data.m_MaxTornado[dimension][col_id]); } } @@ -433,7 +433,7 @@ void ArrowEffects::SetCurrentOptions(const PlayerOptions* options) static float GetDisplayedBeat( const PlayerState* pPlayerState, float beat ) { // do a binary search here - const vector &data = pPlayerState->m_CacheDisplayedBeat; + const std::vector &data = pPlayerState->m_CacheDisplayedBeat; int max = data.size() - 1; int l = 0, r = max; while( l <= r ) @@ -856,7 +856,7 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float { // Allow Tiny to pull tracks together, but not to push them apart. float fTinyPercent = fEffects[PlayerOptions::EFFECT_TINY]; - fTinyPercent = min( powf(TINY_PERCENT_BASE, fTinyPercent), (float)TINY_PERCENT_GATE ); + fTinyPercent = std::min( powf(TINY_PERCENT_BASE, fTinyPercent), (float)TINY_PERCENT_GATE ); fPixelOffsetFromCenter *= fTinyPercent; } @@ -1120,7 +1120,7 @@ float ArrowGetPercentVisible(float fYPosWithoutReverse, int iCol, float fYOffset * fAppearances[PlayerOptions::APPEARANCE_RANDOMVANISH]; } - return clamp( 1+fVisibleAdjust, 0, 1 ); + return clamp(1 + fVisibleAdjust, 0.0f, 1.0f); } float ArrowEffects::GetAlpha( const PlayerState* pPlayerState, int iCol, float fYOffset, float fPercentFadeToFail, float fYReverseOffsetPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar) diff --git a/src/Attack.cpp b/src/Attack.cpp index 3e6cec20fa..7a51d6755b 100644 --- a/src/Attack.cpp +++ b/src/Attack.cpp @@ -33,7 +33,7 @@ void Attack::GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlay ASSERT( pPlayerState != nullptr ); /* If reasonable, push the attack forward 8 beats so that notes on screen don't change suddenly. */ - fStartBeat = min( GAMESTATE->m_Position.m_fSongBeat+8, pPlayerState->m_fLastDrawnBeat ); + fStartBeat = std::min( GAMESTATE->m_Position.m_fSongBeat+8, pPlayerState->m_fLastDrawnBeat ); fStartBeat = truncf(fStartBeat)+1; const TimingData &timing = pSong->m_SongTiming; @@ -84,7 +84,7 @@ RString Attack::GetTextDescription() const int Attack::GetNumAttacks() const { - vector tmp; + std::vector tmp; split(this->sModifiers, ",", tmp); return tmp.size(); } @@ -94,9 +94,9 @@ bool AttackArray::ContainsTransformOrTurn() const return std::any_of((*this).begin(), (*this).end(), [](Attack const &a) { return a.ContainsTransformOrTurn(); }); } -vector AttackArray::ToVectorString() const +std::vector AttackArray::ToVectorString() const { - vector ret; + std::vector ret; for (Attack const &a : *this) { ret.push_back(ssprintf("TIME=%f:LEN=%f:MODS=%s", diff --git a/src/Attack.h b/src/Attack.h index da8bdcc18b..24f66c58aa 100644 --- a/src/Attack.h +++ b/src/Attack.h @@ -69,7 +69,7 @@ struct Attack int GetNumAttacks() const; }; -struct AttackArray : public vector +struct AttackArray : public std::vector { /** * @brief Determine if the list of attacks contains a transform or turn mod. @@ -79,7 +79,7 @@ struct AttackArray : public vector /** * @brief Return a string representation used for simfiles. * @return the string representation. */ - vector ToVectorString() const; + std::vector ToVectorString() const; /** * @brief Adjust the starting time of all attacks. diff --git a/src/AttackDisplay.cpp b/src/AttackDisplay.cpp index db286c9f2a..cfbd25f6a0 100644 --- a/src/AttackDisplay.cpp +++ b/src/AttackDisplay.cpp @@ -42,7 +42,7 @@ void AttackDisplay::Init( const PlayerState* pPlayerState ) GAMESTATE->m_PlayMode != PLAY_MODE_RAVE ) return; - set attacks; + std::set attacks; for( int al=0; alm_pCurCharacters[pn]; @@ -52,7 +52,7 @@ void AttackDisplay::Init( const PlayerState* pPlayerState ) attacks.insert( asAttacks[att] ); } - for( set::const_iterator it = attacks.begin(); it != attacks.end(); ++it ) + for( std::set::const_iterator it = attacks.begin(); it != attacks.end(); ++it ) { const RString path = THEME->GetPathG( "AttackDisplay", GetAttackPieceName( *it ), true ); if( path == "" ) diff --git a/src/AutoKeysounds.cpp b/src/AutoKeysounds.cpp index 6910b242ce..7dccd94083 100644 --- a/src/AutoKeysounds.cpp +++ b/src/AutoKeysounds.cpp @@ -67,7 +67,7 @@ void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain ) * This leads to failure later on. * We need a better way to prevent this. */ if( m_ndAutoKeysoundsOnly[pn].GetNextTapNoteRowForTrack( t, iNextRowForPlayer ) ) - iNextRow = min( iNextRow, iNextRowForPlayer ); + iNextRow = std::min( iNextRow, iNextRowForPlayer ); } if( iNextRow == INT_MAX ) @@ -111,7 +111,7 @@ void AutoKeysounds::LoadTracks( const Song *pSong, RageSoundReader *&pShared, Ra pPlayer2 = nullptr; pShared = nullptr; - vector vsMusicFile; + std::vector vsMusicFile; const RString sMusicPath = GAMESTATE->m_pCurSteps[GAMESTATE->GetMasterPlayerNumber()]->GetMusicPath(); if( !sMusicPath.empty() ) @@ -126,7 +126,7 @@ void AutoKeysounds::LoadTracks( const Song *pSong, RageSoundReader *&pShared, Ra } - vector vpSounds; + std::vector vpSounds; for (RString const &s : vsMusicFile) { RString sError; @@ -239,7 +239,7 @@ void AutoKeysounds::FinishLoading() Song* pSong = GAMESTATE->m_pCurSong; - vector apSounds; + std::vector apSounds; LoadTracks( pSong, m_pSharedSound, m_pPlayerSounds[0], m_pPlayerSounds[1] ); // Load autoplay sounds, if any. @@ -287,7 +287,7 @@ void AutoKeysounds::FinishLoading() } if( GAMESTATE->GetNumPlayersEnabled() == 1 && GAMESTATE->GetMasterPlayerNumber() == PLAYER_2 ) - swap( m_pPlayerSounds[PLAYER_1], m_pPlayerSounds[PLAYER_2] ); + std::swap( m_pPlayerSounds[PLAYER_1], m_pPlayerSounds[PLAYER_2] ); if( apSounds.size() > 1 ) { @@ -319,7 +319,7 @@ void AutoKeysounds::Update( float fDelta ) float fSongBeat = GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds ); int iRowNow = BeatToNoteRowNotRounded( fSongBeat ); - iRowNow = max( 0, iRowNow ); + iRowNow = std::max( 0, iRowNow ); static int iRowLastCrossed = 0; float fBeatLast = roundf(NoteRowToBeat(iRowLastCrossed)); diff --git a/src/AutoKeysounds.h b/src/AutoKeysounds.h index ca6e14647c..fe9723410f 100644 --- a/src/AutoKeysounds.h +++ b/src/AutoKeysounds.h @@ -25,7 +25,7 @@ protected: static void LoadTracks( const Song *pSong, RageSoundReader *&pGlobal, RageSoundReader *&pPlayer1, RageSoundReader *&pPlayer2 ); NoteData m_ndAutoKeysoundsOnly[NUM_PLAYERS]; - vector m_vKeysounds; + std::vector m_vKeysounds; RageSound m_sSound; RageSoundReader *m_pChain; // owned by m_sSound RageSoundReader *m_pPlayerSounds[NUM_PLAYERS]; // owned by m_sSound diff --git a/src/BGAnimation.cpp b/src/BGAnimation.cpp index 57166cf59f..039ac7831b 100644 --- a/src/BGAnimation.cpp +++ b/src/BGAnimation.cpp @@ -36,7 +36,7 @@ void BGAnimation::AddLayersFromAniDir( const RString &_sAniDir, const XNode *pNo const RString& sAniDir = _sAniDir; { - vector vsLayerNames; + std::vector vsLayerNames; FOREACH_CONST_Child( pNode, pLayer ) { if( strncmp(pLayer->GetName(), "Layer", 5) == 0 ) @@ -129,7 +129,7 @@ void BGAnimation::LoadFromAniDir( const RString &_sAniDir ) // This is an 3.0 and before-style BGAnimation (not using .ini) // loading a directory of layers - vector asImagePaths; + std::vector asImagePaths; ASSERT( sAniDir != "" ); GetDirListing( sAniDir+"*.png", asImagePaths, false, true ); diff --git a/src/BGAnimationLayer.cpp b/src/BGAnimationLayer.cpp index 0caa21ccb6..19bfb02cad 100644 --- a/src/BGAnimationLayer.cpp +++ b/src/BGAnimationLayer.cpp @@ -155,7 +155,7 @@ void BGAnimationLayer::LoadFromAniLayerFile( const RString& sPath ) Effect effect = EFFECT_CENTER; for( int i=0; i m_vParticleVelocity; + std::vector m_vParticleVelocity; enum Type { diff --git a/src/BPMDisplay.cpp b/src/BPMDisplay.cpp index b0a5415b59..b6f794e5c7 100644 --- a/src/BPMDisplay.cpp +++ b/src/BPMDisplay.cpp @@ -102,7 +102,7 @@ void BPMDisplay::SetBPMRange( const DisplayBpms &bpms ) m_BPMS.clear(); - const vector &BPMS = bpms.vfBpms; + const std::vector &BPMS = bpms.vfBpms; bool AllIdentical = true; for( unsigned i = 0; i < BPMS.size(); ++i ) @@ -117,8 +117,8 @@ void BPMDisplay::SetBPMRange( const DisplayBpms &bpms ) int MaxBPM = INT_MIN; for( unsigned i = 0; i < BPMS.size(); ++i ) { - MinBPM = min( MinBPM, (int)lrintf(BPMS[i]) ); - MaxBPM = max( MaxBPM, (int)lrintf(BPMS[i]) ); + MinBPM = std::min( MinBPM, (int) lrintf(BPMS[i]) ); + MaxBPM = std::max( MaxBPM, (int) lrintf(BPMS[i]) ); } if( MinBPM == MaxBPM ) { @@ -141,7 +141,7 @@ void BPMDisplay::SetBPMRange( const DisplayBpms &bpms ) m_BPMS.push_back(BPMS[i]); // hold } - m_iCurrentBPM = min(1u, m_BPMS.size()); // start on the first hold + m_iCurrentBPM = std::min(1, static_cast(m_BPMS.size())); // start on the first hold m_fBPMFrom = BPMS[0]; m_fBPMTo = BPMS[0]; m_fPercentInState = 1; diff --git a/src/BPMDisplay.h b/src/BPMDisplay.h index d868ab23be..5fe5a7dff8 100644 --- a/src/BPMDisplay.h +++ b/src/BPMDisplay.h @@ -109,7 +109,7 @@ protected: /** @brief The current BPM index used. */ int m_iCurrentBPM; /** @brief The list of BPMs. */ - vector m_BPMS; + std::vector m_BPMS; float m_fPercentInState; /** @brief How long it takes to cycle the various BPMs. */ float m_fCycleTime; diff --git a/src/Background.cpp b/src/Background.cpp index 9311e4a498..db620b5f47 100644 --- a/src/Background.cpp +++ b/src/Background.cpp @@ -86,14 +86,14 @@ public: DancingCharacters* GetDancingCharacters() { return m_pDancingCharacters; }; - void GetLoadedBackgroundChanges( vector *pBackgroundChangesOut[NUM_BackgroundLayer] ); + void GetLoadedBackgroundChanges( std::vector *pBackgroundChangesOut[NUM_BackgroundLayer] ); protected: bool m_bInitted; DancingCharacters* m_pDancingCharacters; const Song *m_pSong; - map m_mapNameToTransition; - deque m_RandomBGAnimations; // random background to choose from. These may or may not be loaded into m_BGAnimations. + std::map m_mapNameToTransition; + std::deque m_RandomBGAnimations; // random background to choose from. These may or may not be loaded into m_BGAnimations. void LoadFromRandom( float fFirstBeat, float fEndBeat, const BackgroundChange &change ); bool IsDangerAllVisible(); @@ -107,13 +107,13 @@ protected: // return true if created and added to m_BGAnimations bool CreateBackground( const Song *pSong, const BackgroundDef &bd, Actor *pParent ); // return def of the background that was created and added to m_BGAnimations. calls CreateBackground - BackgroundDef CreateRandomBGA( const Song *pSong, const RString &sEffect, deque &RandomBGAnimations, Actor *pParent ); + BackgroundDef CreateRandomBGA( const Song *pSong, const RString &sEffect, std::deque &RandomBGAnimations, Actor *pParent ); int FindBGSegmentForBeat( float fBeat ) const; - void UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const map &mapNameToTransition ); + void UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const std::map &mapNameToTransition ); - map m_BGAnimations; - vector m_aBGChanges; + std::map m_BGAnimations; + std::vector m_aBGChanges; int m_iCurBGChangeIndex; Actor *m_pCurrentBGA; Actor *m_pFadingBGA; @@ -179,7 +179,7 @@ void BackgroundImpl::Init() // load transitions { ASSERT( m_mapNameToTransition.empty() ); - vector vsPaths, vsNames; + std::vector vsPaths, vsNames; BackgroundUtil::GetBackgroundTransitions( "", vsPaths, vsNames ); for( unsigned i=0; i vsToResolve; + std::vector vsToResolve; vsToResolve.push_back( bd.m_sFile1 ); vsToResolve.push_back( bd.m_sFile2 ); - vector vsResolved; + std::vector vsResolved; vsResolved.resize( vsToResolve.size() ); - vector vsResolvedRef; + std::vector vsResolvedRef; vsResolvedRef.resize( vsToResolve.size() ); for( unsigned i=0; i vsPaths, vsThrowAway; + std::vector vsPaths, vsThrowAway; // Look for BGAnims in the song dir if( sToResolve == SONG_BACKGROUND_FILE ) @@ -364,7 +364,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun RString sEffectFile; for( int i=0; i<2; i++ ) { - vector vsPaths, vsThrowAway; + std::vector vsPaths, vsThrowAway; BackgroundUtil::GetBackgroundEffects( sEffect, vsPaths, vsThrowAway ); if( vsPaths.empty() ) { @@ -396,7 +396,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun return true; } -BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const RString &sEffect, deque &RandomBGAnimations, Actor *pParent ) +BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const RString &sEffect, std::deque &RandomBGAnimations, Actor *pParent ) { if( g_RandomBackgroundMode == BGMODE_OFF ) return BackgroundDef(); @@ -417,7 +417,7 @@ BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const R if( !sEffect.empty() ) bd.m_sEffect = sEffect; - map::const_iterator iter = m_BGAnimations.find( bd ); + std::map::const_iterator iter = m_BGAnimations.find( bd ); // create the background if it's not already created if( iter == m_BGAnimations.end() ) @@ -436,7 +436,7 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fEndBeat, const Bac const TimingData &timing = m_pSong->m_SongTiming; // change BG every time signature change or 4 measures - const vector &tSigs = timing.GetTimingSegments(SEGMENT_TIME_SIG); + const std::vector &tSigs = timing.GetTimingSegments(SEGMENT_TIME_SIG); for (unsigned i = 0; i < tSigs.size(); i++) { @@ -444,9 +444,9 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fEndBeat, const Bac int iSegmentEndRow = (i + 1 == tSigs.size()) ? iEndRow : tSigs[i+1]->GetRow(); - int time_signature_start= max(ts->GetRow(),iStartRow); + int time_signature_start= std::max(ts->GetRow(),iStartRow); for(int j= time_signature_start; - jGetNoteRowsPerMeasure())) { // Don't fade. It causes frame rate dip, especially on slower machines. @@ -473,7 +473,7 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fEndBeat, const Bac if(RAND_BG_CHANGES_WHEN_BPM_CHANGES) { // change BG every BPM change that is at the beginning of a measure - const vector &bpms = timing.GetTimingSegments(SEGMENT_BPM); + const std::vector &bpms = timing.GetTimingSegments(SEGMENT_BPM); for( unsigned i=0; i vsThrowAway, vsNames; + std::vector vsThrowAway, vsNames; switch( g_RandomBackgroundMode ) { default: @@ -539,7 +539,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) // Pick the same random items every time the song is played. RandomGen rnd( GetHashForString(pSong->GetSongDir()) ); random_shuffle( vsNames.begin(), vsNames.end(), rnd ); - int iSize = min( (int)g_iNumBackgrounds, (int)vsNames.size() ); + int iSize = std::min( (int)g_iNumBackgrounds, (int)vsNames.size() ); vsNames.resize( iSize ); for (RString const &s : vsNames) @@ -718,7 +718,7 @@ int BackgroundImpl::Layer::FindBGSegmentForBeat( float fBeat ) const } /* If the BG segment has changed, move focus to it. Send Update() calls. */ -void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const map &mapNameToTransition ) +void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const std::map &mapNameToTransition ) { ASSERT( fCurrentTime != GameState::MUSIC_SECONDS_INVALID ); @@ -750,7 +750,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus m_pFadingBGA = m_pCurrentBGA; - map::const_iterator iter = m_BGAnimations.find( change.m_def ); + std::map::const_iterator iter = m_BGAnimations.find( change.m_def ); if( iter == m_BGAnimations.end() ) { XNode *pNode = change.m_def.CreateNode(); @@ -776,7 +776,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus if( !change.m_sTransition.empty() ) { - map::const_iterator lIter = mapNameToTransition.find( change.m_sTransition ); + std::map::const_iterator lIter = mapNameToTransition.find( change.m_sTransition ); if(lIter == mapNameToTransition.end()) { LuaHelpers::ReportScriptErrorFmt("'%s' is not the name of a BackgroundTransition file.", change.m_sTransition.c_str()); @@ -811,7 +811,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus } /* This is unaffected by the music rate. */ - float fDeltaTimeNoMusicRate = max( fDeltaTime / fRate, 0 ); + float fDeltaTimeNoMusicRate = std::max( fDeltaTime / fRate, 0.0f ); if( m_pCurrentBGA ) m_pCurrentBGA->Update( fDeltaTimeNoMusicRate ); @@ -876,7 +876,7 @@ void BackgroundImpl::DrawPrimitives() ActorFrame::DrawPrimitives(); } -void BackgroundImpl::GetLoadedBackgroundChanges( vector *pBackgroundChangesOut[NUM_BackgroundLayer] ) +void BackgroundImpl::GetLoadedBackgroundChanges( std::vector *pBackgroundChangesOut[NUM_BackgroundLayer] ) { FOREACH_BackgroundLayer( i ) *pBackgroundChangesOut[i] = m_Layer[i].m_aBGChanges; @@ -988,7 +988,7 @@ void Background::Unload() { m_pImpl->Unload(); } void Background::FadeToActualBrightness() { m_pImpl->FadeToActualBrightness(); } void Background::SetBrightness( float fBrightness ) { m_pImpl->SetBrightness(fBrightness); } DancingCharacters* Background::GetDancingCharacters() { return m_pImpl->GetDancingCharacters(); } -void Background::GetLoadedBackgroundChanges( vector *pBackgroundChangesOut[NUM_BackgroundLayer] ) { m_pImpl->GetLoadedBackgroundChanges(pBackgroundChangesOut); } +void Background::GetLoadedBackgroundChanges( std::vector *pBackgroundChangesOut[NUM_BackgroundLayer] ) { m_pImpl->GetLoadedBackgroundChanges(pBackgroundChangesOut); } /* * (c) 2001-2004 Chris Danford, Ben Nordstrom diff --git a/src/Background.h b/src/Background.h index f0785d9cfb..59365b78f8 100644 --- a/src/Background.h +++ b/src/Background.h @@ -35,7 +35,7 @@ public: * @return the dancing characters. */ DancingCharacters* GetDancingCharacters(); - void GetLoadedBackgroundChanges( vector **pBackgroundChangesOut ); + void GetLoadedBackgroundChanges( std::vector **pBackgroundChangesOut ); protected: BackgroundImpl *m_pImpl; diff --git a/src/BackgroundUtil.cpp b/src/BackgroundUtil.cpp index 24a5eb4976..c0ea2b7b8b 100644 --- a/src/BackgroundUtil.cpp +++ b/src/BackgroundUtil.cpp @@ -54,7 +54,7 @@ XNode *BackgroundDef::CreateNode() const RString BackgroundChange::GetTextDescription() const { - vector vsParts; + std::vector vsParts; if( !m_def.m_sFile1.empty() ) vsParts.push_back( m_def.m_sFile1 ); if( !m_def.m_sFile2.empty() ) vsParts.push_back( m_def.m_sFile2 ); if( m_fRate!=1.0f ) vsParts.push_back( ssprintf("%.2f%%",m_fRate*100) ); @@ -108,7 +108,7 @@ const RString SBE_StretchNoLoop = "StretchNoLoop"; const RString SBE_StretchRewind = "StretchRewind"; const RString SBT_CrossFade = "CrossFade"; -static void StripCvsAndSvn( vector &vsPathsToStrip, vector &vsNamesToStrip ) +static void StripCvsAndSvn( std::vector &vsPathsToStrip, std::vector &vsNamesToStrip ) { ASSERT( vsPathsToStrip.size() == vsNamesToStrip.size() ); for( unsigned i=0; i &vBackgroundChanges ) +void BackgroundUtil::SortBackgroundChangesArray( std::vector &vBackgroundChanges ) { sort( vBackgroundChanges.begin(), vBackgroundChanges.end(), CompareBackgroundChanges ); } -void BackgroundUtil::AddBackgroundChange( vector &vBackgroundChanges, BackgroundChange seg ) +void BackgroundUtil::AddBackgroundChange( std::vector &vBackgroundChanges, BackgroundChange seg ) { - vector::iterator it; + std::vector::iterator it; it = upper_bound( vBackgroundChanges.begin(), vBackgroundChanges.end(), seg, CompareBackgroundChanges ); vBackgroundChanges.insert( it, seg ); } -void BackgroundUtil::GetBackgroundEffects( const RString &_sName, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetBackgroundEffects( const RString &_sName, std::vector &vsPathsOut, std::vector &vsNamesOut ) { RString sName = _sName; if( sName == "" ) @@ -154,7 +154,7 @@ void BackgroundUtil::GetBackgroundEffects( const RString &_sName, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetBackgroundTransitions( const RString &_sName, std::vector &vsPathsOut, std::vector &vsNamesOut ) { RString sName = _sName; if( sName == "" ) @@ -172,7 +172,7 @@ void BackgroundUtil::GetBackgroundTransitions( const RString &_sName, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetSongBGAnimations( const Song *pSong, const RString &sMatch, std::vector &vsPathsOut, std::vector &vsNamesOut ) { vsPathsOut.clear(); if( sMatch.empty() ) @@ -191,7 +191,7 @@ void BackgroundUtil::GetSongBGAnimations( const Song *pSong, const RString &sMat StripCvsAndSvn( vsPathsOut, vsNamesOut ); } -void BackgroundUtil::GetSongMovies( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetSongMovies( const Song *pSong, const RString &sMatch, std::vector &vsPathsOut, std::vector &vsNamesOut ) { vsPathsOut.clear(); if( sMatch.empty() ) @@ -211,7 +211,7 @@ void BackgroundUtil::GetSongMovies( const Song *pSong, const RString &sMatch, ve StripCvsAndSvn( vsPathsOut, vsNamesOut ); } -void BackgroundUtil::GetSongBitmaps( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetSongBitmaps( const Song *pSong, const RString &sMatch, std::vector &vsPathsOut, std::vector &vsNamesOut ) { vsPathsOut.clear(); if( sMatch.empty() ) @@ -231,7 +231,7 @@ void BackgroundUtil::GetSongBitmaps( const Song *pSong, const RString &sMatch, v StripCvsAndSvn( vsPathsOut, vsNamesOut ); } -static void GetFilterToFileNames( const RString sBaseDir, const Song *pSong, set &vsPossibleFileNamesOut ) +static void GetFilterToFileNames( const RString sBaseDir, const Song *pSong, std::set &vsPossibleFileNamesOut ) { vsPossibleFileNamesOut.clear(); @@ -262,7 +262,7 @@ static void GetFilterToFileNames( const RString sBaseDir, const Song *pSong, set vsPossibleFileNamesOut.insert( p->first ); } -void BackgroundUtil::GetGlobalBGAnimations( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetGlobalBGAnimations( const Song *pSong, const RString &sMatch, std::vector &vsPathsOut, std::vector &vsNamesOut ) { vsPathsOut.clear(); GetDirListing( BG_ANIMS_DIR+sMatch+"*", vsPathsOut, true, true ); @@ -283,7 +283,7 @@ namespace { void GetGlobalRandomMoviePaths( const Song *pSong, const RString &sMatch, - vector &vsPathsOut, + std::vector &vsPathsOut, bool bTryInsideOfSongGroupAndGenreFirst, bool bTryInsideOfSongGroupFirst ) { @@ -301,11 +301,11 @@ namespace { } // Search for the most appropriate background - set ssFileNameWhitelist; + std::set ssFileNameWhitelist; if( bTryInsideOfSongGroupAndGenreFirst && pSong && !pSong->m_sGenre.empty() ) GetFilterToFileNames( RANDOMMOVIES_DIR, pSong, ssFileNameWhitelist ); - vector vsDirsToTry; + std::vector vsDirsToTry; if( bTryInsideOfSongGroupFirst && pSong ) { ASSERT( !pSong->m_sGroupName.empty() ); @@ -322,7 +322,7 @@ namespace { if( !ssFileNameWhitelist.empty() ) { - vector vsMatches; + std::vector vsMatches; for (RString const &s : vsPathsOut) { RString sBasename = Basename( s ); @@ -349,8 +349,8 @@ namespace { void BackgroundUtil::GetGlobalRandomMovies( const Song *pSong, const RString &sMatch, - vector &vsPathsOut, - vector &vsNamesOut, + std::vector &vsPathsOut, + std::vector &vsNamesOut, bool bTryInsideOfSongGroupAndGenreFirst, bool bTryInsideOfSongGroupFirst ) { @@ -371,7 +371,7 @@ void BackgroundUtil::BakeAllBackgroundChanges( Song *pSong ) { Background bg; bg.LoadFromSong( pSong ); - vector *vBGChanges[NUM_BackgroundLayer]; + std::vector *vBGChanges[NUM_BackgroundLayer]; FOREACH_BackgroundLayer( i ) vBGChanges[i] = &pSong->GetBackgroundChanges(i); bg.GetLoadedBackgroundChanges( vBGChanges ); diff --git a/src/BackgroundUtil.h b/src/BackgroundUtil.h index 4858019e5f..40ad93be27 100644 --- a/src/BackgroundUtil.h +++ b/src/BackgroundUtil.h @@ -73,17 +73,17 @@ struct BackgroundChange /** @brief Shared background-related routines. */ namespace BackgroundUtil { - void AddBackgroundChange( vector &vBackgroundChanges, BackgroundChange seg ); - void SortBackgroundChangesArray( vector &vBackgroundChanges ); + void AddBackgroundChange( std::vector &vBackgroundChanges, BackgroundChange seg ); + void SortBackgroundChangesArray( std::vector &vBackgroundChanges ); - void GetBackgroundEffects( const RString &sName, vector &vsPathsOut, vector &vsNamesOut ); - void GetBackgroundTransitions( const RString &sName, vector &vsPathsOut, vector &vsNamesOut ); + void GetBackgroundEffects( const RString &sName, std::vector &vsPathsOut, std::vector &vsNamesOut ); + void GetBackgroundTransitions( const RString &sName, std::vector &vsPathsOut, std::vector &vsNamesOut ); - void GetSongBGAnimations( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ); - void GetSongMovies( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ); - void GetSongBitmaps( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ); - void GetGlobalBGAnimations( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ); - void GetGlobalRandomMovies( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut, bool bTryInsideOfSongGroupAndGenreFirst = true, bool bTryInsideOfSongGroupFirst = true ); + void GetSongBGAnimations( const Song *pSong, const RString &sMatch, std::vector &vsPathsOut, std::vector &vsNamesOut ); + void GetSongMovies( const Song *pSong, const RString &sMatch, std::vector &vsPathsOut, std::vector &vsNamesOut ); + void GetSongBitmaps( const Song *pSong, const RString &sMatch, std::vector &vsPathsOut, std::vector &vsNamesOut ); + void GetGlobalBGAnimations( const Song *pSong, const RString &sMatch, std::vector &vsPathsOut, std::vector &vsNamesOut ); + void GetGlobalRandomMovies( const Song *pSong, const RString &sMatch, std::vector &vsPathsOut, std::vector &vsNamesOut, bool bTryInsideOfSongGroupAndGenreFirst = true, bool bTryInsideOfSongGroupFirst = true ); void BakeAllBackgroundChanges( Song *pSong ); }; diff --git a/src/BitmapText.cpp b/src/BitmapText.cpp index 61fe813597..fc629daa4d 100644 --- a/src/BitmapText.cpp +++ b/src/BitmapText.cpp @@ -27,7 +27,7 @@ REGISTER_ACTOR_CLASS( BitmapText ); #define NUM_RAINBOW_COLORS THEME->GetMetricI("BitmapText","NumRainbowColors") #define RAINBOW_COLOR(n) THEME->GetMetricC("BitmapText",ssprintf("RainbowColor%i", n+1)) -static vector RAINBOW_COLORS; +static std::vector RAINBOW_COLORS; BitmapText::BitmapText() { @@ -254,7 +254,7 @@ void BitmapText::BuildChars() for( unsigned l=0; lGetLineWidthInSourcePixels( m_wTextLines[l] )); - m_size.x = max( m_size.x, m_iLineWidths.back() ); + m_size.x = std::max( m_size.x, (float) m_iLineWidths.back() ); } /* Ensure that the width is always even. This maintains pixel alignment; @@ -283,7 +283,7 @@ void BitmapText::BuildChars() { iY += m_pFont->GetHeight(); - wstring sLine = m_wTextLines[i]; + std::wstring sLine = m_wTextLines[i]; if( m_pFont->IsRightToLeft() ) reverse( sLine.begin(), sLine.end() ); const int iLineWidth = m_iLineWidths[i]; @@ -494,12 +494,12 @@ void BitmapText::SetTextInternal() /* "...I can add Japanese wrapping, at least. We could handle hyphens * and soft hyphens and pretty easily, too." -glenn */ // TODO: Move this wrapping logic into Font. - vector asLines; + std::vector asLines; split( m_sText, "\n", asLines, false ); for( unsigned line = 0; line < asLines.size(); ++line ) { - vector asWords; + std::vector asWords; split( asLines[line], " ", asWords ); RString sCurLine; @@ -612,7 +612,7 @@ void BitmapText::UpdateBaseZoom() } \ if(dimension != 0) \ { \ - const float zoom= min(1, dimension_max / dimension); \ + const float zoom= fmin(1, dimension_max / dimension); \ base_zoom_set(zoom); \ } \ } @@ -646,7 +646,7 @@ void BitmapText::CropLineToWidth(size_t l, int width) if(l < m_wTextLines.size()) { int used_width= width; - wstring& line= m_wTextLines[l]; + std::wstring& line= m_wTextLines[l]; int fit= m_pFont->GetGlyphsThatFit(line, &used_width); if(fit < line.size()) { @@ -720,12 +720,12 @@ void BitmapText::DrawPrimitives() else { size_t i = 0; - map::const_iterator iter = m_mAttributes.begin(); + std::map::const_iterator iter = m_mAttributes.begin(); while( i < m_aVertices.size() ) { // Set the colors up to the next attribute. size_t iEnd = iter == m_mAttributes.end()? m_aVertices.size():iter->first*4; - iEnd = min( iEnd, m_aVertices.size() ); + iEnd = std::min( iEnd, m_aVertices.size() ); for( ; i < iEnd; i += 4 ) { m_aVertices[i+0].c = m_pTempState->diffuse[0]; // top left @@ -742,8 +742,8 @@ void BitmapText::DrawPrimitives() iEnd = iter == m_mAttributes.end()? m_aVertices.size():iter->first*4; else iEnd = i + attr.length*4; - iEnd = min( iEnd, m_aVertices.size() ); - vector temp_attr_diffuse(NUM_DIFFUSE_COLORS, m_internalDiffuse); + iEnd = std::min( iEnd, m_aVertices.size() ); + std::vector temp_attr_diffuse(NUM_DIFFUSE_COLORS, m_internalDiffuse); for(size_t c= 0; c < NUM_DIFFUSE_COLORS; ++c) { temp_attr_diffuse[c]*= attr.diffuse[c]; @@ -763,7 +763,7 @@ void BitmapText::DrawPrimitives() } // apply jitter to verts - vector vGlyphJitter; + std::vector vGlyphJitter; if( m_bJitter ) { int iSeed = lrintf( RageTimer::GetTimeSinceStartFast()*8 ); @@ -805,12 +805,12 @@ void BitmapText::DrawPrimitives() DISPLAY->SetTextureMode( TextureUnit_1, TextureMode_Glow ); size_t i = 0; - map::const_iterator iter = m_mAttributes.begin(); + std::map::const_iterator iter = m_mAttributes.begin(); while( i < m_aVertices.size() ) { // Set the glow up to the next attribute. size_t iEnd = iter == m_mAttributes.end()? m_aVertices.size():iter->first*4; - iEnd = min( iEnd, m_aVertices.size() ); + iEnd = std::min( iEnd, m_aVertices.size() ); for( ; i < iEnd; ++i ) m_aVertices[i].c = m_pTempState->glow; if( iter == m_mAttributes.end() ) @@ -822,7 +822,7 @@ void BitmapText::DrawPrimitives() iEnd = iter == m_mAttributes.end()? m_aVertices.size():iter->first*4; else iEnd = i + attr.length*4; - iEnd = min( iEnd, m_aVertices.size() ); + iEnd = std::min( iEnd, m_aVertices.size() ); for( ; i < iEnd; ++i ) { if( m_internalGlow.a > 0 ) @@ -878,7 +878,7 @@ void BitmapText::AddAttribute( size_t iPos, const Attribute &attr ) int iLines = 0; size_t iAdjustedPos = iPos; - for (wstring const & line : m_wTextLines) + for (std::wstring const & line : m_wTextLines) { size_t length = line.length(); if( length >= iAdjustedPos ) diff --git a/src/BitmapText.h b/src/BitmapText.h index 802f4594fe..c2d829a9be 100644 --- a/src/BitmapText.h +++ b/src/BitmapText.h @@ -85,8 +85,8 @@ public: void SetTextGlowMode( TextGlowMode tgm ) { m_TextGlowMode = tgm; } - void GetLines( vector &wTextLines ) const { wTextLines = m_wTextLines; } - const vector &GetLines() const { return m_wTextLines; } + void GetLines( std::vector &wTextLines ) const { wTextLines = m_wTextLines; } + const std::vector &GetLines() const { return m_wTextLines; } RString GetText() const { return m_sText; } // Return true if the string 's' will use an alternate string, if available. @@ -113,8 +113,8 @@ protected: Font *m_pFont; bool m_bUppercase; RString m_sText; - vector m_wTextLines; - vector m_iLineWidths; // in source pixels + std::vector m_wTextLines; + std::vector m_iLineWidths; // in source pixels int m_iWrapWidthPixels; // -1 = no wrap float m_fMaxWidth; // 0 = no max float m_fMaxHeight; // 0 = no max @@ -126,10 +126,10 @@ protected: float m_fDistortion; int m_iVertSpacing; - vector m_aVertices; + std::vector m_aVertices; - vector m_vpFontPageTextures; - map m_mAttributes; + std::vector m_vpFontPageTextures; + std::map m_mAttributes; bool m_bHasGlowAttribute; TextGlowMode m_TextGlowMode; @@ -141,7 +141,7 @@ protected: private: void SetTextInternal(); - vector BMT_Tweens; + std::vector BMT_Tweens; BMT_TweenState BMT_current; BMT_TweenState BMT_start; }; diff --git a/src/Bookkeeper.cpp b/src/Bookkeeper.cpp index 94a68acc9b..f421db7df7 100644 --- a/src/Bookkeeper.cpp +++ b/src/Bookkeeper.cpp @@ -98,7 +98,7 @@ XNode* Bookkeeper::CreateNode() const { XNode* pData = xml->AppendChild("Data"); - for( map::const_iterator it = m_mapCoinsForHour.begin(); it != m_mapCoinsForHour.end(); ++it ) + for( std::map::const_iterator it = m_mapCoinsForHour.begin(); it != m_mapCoinsForHour.end(); ++it ) { int iCoins = it->second; XNode *pDay = pData->AppendChild( "Coins", iCoins ); @@ -173,7 +173,7 @@ void Bookkeeper::ReadCoinsFile( int &coins ) } // Return the number of coins between [beginning,ending). -int Bookkeeper::GetNumCoinsInRange( map::const_iterator begin, map::const_iterator end ) const +int Bookkeeper::GetNumCoinsInRange( std::map::const_iterator begin, std::map::const_iterator end ) const { int iCoins = 0; @@ -237,7 +237,7 @@ void Bookkeeper::GetCoinsByDayOfWeek( int coins[DAYS_IN_WEEK] ) const for( int i=0; i::const_iterator it = m_mapCoinsForHour.begin(); it != m_mapCoinsForHour.end(); ++it ) + for( std::map::const_iterator it = m_mapCoinsForHour.begin(); it != m_mapCoinsForHour.end(); ++it ) { const Date &d = it->first; int iDayOfWeek = GetDayInYearAndYear( d.m_iDayOfYear, d.m_iYear ).tm_wday; @@ -248,7 +248,7 @@ void Bookkeeper::GetCoinsByDayOfWeek( int coins[DAYS_IN_WEEK] ) const void Bookkeeper::GetCoinsByHour( int coins[HOURS_IN_DAY] ) const { memset( coins, 0, sizeof(int) * HOURS_IN_DAY ); - for( map::const_iterator it = m_mapCoinsForHour.begin(); it != m_mapCoinsForHour.end(); ++it ) + for( std::map::const_iterator it = m_mapCoinsForHour.begin(); it != m_mapCoinsForHour.end(); ++it ) { const Date &d = it->first; diff --git a/src/Bookkeeper.h b/src/Bookkeeper.h index ef13e82609..4e0566b539 100644 --- a/src/Bookkeeper.h +++ b/src/Bookkeeper.h @@ -58,10 +58,10 @@ private: bool operator<( const Date &rhs ) const; }; int GetNumCoins( Date beginning, Date ending ) const; - int GetNumCoinsInRange( map::const_iterator begin, map::const_iterator end ) const; + int GetNumCoinsInRange( std::map::const_iterator begin, std::map::const_iterator end ) const; int m_iLastSeenTime; - map m_mapCoinsForHour; + std::map m_mapCoinsForHour; }; extern Bookkeeper* BOOKKEEPER; // global and accessible from anywhere in our program diff --git a/src/Character.cpp b/src/Character.cpp index b6392ef4cb..44d329579c 100644 --- a/src/Character.cpp +++ b/src/Character.cpp @@ -20,13 +20,13 @@ bool Character::Load( RString sCharDir ) // save ID { - vector as; + std::vector as; split( sCharDir, "/", as ); m_sCharacterID = as.back(); } { - vector as; + std::vector as; GetDirListing( m_sCharDir+"card.png", as, false, true ); GetDirListing( m_sCharDir+"card.jpg", as, false, true ); GetDirListing( m_sCharDir+"card.jpeg", as, false, true ); @@ -39,7 +39,7 @@ bool Character::Load( RString sCharDir ) } { - vector as; + std::vector as; GetDirListing( m_sCharDir+"icon.png", as, false, true ); GetDirListing( m_sCharDir+"icon.jpg", as, false, true ); GetDirListing( m_sCharDir+"icon.jpeg", as, false, true ); @@ -74,7 +74,7 @@ bool Character::Load( RString sCharDir ) RString GetRandomFileInDir( RString sDir ) { - vector asFiles; + std::vector asFiles; GetDirListing( sDir, asFiles, false, true ); if( asFiles.empty() ) return RString(); @@ -96,7 +96,7 @@ RString Character::GetWarmUpAnimationPath() const { return DerefRedir(GetRandomF RString Character::GetDanceAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Dance/")); } RString Character::GetTakingABreakPath() const { - vector as; + std::vector as; GetDirListing( m_sCharDir+"break.png", as, false, true ); GetDirListing( m_sCharDir+"break.jpg", as, false, true ); GetDirListing( m_sCharDir+"break.jpeg", as, false, true ); @@ -110,7 +110,7 @@ RString Character::GetTakingABreakPath() const RString Character::GetSongSelectIconPath() const { - vector as; + std::vector as; // first try and find an icon specific to the select music screen // so you can have different icons for music select / char select GetDirListing( m_sCharDir+"selectmusicicon.png", as, false, true ); @@ -138,7 +138,7 @@ RString Character::GetSongSelectIconPath() const RString Character::GetStageIconPath() const { - vector as; + std::vector as; // first try and find an icon specific to the select music screen // so you can have different icons for music select / char select GetDirListing( m_sCharDir+"stageicon.png", as, false, true ); diff --git a/src/CharacterManager.cpp b/src/CharacterManager.cpp index 87e5eada46..655fc542c1 100644 --- a/src/CharacterManager.cpp +++ b/src/CharacterManager.cpp @@ -24,7 +24,7 @@ CharacterManager::CharacterManager() SAFE_DELETE( m_pCharacters[i] ); m_pCharacters.clear(); - vector as; + std::vector as; GetDirListing( CHARACTERS_DIR "*", as, true, true ); StripCvsAndSvn( as ); StripMacResourceForks( as ); @@ -63,7 +63,7 @@ CharacterManager::~CharacterManager() LUA->UnsetGlobal( "CHARMAN" ); } -void CharacterManager::GetCharacters( vector &apCharactersOut ) +void CharacterManager::GetCharacters( std::vector &apCharactersOut ) { for( unsigned i=0; iIsDefaultCharacter() ) @@ -72,7 +72,7 @@ void CharacterManager::GetCharacters( vector &apCharactersOut ) Character* CharacterManager::GetRandomCharacter() { - vector apCharacters; + std::vector apCharacters; GetCharacters( apCharacters ); if( apCharacters.size() ) return apCharacters[RandomInt(apCharacters.size())]; @@ -146,7 +146,7 @@ public: } static int GetAllCharacters( T* p, lua_State *L ) { - vector vChars; + std::vector vChars; p->GetCharacters(vChars); LuaHelpers::CreateTableFromArray(vChars, L); @@ -154,7 +154,7 @@ public: } static int GetCharacterCount(T* p, lua_State *L) { - vector chars; + std::vector chars; p->GetCharacters(chars); lua_pushnumber(L, chars.size()); return 1; diff --git a/src/CharacterManager.h b/src/CharacterManager.h index 1f8bfe0567..2cf31a3afb 100644 --- a/src/CharacterManager.h +++ b/src/CharacterManager.h @@ -13,7 +13,7 @@ public: /** @brief Destroy the character manager. */ ~CharacterManager(); - void GetCharacters( vector &vpCharactersOut ); + void GetCharacters( std::vector &vpCharactersOut ); /** @brief Get one installed character at random. * @return The random character. */ Character* GetRandomCharacter(); @@ -29,7 +29,7 @@ public: void PushSelf( lua_State *L ); private: - vector m_pCharacters; + std::vector m_pCharacters; }; diff --git a/src/CodeDetector.cpp b/src/CodeDetector.cpp index 42780e0805..53ff9832ca 100644 --- a/src/CodeDetector.cpp +++ b/src/CodeDetector.cpp @@ -167,13 +167,13 @@ void CodeDetector::ChangeScrollSpeed( GameController controller, bool bIncrement RString sTitleOut; ScreenOptionsMaster::SetList( row, hand, "Speed", sTitleOut ); - vector& entries = hand.ListEntries; + std::vector& entries = hand.ListEntries; RString sScrollSpeed = po.GetScrollSpeedAsString(); if (sScrollSpeed.empty()) sScrollSpeed = "1x"; - for ( vector::iterator it = entries.begin(); it != entries.end(); ++it ) + for ( std::vector::iterator it = entries.begin(); it != entries.end(); ++it ) { ModeChoice& modeChoice = *it; if ( modeChoice.m_sModifiers == sScrollSpeed ) { diff --git a/src/CodeSet.cpp b/src/CodeSet.cpp index 1917594e82..59b7ffe411 100644 --- a/src/CodeSet.cpp +++ b/src/CodeSet.cpp @@ -15,7 +15,7 @@ void InputQueueCodeSet::Load( const RString &sType ) for( unsigned c=0; c asBits; + std::vector asBits; split( m_asCodeNames[c], "=", asBits, true ); RString sCodeName = asBits[0]; if( asBits.size() > 1 ) diff --git a/src/CodeSet.h b/src/CodeSet.h index 9da45ad45a..8968af2dc3 100644 --- a/src/CodeSet.h +++ b/src/CodeSet.h @@ -12,8 +12,8 @@ public: bool InputMessage( const InputEventPlus &input, Message &msg ) const; private: - vector m_aCodes; - vector m_asCodeNames; + std::vector m_aCodes; + std::vector m_asCodeNames; }; #endif diff --git a/src/ComboGraph.cpp b/src/ComboGraph.cpp index d743607943..92853615c3 100644 --- a/src/ComboGraph.cpp +++ b/src/ComboGraph.cpp @@ -73,7 +73,7 @@ void ComboGraph::Set( const StageStats &s, const PlayerStageStats &pss ) // 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() ); + iMaxComboSize = std::max( iMaxComboSize, pss.m_ComboList[i].GetStageCnt() ); for( unsigned i = 0; i < pss.m_ComboList.size(); ++i ) { diff --git a/src/Command.cpp b/src/Command.cpp index 679f50f493..4764b79de3 100644 --- a/src/Command.cpp +++ b/src/Command.cpp @@ -34,7 +34,7 @@ RString Command::GetOriginalCommandString() const return join( ",", m_vsArgs ); } -static void SplitWithQuotes( const RString sSource, const char Delimitor, vector &asOut, const bool bIgnoreEmpty ) +static void SplitWithQuotes( const RString sSource, const char Delimitor, std::vector &asOut, const bool bIgnoreEmpty ) { /* Short-circuit if the source is empty; we want to return an empty vector if * the string is empty, even if bIgnoreEmpty is true. */ @@ -53,7 +53,7 @@ static void SplitWithQuotes( const RString sSource, const char Delimitor, vector { /* We've found a quote. Search for the close. */ pos = sSource.find( sSource[pos], pos+1 ); - if( pos == string::npos ) + if( pos == std::string::npos ) pos = sSource.size(); else ++pos; @@ -86,7 +86,7 @@ RString Commands::GetOriginalCommandString() const void ParseCommands( const RString &sCommands, Commands &vCommandsOut, bool bLegacy ) { - vector vsCommands; + std::vector vsCommands; if( bLegacy ) split( sCommands, ";", vsCommands, true ); else diff --git a/src/Command.h b/src/Command.h index 94fdcfc242..627b949eb7 100644 --- a/src/Command.h +++ b/src/Command.h @@ -20,7 +20,7 @@ public: }; Arg GetArg( unsigned index ) const; - vector m_vsArgs; + std::vector m_vsArgs; Command(): m_vsArgs() {} }; @@ -28,7 +28,7 @@ public: class Commands { public: - vector v; + std::vector v; RString GetOriginalCommandString() const; // used when reporting an error in number of args }; diff --git a/src/CommandLineActions.cpp b/src/CommandLineActions.cpp index 65d72bd35f..ece58915dc 100644 --- a/src/CommandLineActions.cpp +++ b/src/CommandLineActions.cpp @@ -24,7 +24,7 @@ #include #endif -vector CommandLineActions::ToProcess; +std::vector CommandLineActions::ToProcess; static void LuaInformation() { @@ -33,7 +33,7 @@ static void LuaInformation() pNode->AppendAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); pNode->AppendAttr("xsi:schemaLocation", "http://www.stepmania.com Lua.xsd"); - pNode->AppendChild("Version", string(PRODUCT_FAMILY) + product_version); + pNode->AppendChild("Version", std::string(PRODUCT_FAMILY) + product_version); pNode->AppendChild("Date", DateTime::GetNowDate().GetString()); XmlFileUtil::SaveToFile(pNode, "Lua.xml", "Lua.xsl"); @@ -50,7 +50,7 @@ static void LuaInformation() static void Version() { #if defined(WIN32) - RString sProductID = ssprintf("%s", (string(PRODUCT_FAMILY) + product_version).c_str() ); + RString sProductID = ssprintf("%s", (std::string(PRODUCT_FAMILY) + product_version).c_str() ); RString sVersion = ssprintf("build %s\nCompile Date: %s @ %s", ::sm_version_git_hash, version_date, version_time); AllocConsole(); diff --git a/src/CommandLineActions.h b/src/CommandLineActions.h index daa7c5dde4..491a44a079 100644 --- a/src/CommandLineActions.h +++ b/src/CommandLineActions.h @@ -16,13 +16,13 @@ namespace CommandLineActions { public: /** @brief the arguments in question. */ - vector argv; + std::vector argv; }; /** * @brief A list of command line arguemnts to process while the game is running. * These args could have come from this process or passed to this process * from another process. */ - extern vector ToProcess; + extern std::vector ToProcess; } #endif diff --git a/src/CommonMetrics.cpp b/src/CommonMetrics.cpp index 97ab63e3a6..138ed00f65 100644 --- a/src/CommonMetrics.cpp +++ b/src/CommonMetrics.cpp @@ -37,7 +37,7 @@ void ThemeMetricDifficultiesToShow::Read() m_v.clear(); - vector v; + std::vector v; split( ThemeMetric::GetValue(), ",", v ); if(v.empty()) { @@ -58,7 +58,7 @@ void ThemeMetricDifficultiesToShow::Read() } } } -const vector& ThemeMetricDifficultiesToShow::GetValue() const { return m_v; } +const std::vector& ThemeMetricDifficultiesToShow::GetValue() const { return m_v; } ThemeMetricCourseDifficultiesToShow::ThemeMetricCourseDifficultiesToShow( const RString& sGroup, const RString& sName ) : @@ -76,7 +76,7 @@ void ThemeMetricCourseDifficultiesToShow::Read() m_v.clear(); - vector v; + std::vector v; split( ThemeMetric::GetValue(), ",", v ); if(v.empty()) { @@ -97,11 +97,11 @@ void ThemeMetricCourseDifficultiesToShow::Read() } } } -const vector& ThemeMetricCourseDifficultiesToShow::GetValue() const { return m_v; } +const std::vector& ThemeMetricCourseDifficultiesToShow::GetValue() const { return m_v; } -static void RemoveStepsTypes( vector& inout, RString sStepsTypesToRemove ) +static void RemoveStepsTypes( std::vector& inout, RString sStepsTypesToRemove ) { - vector v; + std::vector v; split( sStepsTypesToRemove, ",", v ); if( v.size() == 0 ) return; // Nothing to do! @@ -115,7 +115,7 @@ static void RemoveStepsTypes( vector& inout, RString sStepsTypesToRem continue; } - const vector::iterator iter = find( inout.begin(), inout.end(), st ); + const std::vector::iterator iter = find( inout.begin(), inout.end(), st ); if( iter != inout.end() ) inout.erase( iter ); } @@ -138,7 +138,7 @@ void ThemeMetricStepsTypesToShow::Read() RemoveStepsTypes( m_v, ThemeMetric::GetValue() ); } -const vector& ThemeMetricStepsTypesToShow::GetValue() const { return m_v; } +const std::vector& ThemeMetricStepsTypesToShow::GetValue() const { return m_v; } RString CommonMetrics::LocalizeOptionItem( const RString &s, bool bOptional ) diff --git a/src/CommonMetrics.h b/src/CommonMetrics.h index c2a4bf9503..a910b398a3 100644 --- a/src/CommonMetrics.h +++ b/src/CommonMetrics.h @@ -14,9 +14,9 @@ public: ThemeMetricDifficultiesToShow(): m_v() { } ThemeMetricDifficultiesToShow( const RString& sGroup, const RString& sName ); void Read(); - const vector &GetValue() const; + const std::vector &GetValue() const; private: - vector m_v; + std::vector m_v; }; class ThemeMetricCourseDifficultiesToShow : public ThemeMetric { @@ -24,9 +24,9 @@ public: ThemeMetricCourseDifficultiesToShow(): m_v() { } ThemeMetricCourseDifficultiesToShow( const RString& sGroup, const RString& sName ); void Read(); - const vector &GetValue() const; + const std::vector &GetValue() const; private: - vector m_v; + std::vector m_v; }; class ThemeMetricStepsTypesToShow : public ThemeMetric { @@ -34,9 +34,9 @@ public: ThemeMetricStepsTypesToShow(): m_v() { } ThemeMetricStepsTypesToShow( const RString& sGroup, const RString& sName ); void Read(); - const vector &GetValue() const; + const std::vector &GetValue() const; private: - vector m_v; + std::vector m_v; }; diff --git a/src/Course.cpp b/src/Course.cpp index 4de8a617d5..64120bb2a0 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -46,7 +46,7 @@ const int MAX_BOTTOM_RANGE = 10; RString CourseEntry::GetTextDescription() const { - vector vsEntryDescription; + std::vector vsEntryDescription; Song *pSong = songID.ToSong(); if( pSong ) vsEntryDescription.push_back( pSong->GetTranslitFullTitle() ); @@ -342,7 +342,7 @@ bool Course::GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) c ASSERT_M( trail.m_vEntries.size() == SortTrail.m_vEntries.size(), ssprintf("%i %i", int(trail.m_vEntries.size()), int(SortTrail.m_vEntries.size())) ); - vector entries; + std::vector entries; for( unsigned i = 0; i < trail.m_vEntries.size(); ++i ) { SortTrailEntry ste; @@ -362,7 +362,7 @@ bool Course::GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) c } // TODO: Move Course initialization after PROFILEMAN is created -static void CourseSortSongs( SongSort sort, vector &vpPossibleSongs, RandomGen &rnd ) +static void CourseSortSongs( SongSort sort, std::vector &vpPossibleSongs, RandomGen &rnd ) { switch( sort ) { @@ -421,7 +421,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) // Different seed for each course, but the same for the whole round: RandomGen rnd( GAMESTATE->m_iStageSeed + GetHashForString(m_sMainTitle) ); - vector tmp_entries; + std::vector tmp_entries; if( m_bShuffle ) { /* Always randomize the same way per round. Otherwise, the displayed course @@ -431,11 +431,11 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) random_shuffle( tmp_entries.begin(), tmp_entries.end(), rnd ); } - const vector &entries = m_bShuffle ? tmp_entries:m_vEntries; + const std::vector &entries = m_bShuffle ? tmp_entries:m_vEntries; // This can take some time, so don't fill it out unless we need it. - vector vSongsByMostPlayed; - vector AllSongsShuffled; + std::vector vSongsByMostPlayed; + std::vector AllSongsShuffled; trail.m_StepsType = st; trail.m_CourseType = GetCourseType(); @@ -454,7 +454,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) } else { - vector vSongAndSteps; + std::vector vSongAndSteps; for (auto e = entries.begin(); e != entries.end(); ++e) { SongAndSteps resolved; // fill this in @@ -502,9 +502,9 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) if( vSongAndSteps.empty() ) continue; - vector vpSongs; - typedef vector StepsVector; - map mapSongToSteps; + std::vector vpSongs; + typedef std::vector StepsVector; + std::map mapSongToSteps; for (std::vector::const_iterator sas = vSongAndSteps.begin(); sas != vSongAndSteps.end(); ++sas) { StepsVector &v = mapSongToSteps[ sas->pSong ]; @@ -520,7 +520,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) if( e->iChooseIndex < int( vSongAndSteps.size() ) ) { resolved.pSong = vpSongs[ e->iChooseIndex ]; - const vector &mappedSongs = mapSongToSteps[ resolved.pSong ]; + const std::vector &mappedSongs = mapSongToSteps[ resolved.pSong ]; resolved.pSteps = mappedSongs[ RandomInt( mappedSongs.size() ) ]; } else @@ -583,8 +583,8 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) /* Clamp the possible adjustments to try to avoid going under 1 or over * MAX_BOTTOM_RANGE. */ - iMinDist = min( max( iMinDist, -iLowMeter + 1 ), iMaxDist ); - iMaxDist = max( min( iMaxDist, MAX_BOTTOM_RANGE - iHighMeter ), iMinDist ); + iMinDist = std::min( std::max( iMinDist, -iLowMeter + 1 ), iMaxDist ); + iMaxDist = std::max( std::min( iMaxDist, MAX_BOTTOM_RANGE - iHighMeter ), iMinDist ); int iAdd; if( iMaxDist == iMinDist ) @@ -649,14 +649,14 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) return bCourseDifficultyIsSignificant && trail.m_vEntries.size() > 0; } -void Course::GetTrailUnsortedEndless( const vector &entries, Trail &trail, StepsType &st, +void Course::GetTrailUnsortedEndless( const std::vector &entries, Trail &trail, StepsType &st, CourseDifficulty &cd, RandomGen &rnd, bool &bCourseDifficultyIsSignificant ) const { - typedef vector StepsVector; + typedef std::vector StepsVector; std::set alreadySelected; Song* lastSongSelected; - vector vSongAndSteps; + std::vector vSongAndSteps; for (auto e = entries.begin(); e != entries.end(); ++e) { @@ -749,7 +749,7 @@ void Course::GetTrailUnsortedEndless( const vector &entries, Trail // Otherwise, pick random steps corresponding to the selected song CourseSortSongs(e->songSort, vpSongs, rnd); resolved.pSong = vpSongs[e->iChooseIndex]; - const vector& songSteps = songStepMap[resolved.pSong]; + const std::vector& songSteps = songStepMap[resolved.pSong]; resolved.pSteps = songSteps[RandomInt(songSteps.size())]; lastSongSelected = resolved.pSong; @@ -814,8 +814,8 @@ void Course::GetTrailUnsortedEndless( const vector &entries, Trail /* Clamp the possible adjustments to try to avoid going under 1 or over * MAX_BOTTOM_RANGE. */ - iMinDist = min( max( iMinDist, -iLowMeter + 1 ), iMaxDist ); - iMaxDist = max( min( iMaxDist, MAX_BOTTOM_RANGE - iHighMeter ), iMinDist ); + iMinDist = std::min( std::max( iMinDist, -iLowMeter + 1 ), iMaxDist ); + iMaxDist = std::max( std::min( iMaxDist, MAX_BOTTOM_RANGE - iHighMeter ), iMinDist ); int iAdd; if( iMaxDist == iMinDist ) @@ -860,7 +860,7 @@ void Course::GetTrailUnsortedEndless( const vector &entries, Trail } } -void Course::GetTrails( vector &AddTo, StepsType st ) const +void Course::GetTrails( std::vector &AddTo, StepsType st ) const { FOREACH_ShownCourseDifficulty( cd ) { @@ -871,9 +871,9 @@ void Course::GetTrails( vector &AddTo, StepsType st ) const } } -void Course::GetAllTrails( vector &AddTo ) const +void Course::GetAllTrails( std::vector &AddTo ) const { - vector vStepsTypesToShow; + std::vector vStepsTypesToShow; GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vStepsTypesToShow ); for (StepsType const &st : vStepsTypesToShow) { @@ -923,7 +923,7 @@ bool Course::AllSongsAreFixed() const const Style *Course::GetCourseStyle( const Game *pGame, int iNumPlayers ) const { - vector vpStyles; + std::vector vpStyles; GAMEMAN->GetCompatibleStyles( pGame, iNumPlayers, vpStyles ); for (Style const *pStyle : vpStyles) @@ -1127,7 +1127,7 @@ void Course::UpdateCourseStats( StepsType st ) bool Course::IsRanking() const { - vector rankingsongs; + std::vector rankingsongs; split(THEME->GetMetric("ScreenRanking", "CoursesToShow"), ",", rankingsongs); @@ -1150,7 +1150,7 @@ const CourseEntry *Course::FindFixedSong( const Song *pSong ) const return nullptr; } -void Course::GetAllCachedTrails( vector &out ) +void Course::GetAllCachedTrails( std::vector &out ) { TrailCache_t::iterator it; for( it = m_TrailCache.begin(); it != m_TrailCache.end(); ++it ) @@ -1201,7 +1201,7 @@ bool Course::Matches( RString sGroup, RString sCourse ) const if( !sFile.empty() ) { sFile.Replace("\\","/"); - vector bits; + std::vector bits; split( sFile, "/", bits ); const RString &sLastBit = bits[bits.size()-1]; if( sCourse.EqualsNoCase(sLastBit) ) @@ -1281,7 +1281,7 @@ public: } static int GetCourseEntries( T* p, lua_State *L ) { - vector v; + std::vector v; for( unsigned i = 0; i < p->m_vEntries.size(); ++i ) { v.push_back(&p->m_vEntries[i]); @@ -1296,7 +1296,7 @@ public: } static int GetAllTrails( T* p, lua_State *L ) { - vector v; + std::vector v; p->GetAllTrails( v ); LuaHelpers::CreateTableFromArray( v, L ); return 1; diff --git a/src/Course.h b/src/Course.h index 1f7cb802cb..7f8246d5eb 100644 --- a/src/Course.h +++ b/src/Course.h @@ -95,8 +95,8 @@ public: // Dereferences course_entries and returns only the playable Songs and Steps Trail* GetTrail( StepsType st, CourseDifficulty cd=Difficulty_Medium ) const; Trail* GetTrailForceRegenCache( StepsType st, CourseDifficulty cd=Difficulty_Medium ) const; - void GetTrails( vector &AddTo, StepsType st ) const; - void GetAllTrails( vector &AddTo ) const; + void GetTrails( std::vector &AddTo, StepsType st ) const; + void GetAllTrails( std::vector &AddTo ) const; int GetMeter( StepsType st, CourseDifficulty cd=Difficulty_Medium ) const; bool HasMods() const; bool HasTimedMods() const; @@ -133,7 +133,7 @@ public: // Call when a Song or its Steps are deleted/changed. void Invalidate( const Song *pStaleSong ); - void GetAllCachedTrails( vector &out ); + void GetAllCachedTrails( std::vector &out ); RString GetCacheFilePath() const; const CourseEntry *FindFixedSong( const Song *pSong ) const; @@ -149,7 +149,7 @@ public: void CalculateRadarValues(); bool GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) const; - void GetTrailUnsortedEndless( const vector &entries, Trail &trail, StepsType &st, + void GetTrailUnsortedEndless( const std::vector &entries, Trail &trail, StepsType &st, CourseDifficulty &cd, RandomGen &rnd, bool &bCourseDifficultyIsSignificant ) const; bool GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) const; @@ -178,7 +178,7 @@ public: bool m_bIncomplete; - vector m_vEntries; + std::vector m_vEntries; // sorting values int m_SortOrder_TotalDifficulty; @@ -186,7 +186,7 @@ public: ProfileSlot m_LoadedFromProfile; // ProfileSlot_Invalid if wasn't loaded from a profile - typedef pair CacheEntry; + typedef std::pair CacheEntry; struct CacheData { Trail trail; @@ -194,15 +194,15 @@ public: CacheData(): trail(), null(false) {} }; - typedef map TrailCache_t; + typedef std::map TrailCache_t; mutable TrailCache_t m_TrailCache; mutable int m_iTrailCacheSeed; - typedef map RadarCache_t; + typedef std::map RadarCache_t; RadarCache_t m_RadarCache; // Preferred styles: - set m_setStyles; + std::set m_setStyles; }; #endif diff --git a/src/CourseContentsList.h b/src/CourseContentsList.h index 11faae7443..c304a9318e 100644 --- a/src/CourseContentsList.h +++ b/src/CourseContentsList.h @@ -20,7 +20,7 @@ public: protected: void SetItemFromGameState( Actor *pActor, int iCourseEntryIndex ); - vector m_vpDisplay; + std::vector m_vpDisplay; }; #endif diff --git a/src/CourseLoaderCRS.cpp b/src/CourseLoaderCRS.cpp index d2eee8228c..39a464687e 100644 --- a/src/CourseLoaderCRS.cpp +++ b/src/CourseLoaderCRS.cpp @@ -73,7 +73,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou { RString str = sParams[1]; str.MakeLower(); - if( str.find("yes") != string::npos ) + if( str.find("yes") != std::string::npos ) out.m_bRepeat = true; } @@ -87,7 +87,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou } else if( sValueName.EqualsNoCase("LIVES") ) { - out.m_iLives = max( StringToInt(sParams[1]), 0 ); + out.m_iLives = std::max( StringToInt(sParams[1]), 0 ); } else if( sValueName.EqualsNoCase("GAINSECONDS") ) { @@ -97,7 +97,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou { if( sParams.params.size() == 2 ) { - out.m_iCustomMeter[Difficulty_Medium] = max( StringToInt(sParams[1]), 0 ); /* compat */ + out.m_iCustomMeter[Difficulty_Medium] = std::max( StringToInt(sParams[1]), 0 ); /* compat */ } else if( sParams.params.size() == 3 ) { @@ -107,7 +107,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou LOG->UserLog( "Course file", sPath, "contains an invalid #METER string: \"%s\"", sParams[1].c_str() ); continue; } - out.m_iCustomMeter[cd] = max( StringToInt(sParams[2]), 0 ); + out.m_iCustomMeter[cd] = std::max( StringToInt(sParams[2]), 0 ); } } @@ -117,14 +117,14 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou float end = -9999; for( unsigned j = 1; j < sParams.params.size(); ++j ) { - vector sBits; + std::vector sBits; split( sParams[j], "=", sBits, false ); if( sBits.size() < 2 ) continue; Trim( sBits[0] ); if( !sBits[0].CompareNoCase("TIME") ) - attack.fStartSecond = max( StringToFloat(sBits[1]), 0.0f ); + attack.fStartSecond = std::max( StringToFloat(sBits[1]), 0.0f ); else if( !sBits[0].CompareNoCase("LEN") ) attack.fSecsRemaining = StringToFloat( sBits[1] ); else if( !sBits[0].CompareNoCase("END") ) @@ -223,7 +223,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou //new_entry.bSecret = true; RString sSong = sParams[1]; sSong.Replace( "\\", "/" ); - vector bits; + std::vector bits; split( sSong, "/", bits ); if( bits.size() == 2 ) { @@ -247,7 +247,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou { RString sSong = sParams[1]; sSong.Replace( "\\", "/" ); - vector bits; + std::vector bits; split( sSong, "/", bits ); Song *pSong = nullptr; @@ -287,14 +287,14 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou new_entry.stepsCriteria.m_iLowMeter = 3; new_entry.stepsCriteria.m_iHighMeter = 6; } - new_entry.stepsCriteria.m_iLowMeter = max( new_entry.stepsCriteria.m_iLowMeter, 1 ); - new_entry.stepsCriteria.m_iHighMeter = max( new_entry.stepsCriteria.m_iHighMeter, new_entry.stepsCriteria.m_iLowMeter ); + new_entry.stepsCriteria.m_iLowMeter = std::max( new_entry.stepsCriteria.m_iLowMeter, 1 ); + new_entry.stepsCriteria.m_iHighMeter = std::max( new_entry.stepsCriteria.m_iHighMeter, new_entry.stepsCriteria.m_iLowMeter ); } { // If "showcourse" or "noshowcourse" is in the list, force // new_entry.secret on or off. - vector mods; + std::vector mods; split( sParams[3], ",", mods, true ); for( int j = (int) mods.size()-1; j >= 0 ; --j ) { @@ -340,7 +340,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou else if( sValueName.EqualsNoCase("STYLE") ) { RString sStyles = sParams[1]; - vector asStyles; + std::vector asStyles; split( sStyles, ",", asStyles ); for (RString const &s : asStyles) out.m_setStyles.insert( s ); @@ -356,7 +356,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou { const RString sFName = SetExtension( out.m_sPath, "" ); - vector arrayPossibleBanners; + std::vector arrayPossibleBanners; GetDirListing( sFName + "*.png", arrayPossibleBanners, false, false ); GetDirListing( sFName + "*.jpg", arrayPossibleBanners, false, false ); GetDirListing( sFName + "*.jpeg", arrayPossibleBanners, false, false ); @@ -400,7 +400,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const RString &_sPath, Course &out ) // save group name { - vector parts; + std::vector parts; split( sPath, "/", parts, false ); if( parts.size() >= 4 ) // e.g. "/Courses/blah/fun.crs" out.m_sGroupName = parts[parts.size()-2]; diff --git a/src/CourseUtil.cpp b/src/CourseUtil.cpp index f8433ef61d..0f1ccfab9f 100644 --- a/src/CourseUtil.cpp +++ b/src/CourseUtil.cpp @@ -87,19 +87,19 @@ static bool CompareCoursePointersByRanking( const Course* pCourse1, const Course return iNum1 < iNum2; } -void CourseUtil::SortCoursePointerArrayByDifficulty( vector &vpCoursesInOut ) +void CourseUtil::SortCoursePointerArrayByDifficulty( std::vector &vpCoursesInOut ) { sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByDifficulty ); } -void CourseUtil::SortCoursePointerArrayByRanking( vector &vpCoursesInOut ) +void CourseUtil::SortCoursePointerArrayByRanking( std::vector &vpCoursesInOut ) { for( unsigned i=0; iUpdateCourseStats( GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType ); sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByRanking ); } -void CourseUtil::SortCoursePointerArrayByTotalDifficulty( vector &vpCoursesInOut ) +void CourseUtil::SortCoursePointerArrayByTotalDifficulty( std::vector &vpCoursesInOut ) { for( unsigned i=0; iUpdateCourseStats( GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType ); @@ -115,7 +115,7 @@ RString GetSectionNameFromCourseAndSort( const Course *pCourse, SortOrder so ) // more code here } -void SortCoursePointerArrayBySectionName( vector &vpCoursesInOut, SortOrder so ) +void SortCoursePointerArrayBySectionName( std::vector &vpCoursesInOut, SortOrder so ) { RString sOther = SORT_OTHER.GetValue(); for(unsigned i = 0; i < vpCoursesInOut.size(); ++i) @@ -138,17 +138,17 @@ static bool CompareCoursePointersByType( const Course* pCourse1, const Course* p return pCourse1->GetPlayMode() < pCourse2->GetPlayMode(); } -void CourseUtil::SortCoursePointerArrayByType( vector &vpCoursesInOut ) +void CourseUtil::SortCoursePointerArrayByType( std::vector &vpCoursesInOut ) { stable_sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByType ); } -void CourseUtil::MoveRandomToEnd( vector &vpCoursesInOut ) +void CourseUtil::MoveRandomToEnd( std::vector &vpCoursesInOut ) { stable_sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareRandom ); } -static map course_sort_val; +static std::map course_sort_val; bool CompareCoursePointersBySortValueAscending( const Course *pSong1, const Course *pSong2 ) { @@ -165,12 +165,12 @@ bool CompareCoursePointersByTitle( const Course *pCourse1, const Course *pCourse return CompareCoursePointersByName( pCourse1, pCourse2 ); } -void CourseUtil::SortCoursePointerArrayByTitle( vector &vpCoursesInOut ) +void CourseUtil::SortCoursePointerArrayByTitle( std::vector &vpCoursesInOut ) { sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByTitle ); } -void CourseUtil::SortCoursePointerArrayByAvgDifficulty( vector &vpCoursesInOut ) +void CourseUtil::SortCoursePointerArrayByAvgDifficulty( std::vector &vpCoursesInOut ) { RageTimer foo; course_sort_val.clear(); @@ -185,7 +185,7 @@ void CourseUtil::SortCoursePointerArrayByAvgDifficulty( vector &vpCours stable_sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), MovePlayersBestToEnd ); } -void CourseUtil::SortCoursePointerArrayByNumPlays( vector &vpCoursesInOut, ProfileSlot slot, bool bDescending ) +void CourseUtil::SortCoursePointerArrayByNumPlays( std::vector &vpCoursesInOut, ProfileSlot slot, bool bDescending ) { if( !PROFILEMAN->IsPersistentProfile(slot) ) return; // nothing to do since we don't have data @@ -193,7 +193,7 @@ void CourseUtil::SortCoursePointerArrayByNumPlays( vector &vpCoursesInO SortCoursePointerArrayByNumPlays( vpCoursesInOut, pProfile, bDescending ); } -void CourseUtil::SortCoursePointerArrayByNumPlays( vector &vpCoursesInOut, const Profile* pProfile, bool bDescending ) +void CourseUtil::SortCoursePointerArrayByNumPlays( std::vector &vpCoursesInOut, const Profile* pProfile, bool bDescending ) { ASSERT( pProfile != nullptr ); for(unsigned i = 0; i < vpCoursesInOut.size(); ++i) @@ -202,7 +202,7 @@ void CourseUtil::SortCoursePointerArrayByNumPlays( vector &vpCoursesInO course_sort_val.clear(); } -void CourseUtil::SortByMostRecentlyPlayedForMachine( vector &vpCoursesInOut ) +void CourseUtil::SortByMostRecentlyPlayedForMachine( std::vector &vpCoursesInOut ) { Profile *pProfile = PROFILEMAN->GetMachineProfile(); @@ -275,7 +275,7 @@ void CourseUtil::AutogenNonstopFromGroup( const RString &sGroupName, Difficulty out.m_vEntries.pop_back(); } -void CourseUtil::AutogenOniFromArtist( const RString &sArtistName, RString sArtistNameTranslit, vector aSongs, Difficulty dc, Course &out ) +void CourseUtil::AutogenOniFromArtist( const RString &sArtistName, RString sArtistNameTranslit, std::vector aSongs, Difficulty dc, Course &out ) { out.m_bIsAutogen = true; out.m_bRepeat = false; @@ -325,7 +325,7 @@ void CourseUtil::WarnOnInvalidMods( RString sMods ) { PlayerOptions po; SongOptions so; - vector vs; + std::vector vs; split( sMods, ",", vs, true ); for (RString const &s : vs) { @@ -429,7 +429,7 @@ bool EditCourseUtil::ValidateEditCourseName( const RString &sAnswer, RString &sE } // Check for name conflicts - vector vpCourses; + std::vector vpCourses; EditCourseUtil::GetAllEditCourses( vpCourses ); for (Course const *p : vpCourses) { @@ -467,9 +467,9 @@ void EditCourseUtil::PrepareForPlay() PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_iGoalSeconds = static_cast(pCourse->m_fGoalSeconds); } -void EditCourseUtil::GetAllEditCourses( vector &vpCoursesOut ) +void EditCourseUtil::GetAllEditCourses( std::vector &vpCoursesOut ) { - vector vpCoursesTemp; + std::vector vpCoursesTemp; SONGMAN->GetAllCourses( vpCoursesTemp, false ); for (Course *c : vpCoursesTemp) { @@ -489,15 +489,15 @@ void EditCourseUtil::LoadDefaults( Course &out ) for( int i=0; i<10000; i++ ) { out.m_sMainTitle = ssprintf("Workout %d", i+1); - - vector vpCourses; + + std::vector vpCourses; EditCourseUtil::GetAllEditCourses( vpCourses ); if (std::any_of(vpCourses.begin(), vpCourses.end(), [&](Course const *p) { return out.m_sMainTitle == p->m_sMainTitle; })) break; } - vector vpSongs; + std::vector vpSongs; SONGMAN->GetPreferredSortSongs( vpSongs ); for( int i=0; i<(int)vpSongs.size() && i<6; i++ ) { diff --git a/src/CourseUtil.h b/src/CourseUtil.h index fd01956a11..7403b84bc5 100644 --- a/src/CourseUtil.h +++ b/src/CourseUtil.h @@ -17,25 +17,25 @@ bool CompareCoursePointersByTitle( const Course *pCourse1, const Course *pCourse /** @brief Utility functions that deal with Courses. */ namespace CourseUtil { - void SortCoursePointerArrayByDifficulty( vector &vpCoursesInOut ); - void SortCoursePointerArrayByType( vector &vpCoursesInOut ); - void SortCoursePointerArrayByTitle( vector &vpCoursesInOut ); - void SortCoursePointerArrayByAvgDifficulty( vector &vpCoursesInOut ); - void SortCoursePointerArrayByTotalDifficulty( vector &vpCoursesInOut ); - void SortCoursePointerArrayByRanking( vector &vpCoursesInOut ); - void SortCoursePointerArrayByNumPlays( vector &vpCoursesInOut, ProfileSlot slot, bool bDescending ); - void SortCoursePointerArrayByNumPlays( vector &vpCoursesInOut, const Profile* pProfile, bool bDescending ); - void SortByMostRecentlyPlayedForMachine( vector &vpCoursesInOut ); + void SortCoursePointerArrayByDifficulty( std::vector &vpCoursesInOut ); + void SortCoursePointerArrayByType( std::vector &vpCoursesInOut ); + void SortCoursePointerArrayByTitle( std::vector &vpCoursesInOut ); + void SortCoursePointerArrayByAvgDifficulty( std::vector &vpCoursesInOut ); + void SortCoursePointerArrayByTotalDifficulty( std::vector &vpCoursesInOut ); + void SortCoursePointerArrayByRanking( std::vector &vpCoursesInOut ); + void SortCoursePointerArrayByNumPlays( std::vector &vpCoursesInOut, ProfileSlot slot, bool bDescending ); + void SortCoursePointerArrayByNumPlays( std::vector &vpCoursesInOut, const Profile* pProfile, bool bDescending ); + void SortByMostRecentlyPlayedForMachine( std::vector &vpCoursesInOut ); // sm-ssc sort additions: - //void SortCoursePointerArrayBySectionName( vector &vpCoursesInOut, SortOrder so ); + //void SortCoursePointerArrayBySectionName( std::vector &vpCoursesInOut, SortOrder so ); - void MoveRandomToEnd( vector &vpCoursesInOut ); + void MoveRandomToEnd( std::vector &vpCoursesInOut ); void MakeDefaultEditCourseEntry( CourseEntry &out ); void AutogenEndlessFromGroup( const RString &sGroupName, Difficulty dc, Course &out ); void AutogenNonstopFromGroup( const RString &sGroupName, Difficulty dc, Course &out ); - void AutogenOniFromArtist( const RString &sArtistName, RString sArtistNameTranslit, vector aSongs, Difficulty dc, Course &out ); + void AutogenOniFromArtist( const RString &sArtistName, RString sArtistNameTranslit, std::vector aSongs, Difficulty dc, Course &out ); bool ValidateEditCourseName( const RString &sAnswer, RString &sErrorOut ); @@ -53,7 +53,7 @@ namespace EditCourseUtil void LoadDefaults( Course &out ); bool RemoveAndDeleteFile( Course *pCourse ); bool ValidateEditCourseName( const RString &sAnswer, RString &sErrorOut ); - void GetAllEditCourses( vector &vpCoursesOut ); + void GetAllEditCourses( std::vector &vpCoursesOut ); bool Save( Course *pCourse ); bool RenameAndSave( Course *pCourse, RString sName ); diff --git a/src/CourseWriterCRS.cpp b/src/CourseWriterCRS.cpp index 684a26e215..16dc2ac61b 100644 --- a/src/CourseWriterCRS.cpp +++ b/src/CourseWriterCRS.cpp @@ -59,7 +59,7 @@ bool CourseWriterCRS::Write( const Course &course, RageFileBasic &f, bool bSavin if( !course.m_setStyles.empty() ) { - vector asStyles; + std::vector asStyles; asStyles.insert( asStyles.begin(), course.m_setStyles.begin(), course.m_setStyles.end() ); f.PutLine( ssprintf("#STYLE:%s;", join( ",", asStyles ).c_str()) ); } @@ -83,7 +83,7 @@ bool CourseWriterCRS::Write( const Course &course, RageFileBasic &f, bool bSavin StepsType st = entry.first; CourseDifficulty cd = entry.second; - vector asRadarValues; + std::vector asRadarValues; const RadarValues &rv = it->second; for( int r=0; r < NUM_RadarCategory; r++ ) asRadarValues.push_back( ssprintf("%.3f", rv[r]) ); diff --git a/src/CryptManager.cpp b/src/CryptManager.cpp index 71e0929d28..63072fb674 100644 --- a/src/CryptManager.cpp +++ b/src/CryptManager.cpp @@ -274,7 +274,7 @@ bool CryptManager::VerifyFileWithFile( RString sPath, RString sSignatureFile ) if( VerifyFileWithFile(sPath, sSignatureFile, PUBLIC_KEY_PATH) ) return true; - vector asKeys; + std::vector asKeys; GetDirListing( ALTERNATE_PUBLIC_KEY_DIR, asKeys, false, true ); for( unsigned i = 0; i < asKeys.size(); ++i ) { diff --git a/src/CsvFile.cpp b/src/CsvFile.cpp index 05d39fd1cc..df62ba679c 100644 --- a/src/CsvFile.cpp +++ b/src/CsvFile.cpp @@ -44,7 +44,7 @@ bool CsvFile::ReadFile( RageFileBasic &f ) utf8_remove_bom( line ); - vector vs; + std::vector vs; while( !line.empty() ) { diff --git a/src/CsvFile.h b/src/CsvFile.h index 0360e34ded..f85fd92f3e 100644 --- a/src/CsvFile.h +++ b/src/CsvFile.h @@ -15,8 +15,8 @@ public: bool WriteFile( const RString &sPath ) const; bool WriteFile( RageFileBasic &sFile ) const; - typedef vector StringVector; - vector m_vvs; + typedef std::vector StringVector; + std::vector m_vvs; private: RString m_sPath; diff --git a/src/CubicSpline.cpp b/src/CubicSpline.cpp index d4dce0ccc6..fe66fa8ea2 100644 --- a/src/CubicSpline.cpp +++ b/src/CubicSpline.cpp @@ -3,7 +3,6 @@ #include "RageLog.h" #include "RageUtil.h" #include -using std::list; // Spline solving optimization: // The tridiagonal part of the system of equations for a spline of size n is @@ -22,25 +21,25 @@ struct SplineSolutionCache { struct Entry { - vector diagonals; - vector multiples; + std::vector diagonals; + std::vector multiples; }; - void solve_diagonals_straight(vector& diagonals, vector& multiples); - void solve_diagonals_looped(vector& diagonals, vector& multiples); + void solve_diagonals_straight(std::vector& diagonals, std::vector& multiples); + void solve_diagonals_looped(std::vector& diagonals, std::vector& multiples); private: - void prep_inner(size_t last, vector& out); - bool find_in_cache(list& cache, vector& outd, vector& outm); - void add_to_cache(list& cache, vector& outd, vector& outm); - list straight_diagonals; - list looped_diagonals; + void prep_inner(size_t last, std::vector& out); + bool find_in_cache(std::list& cache, std::vector& outd, std::vector& outm); + void add_to_cache(std::list& cache, std::vector& outd, std::vector& outm); + std::list straight_diagonals; + std::list looped_diagonals; }; const size_t solution_cache_limit= 16; -bool SplineSolutionCache::find_in_cache(list& cache, vector& outd, vector& outm) +bool SplineSolutionCache::find_in_cache(std::list& cache, std::vector& outd, std::vector& outm) { size_t out_size= outd.size(); - for(list::iterator entry= cache.begin(); + for(std::list::iterator entry= cache.begin(); entry != cache.end(); ++entry) { if(out_size == entry->diagonals.size()) @@ -60,7 +59,7 @@ bool SplineSolutionCache::find_in_cache(list& cache, vector& outd, return false; } -void SplineSolutionCache::add_to_cache(list& cache, vector& outd, vector& outm) +void SplineSolutionCache::add_to_cache(std::list& cache, std::vector& outd, std::vector& outm) { if(cache.size() >= solution_cache_limit) { @@ -71,7 +70,7 @@ void SplineSolutionCache::add_to_cache(list& cache, vector& outd, cache.front().multiples= outm; } -void SplineSolutionCache::prep_inner(size_t last, vector& out) +void SplineSolutionCache::prep_inner(size_t last, std::vector& out) { for(size_t i= 1; i < last; ++i) { @@ -79,7 +78,7 @@ void SplineSolutionCache::prep_inner(size_t last, vector& out) } } -void SplineSolutionCache::solve_diagonals_straight(vector& diagonals, vector& multiples) +void SplineSolutionCache::solve_diagonals_straight(std::vector& diagonals, std::vector& multiples) { if(find_in_cache(straight_diagonals, diagonals, multiples)) { @@ -125,7 +124,7 @@ void SplineSolutionCache::solve_diagonals_straight(vector& diagonals, vec add_to_cache(straight_diagonals, diagonals, multiples); } -void SplineSolutionCache::solve_diagonals_looped(vector& diagonals, vector& multiples) +void SplineSolutionCache::solve_diagonals_looped(std::vector& diagonals, std::vector& multiples) { if(find_in_cache(looped_diagonals, diagonals, multiples)) { @@ -165,7 +164,7 @@ void SplineSolutionCache::solve_diagonals_looped(vector& diagonals, vecto diagonals[0]= 4.0f; prep_inner(last, diagonals); // right_column is sized to not store the diagonal . - vector right_column(diagonals.size()-1, 0.0f); + std::vector right_column(diagonals.size()-1, 0.0f); right_column[0]= 1.0f; right_column[last-2]= 1.0f; @@ -253,9 +252,9 @@ void CubicSpline::solve_looped() { if(check_minimum_size()) { return; } size_t last= m_points.size(); - vector results(m_points.size()); - vector diagonals(m_points.size()); - vector multiples; + std::vector results(m_points.size()); + std::vector diagonals(m_points.size()); + std::vector multiples; solution_cache.solve_diagonals_looped(diagonals, multiples); results[0]= 3 * loop_space_difference( m_points[1].a, m_points[last-1].a, m_spatial_extent); @@ -302,9 +301,9 @@ void CubicSpline::solve_straight() { if(check_minimum_size()) { return; } size_t last= m_points.size(); - vector results(m_points.size()); - vector diagonals(m_points.size()); - vector multiples; + std::vector results(m_points.size()); + std::vector diagonals(m_points.size()); + std::vector multiples; solution_cache.solve_diagonals_straight(diagonals, multiples); results[0]= 3 * (m_points[1].a - m_points[0].a); prep_inner(last, results); @@ -373,7 +372,7 @@ bool CubicSpline::check_minimum_size() return all_points_identical; } -void CubicSpline::prep_inner(size_t last, vector& results) +void CubicSpline::prep_inner(size_t last, std::vector& results) { for(size_t i= 1; i < last - 1; ++i) { @@ -382,7 +381,7 @@ void CubicSpline::prep_inner(size_t last, vector& results) } } -void CubicSpline::set_results(size_t last, vector& diagonals, vector& results) +void CubicSpline::set_results(size_t last, std::vector& diagonals, std::vector& results) { // No more operations left, everything not a diagonal should be zero now. for(size_t i= 0; i < last; ++i) @@ -650,7 +649,7 @@ void CubicSplineN::solve() } #define CSN_EVAL_SOMETHING(something) \ -void CubicSplineN::something(float t, vector& v) const \ +void CubicSplineN::something(float t, std::vector& v) const \ { \ for(spline_cont_t::const_iterator spline= m_splines.begin(); \ spline != m_splines.end(); ++spline) \ @@ -680,7 +679,7 @@ CSN_EVAL_RV_SOMETHING(evaluate_derivative); #undef CSN_EVAL_RV_SOMETHING -void CubicSplineN::set_point(size_t i, const vector& v) +void CubicSplineN::set_point(size_t i, const std::vector& v) { ASSERT_M(v.size() == m_splines.size(), "CubicSplineN::set_point requires the passed point to be the same dimension as the spline."); for(size_t n= 0; n < m_splines.size(); ++n) @@ -690,8 +689,8 @@ void CubicSplineN::set_point(size_t i, const vector& v) m_dirty= true; } -void CubicSplineN::set_coefficients(size_t i, const vector& b, - const vector& c, const vector& d) +void CubicSplineN::set_coefficients(size_t i, const std::vector& b, + const std::vector& c, const std::vector& d) { ASSERT_M(b.size() == c.size() && c.size() == d.size() && d.size() == m_splines.size(), "CubicSplineN: coefficient vectors must be " @@ -703,8 +702,8 @@ void CubicSplineN::set_coefficients(size_t i, const vector& b, m_dirty= true; } -void CubicSplineN::get_coefficients(size_t i, vector& b, - vector& c, vector& d) +void CubicSplineN::get_coefficients(size_t i, std::vector& b, + std::vector& c, std::vector& d) { ASSERT_M(b.size() == c.size() && c.size() == d.size() && d.size() == m_splines.size(), "CubicSplineN: coefficient vectors must be " @@ -814,7 +813,7 @@ struct LunaCubicSplineN : Luna #define LCSN_EVAL_SOMETHING(something) \ static int something(T* p, lua_State* L) \ { \ - vector pos; \ + std::vector pos; \ p->something(FArg(1), pos); \ lua_createtable(L, pos.size(), 0); \ for(size_t i= 0; i < pos.size(); ++i) \ @@ -831,7 +830,7 @@ struct LunaCubicSplineN : Luna #undef LCSN_EVAL_SOMETHING static void get_element_table_from_stack(T* p, lua_State* L, int s, - size_t limit, vector& ret) + size_t limit, std::vector& ret) { size_t elements= lua_objlen(L, s); // Too many elements is not an error because allowing it allows the user @@ -854,7 +853,7 @@ struct LunaCubicSplineN : Luna { luaL_error(L, "Spline point must be a table."); } - vector pos; + std::vector pos; get_element_table_from_stack(p, L, s, p->dimension(), pos); p->set_point(i, pos); } @@ -871,9 +870,9 @@ struct LunaCubicSplineN : Luna luaL_error(L, "Spline coefficient args must be three tables."); } size_t limit= p->dimension(); - vector b; get_element_table_from_stack(p, L, s, limit, b); - vector c; get_element_table_from_stack(p, L, s+1, limit, c); - vector d; get_element_table_from_stack(p, L, s+2, limit, d); + std::vector b; get_element_table_from_stack(p, L, s, limit, b); + std::vector c; get_element_table_from_stack(p, L, s+1, limit, c); + std::vector d; get_element_table_from_stack(p, L, s+2, limit, d); p->set_coefficients(i, b, c, d); } static int set_coefficients(T* p, lua_State* L) @@ -886,7 +885,7 @@ struct LunaCubicSplineN : Luna { size_t i= point_index(p, L, 1); size_t limit= p->dimension(); - vector > coeff(3); + std::vector > coeff(3); coeff[0].resize(limit); coeff[1].resize(limit); coeff[2].resize(limit); diff --git a/src/CubicSpline.h b/src/CubicSpline.h index dbbf694e4c..11597e4dd7 100644 --- a/src/CubicSpline.h +++ b/src/CubicSpline.h @@ -2,7 +2,6 @@ #define CUBIC_SPLINE_H #include -using std::vector; #include "RageTypes.h" struct lua_State; @@ -28,14 +27,14 @@ CubicSpline() :m_spatial_extent(0.0f) {} float m_spatial_extent; private: bool check_minimum_size(); - void prep_inner(size_t last, vector& results); - void set_results(size_t last, vector& diagonals, vector& results); + void prep_inner(size_t last, std::vector& results); + void set_results(size_t last, std::vector& diagonals, std::vector& results); struct SplinePoint { float a, b, c, d; }; - vector m_points; + std::vector m_points; }; struct CubicSplineN @@ -46,17 +45,17 @@ struct CubicSplineN static void weighted_average(CubicSplineN& out, const CubicSplineN& from, const CubicSplineN& to, float between); void solve(); - void evaluate(float t, vector& v) const; - void evaluate_derivative(float t, vector& v) const; - void evaluate_second_derivative(float t, vector& v) const; - void evaluate_third_derivative(float t, vector& v) const; + void evaluate(float t, std::vector& v) const; + void evaluate_derivative(float t, std::vector& v) const; + void evaluate_second_derivative(float t, std::vector& v) const; + void evaluate_third_derivative(float t, std::vector& v) const; void evaluate(float t, RageVector3& v) const; void evaluate_derivative(float t, RageVector3& v) const; - void set_point(size_t i, const vector& v); - void set_coefficients(size_t i, const vector& b, - const vector& c, const vector& d); - void get_coefficients(size_t i, vector& b, - vector& c, vector& d); + void set_point(size_t i, const std::vector& v); + void set_coefficients(size_t i, const std::vector& b, + const std::vector& c, const std::vector& d); + void get_coefficients(size_t i, std::vector& b, + std::vector& c, std::vector& d); void set_spatial_extent(size_t i, float extent); float get_spatial_extent(size_t i); void resize(size_t s); @@ -68,7 +67,7 @@ struct CubicSplineN if(m_loop) { return static_cast(size()); } else { return static_cast(size()-1); } } - typedef vector spline_cont_t; + typedef std::vector spline_cont_t; void set_loop(bool l); bool get_loop() const; void set_polygonal(bool p); diff --git a/src/Difficulty.cpp b/src/Difficulty.cpp index a2d0945985..59ab92a8b2 100644 --- a/src/Difficulty.cpp +++ b/src/Difficulty.cpp @@ -23,12 +23,12 @@ LuaXType( Difficulty ); const RString &CourseDifficultyToLocalizedString( CourseDifficulty x ) { - static unique_ptr g_CourseDifficultyName[NUM_Difficulty]; + static std::unique_ptr g_CourseDifficultyName[NUM_Difficulty]; if( g_CourseDifficultyName[0].get() == nullptr ) { FOREACH_ENUM( Difficulty,i) { - unique_ptr ap( new LocalizedString("CourseDifficulty", DifficultyToString(i)) ); + std::unique_ptr ap( new LocalizedString("CourseDifficulty", DifficultyToString(i)) ); g_CourseDifficultyName[i] = move(ap); } } @@ -112,7 +112,7 @@ RString GetCustomDifficulty( StepsType st, Difficulty dc, CourseType ct ) return "Edit"; } // OPTIMIZATION OPPORTUNITY: cache these metrics and cache the splitting - vector vsNames; + std::vector vsNames; split( NAMES, ",", vsNames ); for (RString const &sName: vsNames) { diff --git a/src/DifficultyIcon.cpp b/src/DifficultyIcon.cpp index b2c53d0f2c..04b51e1a75 100644 --- a/src/DifficultyIcon.cpp +++ b/src/DifficultyIcon.cpp @@ -24,7 +24,7 @@ bool DifficultyIcon::Load( RString sPath ) Sprite::Load( sPath ); int iStates = GetNumStates(); bool bWarn = iStates != NUM_Difficulty && iStates != NUM_Difficulty*2; - if( sPath.find("_blank") != string::npos ) + if( sPath.find("_blank") != std::string::npos ) bWarn = false; if( bWarn ) { diff --git a/src/DifficultyList.cpp b/src/DifficultyList.cpp index d17031e090..e2b2923636 100644 --- a/src/DifficultyList.cpp +++ b/src/DifficultyList.cpp @@ -133,36 +133,36 @@ void StepsDisplayList::UpdatePositions() int P1Choice = GAMESTATE->IsHumanPlayer(PLAYER_1)? iCurrentRow[PLAYER_1]: GAMESTATE->IsHumanPlayer(PLAYER_2)? iCurrentRow[PLAYER_2]: 0; int P2Choice = GAMESTATE->IsHumanPlayer(PLAYER_2)? iCurrentRow[PLAYER_2]: GAMESTATE->IsHumanPlayer(PLAYER_1)? iCurrentRow[PLAYER_1]: 0; - vector &Rows = m_Rows; + std::vector &Rows = m_Rows; const bool BothPlayersActivated = GAMESTATE->IsHumanPlayer(PLAYER_1) && GAMESTATE->IsHumanPlayer(PLAYER_2); if( !BothPlayersActivated ) { // Simply center the cursor. - first_start = max( P1Choice - halfsize, 0 ); + first_start = std::max( P1Choice - halfsize, 0 ); first_end = first_start + total; second_start = second_end = first_end; } else { // First half: - const int earliest = min( P1Choice, P2Choice ); - first_start = max( earliest - halfsize/2, 0 ); + const int earliest = std::min( P1Choice, P2Choice ); + first_start = std::max( earliest - halfsize/2, 0 ); first_end = first_start + halfsize; // Second half: - const int latest = max( P1Choice, P2Choice ); + const int latest = std::max( P1Choice, P2Choice ); - second_start = max( latest - halfsize/2, 0 ); + second_start = std::max( latest - halfsize/2, 0 ); // Don't overlap. - second_start = max( second_start, first_end ); + second_start = std::max( second_start, first_end ); second_end = second_start + halfsize; } - first_end = min( first_end, (int) Rows.size() ); - second_end = min( second_end, (int) Rows.size() ); + first_end = std::min( first_end, (int) Rows.size() ); + second_end = std::min( second_end, (int) Rows.size() ); /* If less than total (and Rows.size()) are displayed, fill in the empty * space intelligently. */ @@ -272,7 +272,7 @@ void StepsDisplayList::SetFromGameState() // FIXME: This clamps to between the min and the max difficulty, but // it really should round to the nearest difficulty that's in // DIFFICULTIES_TO_SHOW. - const vector& difficulties = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(); + const std::vector& difficulties = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(); m_Rows.resize( difficulties.size() ); for (Difficulty const &d : difficulties) { @@ -283,7 +283,7 @@ void StepsDisplayList::SetFromGameState() } else { - vector vpSteps; + std::vector vpSteps; SongUtil::GetPlayableSteps( pSong, vpSteps ); // Should match the sort in ScreenSelectMusic::AfterMusicChange. diff --git a/src/DifficultyList.h b/src/DifficultyList.h index a641db6ad9..747dfad184 100644 --- a/src/DifficultyList.h +++ b/src/DifficultyList.h @@ -47,7 +47,7 @@ private: { StepsDisplay m_Meter; }; - vector m_Lines; + std::vector m_Lines; const Song *m_CurSong; bool m_bShown; @@ -68,7 +68,7 @@ private: bool m_bHidden; // currently off screen }; - vector m_Rows; + std::vector m_Rows; }; diff --git a/src/DisplayResolutions.h b/src/DisplayResolutions.h index ff0289fd98..972673ed28 100644 --- a/src/DisplayResolutions.h +++ b/src/DisplayResolutions.h @@ -29,7 +29,7 @@ public: } }; /** @brief The collection of DisplayResolutions available within the program. */ -typedef set DisplayResolutions; +typedef std::set DisplayResolutions; #endif diff --git a/src/EditMenu.cpp b/src/EditMenu.cpp index 40937ff390..ebb9a60734 100644 --- a/src/EditMenu.cpp +++ b/src/EditMenu.cpp @@ -40,7 +40,7 @@ StringToX( EditMenuAction ); static RString ARROWS_X_NAME( size_t i ) { return ssprintf("Arrows%dX",int(i+1)); } static RString ROW_Y_NAME( size_t i ) { return ssprintf("Row%dY",int(i+1)); } -void EditMenu::StripLockedStepsAndDifficulty( vector &v ) +void EditMenu::StripLockedStepsAndDifficulty( std::vector &v ) { const Song *pSong = GetSelectedSong(); for( int i=(int)v.size()-1; i>=0; i-- ) @@ -50,7 +50,7 @@ void EditMenu::StripLockedStepsAndDifficulty( vector &v ) } } -void EditMenu::GetSongsToShowForGroup( const RString &sGroup, vector &vpSongsOut ) +void EditMenu::GetSongsToShowForGroup( const RString &sGroup, std::vector &vpSongsOut ) { if(sGroup == "") { @@ -79,7 +79,7 @@ void EditMenu::GetSongsToShowForGroup( const RString &sGroup, vector &vpS SongUtil::SortSongPointerArrayByTitle( vpSongsOut ); } -void EditMenu::GetGroupsToShow( vector &vsGroupsOut ) +void EditMenu::GetGroupsToShow( std::vector &vsGroupsOut ) { vsGroupsOut.clear(); if( !SHOW_GROUPS.GetValue() ) @@ -89,7 +89,7 @@ void EditMenu::GetGroupsToShow( vector &vsGroupsOut ) for( int i = vsGroupsOut.size()-1; i>=0; i-- ) { const RString &sGroup = vsGroupsOut[i]; - vector vpSongs; + std::vector vpSongs; GetSongsToShowForGroup( sGroup, vpSongs ); // strip groups that have no unlocked songs if( vpSongs.empty() ) @@ -408,7 +408,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) } if( mode == EditMode_Practice ) { - vector vtSongs; + std::vector vtSongs; GetSongsToShowForGroup(GetSelectedGroup(), vtSongs); // Filter out songs that aren't playable. for (Song *s :vtSongs) @@ -461,7 +461,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) m_StepsTypes.clear(); // Only show StepsTypes for which we have valid Steps. - vector vSts = CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue(); + std::vector vSts = CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue(); for (StepsType &st : vSts) { if(SongUtil::GetStepsByDifficulty( GetSelectedSong(), st, Difficulty_Invalid, false) != nullptr) @@ -503,7 +503,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) case EditMode_CourseMods: case EditMode_Practice: { - vector v; + std::vector v; SongUtil::GetSteps( GetSelectedSong(), v, GetSelectedStepsType(), Difficulty_Edit ); StepsUtil::SortStepsByDescription( v ); for (Steps *p : v) @@ -616,7 +616,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) } else { - vector v; + std::vector v; SongUtil::GetSteps( GetSelectedSong(), v, GetSelectedSourceStepsType(), dc ); StepsUtil::SortStepsByDescription( v ); for (Steps *pSteps : v) diff --git a/src/EditMenu.h b/src/EditMenu.h index 9d1ff63f01..963811f5d6 100644 --- a/src/EditMenu.h +++ b/src/EditMenu.h @@ -190,9 +190,9 @@ public: private: struct StepsAndDifficulty; - void StripLockedStepsAndDifficulty( vector &v ); - void GetSongsToShowForGroup( const RString &sGroup, vector &vpSongsOut ); - void GetGroupsToShow( vector &vsGroupsOut ); + void StripLockedStepsAndDifficulty( std::vector &v ); + void GetSongsToShowForGroup( const RString &sGroup, std::vector &vpSongsOut ); + void GetGroupsToShow( std::vector &vsGroupsOut ); void UpdateArrows(); AutoActor m_sprArrows[NUM_ARROWS]; @@ -220,13 +220,13 @@ private: }; /** @brief The list of groups. */ - vector m_sGroups; + std::vector m_sGroups; /** @brief The list of Songs in a group. */ - vector m_pSongs; - vector m_StepsTypes; - vector m_vpSteps; - vector m_vpSourceSteps; - vector m_Actions; + std::vector m_pSongs; + std::vector m_StepsTypes; + std::vector m_vpSteps; + std::vector m_vpSourceSteps; + std::vector m_Actions; void OnRowValueChanged( EditMenuRow row ); void ChangeToRow( EditMenuRow newRow ); diff --git a/src/EnumHelper.cpp b/src/EnumHelper.cpp index 06a5139192..b066834d11 100644 --- a/src/EnumHelper.cpp +++ b/src/EnumHelper.cpp @@ -80,17 +80,17 @@ int CheckEnum( lua_State *L, LuaReference &table, int iPos, int iInvalid, const } // szNameArray is of size iMax; pNameCache is of size iMax+2. -const RString &EnumToString( int iVal, int iMax, const char **szNameArray, unique_ptr *pNameCache ) +const RString &EnumToString( int iVal, int iMax, const char **szNameArray, std::unique_ptr *pNameCache ) { if( unlikely(pNameCache[0].get() == nullptr) ) { for( int i = 0; i < iMax; ++i ) { - unique_ptr ap( new RString( szNameArray[i] ) ); + std::unique_ptr ap( new RString( szNameArray[i] ) ); pNameCache[i] = move(ap); } - unique_ptr ap( new RString ); + std::unique_ptr ap( new RString ); pNameCache[iMax+1] = move(ap); } diff --git a/src/EnumHelper.h b/src/EnumHelper.h index d620830ecc..222cf76ec7 100644 --- a/src/EnumHelper.h +++ b/src/EnumHelper.h @@ -70,14 +70,14 @@ namespace Enum void SetMetatable( lua_State *L, LuaReference &EnumTable, LuaReference &EnumIndexTable, const char *szName ); }; -const RString &EnumToString( int iVal, int iMax, const char **szNameArray, unique_ptr *pNameCache ); // XToString helper +const RString &EnumToString( int iVal, int iMax, const char **szNameArray, std::unique_ptr *pNameCache ); // XToString helper #define XToString(X) \ const RString& X##ToString(X x); \ COMPILE_ASSERT( NUM_##X == ARRAYLEN(X##Names) ); \ const RString& X##ToString( X x ) \ { \ - static unique_ptr as_##X##Name[NUM_##X+2]; \ + static std::unique_ptr as_##X##Name[NUM_##X+2]; \ return EnumToString( x, NUM_##X, X##Names, as_##X##Name ); \ } \ namespace StringConversion { template<> RString ToString( const X &value ) { return X##ToString(value); } } @@ -86,11 +86,11 @@ namespace StringConversion { template<> RString ToString( const X &value ) { const RString &X##ToLocalizedString(X x); \ const RString &X##ToLocalizedString( X x ) \ { \ - static unique_ptr g_##X##Name[NUM_##X]; \ + static std::unique_ptr g_##X##Name[NUM_##X]; \ if( g_##X##Name[0].get() == nullptr ) { \ for( unsigned i = 0; i < NUM_##X; ++i ) \ { \ - unique_ptr ap( new LocalizedString(#X, X##ToString((X)i)) ); \ + std::unique_ptr ap( new LocalizedString(#X, X##ToString((X)i)) ); \ g_##X##Name[i] = move(ap); \ } \ } \ diff --git a/src/Font.cpp b/src/Font.cpp index 934859fd2a..279ed18e7b 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -37,7 +37,7 @@ void FontPage::Load( const FontPageSettings &cfg ) RageTextureID ID2 = ID1; // "arial 20 16x16 [main].png" => "arial 20 16x16 [main-stroke].png" - if( ID2.filename.find("]") != string::npos ) + if( ID2.filename.find("]") != std::string::npos ) { ID2.filename.Replace( "]", "-stroke]" ); if( IsAFile(ID2.filename) ) @@ -76,7 +76,7 @@ void FontPage::Load( const FontPageSettings &cfg ) } // load character widths - vector aiFrameWidths; + std::vector aiFrameWidths; int default_width = m_FontPageTextures.m_pTextureMain->GetSourceFrameWidth(); if( cfg.m_iDefaultWidth != -1 ) @@ -85,7 +85,7 @@ void FontPage::Load( const FontPageSettings &cfg ) // Assume each character is the width of the frame by default. for( int i=0; iGetNumFrames(); i++ ) { - map::const_iterator it = cfg.m_mapGlyphWidths.find(i); + std::map::const_iterator it = cfg.m_mapGlyphWidths.find(i); if( it != cfg.m_mapGlyphWidths.end() ) aiFrameWidths.push_back( it->second ); else @@ -140,7 +140,7 @@ void FontPage::Load( const FontPageSettings &cfg ) // m_sTexturePath.c_str(), height, baseline, baseline-height); } -void FontPage::SetTextureCoords( const vector &widths, int iAdvanceExtraPixels ) +void FontPage::SetTextureCoords( const std::vector &widths, int iAdvanceExtraPixels ) { for(int i = 0; i < m_FontPageTextures.m_pTextureMain->GetNumFrames(); ++i) { @@ -207,8 +207,8 @@ void FontPage::SetExtraPixels( int iDrawExtraPixelsLeft, int iDrawExtraPixelsRig /* Extra pixels to draw to the left and right. We don't have to * worry about alignment here; fCharWidth is always even (by * SetTextureCoords) and iFrameWidth are almost always even. */ - float fExtraLeft = min( float(iDrawExtraPixelsLeft), (iFrameWidth-fCharWidth)/2.0f ); - float fExtraRight = min( float(iDrawExtraPixelsRight), (iFrameWidth-fCharWidth)/2.0f ); + float fExtraLeft = std::min( float(iDrawExtraPixelsLeft), (iFrameWidth-fCharWidth)/2.0f ); + float fExtraRight = std::min( float(iDrawExtraPixelsRight), (iFrameWidth-fCharWidth)/2.0f ); // Move left and expand right. m_aGlyphs[i].m_TexRect.left -= fExtraLeft * m_FontPageTextures.m_pTextureMain->GetSourceToTexCoordsRatioX(); @@ -232,7 +232,7 @@ FontPage::~FontPage() } } -int Font::GetLineWidthInSourcePixels( const wstring &szLine ) const +int Font::GetLineWidthInSourcePixels( const std::wstring &szLine ) const { int iLineWidth = 0; @@ -242,19 +242,19 @@ int Font::GetLineWidthInSourcePixels( const wstring &szLine ) const return iLineWidth; } -int Font::GetLineHeightInSourcePixels( const wstring &szLine ) const +int Font::GetLineHeightInSourcePixels( const std::wstring &szLine ) const { int iLineHeight = 0; // The height of a line is the height of its tallest used font page. for( unsigned i=0; im_iHeight ); + iLineHeight = std::max( iLineHeight, GetGlyph(szLine[i]).m_pPage->m_iHeight ); return iLineHeight; } // width is a pointer so that we can return the used width through it. -int Font::GetGlyphsThatFit(const wstring& line, int* width) const +int Font::GetGlyphsThatFit(const std::wstring& line, int* width) const { if(*width == 0) { @@ -310,7 +310,7 @@ void Font::AddPage( FontPage *m_pPage ) { m_apPages.push_back( m_pPage ); - for( map::const_iterator it = m_pPage->m_iCharToGlyphNo.begin(); + for( std::map::const_iterator it = m_pPage->m_iCharToGlyphNo.begin(); it != m_pPage->m_iCharToGlyphNo.end(); ++it ) { m_iCharToGlyph[it->first] = &m_pPage->m_aGlyphs[it->second]; @@ -326,7 +326,7 @@ void Font::MergeFont(Font &f) if( m_pDefault == nullptr ) m_pDefault = f.m_pDefault; - for(map::iterator it = f.m_iCharToGlyph.begin(); + for(std::map::iterator it = f.m_iCharToGlyph.begin(); it != f.m_iCharToGlyph.end(); ++it) { m_iCharToGlyph[it->first] = it->second; @@ -355,7 +355,7 @@ const glyph &Font::GetGlyph( wchar_t c ) const return *m_iCharToGlyphCache[c]; // Try the regular character. - map::const_iterator it = m_iCharToGlyph.find(c); + std::map::const_iterator it = m_iCharToGlyph.find(c); // If that's missing, use the default glyph. if(it == m_iCharToGlyph.end()) @@ -367,9 +367,9 @@ const glyph &Font::GetGlyph( wchar_t c ) const return *it->second; } -bool Font::FontCompleteForString( const wstring &str ) const +bool Font::FontCompleteForString( const std::wstring &str ) const { - map::const_iterator mapDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH ); + std::map::const_iterator mapDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH ); if( mapDefault == m_iCharToGlyph.end() ) RageException::Throw( "The default glyph is missing from the font \"%s\".", path.c_str() ); @@ -389,7 +389,7 @@ void Font::CapsOnly() * a lowercase one. */ for( char c = 'A'; c <= 'Z'; ++c ) { - map::const_iterator it = m_iCharToGlyph.find(c); + std::map::const_iterator it = m_iCharToGlyph.find(c); if(it == m_iCharToGlyph.end()) continue; @@ -413,10 +413,10 @@ void Font::SetDefaultGlyph( FontPage *pPage ) // Given the INI for a font, find all of the texture pages for the font. -void Font::GetFontPaths( const RString &sFontIniPath, vector &asTexturePathsOut ) +void Font::GetFontPaths( const RString &sFontIniPath, std::vector &asTexturePathsOut ) { RString sPrefix = SetExtension( sFontIniPath, "" ); - vector asFiles; + std::vector asFiles; GetDirListing( sPrefix + "*", asFiles, false, true ); for( unsigned i = 0; i < asFiles.size(); ++i ) @@ -429,11 +429,11 @@ void Font::GetFontPaths( const RString &sFontIniPath, vector &asTexture RString Font::GetPageNameFromFileName( const RString &sFilename ) { size_t begin = sFilename.find_first_of( '[' ); - if( begin == string::npos ) + if( begin == std::string::npos ) return "main"; size_t end = sFilename.find_first_of( ']', begin ); - if( end == string::npos ) + if( end == std::string::npos ) return "main"; begin++; @@ -545,7 +545,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RStr * Map hiragana to 0-84: * range Unicode #3041-3094=0 */ - vector asMatches; + std::vector asMatches; static Regex parse("^RANGE ([A-Z0-9\\-]+)( ?#([0-9A-F]+)-([0-9A-F]+))?$"); bool match = parse.Compare( sName, asMatches ); ASSERT( asMatches.size() == 4 ); // 4 parens @@ -617,7 +617,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RStr } // Decode the string. - const wstring wdata( RStringToWstring(pValue->GetValue()) ); + const std::wstring wdata( RStringToWstring(pValue->GetValue()) ); if(int(wdata.size()) > num_frames_wide) { @@ -720,7 +720,7 @@ RString FontPageSettings::MapRange( RString sMapping, int iMapOffset, int iGlyph return RString(); } -static vector LoadStack; +static std::vector LoadStack; /* A font set is a set of files, eg: * @@ -772,7 +772,7 @@ void Font::Load( const RString &sIniPath, RString sChars ) m_sChars = sChars; // Get the filenames associated with this font. - vector asTexturePaths; + std::vector asTexturePaths; GetFontPaths( sIniPath, asTexturePaths ); bool bCapitalsOnly = false; @@ -792,7 +792,7 @@ void Font::Load( const RString &sIniPath, RString sChars ) } { - vector ImportList; + std::vector ImportList; bool bIsTopLevelFont = LoadStack.size() == 1; @@ -838,7 +838,7 @@ void Font::Load( const RString &sIniPath, RString sChars ) RString sPagename = GetPageNameFromFileName( sTexturePath ); // Ignore stroke textures - if( sTexturePath.find("-stroke") != string::npos ) + if( sTexturePath.find("-stroke") != std::string::npos ) continue; // Create this down here so it doesn't leak if the continue gets triggered. @@ -855,7 +855,7 @@ void Font::Load( const RString &sIniPath, RString sChars ) /* Expect at least as many frames as we have premapped characters. */ /* Make sure that we don't map characters to frames we don't actually * have. This can happen if the font is too small for an sChars. */ - for(map::iterator it = pPage->m_iCharToGlyphNo.begin(); + for(std::map::iterator it = pPage->m_iCharToGlyphNo.begin(); it != pPage->m_iCharToGlyphNo.end(); ++it) { if( it->second < pPage->m_FontPageTextures.m_pTextureMain->GetNumFrames() ) @@ -892,7 +892,7 @@ void Font::Load( const RString &sIniPath, RString sChars ) { // Cache ASCII glyphs. ZERO( m_iCharToGlyphCache ); - map::iterator it; + std::map::iterator it; for( it = m_iCharToGlyph.begin(); it != m_iCharToGlyph.end(); ++it ) if( it->first < (int) ARRAYLEN(m_iCharToGlyphCache) ) m_iCharToGlyphCache[it->first] = it->second; diff --git a/src/Font.h b/src/Font.h index 88c2a3abbe..462ba73031 100644 --- a/src/Font.h +++ b/src/Font.h @@ -79,9 +79,9 @@ struct FontPageSettings float m_fScaleAllWidthsBy; RString m_sTextureHints; - map CharToGlyphNo; + std::map CharToGlyphNo; // If a value is missing, the width of the texture frame is used. - map m_mapGlyphWidths; + std::map m_mapGlyphWidths; /** @brief The initial settings for the FontPage. */ FontPageSettings(): m_sTexturePath(""), @@ -132,13 +132,13 @@ public: RString m_sTexturePath; /** @brief All glyphs in this list will point to m_pTexture. */ - vector m_aGlyphs; + std::vector m_aGlyphs; - map m_iCharToGlyphNo; + std::map m_iCharToGlyphNo; private: void SetExtraPixels( int iDrawExtraPixelsLeft, int DrawExtraPixelsRight ); - void SetTextureCoords( const vector &aiWidths, int iAdvanceExtraPixels ); + void SetTextureCoords( const std::vector &aiWidths, int iAdvanceExtraPixels ); }; class Font @@ -152,11 +152,11 @@ public: const glyph &GetGlyph( wchar_t c ) const; - int GetLineWidthInSourcePixels( const wstring &szLine ) const; - int GetLineHeightInSourcePixels( const wstring &szLine ) const; - int GetGlyphsThatFit(const wstring& line, int* width) const; + int GetLineWidthInSourcePixels( const std::wstring &szLine ) const; + int GetLineHeightInSourcePixels( const std::wstring &szLine ) const; + int GetGlyphsThatFit(const std::wstring& line, int* width) const; - bool FontCompleteForString( const wstring &str ) const; + bool FontCompleteForString( const std::wstring &str ) const; /** * @brief Add a FontPage to this font. @@ -188,7 +188,7 @@ public: private: /** @brief List of pages and fonts that we use (and are responsible for freeing). */ - vector m_apPages; + std::vector m_apPages; /** * @brief This is the primary fontpage of this font. @@ -198,7 +198,7 @@ private: FontPage *m_pDefault; /** @brief Map from characters to glyphs. */ - map m_iCharToGlyph; + std::map m_iCharToGlyph; /** @brief Each glyph is part of one of the pages[]. */ glyph *m_iCharToGlyphCache[128]; @@ -217,7 +217,7 @@ private: RString m_sChars; void LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RString &sTexturePath, const RString &PageName, RString sChars ); - static void GetFontPaths( const RString &sFontOrTextureFilePath, vector &sTexturePaths ); + static void GetFontPaths( const RString &sFontOrTextureFilePath, std::vector &sTexturePaths ); RString GetPageNameFromFileName( const RString &sFilename ); Font(const Font& rhs); diff --git a/src/FontCharAliases.cpp b/src/FontCharAliases.cpp index 826680ecc4..b4106c47a4 100644 --- a/src/FontCharAliases.cpp +++ b/src/FontCharAliases.cpp @@ -7,9 +7,9 @@ #include // Map from "&foo;" to a UTF-8 string. -typedef map aliasmap; +typedef std::map aliasmap; static aliasmap CharAliases; -static map CharAliasRepl; +static std::map CharAliasRepl; /* Editing this file in VC6 will be rather ugly, since it contains a lot of UTF-8. * Just don't change anything you can't read. :) */ diff --git a/src/FontCharmaps.cpp b/src/FontCharmaps.cpp index cee6921e7f..8e43af02eb 100644 --- a/src/FontCharmaps.cpp +++ b/src/FontCharmaps.cpp @@ -5,7 +5,7 @@ const wchar_t FontCharmaps::M_SKIP = 0xFEFF; -static map charmaps; +static std::map charmaps; using namespace FontCharmaps; @@ -224,7 +224,7 @@ const wchar_t *FontCharmaps::get_char_map(RString name) name.MakeLower(); - map::const_iterator i = charmaps.find(name); + std::map::const_iterator i = charmaps.find(name); if(i == charmaps.end()) return nullptr; diff --git a/src/FontManager.cpp b/src/FontManager.cpp index a5e0bebb2b..8504b2d7b5 100644 --- a/src/FontManager.cpp +++ b/src/FontManager.cpp @@ -8,8 +8,8 @@ FontManager* FONT = nullptr; // global and accessible from anywhere in our program // map from file name to a texture holder -typedef pair FontName; -static map g_mapPathToFont; +typedef std::pair FontName; +static std::map g_mapPathToFont; FontManager::FontManager() { @@ -39,7 +39,7 @@ Font* FontManager::LoadFont( const RString &sFontOrTextureFilePath, RString sCha CHECKPOINT_M( ssprintf("FontManager::LoadFont(%s).", sFontOrTextureFilePath.c_str()) ); const FontName NewName( sFontOrTextureFilePath, sChars ); - map::iterator p = g_mapPathToFont.find( NewName ); + std::map::iterator p = g_mapPathToFont.find( NewName ); if( p != g_mapPathToFont.end() ) { pFont=p->second; diff --git a/src/Foreground.cpp b/src/Foreground.cpp index 0b8de33db4..0c67ee834c 100644 --- a/src/Foreground.cpp +++ b/src/Foreground.cpp @@ -108,7 +108,7 @@ void Foreground::Update( float fDeltaTime ) } // This shouldn't go down, but be safe: - lDeltaTime = max( lDeltaTime, 0 ); + lDeltaTime = std::max( lDeltaTime, 0.0f ); bga.m_bga->Update( lDeltaTime / fRate ); diff --git a/src/Foreground.h b/src/Foreground.h index e49ba1267a..28db05f375 100644 --- a/src/Foreground.h +++ b/src/Foreground.h @@ -24,7 +24,7 @@ protected: bool m_bFinished; }; - vector m_BGAnimations; + std::vector m_BGAnimations; float m_fLastMusicSeconds; const Song *m_pSong; }; diff --git a/src/GameCommand.cpp b/src/GameCommand.cpp index 4ece4b90fd..aadd3253b2 100644 --- a/src/GameCommand.cpp +++ b/src/GameCommand.cpp @@ -490,7 +490,7 @@ int GetNumCreditsPaid() // players other than the first joined for free if( GAMESTATE->GetPremium() == Premium_2PlayersFor1Credit ) - iNumCreditsPaid = min( iNumCreditsPaid, 1 ); + iNumCreditsPaid = std::min( iNumCreditsPaid, 1 ); return iNumCreditsPaid; } @@ -611,7 +611,7 @@ bool GameCommand::IsPlayable( RString *why ) const if( !m_sScreen.CompareNoCase("ScreenEditCoursesMenu") ) { - vector vCourses; + std::vector vCourses; SONGMAN->GetAllCourses( vCourses, false ); if( vCourses.size() == 0 ) @@ -659,7 +659,7 @@ bool GameCommand::IsPlayable( RString *why ) const void GameCommand::ApplyToAllPlayers() const { - vector vpns; + std::vector vpns; FOREACH_PlayerNumber( pn ) vpns.push_back( pn ); @@ -669,12 +669,12 @@ void GameCommand::ApplyToAllPlayers() const void GameCommand::Apply( PlayerNumber pn ) const { - vector vpns; + std::vector vpns; vpns.push_back( pn ); Apply( vpns ); } -void GameCommand::Apply( const vector &vpns ) const +void GameCommand::Apply( const std::vector &vpns ) const { if( m_Commands.v.size() ) { @@ -696,7 +696,7 @@ void GameCommand::Apply( const vector &vpns ) const } } -void GameCommand::ApplySelf( const vector &vpns ) const +void GameCommand::ApplySelf( const std::vector &vpns ) const { const PlayMode OldPlayMode = GAMESTATE->m_PlayMode; @@ -790,7 +790,7 @@ void GameCommand::ApplySelf( const vector &vpns ) const if( m_pCharacter ) for (PlayerNumber const &pn : vpns) GAMESTATE->m_pCurCharacters[pn] = m_pCharacter; - for( map::const_iterator i = m_SetEnv.begin(); i != m_SetEnv.end(); i++ ) + for( std::map::const_iterator i = m_SetEnv.begin(); i != m_SetEnv.end(); i++ ) { Lua *L = LUA->Get(); GAMESTATE->m_Environment->PushSelf(L); @@ -800,7 +800,7 @@ void GameCommand::ApplySelf( const vector &vpns ) const lua_pop( L, 1 ); LUA->Release(L); } - for(map::const_iterator setting= m_SetPref.begin(); setting != m_SetPref.end(); ++setting) + for(std::map::const_iterator setting= m_SetPref.begin(); setting != m_SetPref.end(); ++setting) { IPreference* pref= IPreference::GetPreferenceByName(setting->first); if(pref != nullptr) diff --git a/src/GameCommand.h b/src/GameCommand.h index aa7a5d4467..0f4e709282 100644 --- a/src/GameCommand.h +++ b/src/GameCommand.h @@ -54,8 +54,8 @@ public: void ApplyToAllPlayers() const; void Apply( PlayerNumber pn ) const; private: - void Apply( const vector &vpns ) const; - void ApplySelf( const vector &vpns ) const; + void Apply( const std::vector &vpns ) const; + void ApplySelf( const std::vector &vpns ) const; public: bool DescribesCurrentMode( PlayerNumber pn ) const; @@ -96,7 +96,7 @@ public: RString m_sSongGroup; SortOrder m_SortOrder; RString m_sSoundPath; // "" for no sound - vector m_vsScreensToPrepare; + std::vector m_vsScreensToPrepare; /** * @brief What is the player's weight in pounds? * diff --git a/src/GameConstantsAndTypes.cpp b/src/GameConstantsAndTypes.cpp index c1ca5653c5..48dac4a18b 100644 --- a/src/GameConstantsAndTypes.cpp +++ b/src/GameConstantsAndTypes.cpp @@ -13,14 +13,14 @@ RString StepsTypeToString( StepsType st ); -static vector GenerateRankingToFillInMarker() +static std::vector GenerateRankingToFillInMarker() { - vector vRankings; + std::vector vRankings; FOREACH_ENUM( PlayerNumber, pn ) vRankings.push_back( ssprintf("#P%d#", pn+1) ); return vRankings; } -extern const vector RANKING_TO_FILL_IN_MARKER( GenerateRankingToFillInMarker() ); +extern const std::vector RANKING_TO_FILL_IN_MARKER( GenerateRankingToFillInMarker() ); extern const RString GROUP_ALL = "---Group All---"; @@ -380,7 +380,7 @@ float DisplayBpms::GetMin() const for (float const &f : vfBpms) { if( f != -1 ) - fMin = min( fMin, f ); + fMin = std::min( fMin, f ); } if( fMin == FLT_MAX ) return 0; @@ -399,7 +399,7 @@ float DisplayBpms::GetMaxWithin(float highest) const for (float const &f : vfBpms) { if( f != -1 ) - fMax = clamp(max( fMax, f ), 0, highest); + fMax = clamp(std::max( fMax, f ), 0.0f, highest); } return fMax; } diff --git a/src/GameConstantsAndTypes.h b/src/GameConstantsAndTypes.h index 7855ab64c8..9f8fc50dfa 100644 --- a/src/GameConstantsAndTypes.h +++ b/src/GameConstantsAndTypes.h @@ -380,7 +380,7 @@ const RString& RankingCategoryToString( RankingCategory rc ); RankingCategory StringToRankingCategory( const RString& rc ); LuaDeclareType( RankingCategory ); -extern const vector RANKING_TO_FILL_IN_MARKER; +extern const std::vector RANKING_TO_FILL_IN_MARKER; inline bool IsRankingToFillIn( const RString& sName ) { return !sName.empty() && sName[0]=='#'; } RankingCategory AverageMeterToRankingCategory( int iAverageMeter ); @@ -547,7 +547,7 @@ struct DisplayBpms /** * @brief The list of the BPMs for the song or course. */ - vector vfBpms; + std::vector vfBpms; }; /** @brief The various style types available. */ diff --git a/src/GameLoop.cpp b/src/GameLoop.cpp index 0e283c072b..fd024779e9 100644 --- a/src/GameLoop.cpp +++ b/src/GameLoop.cpp @@ -69,14 +69,14 @@ static bool ChangeAppPri() // if using NTPAD don't boost or else input is laggy #if defined(_WINDOWS) { - vector vDevices; + std::vector vDevices; // This can get called before INPUTMAN is constructed. if( INPUTMAN ) { INPUTMAN->GetDevicesAndDescriptions(vDevices); if (std::any_of(vDevices.begin(), vDevices.end(), [](InputDeviceInfo const &d) { - return d.sDesc.find("NTPAD") != string::npos; + return d.sDesc.find("NTPAD") != std::string::npos; })) { LOG->Trace( "Using NTPAD. Don't boost priority." ); diff --git a/src/GameManager.cpp b/src/GameManager.cpp index 3e56d387cf..8fa5b8c43f 100644 --- a/src/GameManager.cpp +++ b/src/GameManager.cpp @@ -3250,7 +3250,7 @@ GameManager::~GameManager() } -void GameManager::GetStylesForGame( const Game *pGame, vector& aStylesAddTo, bool editor ) +void GameManager::GetStylesForGame( const Game *pGame, std::vector& aStylesAddTo, bool editor ) { for( int s=0; pGame->m_apStyles[s]; ++s ) { @@ -3296,7 +3296,7 @@ const Style* GameManager::GetEditorStyleForStepsType( StepsType st ) } -void GameManager::GetStepsTypesForGame( const Game *pGame, vector& aStepsTypeAddTo ) +void GameManager::GetStepsTypesForGame( const Game *pGame, std::vector& aStepsTypeAddTo ) { for( int i=0; pGame->m_apStyles[i]; ++i ) { @@ -3314,7 +3314,7 @@ void GameManager::GetStepsTypesForGame( const Game *pGame, vector& aS } } -void GameManager::GetDemonstrationStylesForGame( const Game *pGame, vector &vpStylesOut ) +void GameManager::GetDemonstrationStylesForGame( const Game *pGame, std::vector &vpStylesOut ) { vpStylesOut.clear(); @@ -3340,7 +3340,7 @@ const Style* GameManager::GetHowToPlayStyleForGame( const Game *pGame ) FAIL_M(ssprintf("Game has no Style that can be used with HowToPlay: %s", pGame->m_szName)); } -void GameManager::GetCompatibleStyles( const Game *pGame, int iNumPlayers, vector &vpStylesOut ) +void GameManager::GetCompatibleStyles( const Game *pGame, int iNumPlayers, std::vector &vpStylesOut ) { FOREACH_ENUM( StyleType, styleType ) { @@ -3376,7 +3376,7 @@ void GameManager::GetCompatibleStyles( const Game *pGame, int iNumPlayers, vecto const Style *GameManager::GetFirstCompatibleStyle( const Game *pGame, int iNumPlayers, StepsType st ) { - vector vpStyles; + std::vector vpStyles; GetCompatibleStyles( pGame, iNumPlayers, vpStyles ); for (Style const *s : vpStyles) { @@ -3389,7 +3389,7 @@ const Style *GameManager::GetFirstCompatibleStyle( const Game *pGame, int iNumPl } -void GameManager::GetEnabledGames( vector& aGamesOut ) +void GameManager::GetEnabledGames( std::vector& aGamesOut ) { for( size_t g=0; g::check( L, 1 ); - vector vstAddTo; + std::vector vstAddTo; p->GetStepsTypesForGame( pGame, vstAddTo ); ASSERT( !vstAddTo.empty() ); StepsType st = vstAddTo[0]; @@ -3526,7 +3526,7 @@ public: { luaL_error(L, "GetStylesForGame: Invalid Game: '%s'", game_name.c_str()); } - vector aStyles; + std::vector aStyles; lua_createtable(L, 0, 0); for( int s=0; pGame->m_apStyles[s]; ++s ) { @@ -3538,7 +3538,7 @@ public: } static int GetEnabledGames( T* p, lua_State *L ) { - vector aGames; + std::vector aGames; p->GetEnabledGames( aGames ); lua_createtable(L, aGames.size(), 0); for(size_t i= 0; i < aGames.size(); ++i) diff --git a/src/GameManager.h b/src/GameManager.h index 1efa2d2015..ff07d71f8e 100644 --- a/src/GameManager.h +++ b/src/GameManager.h @@ -29,16 +29,16 @@ public: GameManager(); ~GameManager(); - void GetStylesForGame( const Game* pGame, vector& aStylesAddTo, bool editor=false ); + void GetStylesForGame( const Game* pGame, std::vector& aStylesAddTo, bool editor=false ); const Game *GetGameForStyle( const Style *pStyle ); - void GetStepsTypesForGame( const Game* pGame, vector& aStepsTypeAddTo ); + void GetStepsTypesForGame( const Game* pGame, std::vector& aStepsTypeAddTo ); const Style *GetEditorStyleForStepsType( StepsType st ); - void GetDemonstrationStylesForGame( const Game *pGame, vector &vpStylesOut ); + void GetDemonstrationStylesForGame( const Game *pGame, std::vector &vpStylesOut ); const Style *GetHowToPlayStyleForGame( const Game* pGame ); - void GetCompatibleStyles( const Game *pGame, int iNumPlayers, vector &vpStylesOut ); + void GetCompatibleStyles( const Game *pGame, int iNumPlayers, std::vector &vpStylesOut ); const Style *GetFirstCompatibleStyle( const Game *pGame, int iNumPlayers, StepsType st ); - void GetEnabledGames( vector& aGamesOut ); + void GetEnabledGames( std::vector& aGamesOut ); const Game* GetDefaultGame(); bool IsGameEnabled( const Game* pGame ); int GetIndexFromGame( const Game* pGame ); diff --git a/src/GameSoundManager.cpp b/src/GameSoundManager.cpp index b9bed2a861..68f2ee2ca5 100644 --- a/src/GameSoundManager.cpp +++ b/src/GameSoundManager.cpp @@ -80,11 +80,11 @@ static MusicPlaying *g_Playing; static RageThread MusicThread; -vector g_SoundsToPlayOnce; -vector g_SoundsToPlayOnceFromDir; -vector g_SoundsToPlayOnceFromAnnouncer; +std::vector g_SoundsToPlayOnce; +std::vector g_SoundsToPlayOnceFromDir; +std::vector g_SoundsToPlayOnceFromAnnouncer; // This should get updated to unordered_map when once C++11 is supported -std::map> g_DirSoundOrder; +std::map> g_DirSoundOrder; struct MusicToPlay { @@ -100,7 +100,7 @@ struct MusicToPlay HasTiming = false; } }; -vector g_MusicsToPlay; +std::vector g_MusicsToPlay; static GameSoundManager::PlayMusicParams g_FallbackMusicParams; static void StartMusic( MusicToPlay &ToPlay ) @@ -242,7 +242,7 @@ static void StartMusic( MusicToPlay &ToPlay ) const float fSecondToStartOn = g_Playing->m_Timing.GetElapsedTimeFromBeatNoOffset( fCurBeatToStartOn ); const float fMaximumDistance = 2; - const float fDistance = min( fSecondToStartOn - GAMESTATE->m_Position.m_fMusicSeconds, fMaximumDistance ); + const float fDistance = std::min( fSecondToStartOn - GAMESTATE->m_Position.m_fMusicSeconds, fMaximumDistance ); when = GAMESTATE->m_Position.m_LastBeatUpdate + fDistance; } @@ -293,7 +293,7 @@ static void DoPlayOnceFromDir( RString sPath ) if( sPath.Right(1) != "/" ) sPath += "/"; - vector arraySoundFiles; + std::vector arraySoundFiles; GetDirListing( sPath + "*.mp3", arraySoundFiles ); GetDirListing( sPath + "*.wav", arraySoundFiles ); GetDirListing( sPath + "*.ogg", arraySoundFiles ); @@ -310,7 +310,7 @@ static void DoPlayOnceFromDir( RString sPath ) } g_Mutex->Lock(); - vector &order = g_DirSoundOrder.insert({sPath, vector()}).first->second; + std::vector &order = g_DirSoundOrder.insert({sPath, std::vector()}).first->second; // If order is exhausted, repopulate and reshuffle if (order.size() == 0) { @@ -340,13 +340,13 @@ static bool SoundWaiting() static void StartQueuedSounds() { g_Mutex->Lock(); - vector aSoundsToPlayOnce = g_SoundsToPlayOnce; + std::vector aSoundsToPlayOnce = g_SoundsToPlayOnce; g_SoundsToPlayOnce.clear(); - vector aSoundsToPlayOnceFromDir = g_SoundsToPlayOnceFromDir; + std::vector aSoundsToPlayOnceFromDir = g_SoundsToPlayOnceFromDir; g_SoundsToPlayOnceFromDir.clear(); - vector aSoundsToPlayOnceFromAnnouncer = g_SoundsToPlayOnceFromAnnouncer; + std::vector aSoundsToPlayOnceFromAnnouncer = g_SoundsToPlayOnceFromAnnouncer; g_SoundsToPlayOnceFromAnnouncer.clear(); - vector aMusicsToPlay = g_MusicsToPlay; + std::vector aMusicsToPlay = g_MusicsToPlay; g_MusicsToPlay.clear(); g_Mutex->Unlock(); @@ -507,7 +507,7 @@ float GameSoundManager::GetFrameTimingAdjustment( float fDeltaTime ) return 0; /* Subtract the extra delay. */ - return min( -fExtraDelay, 0 ); + return std::min( -fExtraDelay, 0.0f ); } void GameSoundManager::Update( float fDeltaTime ) @@ -638,7 +638,7 @@ void GameSoundManager::Update( float fDeltaTime ) float fSongBeat = GAMESTATE->m_Position.m_fSongBeat; int iRowNow = BeatToNoteRowNotRounded( fSongBeat ); - iRowNow = max( 0, iRowNow ); + iRowNow = std::max( 0, iRowNow ); int iBeatNow = iRowNow / ROWS_PER_BEAT; @@ -900,7 +900,7 @@ LUA_REGISTER_CLASS(GameSoundManager); int LuaFunc_get_sound_driver_list(lua_State* L); int LuaFunc_get_sound_driver_list(lua_State* L) { - vector driver_names; + std::vector driver_names; split(RageSoundDriver::GetDefaultSoundDriverList(), ",", driver_names, true); lua_createtable(L, driver_names.size(), 0); for(size_t n= 0; n < driver_names.size(); ++n) diff --git a/src/GameState.cpp b/src/GameState.cpp index 148e8e0562..5f27a2809d 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -708,7 +708,7 @@ int GameState::GetNumStagesForCurrentSongAndStepsOrCourse() const else return -1; - iNumStagesOfThisSong = max( iNumStagesOfThisSong, 1 ); + iNumStagesOfThisSong = std::max( iNumStagesOfThisSong, 1 ); return iNumStagesOfThisSong; } @@ -789,7 +789,7 @@ void GameState::CommitStageStats() STATSMAN->CommitStatsToProfiles( &STATSMAN->m_CurStageStats ); // Update TotalPlaySeconds. - int iPlaySeconds = max( 0, (int) m_timeGameStarted.GetDeltaTime() ); + int iPlaySeconds = std::max( 0, (int) m_timeGameStarted.GetDeltaTime() ); Profile* pMachineProfile = PROFILEMAN->GetMachineProfile(); pMachineProfile->m_iTotalSessionSeconds += iPlaySeconds; @@ -1007,7 +1007,7 @@ void GameState::SetCompatibleStylesForPlayers() } else if(GetCurrentStyle(PLAYER_INVALID) == nullptr) { - vector vst; + std::vector vst; GAMEMAN->GetStepsTypesForGame(m_pCurGame, vst); const Style *style = GAMEMAN->GetFirstCompatibleStyle( m_pCurGame, GetNumSidesJoined(), vst[0]); @@ -1029,7 +1029,7 @@ void GameState::SetCompatibleStylesForPlayers() } else { - vector vst; + std::vector vst; GAMEMAN->GetStepsTypesForGame(m_pCurGame, vst); st= vst[0]; } @@ -1302,7 +1302,7 @@ int GameState::GetSmallestNumStagesLeftForAnyHumanPlayer() const return 999; int iSmallest = INT_MAX; FOREACH_HumanPlayer( p ) - iSmallest = min( iSmallest, m_iPlayerStageTokens[p] ); + iSmallest = std::min( iSmallest, m_iPlayerStageTokens[p] ); return iSmallest; } @@ -1459,11 +1459,11 @@ int GameState::prepare_song_for_gameplay() // specify their own music file, and the variety of step file formats. // Complex logic to figure out what files the song actually uses would be // bug prone. Just copy all audio files and step files. -Kyz - vector copy_exts= ActorUtil::GetTypeExtensionList(FT_Sound); + std::vector copy_exts= ActorUtil::GetTypeExtensionList(FT_Sound); copy_exts.push_back("sm"); copy_exts.push_back("ssc"); copy_exts.push_back("lrc"); - vector files_in_dir; + std::vector files_in_dir; FILEMAN->GetDirListingWithMultipleExtensions(from_dir, copy_exts, files_in_dir); for(size_t i= 0; i < files_in_dir.size(); ++i) { @@ -1937,7 +1937,7 @@ bool GameState::CurrentOptionsDisqualifyPlayer( PlayerNumber pn ) * */ -void GameState::GetAllUsedNoteSkins( vector &out ) const +void GameState::GetAllUsedNoteSkins( std::vector &out ) const { FOREACH_EnabledPlayer( pn ) { @@ -1979,13 +1979,13 @@ void GameState::AddStageToPlayer( PlayerNumber pn ) template void setmin( T &a, const T &b ) { - a = min(a, b); + a = std::min(a, b); } template void setmax( T &a, const T &b ) { - a = max(a, b); + a = std::max(a, b); } FailType GameState::GetPlayerFailType( const PlayerState *pPlayerState ) const @@ -2000,7 +2000,7 @@ FailType GameState::GetPlayerFailType( const PlayerState *pPlayerState ) const if( IsCourseMode() ) { if( PREFSMAN->m_bMinimum1FullSongInCourses && GetCourseSongIndex()==0 ) - ft = max( ft, FailType_ImmediateContinue ); // take the least harsh of the two FailTypes + ft = std::max( ft, FailType_ImmediateContinue ); // take the least harsh of the two FailTypes } else { @@ -2047,7 +2047,7 @@ bool GameState::ShowW1() const static ThemeMetric PROFILE_RECORD_FEATS("GameState","ProfileRecordFeats"); static ThemeMetric CATEGORY_RECORD_FEATS("GameState","CategoryRecordFeats"); -void GameState::GetRankingFeats( PlayerNumber pn, vector &asFeatsOut ) const +void GameState::GetRankingFeats( PlayerNumber pn, std::vector &asFeatsOut ) const { if( !IsHumanPlayer(pn) ) return; @@ -2071,7 +2071,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector &asFeatsOu // Find unique Song and Steps combinations that were played. // We must keep only the unique combination or else we'll double-count // high score markers. - vector vSongAndSteps; + std::vector vSongAndSteps; for( unsigned i=0; im_vPlayedStageStats.size(); i++ ) { @@ -2090,7 +2090,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector &asFeatsOu sort( vSongAndSteps.begin(), vSongAndSteps.end() ); - vector::iterator toDelete = unique( vSongAndSteps.begin(), vSongAndSteps.end() ); + std::vector::iterator toDelete = unique( vSongAndSteps.begin(), vSongAndSteps.end() ); vSongAndSteps.erase(toDelete, vSongAndSteps.end()); CHECKPOINT_M( "About to find records from the gathered."); @@ -2283,7 +2283,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector &asFeatsOu bool GameState::AnyPlayerHasRankingFeats() const { - vector vFeats; + std::vector vFeats; FOREACH_PlayerNumber( p ) { GetRankingFeats( p, vFeats ); @@ -2314,7 +2314,7 @@ void GameState::StoreRankingName( PlayerNumber pn, RString sName ) } sLine.MakeUpper(); - if( !sLine.empty() && sName.find(sLine) != string::npos ) // name contains a bad word + if( !sLine.empty() && sName.find(sLine) != std::string::npos ) // name contains a bad word { LOG->Trace( "entered '%s' matches blacklisted item '%s'", sName.c_str(), sLine.c_str() ); sName = ""; @@ -2324,7 +2324,7 @@ void GameState::StoreRankingName( PlayerNumber pn, RString sName ) } } - vector aFeats; + std::vector aFeats; GetRankingFeats( pn, aFeats ); for( unsigned i=0; i &v = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(); + const std::vector &v = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(); Difficulty d = GetClosestShownDifficulty(pn); for(;;) @@ -2453,7 +2453,7 @@ bool GameState::ChangePreferredDifficulty( PlayerNumber pn, int dir ) * Difficulty_Edit. Return the closest shown difficulty <= m_PreferredDifficulty. */ Difficulty GameState::GetClosestShownDifficulty( PlayerNumber pn ) const { - const vector &v = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(); + const std::vector &v = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(); Difficulty iClosest = (Difficulty) 0; int iClosestDist = -1; @@ -2488,7 +2488,7 @@ bool GameState::ChangePreferredCourseDifficulty( PlayerNumber pn, int dir ) /* If we have a course selected, only choose among difficulties available in the course. */ const Course *pCourse = m_pCurCourse; - const vector &v = CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW.GetValue(); + const std::vector &v = CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW.GetValue(); CourseDifficulty cd = m_PreferredCourseDifficulty[pn]; for(;;) @@ -2512,7 +2512,7 @@ bool GameState::ChangePreferredCourseDifficulty( PlayerNumber pn, int dir ) bool GameState::IsCourseDifficultyShown( CourseDifficulty cd ) { - const vector &v = CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW.GetValue(); + const std::vector &v = CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW.GetValue(); return find(v.begin(), v.end(), cd) != v.end(); } @@ -2526,7 +2526,7 @@ Difficulty GameState::GetEasiestStepsDifficulty() const LuaHelpers::ReportScriptErrorFmt( "GetEasiestStepsDifficulty called but p%i hasn't chosen notes", p+1 ); continue; } - dc = min( dc, m_pCurSteps[p]->GetDifficulty() ); + dc = std::min( dc, m_pCurSteps[p]->GetDifficulty() ); } return dc; } @@ -2541,7 +2541,7 @@ Difficulty GameState::GetHardestStepsDifficulty() const LuaHelpers::ReportScriptErrorFmt( "GetHardestStepsDifficulty called but p%i hasn't chosen notes", p+1 ); continue; } - dc = max( dc, m_pCurSteps[p]->GetDifficulty() ); + dc = std::max( dc, m_pCurSteps[p]->GetDifficulty() ); } return dc; } @@ -2950,7 +2950,7 @@ public: return 0; // use a vector and not a set so that ordering is maintained - vector vpStepsToShow; + std::vector vpStepsToShow; FOREACH_HumanPlayer( p ) { const Steps* pSteps = GAMESTATE->m_pCurSteps[p]; @@ -2977,7 +2977,7 @@ public: DEFINE_METHOD( GetPreferredSongGroup, m_sPreferredSongGroup.Get() ); static int GetHumanPlayers( T* p, lua_State *L ) { - vector vHP; + std::vector vHP; FOREACH_HumanPlayer( pn ) vHP.push_back( pn ); LuaHelpers::CreateTableFromArray( vHP, L ); @@ -2985,7 +2985,7 @@ public: } static int GetEnabledPlayers(T* , lua_State *L ) { - vector vEP; + std::vector vEP; FOREACH_EnabledPlayer( pn ) vEP.push_back( pn ); LuaHelpers::CreateTableFromArray( vEP, L ); @@ -3130,7 +3130,7 @@ public: // Do not allow styles with StepsTypes with shared sides or that are one player only with Battle or Rave. if( style->m_StyleType != StyleType_TwoPlayersSharedSides ) { - vector vpStyles; + std::vector vpStyles; GAMEMAN->GetCompatibleStyles( p->m_pCurGame, 2, vpStyles ); for (const Style *s : vpStyles) { diff --git a/src/GameState.h b/src/GameState.h index d8121a2167..8e2a3dea08 100644 --- a/src/GameState.h +++ b/src/GameState.h @@ -266,7 +266,7 @@ public: BroadcastOnChange m_bGameplayLeadIn; // if re-adding noteskin changes in courses, add functions and such here -aj - void GetAllUsedNoteSkins( vector &out ) const; + void GetAllUsedNoteSkins( std::vector &out ) const; static const float MUSIC_SECONDS_INVALID; @@ -289,7 +289,7 @@ public: float m_DanceDuration; // Random Attacks & Attack Mines - vector m_RandomAttacks; + std::vector m_RandomAttacks; // used in PLAY_MODE_BATTLE float m_fOpponentHealthPercent; @@ -353,15 +353,15 @@ public: RString *pStringToFill; }; - void GetRankingFeats( PlayerNumber pn, vector &vFeatsOut ) const; + void GetRankingFeats( PlayerNumber pn, std::vector &vFeatsOut ) const; bool AnyPlayerHasRankingFeats() const; void StoreRankingName( PlayerNumber pn, RString name ); // Called by name entry screens - vector m_vpsNamesThatWereFilled; // filled on StoreRankingName, + std::vector m_vpsNamesThatWereFilled; // filled on StoreRankingName, // Award stuff // lowest priority in front, highest priority at the back. - deque m_vLastStageAwards[NUM_PLAYERS]; - deque m_vLastPeakComboAwards[NUM_PLAYERS]; + std::deque m_vLastStageAwards[NUM_PLAYERS]; + std::deque m_vLastPeakComboAwards[NUM_PLAYERS]; // Attract stuff int m_iNumTimesThroughAttract; // negative means play regardless of m_iAttractSoundFrequency setting @@ -416,7 +416,7 @@ public: if(i >= m_autogen_fargs.size()) { return 0.0f; } return m_autogen_fargs[i]; } - vector m_autogen_fargs; + std::vector m_autogen_fargs; // Lua void PushSelf( lua_State *L ); diff --git a/src/GameplayAssist.cpp b/src/GameplayAssist.cpp index 862bdf3744..ad4267ee2f 100644 --- a/src/GameplayAssist.cpp +++ b/src/GameplayAssist.cpp @@ -37,7 +37,7 @@ void GameplayAssist::PlayTicks( const NoteData &nd, const PlayerState *ps ) const TimingData &timing = *GAMESTATE->m_pCurSteps[ps->m_PlayerNumber]->GetTimingData(); const float fSongBeat = timing.GetBeatFromElapsedTimeNoOffset( fPositionSeconds ); - const int iSongRow = max( 0, BeatToNoteRowNotRounded( fSongBeat ) ); + const int iSongRow = std::max( 0, BeatToNoteRowNotRounded( fSongBeat ) ); static int iRowLastCrossed = -1; if( iSongRow < iRowLastCrossed ) iRowLastCrossed = iSongRow; diff --git a/src/GhostArrowRow.cpp b/src/GhostArrowRow.cpp index 5b2cdeefa3..e793c4fd49 100644 --- a/src/GhostArrowRow.cpp +++ b/src/GhostArrowRow.cpp @@ -24,7 +24,7 @@ void GhostArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOffset { const RString &sButton = GAMESTATE->GetCurrentStyle(pn)->ColToButtonName( c ); - vector GameI; + std::vector GameI; GAMESTATE->GetCurrentStyle(pn)->StyleInputToGameInput( c, pn, GameI ); NOTESKIN->SetGameController( GameI[0].controller ); @@ -36,7 +36,7 @@ void GhostArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOffset } } -void GhostArrowRow::SetColumnRenderers(vector& renderers) +void GhostArrowRow::SetColumnRenderers(std::vector& renderers) { ASSERT_M(renderers.size() == m_Ghost.size(), "Notefield has different number of columns than ghost row."); for(size_t c= 0; c < m_Ghost.size(); ++c) diff --git a/src/GhostArrowRow.h b/src/GhostArrowRow.h index d2dc96e1b3..9cafa1129f 100644 --- a/src/GhostArrowRow.h +++ b/src/GhostArrowRow.h @@ -16,7 +16,7 @@ public: virtual void DrawPrimitives(); void Load( const PlayerState* pPlayerState, float fYReverseOffset ); - void SetColumnRenderers(vector& renderers); + void SetColumnRenderers(std::vector& renderers); void DidTapNote( int iCol, TapNoteScore tns, bool bBright ); void DidHoldNote( int iCol, HoldNoteScore hns, bool bBright ); @@ -26,10 +26,10 @@ protected: float m_fYReverseOffsetPixels; const PlayerState* m_pPlayerState; - vector const* m_renderers; - vector m_Ghost; - vector m_bHoldShowing; - vector m_bLastHoldShowing; + std::vector const* m_renderers; + std::vector m_Ghost; + std::vector m_bHoldShowing; + std::vector m_bLastHoldShowing; }; diff --git a/src/GradeDisplay.h b/src/GradeDisplay.h index e2a3c09cf2..19ae7bad38 100644 --- a/src/GradeDisplay.h +++ b/src/GradeDisplay.h @@ -18,7 +18,7 @@ public: // Lua void PushSelf( lua_State *L ); protected: - vector m_vSpr; + std::vector m_vSpr; }; #endif diff --git a/src/GraphDisplay.cpp b/src/GraphDisplay.cpp index a1431092b8..5f969312a1 100644 --- a/src/GraphDisplay.cpp +++ b/src/GraphDisplay.cpp @@ -104,8 +104,8 @@ public: virtual GraphLine *Copy() const; private: - vector m_Quads; - vector m_pCircles; + std::vector m_Quads; + std::vector m_pCircles; }; REGISTER_ACTOR_CLASS( GraphLine ); @@ -177,7 +177,7 @@ void GraphDisplay::Set( const StageStats &ss, const PlayerStageStats &pss ) // Show song boundaries float fSec = 0; - vector const &possibleSongs = ss.m_vpPossibleSongs; + std::vector const &possibleSongs = ss.m_vpPossibleSongs; std::for_each(possibleSongs.begin(), possibleSongs.end() - 1, [&](Song *song) { fSec += song->GetStepsSeconds(); diff --git a/src/GraphDisplay.h b/src/GraphDisplay.h index 42e17b8695..ab6c529e43 100644 --- a/src/GraphDisplay.h +++ b/src/GraphDisplay.h @@ -25,11 +25,11 @@ public: private: void UpdateVerts(); - vector m_Values; + std::vector m_Values; RectF m_quadVertices; - vector m_vpSongBoundaries; + std::vector m_vpSongBoundaries; AutoActor m_sprBarely; AutoActor m_sprBacking; AutoActor m_sprSongBoundary; diff --git a/src/GrooveRadar.cpp b/src/GrooveRadar.cpp index a90a014b65..8380cc3ffc 100644 --- a/src/GrooveRadar.cpp +++ b/src/GrooveRadar.cpp @@ -78,7 +78,7 @@ void GrooveRadar::SetFromSteps( PlayerNumber pn, Steps* pSteps ) // nullptr mean m_GrooveRadarValueMap[pn].SetFromSteps( rv ); } -void GrooveRadar::SetFromValues( PlayerNumber pn, vector vals ) +void GrooveRadar::SetFromValues( PlayerNumber pn, std::vector vals ) { m_GrooveRadarValueMap[pn].SetFromValues(vals); } @@ -107,7 +107,7 @@ void GrooveRadar::GrooveRadarValueMap::SetFromSteps( const RadarValues &rv ) { const float fValueCurrent = m_fValuesOld[c] * (1-m_PercentTowardNew) + m_fValuesNew[c] * m_PercentTowardNew; m_fValuesOld[c] = fValueCurrent; - m_fValuesNew[c] = clamp(rv[c], 0.0, 1.0); + m_fValuesNew[c] = clamp(rv[c], 0.0f, 1.0f); } if( !m_bValuesVisible ) // the values WERE invisible @@ -116,7 +116,7 @@ void GrooveRadar::GrooveRadarValueMap::SetFromSteps( const RadarValues &rv ) m_PercentTowardNew = 0; } -void GrooveRadar::GrooveRadarValueMap::SetFromValues( vector vals ) +void GrooveRadar::GrooveRadarValueMap::SetFromValues( std::vector vals ) { m_bValuesVisible = true; for( int c=0; c vals; + std::vector vals; LuaHelpers::ReadArrayFromTable( vals, L ); p->SetFromValues(pn, vals); } diff --git a/src/GrooveRadar.h b/src/GrooveRadar.h index b0f2af53d9..ab53800a4e 100644 --- a/src/GrooveRadar.h +++ b/src/GrooveRadar.h @@ -26,7 +26,7 @@ public: * @param pn the Player to give a GrooveRadar. * @param pSteps the Steps to use to make the radar. If nullptr, there are no Steps. */ void SetFromSteps( PlayerNumber pn, Steps* pSteps ); - void SetFromValues( PlayerNumber pn, vector vals ); + void SetFromValues( PlayerNumber pn, std::vector vals ); // Lua void PushSelf( lua_State *L ); @@ -46,7 +46,7 @@ protected: void SetEmpty(); void SetFromSteps( const RadarValues &rv ); - void SetFromValues( vector vals ); + void SetFromValues( std::vector vals ); void SetRadius( float f ) { m_size.x = f; m_size.y = f; } diff --git a/src/HelpDisplay.cpp b/src/HelpDisplay.cpp index 07c035eb01..b44557788e 100644 --- a/src/HelpDisplay.cpp +++ b/src/HelpDisplay.cpp @@ -21,8 +21,8 @@ void HelpDisplay::Load( const RString &sType ) m_fSecsBetweenSwitches = THEME->GetMetricF(sType,"TipSwitchTime"); } -void HelpDisplay::SetTips( const vector &arrayTips, const vector &arrayTipsAlt ) -{ +void HelpDisplay::SetTips( const std::vector &arrayTips, const std::vector &arrayTipsAlt ) +{ ASSERT( arrayTips.size() == arrayTipsAlt.size() ); if( arrayTips == m_arrayTips && arrayTipsAlt == m_arrayTipsAlt ) @@ -48,7 +48,7 @@ void HelpDisplay::Update( float fDeltaTime ) if( m_arrayTips.empty() ) return; - m_fSecsUntilSwitch -= max( fDeltaTime - fHibernate, 0 ); + m_fSecsUntilSwitch -= std::max( fDeltaTime - fHibernate, 0.0f ); if( m_fSecsUntilSwitch > 0 ) return; @@ -71,14 +71,14 @@ public: { luaL_checktype( L, 1, LUA_TTABLE ); lua_pushvalue( L, 1 ); - vector arrayTips; + std::vector arrayTips; LuaHelpers::ReadArrayFromTable( arrayTips, L ); lua_pop( L, 1 ); for( unsigned i = 0; i < arrayTips.size(); ++i ) FontCharAliases::ReplaceMarkers( arrayTips[i] ); if( lua_gettop(L) > 1 && !lua_isnil( L, 2 ) ) { - vector arrayTipsAlt; + std::vector arrayTipsAlt; luaL_checktype( L, 2, LUA_TTABLE ); lua_pushvalue( L, 2 ); LuaHelpers::ReadArrayFromTable( arrayTipsAlt, L ); @@ -95,7 +95,7 @@ public: } static int SetTipsColonSeparated( T* p, lua_State *L ) { - vector vs; + std::vector vs; split( SArg(1), "::", vs ); p->SetTips( vs ); COMMON_RETURN_SELF; @@ -103,7 +103,7 @@ public: static int gettips( T* p, lua_State *L ) { - vector arrayTips, arrayTipsAlt; + std::vector arrayTips, arrayTipsAlt; p->GetTips( arrayTips, arrayTipsAlt ); LuaHelpers::CreateTableFromArray( arrayTips, L ); diff --git a/src/HelpDisplay.h b/src/HelpDisplay.h index ec251b76e1..03ce30ce92 100644 --- a/src/HelpDisplay.h +++ b/src/HelpDisplay.h @@ -13,9 +13,12 @@ public: virtual HelpDisplay *Copy() const; - void SetTips( const vector &arrayTips ) { SetTips( arrayTips, arrayTips ); } - void SetTips( const vector &arrayTips, const vector &arrayTipsAlt ); - void GetTips( vector &arrayTipsOut, vector &arrayTipsAltOut ) const { arrayTipsOut = m_arrayTips; arrayTipsAltOut = m_arrayTipsAlt; } + void SetTips( const std::vector &arrayTips ) { SetTips( arrayTips, arrayTips ); } + void SetTips( const std::vector &arrayTips, const std::vector &arrayTipsAlt ); + void GetTips( std::vector &arrayTipsOut, std::vector &arrayTipsAltOut ) const { + arrayTipsOut = m_arrayTips; + arrayTipsAltOut = m_arrayTipsAlt; + } void SetSecsBetweenSwitches( float fSeconds ) { m_fSecsBetweenSwitches = m_fSecsUntilSwitch = fSeconds; } virtual void Update( float fDeltaTime ); @@ -24,7 +27,7 @@ public: virtual void PushSelf( lua_State *L ); protected: - vector m_arrayTips, m_arrayTipsAlt; + std::vector m_arrayTips, m_arrayTipsAlt; int m_iCurTipIndex; float m_fSecsBetweenSwitches; diff --git a/src/HighScore.cpp b/src/HighScore.cpp index 626df6c22f..06022141cd 100644 --- a/src/HighScore.cpp +++ b/src/HighScore.cpp @@ -324,7 +324,7 @@ void HighScoreList::AddHighScore( HighScore hs, int &iIndexOut, bool bIsMachine if( !bIsMachine ) ClampSize( bIsMachine ); } - HighGrade = min( hs.GetGrade(), HighGrade ); + HighGrade = std::min( hs.GetGrade(), HighGrade ); } void HighScoreList::IncrementPlayCount( DateTime _dtLastPlayed ) @@ -398,16 +398,16 @@ void HighScoreList::LoadFromNode( const XNode* pHighScoreList ) if( vHighScores.back().GetScore() == 0 ) vHighScores.pop_back(); else - HighGrade = min( vHighScores.back().GetGrade(), HighGrade ); + HighGrade = std::min( vHighScores.back().GetGrade(), HighGrade ); } } } void HighScoreList::RemoveAllButOneOfEachName() { - for (vector::iterator i = vHighScores.begin(); i != vHighScores.end(); ++i) + for (std::vector::iterator i = vHighScores.begin(); i != vHighScores.end(); ++i) { - for( vector::iterator j = i+1; j != vHighScores.end(); j++ ) + for( std::vector::iterator j = i+1; j != vHighScores.end(); j++ ) { if( i->GetName() == j->GetName() ) { @@ -437,7 +437,7 @@ void HighScoreList::MergeFromOtherHSL(HighScoreList& other, bool is_machine) std::sort(vHighScores.begin(), vHighScores.end()); // Remove non-unique scores because they probably come from an accidental // repeated merge. -Kyz - vector::iterator unique_end= + std::vector::iterator unique_end= std::unique(vHighScores.begin(), vHighScores.end()); vHighScores.erase(unique_end, vHighScores.end()); // Reverse it because sort moved the lesser scores to the top. diff --git a/src/HighScore.h b/src/HighScore.h index 568ad191ea..11abf37294 100644 --- a/src/HighScore.h +++ b/src/HighScore.h @@ -140,7 +140,7 @@ public: XNode* CreateNode() const; void LoadFromNode( const XNode* pNode ); - vector vHighScores; + std::vector vHighScores; Grade HighGrade; // Lua diff --git a/src/ImageCache.cpp b/src/ImageCache.cpp index d3d5b6c5e1..cc4f20e1d5 100644 --- a/src/ImageCache.cpp +++ b/src/ImageCache.cpp @@ -49,7 +49,7 @@ static Preference g_bPalettedImageCache( "PalettedImageCache", false ); ImageCache *IMAGECACHE; // global and accessible from anywhere in our program -static map g_ImagePathToImage; +static std::map g_ImagePathToImage; static int g_iDemandRefcount = 0; RString ImageCache::GetImageCachePath( RString sImageDir ,RString sImagePath ) @@ -220,8 +220,8 @@ struct ImageTexture: public RageTexture m_pImage->h > DISPLAY->GetMaxTextureSize() ) { LOG->Warn( "Converted %s at runtime", GetID().filename.c_str() ); - int iWidth = min( m_pImage->w, DISPLAY->GetMaxTextureSize() ); - int iHeight = min( m_pImage->h, DISPLAY->GetMaxTextureSize() ); + int iWidth = std::min( m_pImage->w, DISPLAY->GetMaxTextureSize() ); + int iHeight = std::min( m_pImage->h, DISPLAY->GetMaxTextureSize() ); RageSurfaceUtils::Zoom( m_pImage, iWidth, iHeight ); } @@ -392,8 +392,8 @@ void ImageCache::CacheImageInternal( RString sImageDir, RString sImagePath ) /* Don't resize the image to less than 32 pixels in either dimension or the next * power of two of the source (whichever is smaller); it's already very low res. */ - iWidth = max( iWidth, min(32, power_of_two(iSourceWidth)) ); - iHeight = max( iHeight, min(32, power_of_two(iSourceHeight)) ); + iWidth = std::max( iWidth, std::min(32, power_of_two(iSourceWidth)) ); + iHeight = std::max( iHeight, std::min(32, power_of_two(iSourceHeight)) ); //RageSurfaceUtils::ApplyHotPinkColorKey( pImage ); diff --git a/src/IniFile.cpp b/src/IniFile.cpp index 50478a3822..27ec5063a1 100644 --- a/src/IniFile.cpp +++ b/src/IniFile.cpp @@ -94,7 +94,7 @@ bool IniFile::ReadFile( RageFileBasic &f ) { break; } // New value. size_t iEqualIndex = line.find("="); - if( iEqualIndex != string::npos ) + if( iEqualIndex != std::string::npos ) { RString valuename = line.Left((int) iEqualIndex); RString value = line.Right(line.size()-valuename.size()-1); diff --git a/src/IniFile.h b/src/IniFile.h index 88239db3ce..fe35ba1865 100644 --- a/src/IniFile.h +++ b/src/IniFile.h @@ -4,7 +4,6 @@ #define INIFILE_H #include "XmlFile.h" -using namespace std; class RageFileBasic; /** @brief The functions to read and write .INI files. */ diff --git a/src/InputFilter.cpp b/src/InputFilter.cpp index ce323a0f8b..4dd0c10dab 100644 --- a/src/InputFilter.cpp +++ b/src/InputFilter.cpp @@ -80,7 +80,7 @@ namespace * optimize InputFilter::Update, so we don't have to process every button * we know about when most of them aren't in use. This set is protected * by queuemutex. */ - typedef map ButtonStateMap; + typedef std::map ButtonStateMap; ButtonStateMap g_ButtonStates; ButtonState &GetButtonState( const DeviceInput &di ) { @@ -92,7 +92,7 @@ namespace } DeviceInputList g_CurrentState; - set g_DisableRepeat; + std::set g_DisableRepeat; } /* Some input devices require debouncing. Do this on both press and release. @@ -300,7 +300,7 @@ void InputFilter::ReportButtonChange( const DeviceInput &di, InputEventType t ) ie.m_ButtonState = g_CurrentState; } -void InputFilter::MakeButtonStateList( vector &aInputOut ) const +void InputFilter::MakeButtonStateList( std::vector &aInputOut ) const { aInputOut.clear(); aInputOut.reserve( g_ButtonStates.size() ); @@ -327,9 +327,9 @@ void InputFilter::Update( float fDeltaTime ) MakeButtonStateList( g_CurrentState ); - vector ButtonsToErase; + std::vector ButtonsToErase; - for( map::iterator b = g_ButtonStates.begin(); b != g_ButtonStates.end(); ++b ) + for( std::map::iterator b = g_ButtonStates.begin(); b != g_ButtonStates.end(); ++b ) { di.device = b->first.device; di.button = b->first.button; @@ -452,14 +452,14 @@ void InputFilter::RepeatStopKey( const DeviceInput &di ) g_DisableRepeat.insert( di ); } -void InputFilter::GetInputEvents( vector &array ) +void InputFilter::GetInputEvents( std::vector &array ) { array.clear(); LockMut(*queuemutex); array.swap( queue ); } -void InputFilter::GetPressedButtons( vector &array ) const +void InputFilter::GetPressedButtons( std::vector &array ) const { LockMut(*queuemutex); array = g_CurrentState; diff --git a/src/InputFilter.h b/src/InputFilter.h index 5cacc3bd8a..3897943561 100644 --- a/src/InputFilter.h +++ b/src/InputFilter.h @@ -70,8 +70,8 @@ public: float GetLevel( const DeviceInput &di, const DeviceInputList *pButtonState = nullptr ) const; RString GetButtonComment( const DeviceInput &di ) const; - void GetInputEvents( vector &aEventOut ); - void GetPressedButtons( vector &array ) const; + void GetInputEvents( std::vector &aEventOut ); + void GetPressedButtons( std::vector &array ) const; // cursor void UpdateCursorLocation(float _fX, float _fY); @@ -86,9 +86,9 @@ public: private: void CheckButtonChange( ButtonState &bs, DeviceInput di, const RageTimer &now ); void ReportButtonChange( const DeviceInput &di, InputEventType t ); - void MakeButtonStateList( vector &aInputOut ) const; + void MakeButtonStateList( std::vector &aInputOut ) const; - vector queue; + std::vector queue; RageMutex *queuemutex; MouseCoordinates m_MouseCoords; diff --git a/src/InputMapper.cpp b/src/InputMapper.cpp index 3d0bfc20c9..b57defa7fa 100644 --- a/src/InputMapper.cpp +++ b/src/InputMapper.cpp @@ -20,7 +20,7 @@ namespace { // lookup for efficiency from a DeviceInput to a GameInput // This is repopulated every time m_PItoDI changes by calling UpdateTempDItoPI(). - map g_tempDItoGI; + std::map g_tempDItoGI; PlayerNumber g_JoinControllers; }; @@ -75,7 +75,7 @@ void InputMapper::AddDefaultMappingsForCurrentGameIfUnmapped() FOREACH_ENUM( GameButton, j) ClearFromInputMap( GameInput(i, j), 2 ); - vector aMaps; + std::vector aMaps; aMaps.reserve( 32 ); for (AutoMappingEntry const &iter : g_DefaultKeyMappings.m_vMaps) @@ -599,9 +599,9 @@ void InputMapper::Unmap( InputDevice id ) UpdateTempDItoGI(); } -void InputMapper::ApplyMapping( const vector &vMmaps, GameController gc, InputDevice id ) +void InputMapper::ApplyMapping( const std::vector &vMmaps, GameController gc, InputDevice id ) { - map MappedButtons; + std::map MappedButtons; for (AutoMappingEntry const &iter : vMmaps) { GameController map_gc = gc; @@ -626,14 +626,14 @@ void InputMapper::ApplyMapping( const vector &vMmaps, GameCont void InputMapper::AutoMapJoysticksForCurrentGame() { - vector vDevices; + std::vector vDevices; INPUTMAN->GetDevicesAndDescriptions(vDevices); // fill vector with all auto mappings - vector vAutoMappings; + std::vector vAutoMappings; { // file automaps - Add these first so that they can match before the hard-coded mappings - vector vs; + std::vector vs; GetDirListing( AUTOMAPPINGS_DIR "*.ini", vs, false, true ); for (RString const &sFilePath : vs) { @@ -733,16 +733,16 @@ void InputMapper::ResetMappingsToDefault() AddDefaultMappingsForCurrentGameIfUnmapped(); } -void InputMapper::CheckButtonAndAddToReason(GameButton menu, vector& full_reason, RString const& sub_reason) +void InputMapper::CheckButtonAndAddToReason(GameButton menu, std::vector& full_reason, RString const& sub_reason) { - vector inputs; + std::vector inputs; bool exists= false; // Only player 1 is checked because the player 2 buttons are rarely // unmapped and do not exist on some keyboard models. -Kyz GetInputScheme()->MenuButtonToGameInputs(menu, PLAYER_1, inputs); if(!inputs.empty()) { - vector device_inputs; + std::vector device_inputs; for(GameInput &inp : inputs) { for(int slot= 0; slot < NUM_GAME_TO_DEVICE_SLOTS; ++slot) @@ -781,7 +781,7 @@ void InputMapper::CheckButtonAndAddToReason(GameButton menu, vector& fu } } -void InputMapper::SanityCheckMappings(vector& reason) +void InputMapper::SanityCheckMappings(std::vector& reason) { // This is just to check whether the current mapping has the minimum // necessary to navigate the menus so the user can reach the config screen. @@ -802,17 +802,17 @@ bool InputMapper::CheckForChangedInputDevicesAndRemap( RString &sMessageOut ) // Only check for changes in joysticks since that's all we know how to remap. // update last seen joysticks - vector vDevices; + std::vector vDevices; INPUTMAN->GetDevicesAndDescriptions( vDevices ); // Strip non-joysticks. - vector vsLastSeenJoysticks; + std::vector vsLastSeenJoysticks; // Don't use "," since some vendors have a name like "company Ltd., etc". // For now, use a pipe character. -aj, fix from Mordae. split( g_sLastSeenInputDevices, "|", vsLastSeenJoysticks ); - vector vsCurrent; - vector vsCurrentJoysticks; + std::vector vsCurrent; + std::vector vsCurrentJoysticks; for( int i=vDevices.size()-1; i>=0; i-- ) { vsCurrent.push_back( vDevices[i].sDesc ); @@ -822,7 +822,7 @@ bool InputMapper::CheckForChangedInputDevicesAndRemap( RString &sMessageOut ) } else { - vector::iterator iter = find( vsLastSeenJoysticks.begin(), vsLastSeenJoysticks.end(), vDevices[i].sDesc ); + std::vector::iterator iter = find( vsLastSeenJoysticks.begin(), vsLastSeenJoysticks.end(), vDevices[i].sDesc ); if( iter != vsLastSeenJoysticks.end() ) vsLastSeenJoysticks.erase( iter ); } @@ -832,7 +832,7 @@ bool InputMapper::CheckForChangedInputDevicesAndRemap( RString &sMessageOut ) if( !bJoysticksChanged ) return false; - vector vsConnects, vsDisconnects; + std::vector vsConnects, vsDisconnects; GetConnectsDisconnects( vsLastSeenJoysticks, vsCurrentJoysticks, vsDisconnects, vsConnects ); sMessageOut = RString(); @@ -944,7 +944,7 @@ void InputMapper::SetJoinControllers( PlayerNumber pn ) } -void InputMapper::MenuToGame( GameButton MenuI, PlayerNumber pn, vector &GameIout ) const +void InputMapper::MenuToGame( GameButton MenuI, PlayerNumber pn, std::vector &GameIout ) const { if( g_JoinControllers != PLAYER_INVALID ) pn = PLAYER_INVALID; @@ -981,7 +981,7 @@ bool InputMapper::IsBeingPressed( GameButton MenuI, PlayerNumber pn ) const { return false; } - vector GameI; + std::vector GameI; MenuToGame( MenuI, pn, GameI ); for( size_t i=0; i& GameI, MultiPlayer mp, const DeviceInputList *pButtonState ) const +bool InputMapper::IsBeingPressed(const std::vector& GameI, MultiPlayer mp, const DeviceInputList *pButtonState ) const { bool pressed= false; for(size_t i= 0; i < GameI.size(); ++i) @@ -1021,7 +1021,7 @@ void InputMapper::RepeatStopKey( GameButton MenuI, PlayerNumber pn ) { return; } - vector GameI; + std::vector GameI; MenuToGame( MenuI, pn, GameI ); for( size_t i=0; iGetSecsHeld(DeviceI) ); + fMaxSecsHeld = std::max( fMaxSecsHeld, INPUTFILTER->GetSecsHeld(DeviceI) ); } } @@ -1057,10 +1057,10 @@ float InputMapper::GetSecsHeld( GameButton MenuI, PlayerNumber pn ) const } float fMaxSecsHeld = 0; - vector GameI; + std::vector GameI; MenuToGame( MenuI, pn, GameI ); for( size_t i=0; i GameI; + std::vector GameI; MenuToGame( MenuI, pn, GameI ); for( size_t i=0; iGetLevel(DeviceI) ); + fLevel = std::max( fLevel, INPUTFILTER->GetLevel(DeviceI) ); } return fLevel; } @@ -1114,12 +1114,12 @@ float InputMapper::GetLevel( GameButton MenuI, PlayerNumber pn ) const { return 0.f; } - vector GameI; + std::vector GameI; MenuToGame( MenuI, pn, GameI ); float fLevel = 0; for( size_t i=0; i &GameIout ) const +void InputScheme::MenuButtonToGameInputs( GameButton MenuI, PlayerNumber pn, std::vector &GameIout ) const { ASSERT( MenuI != GameButton_Invalid ); - vector aGameButtons; + std::vector aGameButtons; MenuButtonToGameButtons( MenuI, aGameButtons ); for (GameButton const &gb : aGameButtons) { @@ -1167,7 +1167,7 @@ void InputScheme::MenuButtonToGameInputs( GameButton MenuI, PlayerNumber pn, vec } } -void InputScheme::MenuButtonToGameButtons( GameButton MenuI, vector &aGameButtons ) const +void InputScheme::MenuButtonToGameButtons( GameButton MenuI, std::vector &aGameButtons ) const { ASSERT( MenuI != GameButton_Invalid ); @@ -1283,7 +1283,7 @@ void InputMappings::ReadMappings( const InputScheme *pInputScheme, RString sFile if( !GameI.IsValid() ) continue; - vector sDeviceInputStrings; + std::vector sDeviceInputStrings; split( value, DEVICE_INPUT_SEPARATOR, sDeviceInputStrings, false ); for( unsigned j=0; j asValues; + + std::vector asValues; for( int slot = 0; slot < NUM_USER_GAME_TO_DEVICE_SLOTS; ++slot ) // don't save data from the last (keyboard automap) slot asValues.push_back( m_GItoDI[i][j][slot].ToString() ); diff --git a/src/InputMapper.h b/src/InputMapper.h index f6280ce30f..d3b23759ab 100644 --- a/src/InputMapper.h +++ b/src/InputMapper.h @@ -92,7 +92,7 @@ struct AutoMappings RString m_sDriverRegex; // reported by InputHandler RString m_sControllerName; // the product name of the controller - vector m_vMaps; + std::vector m_vMaps; }; class InputScheme @@ -111,8 +111,8 @@ public: GameButton ButtonNameToIndex( const RString &sButtonName ) const; GameButton GameButtonToMenuButton( GameButton gb ) const; - void MenuButtonToGameInputs( GameButton MenuI, PlayerNumber pn, vector &GameIout ) const; - void MenuButtonToGameButtons( GameButton MenuI, vector &aGameButtons ) const; + void MenuButtonToGameInputs( GameButton MenuI, PlayerNumber pn, std::vector &GameIout ) const; + void MenuButtonToGameButtons( GameButton MenuI, std::vector &aGameButtons ) const; const GameButtonInfo *GetGameButtonInfo( GameButton gb ) const; const char *GetGameButtonName( GameButton gb ) const; }; @@ -152,8 +152,8 @@ public: void ReadMappingsFromDisk(); void SaveMappingsToDisk(); void ResetMappingsToDefault(); - void CheckButtonAndAddToReason(GameButton menu, vector& full_reason, RString const& sub_reason); - void SanityCheckMappings(vector& reason); + void CheckButtonAndAddToReason(GameButton menu, std::vector& full_reason, RString const& sub_reason); + void SanityCheckMappings(std::vector& reason); void ClearAllMappings(); @@ -171,7 +171,7 @@ public: bool GameToDevice( const GameInput &GameI, int iSlotNum, DeviceInput& DeviceI ) const; // return true if there is a mapping from pad to device GameButton GameButtonToMenuButton( GameButton gb ) const; - void MenuToGame( GameButton MenuI, PlayerNumber pn, vector &GameIout ) const; + void MenuToGame( GameButton MenuI, PlayerNumber pn, std::vector &GameIout ) const; PlayerNumber ControllerToPlayerNumber( GameController controller ) const; float GetSecsHeld( const GameInput &GameI, MultiPlayer mp = MultiPlayer_Invalid ) const; @@ -179,7 +179,7 @@ public: bool IsBeingPressed( const GameInput &GameI, MultiPlayer mp = MultiPlayer_Invalid, const DeviceInputList *pButtonState = nullptr ) const; bool IsBeingPressed( GameButton MenuI, PlayerNumber pn ) const; - bool IsBeingPressed(const vector& GameI, MultiPlayer mp = MultiPlayer_Invalid, const DeviceInputList *pButtonState = nullptr ) const; + bool IsBeingPressed(const std::vector& GameI, MultiPlayer mp = MultiPlayer_Invalid, const DeviceInputList *pButtonState = nullptr ) const; void ResetKeyRepeat( const GameInput &GameI ); void ResetKeyRepeat( GameButton MenuI, PlayerNumber pn ); @@ -194,7 +194,7 @@ public: static MultiPlayer InputDeviceToMultiPlayer( InputDevice id ); void Unmap( InputDevice device ); - void ApplyMapping( const vector &vMmaps, GameController gc, InputDevice id ); + void ApplyMapping( const std::vector &vMmaps, GameController gc, InputDevice id ); protected: InputMappings m_mappings; diff --git a/src/InputQueue.cpp b/src/InputQueue.cpp index bf8a63eb3e..9e799b439e 100644 --- a/src/InputQueue.cpp +++ b/src/InputQueue.cpp @@ -68,7 +68,7 @@ bool InputQueueCode::EnteredCode( GameController controller ) const // iterate newest to oldest int iSequenceIndex = m_aPresses.size()-1; // count down - const vector &aQueue = INPUTQUEUE->GetQueue( controller ); + const std::vector &aQueue = INPUTQUEUE->GetQueue( controller ); int iQueueIndex = aQueue.size()-1; while( iQueueIndex >= 0 ) { @@ -130,7 +130,7 @@ bool InputQueueCode::EnteredCode( GameController controller ) const } if( !bAllHeldButtonsOK ) continue; - iMinSearchIndexUsed = min( iMinSearchIndexUsed, iQueueSearchIndex ); + iMinSearchIndexUsed = std::min( iMinSearchIndexUsed, iQueueSearchIndex ); if( b == (int) Press.m_aButtonsToPress.size()-1 ) bMatched = true; } @@ -164,11 +164,11 @@ bool InputQueueCode::Load( RString sButtonsNames ) { m_aPresses.clear(); - vector asPresses; + std::vector asPresses; split( sButtonsNames, ",", asPresses, false ); for (RString &sPress : asPresses) { - vector asButtonNames; + std::vector asButtonNames; split( sPress, "-", asButtonNames, false ); diff --git a/src/InputQueue.h b/src/InputQueue.h index 0fb54692a0..4ef1e0a500 100644 --- a/src/InputQueue.h +++ b/src/InputQueue.h @@ -15,11 +15,11 @@ public: void RememberInput( const InputEventPlus &gi ); bool WasPressedRecently( GameController c, const GameButton button, const RageTimer &OldestTimeAllowed, InputEventPlus *pIEP = nullptr ); - const vector &GetQueue( GameController c ) const { return m_aQueue[c]; } + const std::vector &GetQueue( GameController c ) const { return m_aQueue[c]; } void ClearQueue( GameController c ); protected: - vector m_aQueue[NUM_GameController]; + std::vector m_aQueue[NUM_GameController]; }; struct InputQueueCode @@ -40,17 +40,17 @@ private: memset( m_InputTypes, 0, sizeof(m_InputTypes) ); m_InputTypes[IET_FIRST_PRESS] = true; } - vector m_aButtonsToHold; - vector m_aButtonsToNotHold; - vector m_aButtonsToPress; + std::vector m_aButtonsToHold; + std::vector m_aButtonsToNotHold; + std::vector m_aButtonsToPress; bool m_InputTypes[NUM_InputEventType]; bool m_bAllowIntermediatePresses; }; - vector m_aPresses; + std::vector m_aPresses; float m_fMaxSecondsBack; -}; +}; extern InputQueue* INPUTQUEUE; // global and accessible from anywhere in our program diff --git a/src/Inventory.cpp b/src/Inventory.cpp index 7b416d35f4..5662107b66 100644 --- a/src/Inventory.cpp +++ b/src/Inventory.cpp @@ -28,7 +28,7 @@ struct Item unsigned int iCombo; RString sModifier; }; -static vector g_Items; +static std::vector g_Items; void ReloadItems() { diff --git a/src/Inventory.h b/src/Inventory.h index 93712c3e17..20050f0e05 100644 --- a/src/Inventory.h +++ b/src/Inventory.h @@ -32,7 +32,7 @@ protected: /** @brief a sound played when an item has been acquired. */ RageSound m_soundAcquireItem; - vector m_vpSoundUseItem; + std::vector m_vpSoundUseItem; RageSound m_soundItemEnding; }; diff --git a/src/JsonUtil.h b/src/JsonUtil.h index 422a76036e..9be5841509 100644 --- a/src/JsonUtil.h +++ b/src/JsonUtil.h @@ -17,7 +17,7 @@ namespace JsonUtil std::vector DeserializeArrayStrings(const Json::Value &array); template - static void SerializeVectorObjects(const vector &v, void fn(const T &, Json::Value &), Json::Value &root) + static void SerializeVectorObjects(const std::vector &v, void fn(const T &, Json::Value &), Json::Value &root) { root = Json::Value(Json::arrayValue); root.resize(v.size()); @@ -26,7 +26,7 @@ namespace JsonUtil } template - static void SerializeVectorPointers(const vector &v, void fn(const T &, Json::Value &), Json::Value &root) + static void SerializeVectorPointers(const std::vector &v, void fn(const T &, Json::Value &), Json::Value &root) { root = Json::Value(Json::arrayValue); root.resize(v.size()); @@ -35,7 +35,7 @@ namespace JsonUtil } template - static void SerializeVectorPointers(const vector &v, void fn(const T &, Json::Value &), Json::Value &root) + static void SerializeVectorPointers(const std::vector &v, void fn(const T &, Json::Value &), Json::Value &root) { root = Json::Value(Json::arrayValue); root.resize(v.size()); @@ -44,7 +44,7 @@ namespace JsonUtil } template - static void SerializeVectorPointers(const vector &v, void fn(const T *, Json::Value &), Json::Value &root) + static void SerializeVectorPointers(const std::vector &v, void fn(const T *, Json::Value &), Json::Value &root) { root = Json::Value(Json::arrayValue); root.resize(v.size()); @@ -133,7 +133,7 @@ namespace JsonUtil } template - static void SerializeVectorValues(const vector &v, Json::Value &root) + static void SerializeVectorValues(const std::vector &v, Json::Value &root) { root = Json::Value(Json::arrayValue); root.resize(v.size()); @@ -142,7 +142,7 @@ namespace JsonUtil } template - static void DeserializeVectorObjects(vector &v, void fn(T &, const Json::Value &), const Json::Value &root) + static void DeserializeVectorObjects(std::vector &v, void fn(T &, const Json::Value &), const Json::Value &root) { v.resize(root.size()); for(unsigned i=0; i - static void DeserializeVectorPointers(vector &v, void fn(T &, const Json::Value &), const Json::Value &root) + static void DeserializeVectorPointers(std::vector &v, void fn(T &, const Json::Value &), const Json::Value &root) { for(unsigned i=0; i - static void DeserializeVectorPointers(vector &v, void fn(T *, const Json::Value &), const Json::Value &root) + static void DeserializeVectorPointers(std::vector &v, void fn(T *, const Json::Value &), const Json::Value &root) { for(unsigned i=0; i - static void DeserializeVectorPointersParam(vector &v, void fn(T &, const Json::Value &), const Json::Value &root, const P param) + static void DeserializeVectorPointersParam(std::vector &v, void fn(T &, const Json::Value &), const Json::Value &root, const P param) { for(unsigned i=0; i - static void DeserializeObjectToObjectMapAsArray(map &m, const RString &sKeyName, const RString &sValueName, const Json::Value &root) + static void DeserializeObjectToObjectMapAsArray(std::map &m, const RString &sKeyName, const RString &sValueName, const Json::Value &root) { m.clear(); ASSERT( root.type() == Json::arrayValue ); @@ -224,7 +224,7 @@ namespace JsonUtil } template - static void DeserializeVectorValues(vector &v, const Json::Value &root) + static void DeserializeVectorValues(std::vector &v, const Json::Value &root) { v.resize(root.size()); for(unsigned i=0; im_HarshHotLifePenalty && IsHot() && fDeltaLife < 0) - fDeltaLife = min( fDeltaLife, -0.10f ); // make it take a while to get back to "hot" + fDeltaLife = std::min( fDeltaLife, -0.10f ); // make it take a while to get back to "hot" switch(m_pPlayerState->m_PlayerOptions.GetSong().m_DrainType) { @@ -134,7 +134,7 @@ void LifeMeterBar::ChangeLife( TapNoteScore score ) case DrainType_Normal: break; case DrainType_NoRecover: - fDeltaLife = min( fDeltaLife, 0 ); + fDeltaLife = std::min( fDeltaLife, 0.0f ); break; case DrainType_SuddenDeath: if( score < MIN_STAY_ALIVE ) @@ -202,7 +202,7 @@ void LifeMeterBar::ChangeLife( float fDeltaLife ) if( fDeltaLife >= 0 ) { m_iMissCombo = 0; - m_iComboToRegainLife = max( m_iComboToRegainLife-1, 0 ); + m_iComboToRegainLife = std::max( m_iComboToRegainLife-1, 0 ); if ( m_iComboToRegainLife > 0 ) fDeltaLife = 0.0f; } @@ -213,11 +213,11 @@ void LifeMeterBar::ChangeLife( float fDeltaLife ) m_iMissCombo++; /* Increase by m_iRegenComboAfterMiss; never push it beyond m_iMaxRegenComboAfterMiss * but don't reduce it if it's already past. */ - const int NewComboToRegainLife = min( + const int NewComboToRegainLife = std::min( (int)PREFSMAN->m_iMaxRegenComboAfterMiss, m_iComboToRegainLife + PREFSMAN->m_iRegenComboAfterMiss ); - m_iComboToRegainLife = max( m_iComboToRegainLife, NewComboToRegainLife ); + m_iComboToRegainLife = std::max( m_iComboToRegainLife, NewComboToRegainLife ); } // If we've already failed, there's no point in letting them fill up the bar again. diff --git a/src/LifeMeterBattery.cpp b/src/LifeMeterBattery.cpp index 85d044d2bd..e504ceba38 100644 --- a/src/LifeMeterBattery.cpp +++ b/src/LifeMeterBattery.cpp @@ -104,7 +104,7 @@ void LifeMeterBattery::OnSongEnded() lua_settop(L, 0); LUA->Release(L); } - m_iLivesLeft = min( m_iLivesLeft, m_pPlayerState->m_PlayerOptions.GetSong().m_BatteryLives ); + m_iLivesLeft = std::min( m_iLivesLeft, m_pPlayerState->m_PlayerOptions.GetSong().m_BatteryLives ); if( m_iTrailingLivesLeft < m_iLivesLeft ) m_soundGainLife.Play(false); diff --git a/src/LifeMeterTime.cpp b/src/LifeMeterTime.cpp index 0d287161a7..b90d9ab480 100644 --- a/src/LifeMeterTime.cpp +++ b/src/LifeMeterTime.cpp @@ -228,7 +228,7 @@ void LifeMeterTime::Update( float fDeltaTime ) { // update current stage stats so ScoreDisplayLifeTime can show the right thing float fSecs = GetLifeSeconds(); - fSecs = max( 0, fSecs ); + fSecs = std::max( 0.0f, fSecs ); m_pPlayerStageStats->m_fLifeRemainingSeconds = fSecs; LifeMeter::Update( fDeltaTime ); diff --git a/src/LightsManager.cpp b/src/LightsManager.cpp index 484943d04b..2afb3807e4 100644 --- a/src/LightsManager.cpp +++ b/src/LightsManager.cpp @@ -48,11 +48,11 @@ static const char *LightsModeNames[] = { XToString( LightsMode ); LuaXType( LightsMode ); -static void GetUsedGameInputs( vector &vGameInputsOut ) +static void GetUsedGameInputs( std::vector &vGameInputsOut ) { vGameInputsOut.clear(); - vector asGameButtons; + std::vector asGameButtons; split( GAME_BUTTONS_TO_SHOW.GetValue(), ",", asGameButtons ); FOREACH_ENUM( GameController, gc ) { @@ -67,8 +67,8 @@ static void GetUsedGameInputs( vector &vGameInputsOut ) } } - set vGIs; - vector vStyles; + std::set vGIs; + std::vector vStyles; GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vStyles ); auto const &value = CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue(); for (Style const *style : vStyles) @@ -80,7 +80,7 @@ static void GetUsedGameInputs( vector &vGameInputsOut ) { for( int iCol=0; iCol < style->m_iColsPerPlayer; ++iCol ) { - vector gi; + std::vector gi; style->StyleInputToGameInput( iCol, pn, gi ); for(size_t i= 0; i < gi.size(); ++i) { @@ -150,7 +150,7 @@ void LightsManager::Update( float fDeltaTime ) if( fDuration > 0 ) { // The light has power left. Brighten it. - float fSeconds = min( fDuration, fTime ); + float fSeconds = std::min( fDuration, fTime ); fDuration -= fSeconds; fTime -= fSeconds; fapproach( m_fActorLights[cl], 1, fSeconds / g_fLightEffectRiseSeconds ); @@ -404,7 +404,7 @@ void LightsManager::Update( float fDeltaTime ) { int index = GetTestAutoCycleCurrentIndex(); - vector vGI; + std::vector vGI; GetUsedGameInputs( vGI ); wrap( index, vGI.size() ); @@ -421,7 +421,7 @@ void LightsManager::Update( float fDeltaTime ) { ZERO( m_LightsState.m_bGameButtonLights ); - vector vGI; + std::vector vGI; GetUsedGameInputs( vGI ); if( m_iControllerTestManualCycleCurrent != -1 ) @@ -487,7 +487,7 @@ void LightsManager::ChangeTestGameButtonLight( int iDir ) { m_clTestManualCycleCurrent = CabinetLight_Invalid; - vector vGI; + std::vector vGI; GetUsedGameInputs( vGI ); m_iControllerTestManualCycleCurrent += iDir; diff --git a/src/LightsManager.h b/src/LightsManager.h index 0e8a677291..6dc24e67f5 100644 --- a/src/LightsManager.h +++ b/src/LightsManager.h @@ -91,7 +91,7 @@ private: float m_fActorLights[NUM_CabinetLight]; // current "power" of each actor light float m_fSecsLeftInActorLightBlink[NUM_CabinetLight]; // duration to "power" an actor light - vector m_vpDrivers; + std::vector m_vpDrivers; LightsMode m_LightsMode; LightsState m_LightsState; diff --git a/src/LuaBinding.cpp b/src/LuaBinding.cpp index 03264f9e1b..feeb46a834 100644 --- a/src/LuaBinding.cpp +++ b/src/LuaBinding.cpp @@ -15,11 +15,11 @@ namespace return; /* Register base classes first. */ - map mapToRegister; + std::map mapToRegister; for (LuaBinding *binding : *m_Subscribers.m_pSubscribers) mapToRegister[binding->GetClassName()] = binding; - set setRegisteredAlready; + std::set setRegisteredAlready; while( !mapToRegister.empty() ) { @@ -33,7 +33,7 @@ namespace break; } RString sBase = pBinding->GetBaseClassName(); - map::const_iterator it = mapToRegister.find(sBase); + std::map::const_iterator it = mapToRegister.find(sBase); if( it != mapToRegister.end() ) { pBinding = it->second; diff --git a/src/LuaBinding.h b/src/LuaBinding.h index f073b2196f..050a566785 100644 --- a/src/LuaBinding.h +++ b/src/LuaBinding.h @@ -109,7 +109,7 @@ private: return pFunc( obj, L ); // call member function } - vector m_aMethods; + std::vector m_aMethods; static int tostring_T( lua_State *L ) { diff --git a/src/LuaExpressionTransform.cpp b/src/LuaExpressionTransform.cpp index 7ddeb91d56..8eeca80e60 100644 --- a/src/LuaExpressionTransform.cpp +++ b/src/LuaExpressionTransform.cpp @@ -35,7 +35,7 @@ const Actor::TweenState &LuaExpressionTransform::GetTransformCached( float fPosi { PositionOffsetAndItemIndex key = { fPositionOffsetFromCenter, iItemIndex }; - map::const_iterator iter = m_mapPositionToTweenStateCache.find( key ); + std::map::const_iterator iter = m_mapPositionToTweenStateCache.find( key ); if( iter != m_mapPositionToTweenStateCache.end() ) return iter->second; diff --git a/src/LuaExpressionTransform.h b/src/LuaExpressionTransform.h index ecdb1bfca2..446cd9fc06 100644 --- a/src/LuaExpressionTransform.h +++ b/src/LuaExpressionTransform.h @@ -41,7 +41,7 @@ protected: return iItemIndex < other.iItemIndex; } }; - mutable map m_mapPositionToTweenStateCache; + mutable std::map m_mapPositionToTweenStateCache; }; #endif diff --git a/src/LuaManager.cpp b/src/LuaManager.cpp index 803e6aea0c..56bf39b811 100644 --- a/src/LuaManager.cpp +++ b/src/LuaManager.cpp @@ -22,8 +22,8 @@ LuaManager *LUA = nullptr; struct Impl { Impl(): g_pLock("Lua") {} - vector g_FreeStateList; - map g_ActiveStates; + std::vector g_FreeStateList; + std::map g_ActiveStates; RageMutex g_pLock; }; @@ -105,7 +105,7 @@ namespace LuaHelpers } } -void LuaHelpers::CreateTableFromArrayB( Lua *L, const vector &aIn ) +void LuaHelpers::CreateTableFromArrayB( Lua *L, const std::vector &aIn ) { lua_newtable( L ); for( unsigned i = 0; i < aIn.size(); ++i ) @@ -115,7 +115,7 @@ void LuaHelpers::CreateTableFromArrayB( Lua *L, const vector &aIn ) } } -void LuaHelpers::ReadArrayFromTableB( Lua *L, vector &aOut ) +void LuaHelpers::ReadArrayFromTableB( Lua *L, std::vector &aOut ) { luaL_checktype( L, -1, LUA_TTABLE ); @@ -180,7 +180,7 @@ static int GetLuaStack( lua_State *L ) // The function is now on the top of the stack. const char *file = ar.source[0] == '@' ? ar.source + 1 : ar.short_src; const char *name; - vector vArgs; + std::vector vArgs; if( !strcmp(ar.what, "C") ) { @@ -236,12 +236,12 @@ static int LuaPanic( lua_State *L ) } // Actor registration -static vector *g_vRegisterActorTypes = nullptr; +static std::vector *g_vRegisterActorTypes = nullptr; void LuaManager::Register( RegisterWithLuaFn pfn ) { if( g_vRegisterActorTypes == nullptr ) - g_vRegisterActorTypes = new vector; + g_vRegisterActorTypes = new std::vector; g_vRegisterActorTypes->push_back( pfn ); } @@ -545,7 +545,7 @@ namespace struct LClass { RString m_sBaseName; - vector m_vMethods; + std::vector m_vMethods; }; } @@ -560,13 +560,13 @@ XNode *LuaHelpers::GetLuaInformation() XNode *pEnumsNode = pLuaNode->AppendChild( "Enums" ); XNode *pConstantsNode = pLuaNode->AppendChild( "Constants" ); - vector vFunctions; - map mClasses; - map > mNamespaces; - map mSingletons; - map mConstants; - map mStringConstants; - map > mEnums; + std::vector vFunctions; + std::map mClasses; + std::map> mNamespaces; + std::map mSingletons; + std::map mConstants; + std::map mStringConstants; + std::map> mEnums; Lua *L = LUA->Get(); FOREACH_LUATABLE( L, LUA_GLOBALSINDEX ) @@ -658,7 +658,7 @@ XNode *LuaHelpers::GetLuaInformation() LuaHelpers::Pop( L, sNamespace ); if( find(BuiltInPackages, end, sNamespace) != end ) continue; - vector &vNamespaceFunctions = mNamespaces[sNamespace]; + std::vector &vNamespaceFunctions = mNamespaces[sNamespace]; FOREACH_LUATABLE( L, -1 ) { RString sFunction; @@ -705,10 +705,10 @@ XNode *LuaHelpers::GetLuaInformation() } /* Namespaces */ - for( map >::const_iterator iter = mNamespaces.begin(); iter != mNamespaces.end(); ++iter ) + for( std::map>::const_iterator iter = mNamespaces.begin(); iter != mNamespaces.end(); ++iter ) { XNode *pNamespaceNode = pNamespacesNode->AppendChild( "Namespace" ); - const vector &vNamespace = iter->second; + const std::vector &vNamespace = iter->second; pNamespaceNode->AppendAttr( "name", iter->first ); for (RString const &func: vNamespace) @@ -719,11 +719,11 @@ XNode *LuaHelpers::GetLuaInformation() } /* Enums */ - for( map >::const_iterator iter = mEnums.begin(); iter != mEnums.end(); ++iter ) + for( std::map>::const_iterator iter = mEnums.begin(); iter != mEnums.end(); ++iter ) { XNode *pEnumNode = pEnumsNode->AppendChild( "Enum" ); - const vector &vEnum = iter->second; + const std::vector &vEnum = iter->second; pEnumNode->AppendAttr( "name", iter->first ); for( unsigned i = 0; i < vEnum.size(); ++i ) @@ -910,7 +910,7 @@ void LuaHelpers::ParseCommandList( Lua *L, const RString &sCommands, const RStri ParseCommands( sCommands, cmds, bLegacy ); // Convert cmds to a Lua function - ostringstream s; + std::ostringstream s; s << "return function(self)\n"; @@ -1113,7 +1113,7 @@ namespace luaL_checktype( L, 1, LUA_TFUNCTION ); luaL_checktype( L, 2, LUA_TTABLE ); - vector apVars; + std::vector apVars; FOREACH_LUATABLE( L, 2 ) { lua_pushvalue( L, -2 ); diff --git a/src/LuaManager.h b/src/LuaManager.h index e0df497a9b..f04e48b030 100644 --- a/src/LuaManager.h +++ b/src/LuaManager.h @@ -98,7 +98,7 @@ namespace LuaHelpers /* Create a Lua array (a table with indices starting at 1) of the given vector, * and push it on the stack. */ - void CreateTableFromArrayB( Lua *L, const vector &aIn ); + void CreateTableFromArrayB( Lua *L, const std::vector &aIn ); // Create a Lua table with contents set from this XNode, then push it on the stack. void CreateTableFromXNode( Lua *L, const XNode *pNode ); @@ -108,7 +108,7 @@ namespace LuaHelpers void DeepCopy( lua_State *L ); // Read the table at the top of the stack back into a vector. - void ReadArrayFromTableB( Lua *L, vector &aOut ); + void ReadArrayFromTableB( Lua *L, std::vector &aOut ); void ParseCommandList( lua_State *L, const RString &sCommands, const RString &sName, bool bLegacy ); @@ -133,7 +133,7 @@ namespace LuaHelpers } template - void ReadArrayFromTable( vector &aOut, lua_State *L ) + void ReadArrayFromTable( std::vector &aOut, lua_State *L ) { luaL_checktype( L, -1, LUA_TTABLE ); @@ -147,7 +147,7 @@ namespace LuaHelpers lua_pop( L, 1 ); // pop nil } template - void CreateTableFromArray( const vector &aIn, lua_State *L ) + void CreateTableFromArray( const std::vector &aIn, lua_State *L ) { lua_newtable( L ); for( unsigned i = 0; i < aIn.size(); ++i ) diff --git a/src/LyricDisplay.cpp b/src/LyricDisplay.cpp index f50985c340..d3b0b173cc 100644 --- a/src/LyricDisplay.cpp +++ b/src/LyricDisplay.cpp @@ -75,7 +75,7 @@ void LyricDisplay::Update( float fDeltaTime ) /* If it's negative, two lyrics are so close together that there's no time * to tween properly. Lyrics should never be this brief, anyway, so just * skip it. */ - float fShowLength = max( fDistance - fTweenBufferTime, 0.0f ); + float fShowLength = std::max( fDistance - fTweenBufferTime, 0.0f ); // Make lyrics show faster for faster song rates. fShowLength /= GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate; diff --git a/src/LyricsLoader.cpp b/src/LyricsLoader.cpp index ea820716d5..1c8097ae9c 100644 --- a/src/LyricsLoader.cpp +++ b/src/LyricsLoader.cpp @@ -56,7 +56,7 @@ bool LyricsLoader::LoadFromLRCFile(const RString& sPath, Song& out) // "[data1] data2". Ignore whitespace at the beginning of the line. static Regex x("^ *\\[([^]]+)\\] *(.*)$"); - vector matches; + std::vector matches; if(!x.Compare(line, matches)) { continue; @@ -91,7 +91,7 @@ bool LyricsLoader::LoadFromLRCFile(const RString& sPath, Song& out) //float fLyricOffset = 0.0f; // Enforce strict timestamp format to prevent crashing the program. - vector dummy; + std::vector dummy; static Regex timestamp("^([0-9]+:){0,2}[0-9]+(.[0-9]*)?$"); if (timestamp.Compare(sValueName, dummy)) { diff --git a/src/MemoryCardManager.cpp b/src/MemoryCardManager.cpp index 54e96627ad..766d8b2bfc 100644 --- a/src/MemoryCardManager.cpp +++ b/src/MemoryCardManager.cpp @@ -85,7 +85,7 @@ public: bool Unmount( const UsbStorageDevice *pDevice ); // This function will not time out. - bool StorageDevicesChanged( vector &aOut ); + bool StorageDevicesChanged( std::vector &aOut ); protected: void HandleRequest( int iRequest ); @@ -105,9 +105,9 @@ private: RageMutex UsbStorageDevicesMutex; bool m_bUsbStorageDevicesChanged; - vector m_aUsbStorageDevices; + std::vector m_aUsbStorageDevices; - vector m_aMountedDevices; + std::vector m_aMountedDevices; enum { @@ -116,7 +116,7 @@ private: }; }; -bool ThreadedMemoryCardWorker::StorageDevicesChanged( vector &aOut ) +bool ThreadedMemoryCardWorker::StorageDevicesChanged( std::vector &aOut ) { UsbStorageDevicesMutex.Lock(); if( !m_bUsbStorageDevicesChanged ) @@ -181,7 +181,7 @@ void ThreadedMemoryCardWorker::HandleRequest( int iRequest ) case REQ_UNMOUNT: { m_pDriver->Unmount( &m_RequestDevice ); - vector::iterator it = + std::vector::iterator it = find( m_aMountedDevices.begin(), m_aMountedDevices.end(), m_RequestDevice ); if( it == m_aMountedDevices.end() ) LOG->Warn( "Unmounted a device that wasn't mounted" ); @@ -211,7 +211,7 @@ void ThreadedMemoryCardWorker::DoHeartbeat() // If true, detect and mount. If false, only detect. bool bMount = (m_MountThreadState == detect_and_mount); - vector aStorageDevices; + std::vector aStorageDevices; //LOG->Trace("update"); if( !m_pDriver->DoOneUpdate( bMount, aStorageDevices ) ) return; @@ -309,7 +309,7 @@ MemoryCardManager::~MemoryCardManager() void MemoryCardManager::Update() { - vector vOld; + std::vector vOld; vOld = m_vStorageDevices; // copy if( !g_pWorker->StorageDevicesChanged( m_vStorageDevices ) ) @@ -327,7 +327,7 @@ void MemoryCardManager::UpdateAssignments() return; // make a list of unassigned - vector vUnassignedDevices = m_vStorageDevices; // copy + std::vector vUnassignedDevices = m_vStorageDevices; // copy // remove cards that are already assigned FOREACH_PlayerNumber( p ) @@ -336,7 +336,7 @@ void MemoryCardManager::UpdateAssignments() if( assigned_device.IsBlank() ) // no card assigned to this player continue; - for (vector::iterator d = vUnassignedDevices.begin(); d != vUnassignedDevices.end(); ++d) + for (std::vector::iterator d = vUnassignedDevices.begin(); d != vUnassignedDevices.end(); ++d) { if( *d == assigned_device ) { @@ -354,7 +354,7 @@ void MemoryCardManager::UpdateAssignments() if( !assigned_device.IsBlank() ) { // The player has a card assigned. If it's been removed, clear it. - vector::iterator it = find( m_vStorageDevices.begin(), m_vStorageDevices.end(), assigned_device ); + std::vector::iterator it = find( m_vStorageDevices.begin(), m_vStorageDevices.end(), assigned_device ); if( it != m_vStorageDevices.end() ) { /* The player has a card, and it's still plugged in. Update any @@ -372,7 +372,7 @@ void MemoryCardManager::UpdateAssignments() LOG->Trace( "Looking for a card for Player %d", p+1 ); - for (vector::iterator d = vUnassignedDevices.begin(); d != vUnassignedDevices.end(); ++d) + for (std::vector::iterator d = vUnassignedDevices.begin(); d != vUnassignedDevices.end(); ++d) { // search for card dir match if( !m_sMemoryCardOsMountPoint[p].Get().empty() && diff --git a/src/MemoryCardManager.h b/src/MemoryCardManager.h index 0244907638..59a1638684 100644 --- a/src/MemoryCardManager.h +++ b/src/MemoryCardManager.h @@ -42,7 +42,7 @@ public: bool IsNameAvailable( PlayerNumber pn ) const; RString GetName( PlayerNumber pn ) const; - const vector &GetStorageDevices() { return m_vStorageDevices; } + const std::vector &GetStorageDevices() { return m_vStorageDevices; } static Preference1D m_sMemoryCardOsMountPoint; static Preference1D m_iMemoryCardUsbBus; @@ -58,7 +58,7 @@ protected: void UpdateAssignments(); void CheckStateChanges(); - vector m_vStorageDevices; // all currently connected + std::vector m_vStorageDevices; // all currently connected bool m_bCardLocked[NUM_PLAYERS]; bool m_bMounted[NUM_PLAYERS]; // card is currently mounted diff --git a/src/MenuTimer.cpp b/src/MenuTimer.cpp index 83acbb3c24..b9754508c9 100644 --- a/src/MenuTimer.cpp +++ b/src/MenuTimer.cpp @@ -82,13 +82,13 @@ void MenuTimer::Update( float fDeltaTime ) // run down the stall time if any if( m_fStallSeconds > 0 ) - m_fStallSeconds = max( m_fStallSeconds - fDeltaTime, 0 ); + m_fStallSeconds = std::max( m_fStallSeconds - fDeltaTime, 0.0f ); if( m_fStallSeconds > 0 ) return; const float fOldSecondsLeft = m_fSecondsLeft; m_fSecondsLeft -= fDeltaTime; - m_fSecondsLeft = max( 0, m_fSecondsLeft ); + m_fSecondsLeft = std::max( 0.0f, m_fSecondsLeft ); const float fNewSecondsLeft = m_fSecondsLeft; SetText( fNewSecondsLeft ); @@ -145,7 +145,7 @@ void MenuTimer::Disable() void MenuTimer::Stall() { // Max amount of stall time we'll use: - const float Amt = min( 0.5f, m_fStallSecondsLeft ); + const float Amt = std::min( 0.5f, m_fStallSecondsLeft ); // Amount of stall time to add: const float ToAdd = Amt - m_fStallSeconds; diff --git a/src/MessageManager.cpp b/src/MessageManager.cpp index 1308c2a549..5a6420c650 100644 --- a/src/MessageManager.cpp +++ b/src/MessageManager.cpp @@ -92,8 +92,8 @@ XToString( MessageID ); static RageMutex g_Mutex( "MessageManager" ); -typedef set SubscribersSet; -static map g_MessageToSubscribers; +typedef std::set SubscribersSet; +static std::map g_MessageToSubscribers; Message::Message( const RString &s ) { @@ -215,7 +215,7 @@ void MessageManager::Broadcast( Message &msg ) const LockMut(g_Mutex); - map::const_iterator iter = g_MessageToSubscribers.find( msg.GetName() ); + std::map::const_iterator iter = g_MessageToSubscribers.find( msg.GetName() ); if( iter == g_MessageToSubscribers.end() ) return; diff --git a/src/MessageManager.h b/src/MessageManager.h index 851a0948a0..a9368ae85c 100644 --- a/src/MessageManager.h +++ b/src/MessageManager.h @@ -128,7 +128,7 @@ struct Message } template - void SetParam( const RString &sName, const vector &val ) + void SetParam( const RString &sName, const std::vector &val ) { Lua *L = LUA->Get(); LuaHelpers::CreateTableFromArray( val, L ); @@ -180,7 +180,7 @@ public: void UnsubscribeAll(); private: - vector m_vsSubscribedTo; + std::vector m_vsSubscribedTo; }; /** @brief Deliver messages to any part of the program as needed. */ @@ -239,7 +239,7 @@ class BroadcastOnChange1D { private: typedef BroadcastOnChange MyType; - vector val; + std::vector val; public: explicit BroadcastOnChange1D( MessageID m ) { @@ -273,7 +273,7 @@ class BroadcastOnChangePtr1D { private: typedef BroadcastOnChangePtr MyType; - vector val; + std::vector val; public: explicit BroadcastOnChangePtr1D( MessageID m ) { diff --git a/src/ModIcon.h b/src/ModIcon.h index 11fb08bbbd..4d8de8f3fd 100644 --- a/src/ModIcon.h +++ b/src/ModIcon.h @@ -22,7 +22,7 @@ protected: ThemeMetric CROP_TEXT_TO_WIDTH; ThemeMetric STOP_WORDS; - vector m_vStopWords; + std::vector m_vStopWords; }; #endif diff --git a/src/ModIconRow.cpp b/src/ModIconRow.cpp index fc91f532ea..6735de8c71 100644 --- a/src/ModIconRow.cpp +++ b/src/ModIconRow.cpp @@ -141,10 +141,10 @@ void ModIconRow::SetFromGameState() PlayerNumber pn = m_pn; RString sOptions = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetStage().GetString(); - vector vsOptions; + std::vector vsOptions; split( sOptions, ", ", vsOptions, true ); - vector vsText; // fill these with what will be displayed on the tabs + std::vector vsText; // fill these with what will be displayed on the tabs vsText.resize( m_vpModIcon.size() ); // for each option, look for the best column to place it in diff --git a/src/ModIconRow.h b/src/ModIconRow.h index 47c8a94ad8..f0fe3da575 100644 --- a/src/ModIconRow.h +++ b/src/ModIconRow.h @@ -34,7 +34,7 @@ protected: ThemeMetric NUM_OPTION_ICONS; ThemeMetric OPTION_ICON_METRICS_GROUP; - vector m_vpModIcon; + std::vector m_vpModIcon; }; #endif diff --git a/src/Model.cpp b/src/Model.cpp index 1e49ed8485..92800a0fcc 100644 --- a/src/Model.cpp +++ b/src/Model.cpp @@ -534,7 +534,7 @@ void Model::PlayAnimation( const RString &sAniName, float fPlayRate ) for( unsigned i = 0; i < m_pGeometry->m_Meshes.size(); ++i ) { msMesh *pMesh = &m_pGeometry->m_Meshes[i]; - vector &Vertices = pMesh->Vertices; + std::vector &Vertices = pMesh->Vertices; for( unsigned j = 0; j < Vertices.size(); j++ ) { // int iBoneIndex = (pMesh->m_iBoneIndex!=-1) ? pMesh->m_iBoneIndex : bone; @@ -565,7 +565,7 @@ void Model::PlayAnimation( const RString &sAniName, float fPlayRate ) void Model::SetPosition( float fSeconds ) { m_fCurFrame = FRAMES_PER_SECOND * fSeconds; - m_fCurFrame = clamp( m_fCurFrame, 0, (float) m_pCurAnimation->nTotalFrames ); + m_fCurFrame = clamp( m_fCurFrame, (float) 0, (float) m_pCurAnimation->nTotalFrames ); } void Model::AdvanceFrame( float fDeltaTime ) @@ -591,14 +591,14 @@ void Model::AdvanceFrame( float fDeltaTime ) else if( m_bLoop ) wrap( m_fCurFrame, (float) m_pCurAnimation->nTotalFrames ); else - m_fCurFrame = clamp( m_fCurFrame, 0, (float) m_pCurAnimation->nTotalFrames ); + m_fCurFrame = clamp( m_fCurFrame, (float) 0, (float) m_pCurAnimation->nTotalFrames ); } SetBones( m_pCurAnimation, m_fCurFrame, m_vpBones ); UpdateTempGeometry(); } -void Model::SetBones( const msAnimation* pAnimation, float fFrame, vector &vpBones ) +void Model::SetBones( const msAnimation* pAnimation, float fFrame, std::vector &vpBones ) { for( size_t i = 0; i < pAnimation->Bones.size(); ++i ) { @@ -688,8 +688,8 @@ void Model::UpdateTempGeometry() { const msMesh &origMesh = m_pGeometry->m_Meshes[i]; msMesh &tempMesh = m_vTempMeshes[i]; - const vector &origVertices = origMesh.Vertices; - vector &tempVertices = tempMesh.Vertices; + const std::vector &origVertices = origMesh.Vertices; + std::vector &tempVertices = tempMesh.Vertices; for( unsigned j = 0; j < origVertices.size(); j++ ) { RageVector3 &tempPos = tempVertices[j].p; @@ -731,7 +731,7 @@ int Model::GetNumStates() const { int iMaxStates = 0; for (msMaterial const &m : m_Materials) - iMaxStates = max( iMaxStates, m.diffuse.GetNumStates() ); + iMaxStates = std::max( iMaxStates, m.diffuse.GetNumStates() ); return iMaxStates; } @@ -749,7 +749,7 @@ void Model::RecalcAnimationLengthSeconds() m_animation_length_seconds= 0; for (msMaterial const &m : m_Materials) { - m_animation_length_seconds= max(m_animation_length_seconds, + m_animation_length_seconds= std::max(m_animation_length_seconds, m.diffuse.GetAnimationLengthSeconds()); } } diff --git a/src/Model.h b/src/Model.h index af54269f45..b50b8fd110 100644 --- a/src/Model.h +++ b/src/Model.h @@ -60,12 +60,12 @@ private: RageModelGeometry *m_pGeometry; float m_animation_length_seconds; - vector m_Materials; - map m_mapNameToAnimation; + std::vector m_Materials; + std::map m_mapNameToAnimation; const msAnimation* m_pCurAnimation; - static void SetBones( const msAnimation* pAnimation, float fFrame, vector &vpBones ); - vector m_vpBones; + static void SetBones( const msAnimation* pAnimation, float fFrame, std::vector &vpBones ); + std::vector m_vpBones; // If any vertex has a bone weight, then then render from m_pTempGeometry. // Otherwise, render directly from m_pGeometry. @@ -75,7 +75,7 @@ private: /* Keep a copy of the mesh data only if m_pTempGeometry is in use. The normal and * position data will be changed; the rest is static and kept only to prevent making * a complete copy. */ - vector m_vTempMeshes; + std::vector m_vTempMeshes; void DrawMesh( int i ) const; void AdvanceFrame( float fDeltaTime ); diff --git a/src/ModelTypes.cpp b/src/ModelTypes.cpp index 60a9736b29..fa6bf25bda 100644 --- a/src/ModelTypes.cpp +++ b/src/ModelTypes.cpp @@ -43,7 +43,7 @@ void AnimatedTexture::Load( const RString &sTexOrIniPath ) ASSERT( vFrames.empty() ); // don't load more than once m_bSphereMapped = sTexOrIniPath.find("sphere") != RString::npos; - if( sTexOrIniPath.find("add") != string::npos ) + if( sTexOrIniPath.find("add") != std::string::npos ) m_BlendMode = BLEND_ADD; else m_BlendMode = BLEND_NORMAL; @@ -341,9 +341,9 @@ bool msAnimation::LoadMilkshapeAsciiBones( RString sAniName, RString sPath ) { msBone& Bone = Animation.Bones[i]; for( unsigned j = 0; j < Bone.PositionKeys.size(); ++j ) - Animation.nTotalFrames = max( Animation.nTotalFrames, (int)Bone.PositionKeys[j].fTime ); + Animation.nTotalFrames = std::max( Animation.nTotalFrames, (int)Bone.PositionKeys[j].fTime ); for( unsigned j = 0; j < Bone.RotationKeys.size(); ++j ) - Animation.nTotalFrames = max( Animation.nTotalFrames, (int)Bone.RotationKeys[j].fTime ); + Animation.nTotalFrames = std::max( Animation.nTotalFrames, (int)Bone.RotationKeys[j].fTime ); } } diff --git a/src/ModelTypes.h b/src/ModelTypes.h index 3c2c2150b1..819f2bc06b 100644 --- a/src/ModelTypes.h +++ b/src/ModelTypes.h @@ -16,14 +16,14 @@ struct msMesh RString sName; char nMaterialIndex; - vector Vertices; + std::vector Vertices; // OPTIMIZATION: If all verts in a mesh are transformed by the same bone, // then send the transform to the graphics card for the whole mesh instead // of transforming each vertex on the CPU; char m_iBoneIndex; // -1 = no bone - vector Triangles; + std::vector Triangles; }; class RageTexture; @@ -74,7 +74,7 @@ private: float fDelaySecs; RageVector2 vTranslate; }; - vector vFrames; + std::vector vFrames; }; struct msMaterial @@ -114,8 +114,8 @@ struct msBone RageVector3 Position; RageVector3 Rotation; - vector PositionKeys; - vector RotationKeys; + std::vector PositionKeys; + std::vector RotationKeys; }; struct msAnimation @@ -130,7 +130,7 @@ struct msAnimation bool LoadMilkshapeAsciiBones( RString sAniName, RString sPath ); - vector Bones; + std::vector Bones; int nTotalFrames; }; diff --git a/src/MsdFile.h b/src/MsdFile.h index 7d43d2aec4..6c0732508d 100644 --- a/src/MsdFile.h +++ b/src/MsdFile.h @@ -12,7 +12,7 @@ public: struct value_t { /** @brief The list of parameters. */ - vector params; + std::vector params; /** @brief Set up the parameters with default values. */ value_t(): params() {} @@ -94,7 +94,7 @@ private: void AddValue(); /** @brief The list of values. */ - vector values; + std::vector values; /** @brief The error string. */ RString error; }; diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index 578eea67cc..35322e3dd3 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -89,13 +89,13 @@ void MusicWheel::Load( RString sType ) HIDE_INACTIVE_SECTIONS .Load(sType,"OnlyShowActiveSection"); HIDE_ACTIVE_SECTION_TITLE .Load(sType,"HideActiveSectionTitle"); REMIND_WHEEL_POSITIONS .Load(sType,"RemindWheelPositions"); - vector vsModeChoiceNames; + std::vector vsModeChoiceNames; split( MODE_MENU_CHOICE_NAMES, ",", vsModeChoiceNames ); CHOICE .Load(sType,CHOICE_NAME,vsModeChoiceNames); SECTION_COLORS .Load(sType,SECTION_COLORS_NAME,NUM_SECTION_COLORS); CUSTOM_WHEEL_ITEM_NAMES .Load(sType,"CustomWheelItemNames"); - vector vsCustomItemNames; + std::vector vsCustomItemNames; split( CUSTOM_WHEEL_ITEM_NAMES, ",", vsCustomItemNames ); CUSTOM_CHOICES.Load(sType,CUSTOM_WHEEL_ITEM_NAME,vsCustomItemNames); CUSTOM_CHOICE_COLORS.Load(sType,CUSTOM_WHEEL_ITEM_COLOR,vsCustomItemNames); @@ -149,7 +149,7 @@ void MusicWheel::BeginScreen() // Set m_LastModeMenuItem to the first item that matches the current mode. (Do this // after building wheel item data.) { - const vector &from = getWheelItemsData(SORT_MODE_MENU); + const std::vector &from = getWheelItemsData(SORT_MODE_MENU); for( unsigned i=0; im_pAction != nullptr ); @@ -189,7 +189,7 @@ void MusicWheel::BeginScreen() // first song in the group. -aj if(!GAMESTATE->IsCourseMode()) { - vector vTemp = SONGMAN->GetSongs(GAMESTATE->m_sPreferredSongGroup); + std::vector vTemp = SONGMAN->GetSongs(GAMESTATE->m_sPreferredSongGroup); ASSERT(vTemp.size() > 0); GAMESTATE->m_pCurSong.Set(vTemp[0]); }; @@ -234,7 +234,7 @@ void MusicWheel::BeginScreen() { if(GAMESTATE->m_pCurSteps[p] != nullptr) { - vector vpPossibleSteps; + std::vector vpPossibleSteps; if(GAMESTATE->m_pCurSong != nullptr) { SongUtil::GetPlayableSteps(GAMESTATE->m_pCurSong, vpPossibleSteps); @@ -251,8 +251,8 @@ void MusicWheel::BeginScreen() MusicWheel::~MusicWheel() { FOREACH_ENUM( SortOrder, so ) { - vector::iterator i = m__UnFilteredWheelItemDatas[so].begin(); - vector::iterator iEnd = m__UnFilteredWheelItemDatas[so].end(); + std::vector::iterator i = m__UnFilteredWheelItemDatas[so].begin(); + std::vector::iterator iEnd = m__UnFilteredWheelItemDatas[so].end(); for( ; i != iEnd; ++i ) { delete *i; } @@ -293,7 +293,7 @@ bool MusicWheel::SelectSongOrCourse() return true; // Select the first selectable song based on the sort order... - vector &wiWheelItems = getWheelItemsData(GAMESTATE->m_SortOrder); + std::vector &wiWheelItems = getWheelItemsData(GAMESTATE->m_SortOrder); for( unsigned i = 0; i < wiWheelItems.size(); i++ ) { if( wiWheelItems[i]->m_pSong ) @@ -326,7 +326,7 @@ bool MusicWheel::SelectSong( const Song *p ) return false; unsigned i; - vector &from = getWheelItemsData(GAMESTATE->m_SortOrder); + std::vector &from = getWheelItemsData(GAMESTATE->m_SortOrder); for( i=0; im_pSong == p ) @@ -354,7 +354,7 @@ bool MusicWheel::SelectCourse( const Course *p ) return false; unsigned i; - vector &from = getWheelItemsData(GAMESTATE->m_SortOrder); + std::vector &from = getWheelItemsData(GAMESTATE->m_SortOrder); for( i=0; im_pCourse == p ) @@ -381,7 +381,7 @@ bool MusicWheel::SelectModeMenuItem() { // Select the last-chosen option. ASSERT( GAMESTATE->m_SortOrder == SORT_MODE_MENU ); - const vector &from = getWheelItemsData(GAMESTATE->m_SortOrder); + const std::vector &from = getWheelItemsData(GAMESTATE->m_SortOrder); unsigned i; for( i=0; i &arraySongs, SortOrder so ) +void MusicWheel::GetSongList( std::vector &arraySongs, SortOrder so ) { - vector apAllSongs; + std::vector apAllSongs; switch( so ) { case SORT_PREFERRED: @@ -447,7 +447,7 @@ void MusicWheel::GetSongList( vector &arraySongs, SortOrder so ) // filter songs that we don't have enough stages to play { - vector vTempSongs; + std::vector vTempSongs; SongCriteria sc; sc.m_iMaxStagesForSong = GAMESTATE->GetSmallestNumStagesLeftForAnyHumanPlayer(); SongUtil::FilterSongs( sc, apAllSongs, vTempSongs ); @@ -505,14 +505,14 @@ void MusicWheel::GetSongList( vector &arraySongs, SortOrder so ) } } -void MusicWheel::BuildWheelItemDatas( vector &arrayWheelItemDatas, SortOrder so ) +void MusicWheel::BuildWheelItemDatas( std::vector &arrayWheelItemDatas, SortOrder so ) { switch( so ) { case SORT_MODE_MENU: { arrayWheelItemDatas.clear(); // clear out the previous wheel items - vector vsNames; + std::vector vsNames; split( MODE_MENU_CHOICE_NAMES, ",", vsNames ); for( unsigned i=0; i &arrayWheelIt case SORT_RECENT: { // Make an array of Song*, then sort them - vector arraySongs; + std::vector arraySongs; GetSongList( arraySongs, so ); bool bUseSections = true; @@ -719,7 +719,7 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelIt arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Portal, nullptr, "", nullptr, PORTAL_COLOR, 0) ); // add custom wheel items - vector vsNames; + std::vector vsNames; split( CUSTOM_WHEEL_ITEM_NAMES, ",", vsNames ); for( unsigned i=0; i &arrayWheelIt { bool bOnlyPreferred = PREFSMAN->m_CourseSortOrder == COURSE_SORT_PREFERRED; - vector vct; + std::vector vct; switch( so ) { case SORT_NONSTOP_COURSES: @@ -782,7 +782,7 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelIt FAIL_M(ssprintf("Wrong sort order: %i", so)); } - vector apCourses; + std::vector apCourses; for (CourseType const &ct : vct) { if( bOnlyPreferred ) @@ -869,7 +869,7 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelIt { WID->m_Flags.bHasBeginnerOr1Meter = WID->m_pSong->IsEasy( GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType ) && SHOW_EASY_FLAG; WID->m_Flags.bEdits = false; - set vStepsType; + std::set vStepsType; SongUtil::GetPlayableStepsTypes( WID->m_pSong, vStepsType ); for (StepsType const &type : vStepsType) WID->m_Flags.bEdits |= WID->m_pSong->HasEdits( type ); @@ -884,7 +884,7 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelIt } } -vector & MusicWheel::getWheelItemsData(SortOrder so) { +std::vector & MusicWheel::getWheelItemsData(SortOrder so) { // Update the popularity and init icons. readyWheelItemsData(so); return m__WheelItemDatas[so]; @@ -894,7 +894,7 @@ void MusicWheel::readyWheelItemsData(SortOrder so) { if(m_WheelItemDatasStatus[so]!=VALID) { RageTimer timer; - vector &aUnFilteredDatas=m__UnFilteredWheelItemDatas[so]; + std::vector &aUnFilteredDatas = m__UnFilteredWheelItemDatas[so]; if(m_WheelItemDatasStatus[so]==INVALID) { BuildWheelItemDatas( aUnFilteredDatas, so ); @@ -907,7 +907,7 @@ void MusicWheel::readyWheelItemsData(SortOrder so) { } -void MusicWheel::FilterWheelItemDatas(vector &aUnFilteredDatas, vector &aFilteredData, SortOrder so ) +void MusicWheel::FilterWheelItemDatas(std::vector &aUnFilteredDatas, std::vector &aFilteredData, SortOrder so ) { aFilteredData.clear(); @@ -922,7 +922,7 @@ void MusicWheel::FilterWheelItemDatas(vector &aUnFilteredD } } - vector aiRemove; + std::vector aiRemove; aiRemove.insert( aiRemove.begin(), unfilteredSize, false ); const int iMaxStagesForSong = GAMESTATE->GetSmallestNumStagesLeftForAnyHumanPlayer(); @@ -1059,7 +1059,7 @@ void MusicWheel::FilterWheelItemDatas(vector &aUnFilteredD /* Update the popularity. This is affected by filtering. */ if( so == SORT_POPULARITY ) { - for( unsigned i=0; i< min(3u,aFilteredData.size()); i++ ) + for( unsigned i=0; i < std::min(3u, aFilteredData.size()); i++ ) { MusicWheelItemData& WID = *aFilteredData[i]; WID.m_Flags.iPlayersBestNumber = i+1; @@ -1232,7 +1232,7 @@ bool MusicWheel::NextSort() // return true if change successful if( GAMESTATE->m_SortOrder == SORT_MODE_MENU ) return false; - vector aSortOrders; + std::vector aSortOrders; { Lua *L = LUA->Get(); SORT_ORDERS.PushSelf( L ); @@ -1274,7 +1274,7 @@ bool MusicWheel::Select() // return true if this selection ends the screen m_fTimeLeftInState = 0.1f; return false; case STATE_RANDOM_SPINNING: - m_fPositionOffsetFromSelection = max(m_fPositionOffsetFromSelection, 0.3f); + m_fPositionOffsetFromSelection = std::max(m_fPositionOffsetFromSelection, 0.3f); m_WheelState = STATE_LOCKED; SCREENMAN->PlayStartSound(); m_fLockedWheelVelocity = 0; @@ -1367,12 +1367,12 @@ void MusicWheel::SetOpenSection( RString group ) if( !m_CurWheelItemData.empty() ) old = GetCurWheelItemData(m_iSelection); - vector vpPossibleStyles; + std::vector vpPossibleStyles; if( CommonMetrics::AUTO_SET_STYLE ) GAMEMAN->GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles ); m_CurWheelItemData.clear(); - vector &from = getWheelItemsData(GAMESTATE->m_SortOrder); + std::vector &from = getWheelItemsData(GAMESTATE->m_SortOrder); m_CurWheelItemData.reserve( from.size() ); for( unsigned i = 0; i < from.size(); ++i ) { @@ -1442,9 +1442,9 @@ void MusicWheel::SetOpenSection( RString group ) RebuildWheelItems(); } -void MusicWheel::GetCurrentSections(vector §ions) +void MusicWheel::GetCurrentSections(std::vector §ions) { - vector &wiWheelItems = getWheelItemsData(GAMESTATE->m_SortOrder); + std::vector &wiWheelItems = getWheelItemsData(GAMESTATE->m_SortOrder); for( unsigned i = 0; i < wiWheelItems.size(); i++ ) { if ( wiWheelItems[i]->m_Type == WheelItemDataType_Section && !wiWheelItems[i]->m_sText.empty()) @@ -1595,7 +1595,7 @@ Song *MusicWheel::GetPreferredSelectionForRandomOrPortal() { // probe to find a song that has the preferred // difficulties of each player - vector vDifficultiesToRequire; + std::vector vDifficultiesToRequire; FOREACH_HumanPlayer(p) { if( GAMESTATE->m_PreferredDifficulty[p] == Difficulty_Invalid ) @@ -1612,7 +1612,7 @@ Song *MusicWheel::GetPreferredSelectionForRandomOrPortal() } RString sPreferredGroup = m_sExpandedSectionName; - vector &wid = getWheelItemsData(GAMESTATE->m_SortOrder); + std::vector &wid = getWheelItemsData(GAMESTATE->m_SortOrder); StepsType st = GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType; @@ -1679,7 +1679,7 @@ public: DEFINE_METHOD(GetSelectedSection, GetSelectedSection()); static int GetCurrentSections( T* p, lua_State *L ) { - vector v; + std::vector v; p->GetCurrentSections(v); LuaHelpers::CreateTableFromArray( v, L ); return 1; diff --git a/src/MusicWheel.h b/src/MusicWheel.h index 232e8bd9da..043023a3a8 100644 --- a/src/MusicWheel.h +++ b/src/MusicWheel.h @@ -52,20 +52,20 @@ public: virtual void ReloadSongList(); - void GetCurrentSections(vector §ions); + void GetCurrentSections(std::vector §ions); // Lua void PushSelf( lua_State *L ); protected: MusicWheelItem *MakeItem(); - void GetSongList( vector &arraySongs, SortOrder so ); + void GetSongList( std::vector &arraySongs, SortOrder so ); bool SelectSongOrCourse(); bool SelectModeMenuItem(); virtual void UpdateSwitch(); - vector & getWheelItemsData(SortOrder so); + std::vector & getWheelItemsData(SortOrder so); void readyWheelItemsData(SortOrder so); RString m_sLastModeMenuItem; @@ -99,7 +99,7 @@ protected: ThemeMetric RANDOM_COLOR; ThemeMetric PORTAL_COLOR; ThemeMetric EMPTY_COLOR; - vector m_viWheelPositions; + std::vector m_viWheelPositions; ThemeMetric CUSTOM_WHEEL_ITEM_NAMES; ThemeMetricMap CUSTOM_CHOICES; ThemeMetricMap CUSTOM_CHOICE_COLORS; @@ -107,11 +107,11 @@ protected: private: //use getWheelItemsData instead of touching this one enum {INVALID,NEEDREFILTER,VALID} m_WheelItemDatasStatus[NUM_SortOrder]; - vector m__WheelItemDatas[NUM_SortOrder]; - vector m__UnFilteredWheelItemDatas[NUM_SortOrder]; + std::vector m__WheelItemDatas[NUM_SortOrder]; + std::vector m__UnFilteredWheelItemDatas[NUM_SortOrder]; - void BuildWheelItemDatas( vector &arrayWheelItems, SortOrder so ); - void FilterWheelItemDatas(vector &aUnFilteredDatas, vector &aFilteredData, SortOrder so ); + void BuildWheelItemDatas( std::vector &arrayWheelItems, SortOrder so ); + void FilterWheelItemDatas(std::vector &aUnFilteredDatas, std::vector &aFilteredData, SortOrder so ); }; #endif diff --git a/src/NetworkManager.cpp b/src/NetworkManager.cpp index 67acc59a2a..c2cf1b9562 100644 --- a/src/NetworkManager.cpp +++ b/src/NetworkManager.cpp @@ -132,7 +132,7 @@ bool NetworkManager::IsUrlAllowed(const std::string& url) RString allowedHostsStr = this->httpAllowHosts.Get(); allowedHostsStr.MakeLower(); - vector allowedHosts; + std::vector allowedHosts; split(allowedHostsStr, ",", allowedHosts); for (const auto& allowedHost : allowedHosts) @@ -283,7 +283,7 @@ std::string NetworkManager::GetUserAgent() void NetworkManager::ClearDownloads() { - vector files; + std::vector files; FILEMAN->GetDirListing("/Downloads/*", files, false, true); for (const auto& file : files) diff --git a/src/NoteData.cpp b/src/NoteData.cpp index ac363c7aa0..ad84d908d6 100644 --- a/src/NoteData.cpp +++ b/src/NoteData.cpp @@ -16,7 +16,7 @@ REGISTER_CLASS_TRAITS( NoteData, new NoteData(*pCopy) ) void NoteData::Init() { - m_TapNotes = vector(); // ensure that the memory is freed + m_TapNotes = std::vector(); // ensure that the memory is freed } void NoteData::SetNumTracks( int iNewNumTracks ) @@ -198,7 +198,7 @@ int NoteData::GetNumTapNonEmptyTracks( int row ) const return iNum; } -void NoteData::GetTapNonEmptyTracks( int row, set& addTo ) const +void NoteData::GetTapNonEmptyTracks( int row, std::set& addTo ) const { for( int t=0; tsecond; if( tnOther.type == TapNoteType_HoldHead ) { - iStartRow = min( iStartRow, iOtherRow ); - iEndRow = max( iEndRow, iOtherRow + tnOther.iDuration ); + iStartRow = std::min( iStartRow, iOtherRow ); + iEndRow = std::max( iEndRow, iOtherRow + tnOther.iDuration ); } } @@ -433,7 +433,7 @@ int NoteData::GetFirstRow() const if( iEarliestRowFoundSoFar == -1 ) iEarliestRowFoundSoFar = iRow; else - iEarliestRowFoundSoFar = min( iEarliestRowFoundSoFar, iRow ); + iEarliestRowFoundSoFar = std::min( iEarliestRowFoundSoFar, iRow ); } if( iEarliestRowFoundSoFar == -1 ) // there are no notes @@ -458,7 +458,7 @@ int NoteData::GetLastRow() const if( tn.type == TapNoteType_HoldHead ) iRow += tn.iDuration; - iOldestRowFoundSoFar = max( iOldestRowFoundSoFar, iRow ); + iOldestRowFoundSoFar = std::max( iOldestRowFoundSoFar, iRow ); } return iOldestRowFoundSoFar; @@ -722,9 +722,9 @@ bool NoteData::IsPlayer1(const int track, const TapNote &tn) const return track < (this->GetNumTracks() / 2); } -pair NoteData::GetNumTapNotesTwoPlayer( int iStartIndex, int iEndIndex ) const +std::pair NoteData::GetNumTapNotesTwoPlayer( int iStartIndex, int iEndIndex ) const { - pair num(0, 0); + std::pair num(0, 0); for( int t=0; t NoteData::GetNumTapNotesTwoPlayer( int iStartIndex, int iEndIndex return num; } -pair NoteData::GetNumRowsWithSimultaneousTapsTwoPlayer(int minTaps, +std::pair NoteData::GetNumRowsWithSimultaneousTapsTwoPlayer(int minTaps, int startRow, int endRow) const { - pair num(0, 0); + std::pair num(0, 0); FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, r, startRow, endRow ) { - pair found(0, 0); + std::pair found(0, 0); for( int t=0; t NoteData::GetNumRowsWithSimultaneousTapsTwoPlayer(int minTaps, return num; } -pair NoteData::GetNumJumpsTwoPlayer( int iStartIndex, int iEndIndex ) const +std::pair NoteData::GetNumJumpsTwoPlayer( int iStartIndex, int iEndIndex ) const { return GetNumRowsWithSimultaneousTapsTwoPlayer( 2, iStartIndex, iEndIndex ); } -pair NoteData::GetNumHandsTwoPlayer( int iStartIndex, int iEndIndex ) const +std::pair NoteData::GetNumHandsTwoPlayer( int iStartIndex, int iEndIndex ) const { return GetNumRowsWithSimultaneousTapsTwoPlayer( 3, iStartIndex, iEndIndex ); } -pair NoteData::GetNumQuadsTwoPlayer( int iStartIndex, int iEndIndex ) const +std::pair NoteData::GetNumQuadsTwoPlayer( int iStartIndex, int iEndIndex ) const { return GetNumRowsWithSimultaneousTapsTwoPlayer( 4, iStartIndex, iEndIndex ); } -pair NoteData::GetNumHoldNotesTwoPlayer( int iStartIndex, int iEndIndex ) const +std::pair NoteData::GetNumHoldNotesTwoPlayer( int iStartIndex, int iEndIndex ) const { - pair num(0, 0); + std::pair num(0, 0); for( int t=0; t NoteData::GetNumHoldNotesTwoPlayer( int iStartIndex, int iEndInde return num; } -pair NoteData::GetNumMinesTwoPlayer( int iStartIndex, int iEndIndex ) const +std::pair NoteData::GetNumMinesTwoPlayer( int iStartIndex, int iEndIndex ) const { - pair num(0, 0); + std::pair num(0, 0); for( int t=0; t NoteData::GetNumMinesTwoPlayer( int iStartIndex, int iEndIndex ) return num; } -pair NoteData::GetNumRollsTwoPlayer( int iStartIndex, int iEndIndex ) const +std::pair NoteData::GetNumRollsTwoPlayer( int iStartIndex, int iEndIndex ) const { - pair num(0, 0); + std::pair num(0, 0); for( int t=0; t NoteData::GetNumRollsTwoPlayer( int iStartIndex, int iEndIndex ) return num; } -pair NoteData::GetNumLiftsTwoPlayer( int iStartIndex, int iEndIndex ) const +std::pair NoteData::GetNumLiftsTwoPlayer( int iStartIndex, int iEndIndex ) const { - pair num(0, 0); + std::pair num(0, 0); for( int t=0; t NoteData::GetNumLiftsTwoPlayer( int iStartIndex, int iEndIndex ) return num; } -pair NoteData::GetNumFakesTwoPlayer( int iStartIndex, int iEndIndex ) const +std::pair NoteData::GetNumFakesTwoPlayer( int iStartIndex, int iEndIndex ) const { - pair num(0, 0); + std::pair num(0, 0); for( int t=0; t& addTo ) +void NoteData::GetTracksHeldAtRow( int row, std::set& addTo ) { for( int t=0; t& addTo ) int NoteData::GetNumTracksHeldAtRow( int row ) { - static set viTracks; + static std::set viTracks; viTracks.clear(); GetTracksHeldAtRow( row, viTracks ); return viTracks.size(); @@ -1141,7 +1141,7 @@ bool NoteData::GetNextTapNoteRowForAllTracks( int &rowInOut ) const { bAnyHaveNextNote = true; ASSERT( iNewRowThisTrack < MAX_NOTE_ROW ); - iClosestNextRow = min( iClosestNextRow, iNewRowThisTrack ); + iClosestNextRow = std::min( iClosestNextRow, iNewRowThisTrack ); } } @@ -1167,7 +1167,7 @@ bool NoteData::GetPrevTapNoteRowForAllTracks( int &rowInOut ) const { bAnyHavePrevNote = true; ASSERT( iNewRowThisTrack < MAX_NOTE_ROW ); - iClosestPrevRow = max( iClosestPrevRow, iNewRowThisTrack ); + iClosestPrevRow = std::max( iClosestPrevRow, iNewRowThisTrack ); } } @@ -1216,7 +1216,7 @@ void NoteData::AddATIToList(all_tracks_const_iterator* iter) const void NoteData::RemoveATIFromList(all_tracks_iterator* iter) const { - set::iterator pos= m_atis.find(iter); + std::set::iterator pos= m_atis.find(iter); if(pos != m_atis.end()) { m_atis.erase(pos); @@ -1225,21 +1225,21 @@ void NoteData::RemoveATIFromList(all_tracks_iterator* iter) const void NoteData::RemoveATIFromList(all_tracks_const_iterator* iter) const { - set::iterator pos= m_const_atis.find(iter); + std::set::iterator pos= m_const_atis.find(iter); if(pos != m_const_atis.end()) { m_const_atis.erase(pos); } } -void NoteData::RevalidateATIs(vector const& added_or_removed_tracks, bool added) +void NoteData::RevalidateATIs(std::vector const& added_or_removed_tracks, bool added) { - for(set::iterator cur= m_atis.begin(); + for(std::set::iterator cur= m_atis.begin(); cur != m_atis.end(); ++cur) { (*cur)->Revalidate(this, added_or_removed_tracks, added); } - for(set::iterator cur= m_const_atis.begin(); + for(std::set::iterator cur= m_const_atis.begin(); cur != m_const_atis.end(); ++cur) { (*cur)->Revalidate(this, added_or_removed_tracks, added); @@ -1377,7 +1377,7 @@ NoteData::_all_tracks_iterator NoteData::_all_tracks_iterator void NoteData::_all_tracks_iterator::Revalidate( - ND* notedata, vector const& added_or_removed_tracks, bool added) + ND* notedata, std::vector const& added_or_removed_tracks, bool added) { m_pNoteData= notedata; ASSERT( m_pNoteData->GetNumTracks() > 0 ); diff --git a/src/NoteData.h b/src/NoteData.h index 9a294ceac6..5ffc864b25 100644 --- a/src/NoteData.h +++ b/src/NoteData.h @@ -27,11 +27,11 @@ class NoteData { public: - typedef map TrackMap; - typedef map::iterator iterator; - typedef map::const_iterator const_iterator; - typedef map::reverse_iterator reverse_iterator; - typedef map::const_reverse_iterator const_reverse_iterator; + typedef std::map TrackMap; + typedef std::map::iterator iterator; + typedef std::map::const_iterator const_iterator; + typedef std::map::reverse_iterator reverse_iterator; + typedef std::map::const_reverse_iterator const_reverse_iterator; NoteData(): m_TapNotes() {} @@ -60,19 +60,19 @@ public: class _all_tracks_iterator { ND *m_pNoteData; - vector m_vBeginIters; + std::vector m_vBeginIters; /* There isn't a "past the beginning" iterator so this is hard to make a true bidirectional iterator. * Use the "past the end" iterator in place of the "past the beginning" iterator when in reverse. */ - vector m_vCurrentIters; + std::vector m_vCurrentIters; - vector m_vEndIters; + std::vector m_vEndIters; int m_iTrack; bool m_bReverse; // These exist so that the iterator can be revalidated if the NoteData is // transformed during this iterator's lifetime. - vector m_PrevCurrentRows; + std::vector m_PrevCurrentRows; bool m_Inclusive; int m_StartRow; int m_EndRow; @@ -95,7 +95,7 @@ public: inline const TN &operator*() const { DEBUG_ASSERT( !IsAtEnd() ); return m_vCurrentIters[m_iTrack]->second; } inline const TN *operator->() const { DEBUG_ASSERT( !IsAtEnd() ); return &m_vCurrentIters[m_iTrack]->second; } // Use when transforming the NoteData. - void Revalidate(ND* notedata, vector const& added_or_removed_tracks, bool added); + void Revalidate(ND* notedata, std::vector const& added_or_removed_tracks, bool added); }; typedef _all_tracks_iterator all_tracks_iterator; typedef _all_tracks_iterator all_tracks_const_iterator; @@ -106,7 +106,7 @@ public: private: // There's no point in inserting empty notes into the map. // Any blank space in the map is defined to be empty. - vector m_TapNotes; + std::vector m_TapNotes; /** * @brief Determine whether this note is for Player 1 or Player 2. @@ -143,14 +143,14 @@ private: * @return true if it's a fake, false otherwise. */ bool IsFake(const TapNote &tn, const int row) const; - pair GetNumRowsWithSimultaneousTapsTwoPlayer(int minTaps = 2, + std::pair GetNumRowsWithSimultaneousTapsTwoPlayer(int minTaps = 2, int startRow = 0, int endRow = MAX_NOTE_ROW) const; // These exist so that they can be revalidated when something that transforms // the NoteData occurs. -Kyz - mutable set m_atis; - mutable set m_const_atis; + mutable std::set m_atis; + mutable std::set m_const_atis; void AddATIToList(all_tracks_iterator* iter) const; void AddATIToList(all_tracks_const_iterator* iter) const; @@ -231,7 +231,7 @@ public: } // Call this after using any transform that changes the NoteData. - void RevalidateATIs(vector const& added_or_removed_tracks, bool added); + void RevalidateATIs(std::vector const& added_or_removed_tracks, bool added); void TransferATIs(NoteData& to); /* Return an iterator range include iStartRow to iEndRow. Extend the range to include @@ -278,7 +278,7 @@ public: bool IsRowEmpty( int row ) const; bool IsRangeEmpty( int track, int rowBegin, int rowEnd ) const; int GetNumTapNonEmptyTracks( int row ) const; - void GetTapNonEmptyTracks( int row, set& addTo ) const; + void GetTapNonEmptyTracks( int row, std::set& addTo ) const; bool GetTapFirstNonEmptyTrack( int row, int &iNonEmptyTrackOut ) const; // return false if no non-empty tracks at row bool GetTapFirstEmptyTrack( int row, int &iEmptyTrackOut ) const; // return false if no non-empty tracks at row bool GetTapLastEmptyTrack( int row, int &iEmptyTrackOut ) const; // return false if no empty tracks at row @@ -290,7 +290,7 @@ public: inline bool IsThereATapAtRow( int row ) const { return GetFirstTrackWithTap( row ) != -1; } inline bool IsThereATapOrHoldHeadAtRow( int row ) const { return GetFirstTrackWithTapOrHoldHead( row ) != -1; } - void GetTracksHeldAtRow( int row, set& addTo ); + void GetTracksHeldAtRow( int row, std::set& addTo ); int GetNumTracksHeldAtRow( int row ); bool IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow = nullptr ) const; @@ -342,31 +342,31 @@ public: int GetNumFakes( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const; // the couple/routine style variants of the above. - pair GetNumTapNotesTwoPlayer(int startRow = 0, + std::pair GetNumTapNotesTwoPlayer(int startRow = 0, int endRow = MAX_NOTE_ROW) const; - pair GetNumJumpsTwoPlayer(int startRow = 0, + std::pair GetNumJumpsTwoPlayer(int startRow = 0, int endRow = MAX_NOTE_ROW) const; - pair GetNumHandsTwoPlayer(int startRow = 0, + std::pair GetNumHandsTwoPlayer(int startRow = 0, int endRow = MAX_NOTE_ROW) const; - pair GetNumQuadsTwoPlayer(int startRow = 0, + std::pair GetNumQuadsTwoPlayer(int startRow = 0, int endRow = MAX_NOTE_ROW) const; - pair GetNumHoldNotesTwoPlayer(int startRow = 0, + std::pair GetNumHoldNotesTwoPlayer(int startRow = 0, int endRow = MAX_NOTE_ROW) const; - pair GetNumMinesTwoPlayer(int startRow = 0, + std::pair GetNumMinesTwoPlayer(int startRow = 0, int endRow = MAX_NOTE_ROW) const; - pair GetNumRollsTwoPlayer(int startRow = 0, + std::pair GetNumRollsTwoPlayer(int startRow = 0, int endRow = MAX_NOTE_ROW) const; - pair GetNumLiftsTwoPlayer(int startRow = 0, + std::pair GetNumLiftsTwoPlayer(int startRow = 0, int endRow = MAX_NOTE_ROW) const; - pair GetNumFakesTwoPlayer(int startRow = 0, + std::pair GetNumFakesTwoPlayer(int startRow = 0, int endRow = MAX_NOTE_ROW) const; // Transformations diff --git a/src/NoteDataUtil.cpp b/src/NoteDataUtil.cpp index a10f9ace59..9eca1ee1ed 100644 --- a/src/NoteDataUtil.cpp +++ b/src/NoteDataUtil.cpp @@ -61,7 +61,7 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS * we can perform this without copying the string at all. */ int size = -1; const int end = start + len; - vector > aMeasureLines; + std::vector > aMeasureLines; for( unsigned m = 0; true; ++m ) { /* XXX Ignoring empty seems wrong for measures. It means that ",,," is treated as @@ -94,7 +94,7 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS while( endLine > beginLine && strchr("\r\n\t ", *(endLine - 1)) ) --endLine; if( beginLine < endLine ) // nonempty - aMeasureLines.push_back( pair(beginLine, endLine) ); + aMeasureLines.push_back( std::pair(beginLine, endLine) ); } for( unsigned l=0; l(), false); + out.RevalidateATIs(std::vector(), false); } void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, const RString &sSMNoteData_, bool bComposite ) @@ -300,7 +300,7 @@ void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, const RString &sSMNo int start = 0, size = -1; - vector vParts; + std::vector vParts; FOREACH_PlayerNumber( pn ) { // Split in place. @@ -314,7 +314,7 @@ void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, const RString &sSMNo LoadFromSMNoteDataStringWithPlayer( nd, sSMNoteData, start, size, pn, iNumTracks ); } CombineCompositeNoteData( out, vParts ); - out.RevalidateATIs(vector(), false); + out.RevalidateATIs(std::vector(), false); } void NoteDataUtil::InsertHoldTails( NoteData &inout ) @@ -345,7 +345,7 @@ void NoteDataUtil::InsertHoldTails( NoteData &inout ) void NoteDataUtil::GetSMNoteDataString( const NoteData &in, RString &sRet ) { // Get note data - vector parts; + std::vector parts; float fLastBeat = -1.0f; SplitCompositeNoteData( in, parts ); @@ -353,7 +353,7 @@ void NoteDataUtil::GetSMNoteDataString( const NoteData &in, RString &sRet ) for (NoteData &nd : parts) { InsertHoldTails( nd ); - fLastBeat = max( fLastBeat, nd.GetLastBeat() ); + fLastBeat = std::max( fLastBeat, nd.GetLastBeat() ); } int iLastMeasure = int( fLastBeat/BEATS_PER_MEASURE ); @@ -430,7 +430,7 @@ void NoteDataUtil::GetSMNoteDataString( const NoteData &in, RString &sRet ) } } -void NoteDataUtil::SplitCompositeNoteData( const NoteData &in, vector &out ) +void NoteDataUtil::SplitCompositeNoteData( const NoteData &in, std::vector &out ) { if( !in.IsComposite() ) { @@ -472,11 +472,11 @@ void NoteDataUtil::SplitCompositeNoteData( const NoteData &in, vector } } -void NoteDataUtil::CombineCompositeNoteData( NoteData &out, const vector &in ) +void NoteDataUtil::CombineCompositeNoteData( NoteData &out, const std::vector &in ) { for (NoteData const &nd : in) { - const int iMaxTracks = min( out.GetNumTracks(), nd.GetNumTracks() ); + const int iMaxTracks = std::min( out.GetNumTracks(), nd.GetNumTracks() ); for( int track = 0; track < iMaxTracks; ++track ) { @@ -492,7 +492,7 @@ void NoteDataUtil::CombineCompositeNoteData( NoteData &out, const vector(), false); + out.RevalidateATIs(std::vector(), false); } @@ -564,7 +564,7 @@ void NoteDataUtil::LoadTransformedSlidingWindow( const NoteData &in, NoteData &o out.SetTapNote( iNewTrack, r, tn ); } } - out.RevalidateATIs(vector(), false); + out.RevalidateATIs(std::vector(), false); } void PlaceAutoKeysound( NoteData &out, int row, TapNote akTap ) @@ -681,7 +681,7 @@ void NoteDataUtil::LoadOverlapped( const NoteData &in, NoteData &out, int iNewNu PlaceAutoKeysound( out, row, tnFrom ); } } - out.RevalidateATIs(vector(), false); + out.RevalidateATIs(std::vector(), false); } int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow ) @@ -691,14 +691,14 @@ int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow ) { const TapNote &tn = in.GetTapNote( t, iRow ); if( tn.type == TapNoteType_HoldHead ) - iMaxTailRow = max( iMaxTailRow, iRow + tn.iDuration ); + iMaxTailRow = std::max( iMaxTailRow, iRow + tn.iDuration ); } return iMaxTailRow; } // For every row in "in" with a tap or hold on any track, enable the specified tracks in "out". -void LightTransformHelper( const NoteData &in, NoteData &out, const vector &aiTracks ) +void LightTransformHelper( const NoteData &in, NoteData &out, const std::vector &aiTracks ) { for( unsigned i = 0; i < aiTracks.size(); ++i ) ASSERT_M( aiTracks[i] < out.GetNumTracks(), ssprintf("%i, %i", aiTracks[i], out.GetNumTracks()) ); @@ -751,7 +751,7 @@ void NoteDataUtil::LoadTransformedLights( const NoteData &in, NoteData &out, int out.SetNumTracks( iNewNumTracks ); - vector aiTracks; + std::vector aiTracks; for( int i = 0; i < out.GetNumTracks(); ++i ) aiTracks.push_back( i ); @@ -778,7 +778,7 @@ void NoteDataUtil::LoadTransformedLightsFromTwo( const NoteData &marquee, const // For each track in "bass", enable the bass lights. { - vector aiTracks; + std::vector aiTracks; aiTracks.push_back( LIGHT_BASS_LEFT ); aiTracks.push_back( LIGHT_BASS_RIGHT ); LightTransformHelper( bass, out, aiTracks ); @@ -800,7 +800,7 @@ void NoteDataUtil::AutogenKickbox(const NoteData& in, NoteData& out, const Timin // abstract handling of the different styles. // By convention, the lower panels are pushed first. This gives the upper // panels a higher index, which is mnemonically useful. - vector > limb_tracks(num_kickbox_limbs); + std::vector> limb_tracks(num_kickbox_limbs); bool have_feet= true; switch(out_type) { @@ -843,9 +843,9 @@ void NoteDataUtil::AutogenKickbox(const NoteData& in, NoteData& out, const Timin } // prev_limb_panels keeps track of which panel in the track list the limb // hit last. - vector prev_limb_panels(num_kickbox_limbs, 0); - vector panel_repeat_counts(num_kickbox_limbs, 0); - vector panel_repeat_goals(num_kickbox_limbs, 0); + std::vector prev_limb_panels(num_kickbox_limbs, 0); + std::vector panel_repeat_counts(num_kickbox_limbs, 0); + std::vector panel_repeat_goals(num_kickbox_limbs, 0); RandomGen rnd(nonrandom_seed); kickbox_limb prev_limb_used= invalid_limb; // Kicks are only allowed if there is enough setup/recovery time. @@ -955,7 +955,7 @@ void NoteDataUtil::AutogenKickbox(const NoteData& in, NoteData& out, const Timin prev_limb_used= this_limb; ++rows_done; } - out.RevalidateATIs(vector(), false); + out.RevalidateATIs(std::vector(), false); } struct recent_note @@ -979,7 +979,7 @@ struct crv_state bool judgable; // hold_ends tracks where currently active holds will end, which is used // to count the number of hands. -Kyz - vector hold_ends; + std::vector hold_ends; // num_holds_on_curr_row saves us the work of tracking where holds started // just to keep a jump of two holds from counting as a hand. int num_holds_on_curr_row; @@ -1013,7 +1013,7 @@ void NoteDataUtil::CalculateRadarValues( const NoteData &in, float fSongSeconds, // and track number of a tap note. When the pair at the beginning is too // old, it's deleted. This provides a way to have a rolling window // that scans for the peak step density. -Kyz - vector recent_notes; + std::vector recent_notes; NoteData::all_tracks_const_iterator curr_note= in.GetTapNoteRangeAllTracks(0, MAX_NOTE_ROW); TimingData* timing= GAMESTATE->GetProcessedTimingData(); @@ -1081,7 +1081,7 @@ void NoteDataUtil::CalculateRadarValues( const NoteData &in, float fSongSeconds, ++total_taps; recent_notes.push_back( recent_note(curr_row, curr_note.Track())); - max_notes_in_voltage_window= max(recent_notes.size(), + max_notes_in_voltage_window= std::max(recent_notes.size(), max_notes_in_voltage_window); // If there is one hold active, and one tap on this row, it does // not count as a jump. Hands do need to count the number of @@ -1170,7 +1170,7 @@ void NoteDataUtil::RemoveHoldNotes( NoteData &in, int iStartIndex, int iEndIndex begin->second.type = TapNoteType_Tap; } } - in.RevalidateATIs(vector(), false); + in.RevalidateATIs(std::vector(), false); } void NoteDataUtil::ChangeRollsToHolds( NoteData &in, int iStartIndex, int iEndIndex ) @@ -1187,7 +1187,7 @@ void NoteDataUtil::ChangeRollsToHolds( NoteData &in, int iStartIndex, int iEndIn begin->second.subType = TapNoteSubType_Hold; } } - in.RevalidateATIs(vector(), false); + in.RevalidateATIs(std::vector(), false); } void NoteDataUtil::ChangeHoldsToRolls( NoteData &in, int iStartIndex, int iEndIndex ) @@ -1204,7 +1204,7 @@ void NoteDataUtil::ChangeHoldsToRolls( NoteData &in, int iStartIndex, int iEndIn begin->second.subType = TapNoteSubType_Roll; } } - in.RevalidateATIs(vector(), false); + in.RevalidateATIs(std::vector(), false); } void NoteDataUtil::RemoveSimultaneousNotes( NoteData &in, int iMaxSimultaneous, int iStartIndex, int iEndIndex ) @@ -1216,7 +1216,7 @@ void NoteDataUtil::RemoveSimultaneousNotes( NoteData &in, int iMaxSimultaneous, if( in.IsComposite() ) { // Do this per part. - vector vParts; + std::vector vParts; SplitCompositeNoteData( in, vParts ); for (NoteData &nd : vParts) @@ -1227,12 +1227,12 @@ void NoteDataUtil::RemoveSimultaneousNotes( NoteData &in, int iMaxSimultaneous, } FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( in, r, iStartIndex, iEndIndex ) { - set viTracksHeld; + std::set viTracksHeld; in.GetTracksHeldAtRow( r, viTracksHeld ); // remove the first tap note or the first hold note that starts on this row int iTotalTracksPressed = in.GetNumTracksWithTapOrHoldHead(r) + viTracksHeld.size(); - int iTracksToRemove = max( 0, iTotalTracksPressed - iMaxSimultaneous ); + int iTracksToRemove = std::max( 0, iTotalTracksPressed - iMaxSimultaneous ); for( int t=0; iTracksToRemove>0 && t(), false); + in.RevalidateATIs(std::vector(), false); } void NoteDataUtil::RemoveJumps( NoteData &inout, int iStartIndex, int iEndIndex ) @@ -1273,7 +1273,7 @@ void NoteDataUtil::RemoveSpecificTapNotes(NoteData &inout, TapNoteType tn, int i } } } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::RemoveMines(NoteData &inout, int iStartIndex, int iEndIndex) @@ -1299,7 +1299,7 @@ void NoteDataUtil::RemoveFakes(NoteData &inout, TimingData const& timing_data, i } } } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::RemoveAllButOneTap( NoteData &inout, int row ) @@ -1321,7 +1321,7 @@ void NoteDataUtil::RemoveAllButOneTap( NoteData &inout, int row ) if( iter != inout.end(track) && iter->second.type == TapNoteType_Tap ) inout.RemoveTapNote( track, iter ); } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::RemoveAllButPlayer( NoteData &inout, PlayerNumber pn ) @@ -1338,7 +1338,7 @@ void NoteDataUtil::RemoveAllButPlayer( NoteData &inout, PlayerNumber pn ) ++i; } } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } // TODO: Perform appropriate matrix calculations for everything instead. @@ -1535,19 +1535,19 @@ static void GetTrackMapping( StepsType st, NoteDataUtil::TrackMapping tt, int Nu switch(st) { case StepsType_beat_single5: { - random_shuffle( &iTakeFromTrack[0], &iTakeFromTrack[5], rnd ); - random_shuffle( &iTakeFromTrack[6], &iTakeFromTrack[11], rnd ); + std::random_shuffle( &iTakeFromTrack[0], &iTakeFromTrack[5], rnd ); + std::random_shuffle( &iTakeFromTrack[6], &iTakeFromTrack[11], rnd ); break; } case StepsType_beat_single7: { - random_shuffle( &iTakeFromTrack[1], &iTakeFromTrack[8], rnd ); - random_shuffle( &iTakeFromTrack[9], &iTakeFromTrack[16], rnd ); + std::random_shuffle( &iTakeFromTrack[1], &iTakeFromTrack[8], rnd ); + std::random_shuffle( &iTakeFromTrack[9], &iTakeFromTrack[16], rnd ); break; } default: { - random_shuffle( &iTakeFromTrack[0], &iTakeFromTrack[NumTracks], rnd ); + std::random_shuffle( &iTakeFromTrack[0], &iTakeFromTrack[NumTracks], rnd ); break; } } @@ -2024,7 +2024,7 @@ static void SuperShuffleTaps( NoteData &inout, int iStartIndex, int iEndIndex ) DEBUG_ASSERT_M( !inout.IsHoldNoteAtRow(t1,r), ssprintf("There is a tap.type = %d inside of a hold at row %d", tn1.type, r) ); // Probe for a spot to swap with. - set vTriedTracks; + std::set vTriedTracks; for( int i=0; i<4; i++ ) // probe max 4 times { int t2 = RandomInt( inout.GetNumTracks() ); @@ -2095,7 +2095,7 @@ void NoteDataUtil::Turn( NoteData &inout, StepsType st, TrackMapping tt, int iSt } inout.CopyAll( tempNoteData ); - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::Backwards( NoteData &inout ) @@ -2120,7 +2120,7 @@ void NoteDataUtil::Backwards( NoteData &inout ) } inout.swap( out ); - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::SwapSides( NoteData &inout ) @@ -2136,7 +2136,7 @@ void NoteDataUtil::SwapSides( NoteData &inout ) NoteData orig( inout ); inout.LoadTransformed( orig, orig.GetNumTracks(), iOriginalTrackToTakeFrom ); - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::Little( NoteData &inout, int iStartIndex, int iEndIndex ) @@ -2151,7 +2151,7 @@ void NoteDataUtil::Little( NoteData &inout, int iStartIndex, int iEndIndex ) inout.SetTapNote( t, i, TAP_EMPTY ); } } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } // Make all quarter notes into jumps. @@ -2204,7 +2204,7 @@ void NoteDataUtil::Wide( NoteData &inout, int iStartIndex, int iEndIndex ) } inout.SetTapNote(iTrackToAdd, i, TAP_ADDITION_TAP); } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::Big( NoteData &inout, int iStartIndex, int iEndIndex ) @@ -2296,22 +2296,22 @@ void NoteDataUtil::InsertIntelligentTaps( else if( abs(iTrackOfNoteEarlier-iTrackOfNoteLater) >= 2 ) { // try to choose a track between the earlier and later notes - iTrackOfNoteToAdd = min(iTrackOfNoteEarlier,iTrackOfNoteLater)+1; + iTrackOfNoteToAdd = std::min(iTrackOfNoteEarlier,iTrackOfNoteLater)+1; } - else if( min(iTrackOfNoteEarlier,iTrackOfNoteLater)-1 >= 0 ) + else if( std::min(iTrackOfNoteEarlier,iTrackOfNoteLater)-1 >= 0 ) { // try to choose a track just to the left - iTrackOfNoteToAdd = min(iTrackOfNoteEarlier,iTrackOfNoteLater)-1; + iTrackOfNoteToAdd = std::min(iTrackOfNoteEarlier,iTrackOfNoteLater)-1; } - else if( max(iTrackOfNoteEarlier,iTrackOfNoteLater)+1 < inout.GetNumTracks() ) + else if( std::max(iTrackOfNoteEarlier,iTrackOfNoteLater)+1 < inout.GetNumTracks() ) { // try to choose a track just to the right - iTrackOfNoteToAdd = max(iTrackOfNoteEarlier,iTrackOfNoteLater)+1; + iTrackOfNoteToAdd = std::max(iTrackOfNoteEarlier,iTrackOfNoteLater)+1; } inout.SetTapNote(iTrackOfNoteToAdd, iRowToAdd, TAP_ADDITION_TAP); } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } #if 0 class TrackIterator @@ -2438,7 +2438,7 @@ void NoteDataUtil::AddMines( NoteData &inout, int iStartIndex, int iEndIndex ) iRowCount = 0; } } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::Echo( NoteData &inout, int iStartIndex, int iEndIndex ) @@ -2451,7 +2451,7 @@ void NoteDataUtil::Echo( NoteData &inout, int iStartIndex, int iEndIndex ) /* Clamp iEndIndex to the last real tap note. Otherwise, we'll keep adding * echos of our echos all the way up to MAX_TAP_ROW. */ - iEndIndex = min( iEndIndex, inout.GetLastRow() )+1; + iEndIndex = std::min( iEndIndex, inout.GetLastRow() )+1; // window is one beat wide and slides 1/2 a beat at a time FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( inout, r, iStartIndex, iEndIndex ) @@ -2479,7 +2479,7 @@ void NoteDataUtil::Echo( NoteData &inout, int iStartIndex, int iEndIndex ) const int iRowEcho = r + rows_per_interval; { - set viTracks; + std::set viTracks; inout.GetTracksHeldAtRow( iRowEcho, viTracks ); // don't lay if holding 2 already @@ -2493,7 +2493,7 @@ void NoteDataUtil::Echo( NoteData &inout, int iStartIndex, int iEndIndex ) inout.SetTapNote( iEchoTrack, iRowEcho, TAP_ADDITION_TAP ); } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::Planted( NoteData &inout, int iStartIndex, int iEndIndex ) @@ -2538,7 +2538,7 @@ void NoteDataUtil::ConvertTapsToHolds( NoteData &inout, int iSimultaneousHolds, break; } - set tracksDown; + std::set tracksDown; inout.GetTracksHeldAtRow( r2, tracksDown ); inout.GetTapNonEmptyTracks( r2, tracksDown ); iTapsLeft -= tracksDown.size(); @@ -2566,7 +2566,7 @@ void NoteDataUtil::ConvertTapsToHolds( NoteData &inout, int iSimultaneousHolds, } } } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::Stomp( NoteData &inout, StepsType st, int iStartIndex, int iEndIndex ) @@ -2609,7 +2609,7 @@ void NoteDataUtil::Stomp( NoteData &inout, StepsType st, int iStartIndex, int iE } } } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteType nt2, int iStartIndex, int iEndIndex ) @@ -2656,7 +2656,7 @@ void NoteDataUtil::SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteTyp inout.SetTapNote( c, iNewIndex, tnNew ); } } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } @@ -2775,7 +2775,7 @@ void NoteDataUtil::SwapUpDown(NoteData& inout, StepsType st) NoteData tempND; tempND.LoadTransformed(inout, inout.GetNumTracks(), TakeFrom); inout.CopyAll(tempND); - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::ArbitraryRemap(NoteData& inout, int* mapping) @@ -2783,7 +2783,7 @@ void NoteDataUtil::ArbitraryRemap(NoteData& inout, int* mapping) NoteData tempND; tempND.LoadTransformed(inout, inout.GetNumTracks(), mapping); inout.CopyAll(tempND); - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } @@ -2809,7 +2809,7 @@ const ValidRow g_ValidRows[] = void NoteDataUtil::RemoveStretch( NoteData &inout, StepsType st, int iStartIndex, int iEndIndex ) { - vector vpValidRowsToCheck; + std::vector vpValidRowsToCheck; for( unsigned i=0; i(), false); + inout.RevalidateATIs(std::vector(), false); } bool NoteDataUtil::RowPassesValidMask( NoteData &inout, int row, const bool bValidMask[] ) @@ -2865,7 +2865,7 @@ void NoteDataUtil::ConvertAdditionsToRegular( NoteData &inout ) tn.source = TapNoteSource_Original; inout.SetTapNote( t, r, tn ); } - inout.RevalidateATIs(vector(), false); + inout.RevalidateATIs(std::vector(), false); } void NoteDataUtil::TransformNoteData(NoteData &nd, TimingData const& timing_data, const AttackArray &aa, StepsType st, Song* pSong) @@ -2937,7 +2937,7 @@ void NoteDataUtil::TransformNoteData( NoteData &nd, TimingData const& timing_dat if( po.m_bTurns[PlayerOptions::TURN_SUPER_SHUFFLE] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::super_shuffle, iStartIndex, iEndIndex ); if( po.m_bTurns[PlayerOptions::TURN_HYPER_SHUFFLE] ) NoteDataUtil::Turn( nd, st, NoteDataUtil::hyper_shuffle, iStartIndex, iEndIndex ); - nd.RevalidateATIs(vector(), false); + nd.RevalidateATIs(std::vector(), false); } void NoteDataUtil::AddTapAttacks( NoteData &nd, Song* pSong ) @@ -2965,7 +2965,7 @@ void NoteDataUtil::AddTapAttacks( NoteData &nd, Song* pSong ) -1 ); nd.SetTapNote( iTrack, BeatToNoteRow(fBeat), tn ); } - nd.RevalidateATIs(vector(), false); + nd.RevalidateATIs(std::vector(), false); } void NoteDataUtil::Scale( NoteData &nd, float fScale ) @@ -2988,7 +2988,7 @@ void NoteDataUtil::Scale( NoteData &nd, float fScale ) } nd.swap( ndOut ); - nd.RevalidateATIs(vector(), false); + nd.RevalidateATIs(std::vector(), false); } /* XXX: move this to an appropriate place, same place as NoteRowToBeat perhaps? */ @@ -3024,7 +3024,7 @@ void NoteDataUtil::ScaleRegion( NoteData &nd, float fScale, int iStartIndex, int } nd.swap( ndOut ); - nd.RevalidateATIs(vector(), false); + nd.RevalidateATIs(std::vector(), false); } void NoteDataUtil::InsertRows( NoteData &nd, int iStartIndex, int iRowsToAdd ) @@ -3036,7 +3036,7 @@ void NoteDataUtil::InsertRows( NoteData &nd, int iStartIndex, int iRowsToAdd ) temp.CopyRange( nd, iStartIndex, MAX_NOTE_ROW ); nd.ClearRange( iStartIndex, MAX_NOTE_ROW ); nd.CopyRange( temp, 0, MAX_NOTE_ROW, iStartIndex + iRowsToAdd ); - nd.RevalidateATIs(vector(), false); + nd.RevalidateATIs(std::vector(), false); } void NoteDataUtil::DeleteRows( NoteData &nd, int iStartIndex, int iRowsToDelete ) @@ -3048,7 +3048,7 @@ void NoteDataUtil::DeleteRows( NoteData &nd, int iStartIndex, int iRowsToDelete temp.CopyRange( nd, iStartIndex + iRowsToDelete, MAX_NOTE_ROW ); nd.ClearRange( iStartIndex, MAX_NOTE_ROW ); nd.CopyRange( temp, 0, MAX_NOTE_ROW, iStartIndex ); - nd.RevalidateATIs(vector(), false); + nd.RevalidateATIs(std::vector(), false); } void NoteDataUtil::RemoveAllTapsOfType( NoteData& ndInOut, TapNoteType typeToRemove ) @@ -3067,7 +3067,7 @@ void NoteDataUtil::RemoveAllTapsOfType( NoteData& ndInOut, TapNoteType typeToRem ++iter; } } - ndInOut.RevalidateATIs(vector(), false); + ndInOut.RevalidateATIs(std::vector(), false); } void NoteDataUtil::RemoveAllTapsExceptForType( NoteData& ndInOut, TapNoteType typeToKeep ) @@ -3083,7 +3083,7 @@ void NoteDataUtil::RemoveAllTapsExceptForType( NoteData& ndInOut, TapNoteType ty ++iter; } } - ndInOut.RevalidateATIs(vector(), false); + ndInOut.RevalidateATIs(std::vector(), false); } int NoteDataUtil::GetMaxNonEmptyTrack( const NoteData& in ) @@ -3141,7 +3141,7 @@ bool NoteDataUtil::GetNextEditorPosition( const NoteData& in, int &rowInOut ) bAnyHaveNextNote = true; ASSERT( iEndRow < MAX_NOTE_ROW ); - iClosestNextRow = min( iClosestNextRow, iEndRow ); + iClosestNextRow = std::min( iClosestNextRow, iEndRow ); } if( !bAnyHaveNextNote ) @@ -3173,7 +3173,7 @@ bool NoteDataUtil::GetPrevEditorPosition( const NoteData& in, int &rowInOut ) bAnyHavePrevNote = true; ASSERT( iEndRow < MAX_NOTE_ROW ); - iClosestPrevRow = max( iClosestPrevRow, iEndRow ); + iClosestPrevRow = std::max( iClosestPrevRow, iEndRow ); } if( !bAnyHavePrevNote ) @@ -3189,7 +3189,7 @@ unsigned int NoteDataUtil::GetTotalHoldTicks( NoteData* nd, const TimingData* td unsigned int ret = 0; // Last row must be included. -- Matt int end = nd->GetLastRow()+1; - vector segments = td->GetTimingSegments( SEGMENT_TICKCOUNT ); + std::vector segments = td->GetTimingSegments( SEGMENT_TICKCOUNT ); // We start with the LAST TimingSegment and work our way backwards. // This way we can continually update end instead of having to lookup when // the next segment starts. diff --git a/src/NoteDataUtil.h b/src/NoteDataUtil.h index 3b09aeb059..6dd75bb69b 100644 --- a/src/NoteDataUtil.h +++ b/src/NoteDataUtil.h @@ -13,7 +13,7 @@ class TimingData; void PlaceAutoKeysound( NoteData &out, int row, TapNote akTap ); int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow ); -void LightTransformHelper( const NoteData &in, NoteData &out, const vector &aiTracks ); +void LightTransformHelper( const NoteData &in, NoteData &out, const std::vector &aiTracks ); /** * @brief Utility functions that deal with NoteData. @@ -27,8 +27,8 @@ namespace NoteDataUtil NoteType GetSmallestNoteTypeInRange( const NoteData &nd, int iStartIndex, int iEndIndex ); void LoadFromSMNoteDataString( NoteData &out, const RString &sSMNoteData, bool bComposite ); void GetSMNoteDataString( const NoteData &in, RString ¬es_out ); - void SplitCompositeNoteData( const NoteData &in, vector &out ); - void CombineCompositeNoteData( NoteData &out, const vector &in ); + void SplitCompositeNoteData( const NoteData &in, std::vector &out ); + void CombineCompositeNoteData( NoteData &out, const std::vector &in ); /** * @brief Autogenerate notes from one type to another. * diff --git a/src/NoteDataWithScoring.cpp b/src/NoteDataWithScoring.cpp index f37a26461c..42a79dc4b7 100644 --- a/src/NoteDataWithScoring.cpp +++ b/src/NoteDataWithScoring.cpp @@ -135,7 +135,7 @@ TapNoteScore NoteDataWithScoring::MinTapNoteScore( const NoteData &in, unsigned tn.type == TapNoteType_AutoKeysound || ( plnum != PlayerNumber_Invalid && tn.pn != plnum ) ) continue; - score = min( score, tn.result.tns ); + score = std::min( score, tn.result.tns ); } //LOG->Trace( ssprintf("OMG score is?? %s",TapNoteScoreToString(score).c_str()) ); @@ -198,7 +198,7 @@ struct garv_state int lifts_hit; // hold_ends tracks where currently active holds will end, which is used // to count the number of hands. -Kyz - vector hold_ends; + std::vector hold_ends; int num_notes_on_curr_row; // num_holds_on_curr_row saves us the work of tracking where holds started // just to keep a jump of two holds from counting as a hand. @@ -387,7 +387,7 @@ void NoteDataWithScoring::GetActualRadarValues(const NoteData &in, int jump_count= out[RadarCategory_Jumps]; int hold_count= out[RadarCategory_Holds]; int tap_count= out[RadarCategory_TapsAndHolds]; - float hittable_steps_length= max(0, + float hittable_steps_length= std::max(0.0f, timing->GetElapsedTimeFromBeat(NoteRowToBeat(last_hittable_row)) - timing->GetElapsedTimeFromBeat(NoteRowToBeat(first_hittable_row))); // The for loop and the assert are used to ensure that all fields of diff --git a/src/NoteDisplay.cpp b/src/NoteDisplay.cpp index 034d545a7b..52c6043ea9 100644 --- a/src/NoteDisplay.cpp +++ b/src/NoteDisplay.cpp @@ -192,14 +192,14 @@ struct NoteResource Actor *m_pActor; // todo: AutoActor me? -aj }; -static map g_NoteResource; +static std::map g_NoteResource; static NoteResource *MakeNoteResource( const RString &sButton, const RString &sElement, PlayerNumber pn, GameController gc, bool bSpriteOnly ) { RString sElementAndType = ssprintf( "%s, %s", sButton.c_str(), sElement.c_str() ); NoteSkinAndPath nsap( NOTESKIN->GetCurrentNoteSkin(), sElementAndType, pn, gc ); - map::iterator it = g_NoteResource.find( nsap ); + std::map::iterator it = g_NoteResource.find( nsap ); if( it == g_NoteResource.end() ) { NoteResource *pRes = new NoteResource( nsap ); @@ -421,7 +421,7 @@ void NoteDisplay::Load( int iColNum, const PlayerState* pPlayerState, float fYRe m_fYReverseOffsetPixels = fYReverseOffsetPixels; const PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - vector GameI; + std::vector GameI; GAMESTATE->GetCurrentStyle(pPlayerState->m_PlayerNumber)->StyleInputToGameInput( iColNum, pn, GameI ); const RString &sButton = GAMESTATE->GetCurrentStyle(pPlayerState->m_PlayerNumber)->ColToButtonName( iColNum ); @@ -473,10 +473,10 @@ bool NoteDisplay::IsOnScreen( float fBeat, int iCol, int iDrawDistanceAfterTarge bool NoteDisplay::DrawHoldsInRange(const NoteFieldRenderArgs& field_args, const NoteColumnRenderArgs& column_args, - const vector& tap_set) + const std::vector& tap_set) { bool any_upcoming = false; - for(vector::const_iterator tapit= + for(std::vector::const_iterator tapit= tap_set.begin(); tapit != tap_set.end(); ++tapit) { const TapNote& tn= (*tapit)->second; @@ -539,7 +539,7 @@ bool NoteDisplay::DrawHoldsInRange(const NoteFieldRenderArgs& field_args, bool NoteDisplay::DrawTapsInRange(const NoteFieldRenderArgs& field_args, const NoteColumnRenderArgs& column_args, - const vector& tap_set) + const std::vector& tap_set) { bool any_upcoming= false; @@ -651,7 +651,7 @@ void NoteDisplay::Update( float fDeltaTime ) { /* This function is static: it's called once per game loop, not once per * NoteDisplay. Update each cached item exactly once. */ - map::iterator it; + std::map::iterator it; for( it = g_NoteResource.begin(); it != g_NoteResource.end(); ++it ) { NoteResource *pRes = it->second; @@ -752,7 +752,7 @@ enum hold_part_type hpt_bottom, }; -void NoteDisplay::DrawHoldPart(vector &vpSpr, +void NoteDisplay::DrawHoldPart(std::vector &vpSpr, const NoteFieldRenderArgs& field_args, const NoteColumnRenderArgs& column_args, const draw_hold_part_args& part_args, bool glow, int part_type) @@ -765,7 +765,7 @@ void NoteDisplay::DrawHoldPart(vector &vpSpr, // draw manually in small segments RectF rect = *pSprite->GetCurrentTextureCoordRect(); if(part_args.flip_texture_vertically) - swap(rect.top, rect.bottom); + std::swap(rect.top, rect.bottom); const float fFrameWidth = pSprite->GetUnzoomedWidth(); const float unzoomed_frame_height= pSprite->GetUnzoomedHeight(); @@ -773,12 +773,12 @@ void NoteDisplay::DrawHoldPart(vector &vpSpr, * very long, don't process or draw the part outside of the range. Don't change * part_args.y_top or part_args.y_bottom; they need to be left alone to calculate texture coordinates. */ // If hold body, draw texture to the outside screen.(fix by A.C) - float y_start_pos = (part_type == hpt_body) ? part_args.y_top : max(part_args.y_top, part_args.y_start_pos); + float y_start_pos = (part_type == hpt_body) ? part_args.y_top : std::max(part_args.y_top, part_args.y_start_pos); if (part_args.y_top < part_args.y_start_pos - unzoomed_frame_height) { y_start_pos = fmod((y_start_pos - part_args.y_start_pos), unzoomed_frame_height) + part_args.y_start_pos; } - float y_end_pos = min(part_args.y_bottom, part_args.y_end_pos); + float y_end_pos = std::min(part_args.y_bottom, part_args.y_end_pos); const float color_scale= glow ? 1 : part_args.color_scale; if(part_type == hpt_body) { @@ -1051,8 +1051,8 @@ void NoteDisplay::DrawHoldPart(vector &vpSpr, } } -void NoteDisplay::DrawHoldBodyInternal(vector& sprite_top, - vector& sprite_body, vector& sprite_bottom, +void NoteDisplay::DrawHoldBodyInternal(std::vector& sprite_top, + std::vector& sprite_body, std::vector& sprite_bottom, const NoteFieldRenderArgs& field_args, const NoteColumnRenderArgs& column_args, draw_hold_part_args& part_args, @@ -1093,15 +1093,15 @@ void NoteDisplay::DrawHoldBody(const TapNote& tn, part_args.percent_fade_to_fail= percent_fade_to_fail; part_args.color_scale= color_scale; part_args.overlapped_time= tn.HoldResult.fOverlappedTime; - vector vpSprTop; + std::vector vpSprTop; Sprite *pSpriteTop = GetHoldSprite( m_HoldTopCap, NotePart_HoldTopCap, beat, tn.subType == TapNoteSubType_Roll, being_held && !cache->m_bHoldActiveIsAddLayer ); vpSprTop.push_back( pSpriteTop ); - vector vpSprBody; + std::vector vpSprBody; Sprite *pSpriteBody = GetHoldSprite( m_HoldBody, NotePart_HoldBody, beat, tn.subType == TapNoteSubType_Roll, being_held && !cache->m_bHoldActiveIsAddLayer ); vpSprBody.push_back( pSpriteBody ); - vector vpSprBottom; + std::vector vpSprBottom; Sprite *pSpriteBottom = GetHoldSprite( m_HoldBottomCap, NotePart_HoldBottomCap, beat, tn.subType == TapNoteSubType_Roll, being_held && !cache->m_bHoldActiveIsAddLayer ); vpSprBottom.push_back( pSpriteBottom ); @@ -1119,8 +1119,8 @@ void NoteDisplay::DrawHoldBody(const TapNote& tn, part_args.flip_texture_vertically = reverse && cache->m_bFlipHoldBodyWhenReverse; if(part_args.flip_texture_vertically) { - swap( vpSprTop, vpSprBottom ); - swap( pSpriteTop, pSpriteBottom ); + std::swap( vpSprTop, vpSprBottom ); + std::swap( pSpriteTop, pSpriteBottom ); } const bool bWavyPartsNeedZBuffer = ArrowEffects::NeedZBuffer(); @@ -1151,7 +1151,7 @@ void NoteDisplay::DrawHoldBody(const TapNote& tn, field_args.draw_pixels_before_targets, m_fYReverseOffsetPixels); if(reverse) { - swap(part_args.y_start_pos, part_args.y_end_pos); + std::swap(part_args.y_start_pos, part_args.y_end_pos); } // So that part_args.y_start_pos can be changed when drawing the bottom. const float original_y_start_pos= part_args.y_start_pos; @@ -1189,7 +1189,7 @@ void NoteDisplay::DrawHold(const TapNote& tn, // bDrawGlowOnly is a little hacky. We need to draw the diffuse part and the glow part one pass at a time to minimize state changes bool bReverse = m_pPlayerState->m_PlayerOptions.GetCurrent().GetReversePercentForColumn(column_args.column) > 0.5f; - float fStartBeat = NoteRowToBeat( max(tn.HoldResult.iLastHeldRow, iRow) ); + float fStartBeat = NoteRowToBeat( std::max(tn.HoldResult.iLastHeldRow, iRow) ); float fThrowAway = 0; // HACK: If life > 0, don't set YOffset to 0 so that it doesn't jiggle around the receptor. @@ -1213,7 +1213,7 @@ void NoteDisplay::DrawHold(const TapNote& tn, // Swap in reverse, so fStartYOffset is always the offset higher on the screen. if( bReverse ) - swap( fStartYOffset, fEndYOffset ); + std::swap( fStartYOffset, fEndYOffset ); const float fYHead= ArrowEffects::GetYPos(m_pPlayerState, column_args.column, fStartYOffset, m_fYReverseOffsetPixels); const float fYTail= ArrowEffects::GetYPos(m_pPlayerState, column_args.column, fEndYOffset, m_fYReverseOffsetPixels); @@ -1349,7 +1349,7 @@ void NoteDisplay::DrawActor(const TapNote& tn, Actor* pActor, NotePart part, { case NoteColorType_Denominator: color = float( BeatToNoteType( fBeat ) ); - color = clamp( color, 0, (cache->m_iNoteColorCount[part]-1) ); + color = clamp( color, 0.0f, (float) (cache->m_iNoteColorCount[part]-1) ); break; case NoteColorType_Progress: color = fmodf( ceilf( fBeat * cache->m_iNoteColorCount[part] ), (float)cache->m_iNoteColorCount[part] ); @@ -1545,8 +1545,8 @@ void NoteColumnRenderer::DrawPrimitives() // lists to the displays to draw. // The vector in the NUM_PlayerNumber slot should stay empty, not worth // optimizing it out. -Kyz - vector > holds(PLAYER_INVALID+1); - vector > taps(PLAYER_INVALID+1); + std::vector > holds(PLAYER_INVALID+1); + std::vector > taps(PLAYER_INVALID+1); NoteData::TrackMap::const_iterator begin, end; m_field_render_args->note_data->GetTapNoteRangeInclusive(m_column, m_field_render_args->first_row, m_field_render_args->last_row+1, begin, end); diff --git a/src/NoteDisplay.h b/src/NoteDisplay.h index 83833a3a4d..0e8fb59643 100644 --- a/src/NoteDisplay.h +++ b/src/NoteDisplay.h @@ -187,10 +187,10 @@ public: bool DrawHoldsInRange(const NoteFieldRenderArgs& field_args, const NoteColumnRenderArgs& column_args, - const vector& tap_set); + const std::vector& tap_set); bool DrawTapsInRange(const NoteFieldRenderArgs& field_args, const NoteColumnRenderArgs& column_args, - const vector& tap_set); + const std::vector& tap_set); /** * @brief Draw the TapNote onto the NoteField. * @param tn the TapNote in question. @@ -244,12 +244,12 @@ private: const NoteColumnRenderArgs& column_args, float fYOffset, float fBeat, bool bIsAddition, float fPercentFadeToFail, float fColorScale, bool is_being_held); - void DrawHoldPart(vector &vpSpr, + void DrawHoldPart(std::vector &vpSpr, const NoteFieldRenderArgs& field_args, const NoteColumnRenderArgs& column_args, const draw_hold_part_args& part_args, bool glow, int part_type); - void DrawHoldBodyInternal(vector& sprite_top, - vector& sprite_body, vector& sprite_bottom, + void DrawHoldBodyInternal(std::vector& sprite_top, + std::vector& sprite_body, std::vector& sprite_bottom, const NoteFieldRenderArgs& field_args, const NoteColumnRenderArgs& column_args, draw_hold_part_args& part_args, @@ -333,7 +333,7 @@ struct NoteColumnRenderer : public Actor NCSplineHandler* GetZoomHandler() { return &NCR_DestTweenState().m_zoom_handler; } private: - vector NCR_Tweens; + std::vector NCR_Tweens; NCR_TweenState NCR_current; NCR_TweenState NCR_start; }; diff --git a/src/NoteField.cpp b/src/NoteField.cpp index d05c3ec49b..7a2fb94919 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -83,7 +83,7 @@ NoteField::~NoteField() void NoteField::Unload() { - for( map::iterator it = m_NoteDisplays.begin(); + for( std::map::iterator it = m_NoteDisplays.begin(); it != m_NoteDisplays.end(); ++it ) delete it->second; m_NoteDisplays.clear(); @@ -134,7 +134,7 @@ void NoteField::CacheAllUsedNoteSkins() /* Cache all note skins that we might need for the whole song, course or battle * play, so we don't have to load them later (such as between course songs). */ - vector asSkinsLower; + std::vector asSkinsLower; GAMESTATE->GetAllUsedNoteSkins( asSkinsLower ); asSkinsLower.push_back( m_pPlayerState->m_PlayerOptions.GetStage().m_sNoteSkin ); for (RString &s : asSkinsLower) @@ -148,7 +148,7 @@ void NoteField::CacheAllUsedNoteSkins() /* If we're changing note skins in the editor, we can have old note skins lying * around. Remove them so they don't accumulate. */ - set setNoteSkinsToUnload; + std::set setNoteSkinsToUnload; for (std::pair d : m_NoteDisplays) { bool unused = find(asSkinsLower.begin(), asSkinsLower.end(), d.first) == asSkinsLower.end(); @@ -162,7 +162,7 @@ void NoteField::CacheAllUsedNoteSkins() NOTESKIN->ValidateNoteSkinName(sCurrentNoteSkinLower); sCurrentNoteSkinLower.MakeLower(); - map::iterator it = m_NoteDisplays.find( sCurrentNoteSkinLower ); + std::map::iterator it = m_NoteDisplays.find( sCurrentNoteSkinLower ); ASSERT_M( it != m_NoteDisplays.end(), sCurrentNoteSkinLower ); m_pCurDisplay = it->second; memset( m_pDisplays, 0, sizeof(m_pDisplays) ); @@ -249,11 +249,11 @@ void NoteField::ensure_note_displays_have_skin() { sNoteSkinLower = "default"; } - m_NoteDisplays.insert(pair (sNoteSkinLower, badIdea)); + m_NoteDisplays.insert(std::pair (sNoteSkinLower, badIdea)); } sNoteSkinLower.MakeLower(); - map::iterator it = m_NoteDisplays.find( sNoteSkinLower ); + std::map::iterator it = m_NoteDisplays.find( sNoteSkinLower ); ASSERT_M( it != m_NoteDisplays.end(), ssprintf("iterator != m_NoteDisplays.end() [sNoteSkinLower = %s]",sNoteSkinLower.c_str()) ); memset( m_pDisplays, 0, sizeof(m_pDisplays) ); FOREACH_EnabledPlayer( pn ) @@ -269,7 +269,7 @@ void NoteField::ensure_note_displays_have_skin() { sNoteSkinLower = "default"; } - m_NoteDisplays.insert(pair (sNoteSkinLower, badIdea)); + m_NoteDisplays.insert(std::pair (sNoteSkinLower, badIdea)); } sNoteSkinLower.MakeLower(); @@ -343,7 +343,7 @@ void NoteField::Update( float fDeltaTime ) cur->m_GhostArrowRow.Update( fDeltaTime ); if( m_FieldRenderArgs.fail_fade >= 0 ) - m_FieldRenderArgs.fail_fade = min( m_FieldRenderArgs.fail_fade + fDeltaTime/FADE_FAIL_TIME, 1 ); + m_FieldRenderArgs.fail_fade = std::min( m_FieldRenderArgs.fail_fade + fDeltaTime/FADE_FAIL_TIME, 1.0f ); // Update fade to failed m_pCurDisplay->m_ReceptorArrowRow.SetFadeToFailPercent( m_FieldRenderArgs.fail_fade ); @@ -590,7 +590,7 @@ static CacheNoteStat GetNumNotesFromBeginning( const PlayerState *pPlayerState, { // XXX: I realized that I have copied and pasted my binary search code 3 times already. // how can we abstract this? - const vector &data = pPlayerState->m_CacheNoteStat; + const std::vector &data = pPlayerState->m_CacheNoteStat; int max = data.size() - 1; int l = 0, r = max; while( l <= r ) @@ -696,7 +696,7 @@ float FindLastDisplayedBeat( const PlayerState* pPlayerState, int iDrawDistanceB if( fSpeedMultiplier < 0.75 ) { - fLastBeatToDraw = min(fLastBeatToDraw, pPlayerState->GetDisplayedPosition().m_fSongBeat + 16); + fLastBeatToDraw = std::min(fLastBeatToDraw, pPlayerState->GetDisplayedPosition().m_fSongBeat + 16); } return fLastBeatToDraw; @@ -789,7 +789,7 @@ void NoteField::DrawPrimitives() } const TimingData *pTiming = &m_pPlayerState->GetDisplayedTiming(); - const vector* segs[NUM_TimingSegmentType]; + const std::vector* segs[NUM_TimingSegmentType]; FOREACH_TimingSegmentType( tst ) segs[tst] = &(pTiming->GetTimingSegments(tst)); @@ -798,7 +798,7 @@ void NoteField::DrawPrimitives() // Draw beat bars if( ( GAMESTATE->IsEditing() || SHOW_BEAT_BARS ) && pTiming != nullptr ) { - const vector &tSigs = *segs[SEGMENT_TIME_SIG]; + const std::vector &tSigs = *segs[SEGMENT_TIME_SIG]; int iMeasureIndex = 0; for (i = 0; i < tSigs.size(); i++) { @@ -931,14 +931,14 @@ void NoteField::DrawPrimitives() break; case EditMode_Full: { - vector::iterator iter[NUM_BackgroundLayer]; + std::vector::iterator iter[NUM_BackgroundLayer]; FOREACH_BackgroundLayer( j ) iter[j] = GAMESTATE->m_pCurSong->GetBackgroundChanges(j).begin(); for(;;) { float fLowestBeat = FLT_MAX; - vector viLowestIndex; + std::vector viLowestIndex; FOREACH_BackgroundLayer( j ) { @@ -970,7 +970,7 @@ void NoteField::DrawPrimitives() if( IS_ON_SCREEN(fLowestBeat) ) { - vector vsBGChanges; + std::vector vsBGChanges; for (BackgroundLayer const &bl : viLowestIndex) { ASSERT( iter[bl] != GAMESTATE->m_pCurSong->GetBackgroundChanges(bl).end() ); @@ -1058,7 +1058,7 @@ void NoteField::DrawBoardPrimitive() void NoteField::FadeToFail() { - m_FieldRenderArgs.fail_fade = max( 0.0f, m_FieldRenderArgs.fail_fade ); // this will slowly increase every Update() + m_FieldRenderArgs.fail_fade = std::max( 0.0f, m_FieldRenderArgs.fail_fade ); // this will slowly increase every Update() // don't fade all over again if this is called twice } diff --git a/src/NoteField.h b/src/NoteField.h index 0a347023ee..8b06837112 100644 --- a/src/NoteField.h +++ b/src/NoteField.h @@ -62,7 +62,7 @@ public: // m_ColumnRenderers belongs in the protected section, but it's here in // public so that the Lua API can access it. -Kyz - vector m_ColumnRenderers; + std::vector m_ColumnRenderers; protected: void CacheNoteSkin( const RString &sNoteSkin ); @@ -109,7 +109,7 @@ protected: NoteFieldRenderArgs m_FieldRenderArgs; /* All loaded note displays, mapped by their name. */ - map m_NoteDisplays; + std::map m_NoteDisplays; NoteDisplayCols *m_pCurDisplay; NoteDisplayCols *m_pDisplays[NUM_PlayerNumber]; diff --git a/src/NoteSkinManager.cpp b/src/NoteSkinManager.cpp index 562da9f83a..f4ec94c958 100644 --- a/src/NoteSkinManager.cpp +++ b/src/NoteSkinManager.cpp @@ -26,7 +26,7 @@ const RString GAME_BASE_NOTESKIN_NAME = "default"; // might init this before SpecialFiles::NOTESKINS_DIR #define GLOBAL_BASE_DIR (SpecialFiles::NOTESKINS_DIR + GAME_COMMON_NOTESKIN_NAME + "/") -static map g_PathCache; +static std::map g_PathCache; struct NoteSkinData { @@ -34,14 +34,14 @@ struct NoteSkinData IniFile metrics; // When looking for an element, search these dirs from head to tail. - vector vsDirSearchOrder; + std::vector vsDirSearchOrder; LuaReference m_Loader; }; namespace { - static map g_mapNameToData; + static std::map g_mapNameToData; }; NoteSkinManager::NoteSkinManager() @@ -76,7 +76,7 @@ void NoteSkinManager::RefreshNoteSkinData( const Game* pGame ) g_PathCache.clear(); RString sBaseSkinFolder = SpecialFiles::NOTESKINS_DIR + pGame->m_szName + "/"; - vector asNoteSkinNames; + std::vector asNoteSkinNames; GetDirListing( sBaseSkinFolder + "*", asNoteSkinNames, true ); StripCvsAndSvn( asNoteSkinNames ); @@ -92,7 +92,7 @@ void NoteSkinManager::RefreshNoteSkinData( const Game* pGame ) // delete it from the map. -Kyz if(!LoadNoteSkinData(sName, g_mapNameToData[sName])) { - map::iterator entry= g_mapNameToData.find(sName); + std::map::iterator entry= g_mapNameToData.find(sName); g_mapNameToData.erase(entry); } } @@ -167,7 +167,7 @@ bool NoteSkinManager::LoadNoteSkinDataRecursive( const RString &sNoteSkinName_, } LuaReference refScript; - for( vector::reverse_iterator dir = data_out.vsDirSearchOrder.rbegin(); dir != data_out.vsDirSearchOrder.rend(); ++dir ) + for( std::vector::reverse_iterator dir = data_out.vsDirSearchOrder.rbegin(); dir != data_out.vsDirSearchOrder.rend(); ++dir ) { RString sFile = *dir + "NoteSkin.lua"; RString sScript; @@ -197,17 +197,17 @@ bool NoteSkinManager::LoadNoteSkinDataRecursive( const RString &sNoteSkinName_, } -void NoteSkinManager::GetNoteSkinNames( vector &AddTo ) +void NoteSkinManager::GetNoteSkinNames( std::vector &AddTo ) { GetNoteSkinNames( GAMESTATE->m_pCurGame, AddTo ); } -void NoteSkinManager::GetNoteSkinNames( const Game* pGame, vector &AddTo ) +void NoteSkinManager::GetNoteSkinNames( const Game* pGame, std::vector &AddTo ) { GetAllNoteSkinNamesForGame( pGame, AddTo ); } -bool NoteSkinManager::NoteSkinNameInList(const RString name, vector name_list) +bool NoteSkinManager::NoteSkinNameInList(const RString name, std::vector name_list) { for(size_t i= 0; i < name_list.size(); ++i) { @@ -221,14 +221,14 @@ bool NoteSkinManager::NoteSkinNameInList(const RString name, vector nam bool NoteSkinManager::DoesNoteSkinExist( const RString &sSkinName ) { - vector asSkinNames; + std::vector asSkinNames; GetAllNoteSkinNamesForGame( GAMESTATE->m_pCurGame, asSkinNames ); return NoteSkinNameInList(sSkinName, asSkinNames); } bool NoteSkinManager::DoNoteSkinsExistForGame( const Game *pGame ) { - vector asSkinNames; + std::vector asSkinNames; GetAllNoteSkinNamesForGame( pGame, asSkinNames ); return !asSkinNames.empty(); } @@ -236,7 +236,7 @@ bool NoteSkinManager::DoNoteSkinsExistForGame( const Game *pGame ) RString NoteSkinManager::GetDefaultNoteSkinName() { RString name= THEME->GetMetric("Common", "DefaultNoteSkinName"); - vector all_names; + std::vector all_names; GetAllNoteSkinNamesForGame(GAMESTATE->m_pCurGame, all_names); if(all_names.empty()) { @@ -262,12 +262,12 @@ void NoteSkinManager::ValidateNoteSkinName(RString& name) } } -void NoteSkinManager::GetAllNoteSkinNamesForGame( const Game *pGame, vector &AddTo ) +void NoteSkinManager::GetAllNoteSkinNamesForGame( const Game *pGame, std::vector &AddTo ) { if( pGame == m_pCurGame ) { // Faster: - for( map::const_iterator iter = g_mapNameToData.begin(); + for( std::map::const_iterator iter = g_mapNameToData.begin(); iter != g_mapNameToData.end(); ++iter ) { AddTo.push_back( iter->second.sName ); @@ -291,7 +291,7 @@ RString NoteSkinManager::GetMetric( const RString &sButtonName, const RString &s } RString sNoteSkinName = m_sCurrentNoteSkin; sNoteSkinName.MakeLower(); - map::const_iterator it = g_mapNameToData.find(sNoteSkinName); + std::map::const_iterator it = g_mapNameToData.find(sNoteSkinName); ASSERT_M( it != g_mapNameToData.end(), sNoteSkinName ); // this NoteSkin doesn't exist! const NoteSkinData& data = it->second; @@ -332,7 +332,7 @@ apActorCommands NoteSkinManager::GetMetricA( const RString &sButtonName, const R RString NoteSkinManager::GetPath( const RString &sButtonName, const RString &sElement ) { const RString CacheString = m_sCurrentNoteSkin + "/" + sButtonName + "/" + sElement; - map::iterator it = g_PathCache.find( CacheString ); + std::map::iterator it = g_PathCache.find( CacheString ); if( it != g_PathCache.end() ) return it->second; @@ -343,7 +343,7 @@ RString NoteSkinManager::GetPath( const RString &sButtonName, const RString &sEl } RString sNoteSkinName = m_sCurrentNoteSkin; sNoteSkinName.MakeLower(); - map::const_iterator iter = g_mapNameToData.find( sNoteSkinName ); + std::map::const_iterator iter = g_mapNameToData.find( sNoteSkinName ); ASSERT( iter != g_mapNameToData.end() ); const NoteSkinData &data = iter->second; @@ -456,7 +456,7 @@ RString NoteSkinManager::GetPath( const RString &sButtonName, const RString &sEl bool NoteSkinManager::PushActorTemplate( Lua *L, const RString &sButton, const RString &sElement, bool bSpriteOnly ) { - map::const_iterator iter = g_mapNameToData.find( m_sCurrentNoteSkin ); + std::map::const_iterator iter = g_mapNameToData.find( m_sCurrentNoteSkin ); if(iter == g_mapNameToData.end()) { LuaHelpers::ReportScriptError("No current noteskin set!", "NOTESKIN_ERROR"); @@ -493,7 +493,7 @@ Actor *NoteSkinManager::LoadActor( const RString &sButton, const RString &sEleme return Sprite::NewBlankSprite(); } - unique_ptr pNode( XmlFileUtil::XNodeFromTable(L) ); + std::unique_ptr pNode( XmlFileUtil::XNodeFromTable(L) ); if( pNode.get() == nullptr ) { LUA->Release( L ); @@ -522,7 +522,7 @@ Actor *NoteSkinManager::LoadActor( const RString &sButton, const RString &sEleme RString NoteSkinManager::GetPathFromDirAndFile( const RString &sDir, const RString &sFileName ) { - vector matches; // fill this with the possible files + std::vector matches; // fill this with the possible files GetDirListing( sDir+sFileName+"*", matches, false, true ); @@ -585,7 +585,7 @@ public: #undef FOR_NOTESKIN static int GetNoteSkinNames( T* p, lua_State *L ) { - vector vNoteskins; + std::vector vNoteskins; p->GetNoteSkinNames( vNoteskins ); LuaHelpers::CreateTableFromArray(vNoteskins, L); return 1; @@ -594,7 +594,7 @@ public: static int GetNoteSkinNamesForGame( T* p, lua_State *L ) { Game *pGame = Luna::check( L, 1 ); - vector vGameNoteskins; + std::vector vGameNoteskins; p->GetNoteSkinNames( pGame, vGameNoteskins ); LuaHelpers::CreateTableFromArray(vGameNoteskins, L); return 1; diff --git a/src/NoteSkinManager.h b/src/NoteSkinManager.h index f870c9746e..5cd56bc2e8 100644 --- a/src/NoteSkinManager.h +++ b/src/NoteSkinManager.h @@ -18,9 +18,9 @@ public: ~NoteSkinManager(); void RefreshNoteSkinData( const Game* game ); - void GetNoteSkinNames( const Game* game, vector &AddTo ); - void GetNoteSkinNames( vector &AddTo ); // looks up current const Game* in GAMESTATE - bool NoteSkinNameInList(const RString name, vector name_list); + void GetNoteSkinNames( const Game* game, std::vector &AddTo ); + void GetNoteSkinNames( std::vector &AddTo ); // looks up current const Game* in GAMESTATE + bool NoteSkinNameInList(const RString name, std::vector name_list); bool DoesNoteSkinExist( const RString &sNoteSkin ); // looks up current const Game* in GAMESTATE bool DoNoteSkinsExistForGame( const Game *pGame ); RString GetDefaultNoteSkinName(); // looks up current const Game* in GAMESTATE @@ -46,7 +46,7 @@ public: protected: RString GetPathFromDirAndFile( const RString &sDir, const RString &sFileName ); - void GetAllNoteSkinNamesForGame( const Game *pGame, vector &AddTo ); + void GetAllNoteSkinNamesForGame( const Game *pGame, std::vector &AddTo ); bool LoadNoteSkinData( const RString &sNoteSkinName, NoteSkinData& data_out ); bool LoadNoteSkinDataRecursive( const RString &sNoteSkinName, NoteSkinData& data_out ); diff --git a/src/NotesLoader.cpp b/src/NotesLoader.cpp index 41575f924b..719bb359cd 100644 --- a/src/NotesLoader.cpp +++ b/src/NotesLoader.cpp @@ -15,7 +15,7 @@ void NotesLoader::GetMainAndSubTitlesFromFullTitle( const RString &sFullTitle, R for( unsigned i=0; i &BlacklistedImages, bool load_autosave ) +bool NotesLoader::LoadFromDir( const RString &sPath, Song &out, std::set &BlacklistedImages, bool load_autosave ) { - vector list; + std::vector list; BlacklistedImages.clear(); SSCLoader loaderSSC; diff --git a/src/NotesLoader.h b/src/NotesLoader.h index b9047bc41c..bd7e1883f7 100644 --- a/src/NotesLoader.h +++ b/src/NotesLoader.h @@ -21,7 +21,7 @@ namespace NotesLoader * @param out the Song in question. * @param BlacklistedImages images to exclude (DWI files only for some reason). * @return its success or failure. */ - bool LoadFromDir( const RString &sPath, Song &out, set &BlacklistedImages, bool load_autosave= false ); + bool LoadFromDir( const RString &sPath, Song &out, std::set &BlacklistedImages, bool load_autosave= false ); } #endif diff --git a/src/NotesLoaderBMS.cpp b/src/NotesLoaderBMS.cpp index 0a59ed001b..cae1c9ae17 100644 --- a/src/NotesLoaderBMS.cpp +++ b/src/NotesLoaderBMS.cpp @@ -106,7 +106,7 @@ static void SlideDuplicateDifficulties( Song &p ) if( dc == Difficulty_Edit ) continue; - vector vSteps; + std::vector vSteps; SongUtil::GetSteps( &p, vSteps, st, dc ); StepsUtil::SortNotesArrayByDifficulty( vSteps ); @@ -114,14 +114,14 @@ static void SlideDuplicateDifficulties( Song &p ) { Steps* pSteps = vSteps[k]; - Difficulty dc2 = min( (Difficulty)(dc+1), Difficulty_Challenge ); + Difficulty dc2 = std::min( (Difficulty)(dc+1), Difficulty_Challenge ); pSteps->SetDifficulty( dc2 ); } } } } -void BMSLoader::GetApplicableFiles( const RString &sPath, vector &out ) +void BMSLoader::GetApplicableFiles( const RString &sPath, std::vector &out ) { GetDirListing( sPath + RString("*.bms"), out ); GetDirListing( sPath + RString("*.bme"), out ); @@ -179,9 +179,9 @@ struct BMSMeasure }; const int MaxBMSElements = 1296; // ZZ in b36 -typedef map BMSHeaders; -typedef map BMSMeasures; -typedef vector BMSObjects; +typedef std::map BMSHeaders; +typedef std::map BMSMeasures; +typedef std::vector BMSObjects; class BMSChart { @@ -195,7 +195,7 @@ public: BMSObjects objects; BMSHeaders headers; BMSMeasures measures; - map referencedTracks; + std::map referencedTracks; void TidyUpData(); }; @@ -231,8 +231,8 @@ struct bmsCommandTree }; BMSHeaders Commands; - vector ChannelCommands; - vector branches; + std::vector ChannelCommands; + std::vector branches; bmsNodeS* parent; bmsNodeS() @@ -253,7 +253,7 @@ struct bmsCommandTree bmsNodeS *currentNode; bmsNodeS root; - vector randomStack; + std::vector randomStack; int line; RString path; @@ -339,20 +339,20 @@ struct bmsCommandTree -az */ - void appendNodeElements(bmsNodeS* node, BMSHeaders &headersOut, vector &linesOut) + void appendNodeElements(bmsNodeS* node, BMSHeaders &headersOut, std::vector &linesOut) { for (BMSHeaders::iterator i = node->Commands.begin(); i != node->Commands.end(); ++i) { headersOut[i->first] = i->second; } - for (vector::iterator i = node->ChannelCommands.begin(); i != node->ChannelCommands.end(); ++i) + for (std::vector::iterator i = node->ChannelCommands.begin(); i != node->ChannelCommands.end(); ++i) { linesOut.push_back(*i); } } - bool triggerBranches(bmsNodeS* node, BMSHeaders &headersOut, vector &linesOut) + bool triggerBranches(bmsNodeS* node, BMSHeaders &headersOut, std::vector &linesOut) { for (bmsNodeS *b : node->branches) if (evaluateNode(b, headersOut, linesOut)) @@ -363,7 +363,7 @@ struct bmsCommandTree return false; } - bool evaluateNode(bmsNodeS* node, BMSHeaders &headersOut, vector &linesOut) + bool evaluateNode(bmsNodeS* node, BMSHeaders &headersOut, std::vector &linesOut) { switch (node->conditionType) { @@ -395,12 +395,12 @@ struct bmsCommandTree return false; } - void evaluateBMSTree(BMSHeaders &headersOut, vector &linesOut) + void evaluateBMSTree(BMSHeaders &headersOut, std::vector &linesOut) { evaluateNode(&root, headersOut, linesOut); } - void doStatement(RString statement, map &referencedTracks) + void doStatement(RString statement, std::map &referencedTracks) { line++; @@ -541,10 +541,10 @@ bool BMSChart::Load( const RString &chartPath ) Tree.doStatement(line, referencedTracks); } - vector lines; + std::vector lines; Tree.evaluateBMSTree(headers, lines); - for (vector::iterator i = lines.begin(); i != lines.end(); ++i) + for (std::vector::iterator i = lines.begin(); i != lines.end(); ++i) { RString line = *i; RString data = line.substr(7); @@ -592,12 +592,12 @@ void BMSChart::TidyUpData() class BMSSong { - map mapKeysoundToIndex; + std::map mapKeysoundToIndex; Song *out; bool backgroundsPrecached; void PrecacheBackgrounds(const RString &dir); - map mapBackground; + std::map mapBackground; public: BMSSong( Song *song ); @@ -649,7 +649,7 @@ int BMSSong::AllocateKeysound( RString filename, RString path ) if( !IsAFile(dir + normalizedFilename) ) { - vector const& exts= ActorUtil::GetTypeExtensionList(FT_Sound); + std::vector const& exts= ActorUtil::GetTypeExtensionList(FT_Sound); for(size_t i = 0; i < exts.size(); ++i) { RString fn = SetExtension( normalizedFilename, exts[i] ); @@ -714,7 +714,7 @@ bool BMSSong::GetBackground( RString filename, RString path, RString &bgfile ) if( !IsAFile(dir + normalizedFilename) ) { - vector exts; + std::vector exts; ActorUtil::AddTypeExtensionsToList(FT_Movie, exts); ActorUtil::AddTypeExtensionsToList(FT_Bitmap, exts); for(size_t i = 0; i < exts.size(); ++i) @@ -745,9 +745,9 @@ void BMSSong::PrecacheBackgrounds(const RString &dir) { if( backgroundsPrecached ) return; backgroundsPrecached = true; - vector arrayPossibleFiles; + std::vector arrayPossibleFiles; - vector exts; + std::vector exts; ActorUtil::AddTypeExtensionsToList(FT_Movie, exts); ActorUtil::AddTypeExtensionsToList(FT_Bitmap, exts); FILEMAN->GetDirListingWithMultipleExtensions(dir + RString("*."), exts, arrayPossibleFiles); @@ -774,7 +774,7 @@ struct BMSChartInfo { RString musicFile; RString previewFile; - map backgroundChanges; + std::map backgroundChanges; float previewStart; BMSChartInfo() { previewStart = 0; } }; @@ -795,11 +795,11 @@ class BMSChartReader { RString lnobj; int nonEmptyTracksCount; - map nonEmptyTracks; + std::map nonEmptyTracks; int GetKeysound( const BMSObject &obj ); - map mapValueToKeysoundIndex; + std::map mapValueToKeysoundIndex; public: BMSChartReader(BMSChart *chart, Steps *steps, BMSSong *song); @@ -1050,7 +1050,7 @@ StepsType BMSChartReader::DetermineStepsType() int BMSChartReader::GetKeysound( const BMSObject &obj ) { - map::iterator it = mapValueToKeysoundIndex.find(obj.value); + std::map::iterator it = mapValueToKeysoundIndex.find(obj.value); if( it == mapValueToKeysoundIndex.end() ) { int index = -1; @@ -1287,7 +1287,7 @@ bool BMSChartReader::ReadNoteData() } } - vector autos; + std::vector autos; for( unsigned i = 0; i < in->objects.size(); i ++ ) { @@ -1482,7 +1482,7 @@ class BMSSongLoader { RString dir; BMSSong song; - vector loadedSteps; + std::vector loadedSteps; public: BMSSongLoader( RString songDir, Song *outSong ); bool Load( RString fileName ); @@ -1656,7 +1656,7 @@ void BMSSongLoader::AddToSong() break; } - map::const_iterator it = main.info.backgroundChanges.begin(); + std::map::const_iterator it = main.info.backgroundChanges.begin(); for (; it != main.info.backgroundChanges.end(); it++) { @@ -1731,7 +1731,7 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out ) ASSERT( out.m_vsKeysoundFile.empty() ); - vector arrayBMSFileNames; + std::vector arrayBMSFileNames; GetApplicableFiles( sDir, arrayBMSFileNames ); /* We should have at least one; if we had none, we shouldn't have been diff --git a/src/NotesLoaderBMS.h b/src/NotesLoaderBMS.h index caf124f07b..ad9fa3207a 100644 --- a/src/NotesLoaderBMS.h +++ b/src/NotesLoaderBMS.h @@ -6,7 +6,7 @@ class Steps; /** @brief Reads a Song from a set of .BMS files. */ namespace BMSLoader { - void GetApplicableFiles( const RString &sPath, vector &out ); + void GetApplicableFiles( const RString &sPath, std::vector &out ); bool LoadFromDir( const RString &sDir, Song &out ); bool LoadNoteDataFromSimfile( const RString & cachePath, Steps &out ); } diff --git a/src/NotesLoaderDWI.cpp b/src/NotesLoaderDWI.cpp index ece1b5fe1f..78e5c34da5 100644 --- a/src/NotesLoaderDWI.cpp +++ b/src/NotesLoaderDWI.cpp @@ -476,7 +476,7 @@ static float ParseBrokenDWITimestamp( const RString &arg1, const RString &arg2, } -void DWILoader::GetApplicableFiles( const RString &sPath, vector &out ) +void DWILoader::GetApplicableFiles( const RString &sPath, std::vector &out ) { GetDirListing( sPath + RString("*.dwi"), out ); } @@ -519,9 +519,9 @@ bool DWILoader::LoadNoteDataFromSimfile( const RString &path, Steps &out ) return false; } -bool DWILoader::LoadFromDir( const RString &sPath_, Song &out, set &BlacklistedImages ) +bool DWILoader::LoadFromDir( const RString &sPath_, Song &out, std::set &BlacklistedImages ) { - vector aFileNames; + std::vector aFileNames; GetApplicableFiles( sPath_, aFileNames ); if( aFileNames.size() > 1 ) @@ -644,12 +644,12 @@ bool DWILoader::LoadFromDir( const RString &sPath_, Song &out, set &Bla else if( sValueName.EqualsNoCase("FREEZE") ) { - vector arrayFreezeExpressions; + std::vector arrayFreezeExpressions; split( sParams[1], ",", arrayFreezeExpressions ); for( unsigned f=0; f arrayFreezeValues; + std::vector arrayFreezeValues; split( arrayFreezeExpressions[f], "=", arrayFreezeValues ); if( arrayFreezeValues.size() != 2 ) { @@ -666,12 +666,12 @@ bool DWILoader::LoadFromDir( const RString &sPath_, Song &out, set &Bla else if( sValueName.EqualsNoCase("CHANGEBPM") || sValueName.EqualsNoCase("BPMCHANGE") ) { - vector arrayBPMChangeExpressions; + std::vector arrayBPMChangeExpressions; split( sParams[1], ",", arrayBPMChangeExpressions ); for( unsigned b=0; b arrayBPMChangeValues; + std::vector arrayBPMChangeValues; split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues ); if( arrayBPMChangeValues.size() != 2 ) { diff --git a/src/NotesLoaderDWI.h b/src/NotesLoaderDWI.h index c121d0dc28..c06a1cc998 100644 --- a/src/NotesLoaderDWI.h +++ b/src/NotesLoaderDWI.h @@ -16,7 +16,7 @@ namespace DWILoader * @param sPath a const reference to the path on the hard drive to check. * @param out a vector of files found in the path. */ - void GetApplicableFiles( const RString &sPath, vector &out ); + void GetApplicableFiles( const RString &sPath, std::vector &out ); /** * @brief Attempt to load a song from a specified path. * @param sPath a const reference to the path on the hard drive to check. @@ -24,7 +24,7 @@ namespace DWILoader * @param BlacklistedImages a set of images that aren't used. * @return its success or failure. */ - bool LoadFromDir( const RString &sPath, Song &out, set &BlacklistedImages ); + bool LoadFromDir( const RString &sPath, Song &out, std::set &BlacklistedImages ); bool LoadNoteDataFromSimfile( const RString &path, Steps &out ); } diff --git a/src/NotesLoaderJson.cpp b/src/NotesLoaderJson.cpp index a57fbcb404..537255a959 100644 --- a/src/NotesLoaderJson.cpp +++ b/src/NotesLoaderJson.cpp @@ -10,7 +10,7 @@ #include "Steps.h" #include "GameManager.h" -void NotesLoaderJson::GetApplicableFiles( const RString &sPath, vector &out ) +void NotesLoaderJson::GetApplicableFiles( const RString &sPath, std::vector &out ) { GetDirListing( sPath + RString("*.json"), out ); } @@ -47,8 +47,8 @@ static void Deserialize(StopSegment &seg, const Json::Value &root) static void Deserialize(TimingData &td, const Json::Value &root) { - vector vBPMs; - vector vStops; + std::vector vBPMs; + std::vector vStops; JsonUtil::DeserializeVectorPointers( vBPMs, Deserialize, root["BpmSegments"] ); JsonUtil::DeserializeVectorPointers( vStops, Deserialize, root["StopSegments"] ); @@ -204,20 +204,20 @@ static void Deserialize( Song &out, const Json::Value &root ) FOREACH_BackgroundLayer( bl ) { const Json::Value &root3 = root2[bl]; - vector &vBgc = out.GetBackgroundChanges(bl); + std::vector &vBgc = out.GetBackgroundChanges(bl); JsonUtil::DeserializeVectorObjects( vBgc, Deserialize, root3 ); } } { - vector &vBgc = out.GetForegroundChanges(); + std::vector &vBgc = out.GetForegroundChanges(); JsonUtil::DeserializeVectorObjects( vBgc, Deserialize, root["ForegroundChanges"] ); } out.m_vsKeysoundFile = JsonUtil::DeserializeArrayStrings(root["KeySounds"]); { - vector vpSteps; + std::vector vpSteps; JsonUtil::DeserializeVectorPointersParam( vpSteps, Deserialize, root["Charts"], &out ); for (Steps *step : vpSteps) out.AddSteps( step ); diff --git a/src/NotesLoaderJson.h b/src/NotesLoaderJson.h index c96629ffd8..693907c10b 100644 --- a/src/NotesLoaderJson.h +++ b/src/NotesLoaderJson.h @@ -8,7 +8,7 @@ class Song; namespace NotesLoaderJson { - void GetApplicableFiles( const RString &sPath, vector &out ); + void GetApplicableFiles( const RString &sPath, std::vector &out ); bool LoadFromDir( const RString &sPath, Song &out ); bool LoadFromJsonFile( const RString &sPath, Song &out ); }; diff --git a/src/NotesLoaderKSF.cpp b/src/NotesLoaderKSF.cpp index 5b063956e5..132d00d7c2 100644 --- a/src/NotesLoaderKSF.cpp +++ b/src/NotesLoaderKSF.cpp @@ -35,7 +35,7 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, Song &song, bool int iTickCount = -1; // used to adapt weird tickcounts //float fScrollRatio = 1.0f; -- uncomment when ready to use. - vector vNoteRows; + std::vector vNoteRows; // According to Aldo_MX, there is a default BPM and it's 60. -aj bool bDoublesChart = false; @@ -141,14 +141,14 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, Song &song, bool else if( sValueName=="DIFFICULTY" ) { - out.SetMeter( max(StringToInt(sParams[1]), 1) ); + out.SetMeter( std::max(StringToInt(sParams[1]), 1) ); } // new cases from Aldo_MX's fork: else if( sValueName=="PLAYER" ) { RString sPlayer = sParams[1]; sPlayer.MakeLower(); - if( sPlayer.find( "double" ) != string::npos ) + if( sPlayer.find( "double" ) != std::string::npos ) bDoublesChart = true; } // This should always be last. @@ -189,48 +189,48 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, Song &song, bool out.SetDescription(sFName); // Check another before anything else... is this okay? -DaisuMaster - if( sFName.find("another") != string::npos ) + if( sFName.find("another") != std::string::npos ) { out.SetDifficulty( Difficulty_Edit ); if( !out.GetMeter() ) out.SetMeter( 25 ); } - else if(sFName.find("wild") != string::npos || - sFName.find("wd") != string::npos || - sFName.find("crazy+") != string::npos || - sFName.find("cz+") != string::npos || - sFName.find("hardcore") != string::npos ) + else if(sFName.find("wild") != std::string::npos || + sFName.find("wd") != std::string::npos || + sFName.find("crazy+") != std::string::npos || + sFName.find("cz+") != std::string::npos || + sFName.find("hardcore") != std::string::npos ) { out.SetDifficulty( Difficulty_Challenge ); if( !out.GetMeter() ) out.SetMeter( 20 ); } - else if(sFName.find("crazy") != string::npos || - sFName.find("cz") != string::npos || - sFName.find("nightmare") != string::npos || - sFName.find("nm") != string::npos || - sFName.find("crazydouble") != string::npos ) + else if(sFName.find("crazy") != std::string::npos || + sFName.find("cz") != std::string::npos || + sFName.find("nightmare") != std::string::npos || + sFName.find("nm") != std::string::npos || + sFName.find("crazydouble") != std::string::npos ) { out.SetDifficulty( Difficulty_Hard ); if( !out.GetMeter() ) out.SetMeter( 14 ); // Set the meters to the Pump scale, not DDR. } - else if(sFName.find("hard") != string::npos || - sFName.find("hd") != string::npos || - sFName.find("freestyle") != string::npos || - sFName.find("fs") != string::npos || - sFName.find("double") != string::npos ) + else if(sFName.find("hard") != std::string::npos || + sFName.find("hd") != std::string::npos || + sFName.find("freestyle") != std::string::npos || + sFName.find("fs") != std::string::npos || + sFName.find("double") != std::string::npos ) { out.SetDifficulty( Difficulty_Medium ); if( !out.GetMeter() ) out.SetMeter( 8 ); } - else if(sFName.find("easy") != string::npos || - sFName.find("ez") != string::npos || - sFName.find("normal") != string::npos ) + else if(sFName.find("easy") != std::string::npos || + sFName.find("ez") != std::string::npos || + sFName.find("normal") != std::string::npos ) { // I wonder if I should leave easy fall into the Beginner difficulty... -DaisuMaster out.SetDifficulty( Difficulty_Easy ); if( !out.GetMeter() ) out.SetMeter( 4 ); } - else if(sFName.find("beginner") != string::npos || - sFName.find("practice") != string::npos || sFName.find("pr") != string::npos ) + else if(sFName.find("beginner") != std::string::npos || + sFName.find("practice") != std::string::npos || sFName.find("pr") != std::string::npos ) { out.SetDifficulty( Difficulty_Beginner ); if( !out.GetMeter() ) out.SetMeter( 4 ); @@ -244,22 +244,22 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, Song &song, bool out.m_StepsType = StepsType_pump_single; // Check for "halfdouble" before "double". - if(sFName.find("halfdouble") != string::npos || - sFName.find("half-double") != string::npos || - sFName.find("h_double") != string::npos || - sFName.find("hdb") != string::npos ) + if(sFName.find("halfdouble") != std::string::npos || + sFName.find("half-double") != std::string::npos || + sFName.find("h_double") != std::string::npos || + sFName.find("hdb") != std::string::npos ) out.m_StepsType = StepsType_pump_halfdouble; // Handle bDoublesChart from above as well. -aj - else if(sFName.find("double") != string::npos || - sFName.find("nightmare") != string::npos || - sFName.find("freestyle") != string::npos || - sFName.find("db") != string::npos || - sFName.find("nm") != string::npos || - sFName.find("fs") != string::npos || bDoublesChart ) + else if(sFName.find("double") != std::string::npos || + sFName.find("nightmare") != std::string::npos || + sFName.find("freestyle") != std::string::npos || + sFName.find("db") != std::string::npos || + sFName.find("nm") != std::string::npos || + sFName.find("fs") != std::string::npos || bDoublesChart ) out.m_StepsType = StepsType_pump_double; - else if( sFName.find("_1") != string::npos ) + else if( sFName.find("_1") != std::string::npos ) out.m_StepsType = StepsType_pump_single; - else if( sFName.find("_2") != string::npos ) + else if( sFName.find("_2") != std::string::npos ) out.m_StepsType = StepsType_pump_couple; } @@ -472,7 +472,7 @@ static void LoadTags( const RString &str, Song &out ) { /* str is either a #TITLE or a directory component. Fill in missing information. * str is either "title", "artist - title", or "artist - title - difficulty". */ - vector asBits; + std::vector asBits; split( str, " - ", asBits, false ); // Ignore the difficulty, since we get that elsewhere. if( asBits.size() == 3 && ( @@ -535,7 +535,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant // changed up there in case of something is found inside the SONGFILE tag in the head ksf -DaisuMaster // search for music with song in the file name - vector arrayPossibleMusic; + std::vector arrayPossibleMusic; GetDirListing( out.GetSongDir() + RString("song.mp3"), arrayPossibleMusic ); GetDirListing( out.GetSongDir() + RString("song.oga"), arrayPossibleMusic ); GetDirListing( out.GetSongDir() + RString("song.ogg"), arrayPossibleMusic ); @@ -548,7 +548,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant float SMGap1 = 0, SMGap2 = 0, BPM1 = -1, BPMPos2 = -1, BPM2 = -1, BPMPos3 = -1, BPM3 = -1; int iTickCount = -1; bKIUCompliant = false; - vector vNoteRows; + std::vector vNoteRows; for( unsigned i=0; i < msd.GetNumValues(); i++ ) { @@ -705,7 +705,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant // Try to fill in missing bits of information from the pathname. { - vector asBits; + std::vector asBits; split( sPath, "/", asBits, true); ASSERT( asBits.size() > 1 ); @@ -715,7 +715,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant return true; } -void KSFLoader::GetApplicableFiles( const RString &sPath, vector &out ) +void KSFLoader::GetApplicableFiles( const RString &sPath, std::vector &out ) { GetDirListing( sPath + RString("*.ksf"), out ); } @@ -740,7 +740,7 @@ bool KSFLoader::LoadFromDir( const RString &sDir, Song &out ) { LOG->Trace( "KSFLoader::LoadFromDir(%s)", sDir.c_str() ); - vector arrayKSFFileNames; + std::vector arrayKSFFileNames; GetDirListing( sDir + RString("*.ksf"), arrayKSFFileNames ); // We shouldn't have been called to begin with if there were no KSFs. diff --git a/src/NotesLoaderKSF.h b/src/NotesLoaderKSF.h index 650f7aa44f..031107fccf 100644 --- a/src/NotesLoaderKSF.h +++ b/src/NotesLoaderKSF.h @@ -6,7 +6,7 @@ class Steps; /** @brief Reads a Song from a set of .KSF files. */ namespace KSFLoader { - void GetApplicableFiles( const RString &sPath, vector &out ); + void GetApplicableFiles( const RString &sPath, std::vector &out ); bool LoadFromDir( const RString &sDir, Song &out ); bool LoadNoteDataFromSimfile( const RString & cachePath, Steps &out ); } diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index 9d09e6a74f..c6513b7d48 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -24,7 +24,7 @@ struct SMSongTagInfo Song* song; const MsdFile::value_t* params; const RString& path; - vector< pair > BPMChanges, Stops; + std::vector> BPMChanges, Stops; SMSongTagInfo(SMLoader* l, Song* s, const RString& p) :loader(l), song(s), path(p) {} @@ -261,7 +261,7 @@ RString SMLoader::GetSongTitle() const bool SMLoader::LoadFromDir( const RString &sPath, Song &out, bool load_autosave ) { - vector aFileNames; + std::vector aFileNames; GetApplicableFiles( sPath, aFileNames, load_autosave ); return LoadFromSimfile( sPath + aFileNames[0], out ); } @@ -368,7 +368,7 @@ void SMLoader::ProcessBGChanges( Song &out, const RString &sValueName, const RSt } } -void SMLoader::ProcessAttackString( vector & attacks, MsdFile::value_t params ) +void SMLoader::ProcessAttackString( std::vector & attacks, MsdFile::value_t params ) { for( unsigned s=1; s < params.params.size(); ++s ) { @@ -386,7 +386,7 @@ void SMLoader::ProcessAttacks( AttackArray &attacks, MsdFile::value_t params ) for( unsigned j=1; j < params.params.size(); ++j ) { - vector sBits; + std::vector sBits; split( params[j], "=", sBits, false ); // Need an identifer and a value for this to work @@ -422,11 +422,11 @@ void SMLoader::ProcessAttacks( AttackArray &attacks, MsdFile::value_t params ) void SMLoader::ProcessInstrumentTracks( Song &out, const RString &sParam ) { - vector vs1; + std::vector vs1; split( sParam, ",", vs1 ); for (RString const &s : vs1) { - vector vs2; + std::vector vs2; split( s, "=", vs2 ); if( vs2.size() >= 2 ) { @@ -437,14 +437,14 @@ void SMLoader::ProcessInstrumentTracks( Song &out, const RString &sParam ) } } -void SMLoader::ParseBPMs( vector< pair > &out, const RString line, const int rowsPerBeat ) +void SMLoader::ParseBPMs( std::vector> &out, const RString line, const int rowsPerBeat ) { - vector arrayBPMChangeExpressions; + std::vector arrayBPMChangeExpressions; split( line, ",", arrayBPMChangeExpressions ); for( unsigned b=0; b arrayBPMChangeValues; + std::vector arrayBPMChangeValues; split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues ); if( arrayBPMChangeValues.size() != 2 ) { @@ -463,18 +463,18 @@ void SMLoader::ParseBPMs( vector< pair > &out, const RString line, continue; } - out.push_back( make_pair(fBeat, fNewBPM) ); + out.push_back( std::make_pair(fBeat, fNewBPM) ); } } -void SMLoader::ParseStops( vector< pair > &out, const RString line, const int rowsPerBeat ) +void SMLoader::ParseStops( std::vector> &out, const RString line, const int rowsPerBeat ) { - vector arrayFreezeExpressions; + std::vector arrayFreezeExpressions; split( line, ",", arrayFreezeExpressions ); for( unsigned f=0; f arrayFreezeValues; + std::vector arrayFreezeValues; split( arrayFreezeExpressions[f], "=", arrayFreezeValues ); if( arrayFreezeValues.size() != 2 ) { @@ -493,13 +493,13 @@ void SMLoader::ParseStops( vector< pair > &out, const RString line continue; } - out.push_back( make_pair(fFreezeBeat, fFreezeSeconds) ); + out.push_back( std::make_pair(fFreezeBeat, fFreezeSeconds) ); } } // Utility function for sorting timing change data namespace { - bool compare_first(pair a, pair b) { + bool compare_first(std::pair a, std::pair b) { return a.first < b.first; } } @@ -509,11 +509,11 @@ namespace { // Postcondition: all BPM changes, stops, and warps are added to the out // parameter, already sorted by beat. void SMLoader::ProcessBPMsAndStops(TimingData &out, - vector< pair > &vBPMs, - vector< pair > &vStops) + std::vector> &vBPMs, + std::vector> &vStops) { - vector< pair >::const_iterator ibpm, ibpmend; - vector< pair >::const_iterator istop, istopend; + std::vector>::const_iterator ibpm, ibpmend; + std::vector>::const_iterator istop, istopend; // Current BPM (positive or negative) float bpm = 0; @@ -595,7 +595,7 @@ void SMLoader::ProcessBPMsAndStops(TimingData &out, // Get the next change in order, with BPMs taking precedence // when they fall on the same beat. bool changeIsBpm = istop == istopend || (ibpm != ibpmend && ibpm->first <= istop->first); - const pair & change = changeIsBpm ? *ibpm : *istop; + const std::pair & change = changeIsBpm ? *ibpm : *istop; // Calculate the effects of time at the current BPM. "Infinite" // BPMs (SM4 warps) imply that zero time passes, so skip this @@ -735,12 +735,12 @@ void SMLoader::ProcessBPMsAndStops(TimingData &out, void SMLoader::ProcessDelays( TimingData &out, const RString line, const int rowsPerBeat ) { - vector arrayDelayExpressions; + std::vector arrayDelayExpressions; split( line, ",", arrayDelayExpressions ); for( unsigned f=0; f arrayDelayValues; + std::vector arrayDelayValues; split( arrayDelayExpressions[f], "=", arrayDelayValues ); if( arrayDelayValues.size() != 2 ) { @@ -767,12 +767,12 @@ void SMLoader::ProcessDelays( TimingData &out, const RString line, const int row void SMLoader::ProcessTimeSignatures( TimingData &out, const RString line, const int rowsPerBeat ) { - vector vs1; + std::vector vs1; split( line, ",", vs1 ); for (RString const &s1 : vs1) { - vector vs2; + std::vector vs2; split( s1, "=", vs2 ); if( vs2.size() < 3 ) @@ -821,12 +821,12 @@ void SMLoader::ProcessTimeSignatures( TimingData &out, const RString line, const void SMLoader::ProcessTickcounts( TimingData &out, const RString line, const int rowsPerBeat ) { - vector arrayTickcountExpressions; + std::vector arrayTickcountExpressions; split( line, ",", arrayTickcountExpressions ); for( unsigned f=0; f arrayTickcountValues; + std::vector arrayTickcountValues; split( arrayTickcountExpressions[f], "=", arrayTickcountValues ); if( arrayTickcountValues.size() != 2 ) { @@ -846,12 +846,12 @@ void SMLoader::ProcessTickcounts( TimingData &out, const RString line, const int void SMLoader::ProcessSpeeds( TimingData &out, const RString line, const int rowsPerBeat ) { - vector vs1; + std::vector vs1; split( line, ",", vs1 ); for (RString const &s1 : vs1) { - vector vs2; + std::vector vs2; split( s1, "=", vs2 ); if( vs2[0] == 0 && vs2.size() == 2 ) // First one always seems to have 2. @@ -906,12 +906,12 @@ void SMLoader::ProcessSpeeds( TimingData &out, const RString line, const int row void SMLoader::ProcessFakes( TimingData &out, const RString line, const int rowsPerBeat ) { - vector arrayFakeExpressions; + std::vector arrayFakeExpressions; split( line, ",", arrayFakeExpressions ); for( unsigned b=0; b arrayFakeValues; + std::vector arrayFakeValues; split( arrayFakeExpressions[b], "=", arrayFakeValues ); if( arrayFakeValues.size() != 2 ) { @@ -939,7 +939,7 @@ void SMLoader::ProcessFakes( TimingData &out, const RString line, const int rows bool SMLoader::LoadFromBGChangesVector( BackgroundChange &change, std::vector aBGChangeValues ) { - aBGChangeValues.resize( min((int)aBGChangeValues.size(),11) ); + aBGChangeValues.resize( std::min((int) aBGChangeValues.size(), 11) ); switch( aBGChangeValues.size() ) { @@ -960,7 +960,7 @@ bool SMLoader::LoadFromBGChangesVector( BackgroundChange &change, std::vectorm_bQuirksMode ) { return false; @@ -1004,7 +1004,7 @@ bool SMLoader::LoadFromBGChangesVector( BackgroundChange &change, std::vectorm_bQuirksMode ) { return false; @@ -1281,7 +1281,7 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath return false; } -void SMLoader::GetApplicableFiles( const RString &sPath, vector &out, bool load_autosave ) +void SMLoader::GetApplicableFiles( const RString &sPath, std::vector &out, bool load_autosave ) { if(load_autosave) { @@ -1305,7 +1305,7 @@ void SMLoader::TidyUpData( Song &song, bool bFromCache ) * have to add an explicit song BG tag if they want it. This is really a * formatting hack only; nothing outside of SMLoader ever sees "-nosongbg-". */ - vector &bg = song.GetBackgroundChanges(BACKGROUND_LAYER_1); + std::vector &bg = song.GetBackgroundChanges(BACKGROUND_LAYER_1); if( !bg.empty() ) { /* BGChanges have been sorted. On the odd chance that a BGChange exists diff --git a/src/NotesLoaderSM.h b/src/NotesLoaderSM.h index 72de0e15ce..a6bb8f924b 100644 --- a/src/NotesLoaderSM.h +++ b/src/NotesLoaderSM.h @@ -61,7 +61,7 @@ struct SMLoader * @param sPath a const reference to the path on the hard drive to check. * @param out a vector of files found in the path. */ - virtual void GetApplicableFiles( const RString &sPath, vector &out, bool load_autosave= false ); + virtual void GetApplicableFiles( const RString &sPath, std::vector &out, bool load_autosave= false ); virtual bool LoadEditFromFile( RString sEditFilePath, ProfileSlot slot, bool bAddStepsToSong, Song *givenSong=nullptr ); virtual bool LoadEditFromBuffer( const RString &sBuffer, const RString &sEditFilePath, ProfileSlot slot, Song *givenSong=nullptr ); virtual bool LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath, ProfileSlot slot, bool bAddStepsToSong, Song *givenSong=nullptr ); @@ -72,7 +72,7 @@ struct SMLoader * @param out the vector to put the data in. * @param line the string in question. * @param rowsPerBeat the number of rows per beat for this purpose. */ - void ParseBPMs(vector< pair > &out, + void ParseBPMs(std::vector> &out, const RString line, const int rowsPerBeat = -1); /** @@ -80,13 +80,13 @@ struct SMLoader * @param out the TimingData being modified. * @param vBPMChanges the vector of BPM Changes data. */ void ProcessBPMs(TimingData & out, - const vector< pair > &vBPMChanges); + const std::vector> &vBPMChanges); /** * @brief Parse Stops data from a string. * @param out the vector to put the data in. * @param line the string in question. * @param rowsPerBeat the number of rows per beat for this purpose. */ - void ParseStops(vector< pair > &out, + void ParseStops(std::vector> &out, const RString line, const int rowsPerBeat = -1); /** @@ -94,15 +94,15 @@ struct SMLoader * @param out the TimingData being modified. * @param vStops the vector of Stops data. */ void ProcessStops(TimingData & out, - const vector< pair > &vStops); + const std::vector> &vStops); /** * @brief Process BPM and stop segments from the data. * @param out the TimingData being modified. * @param vBPMs the vector of BPM changes. * @param vStops the vector of stops. */ void ProcessBPMsAndStops(TimingData &out, - vector< pair > &vBPMs, - vector< pair > &vStops); + std::vector< std::pair> &vBPMs, + std::vector< std::pair> &vStops); /** * @brief Process the Delay Segments from the string. * @param out the TimingData being modified. @@ -159,7 +159,7 @@ struct SMLoader * @brief Put the attacks in the attacks string. * @param attacks the attack string. * @param params the params from the simfile. */ - virtual void ProcessAttackString(vector &attacks, MsdFile::value_t params); + virtual void ProcessAttackString(std::vector &attacks, MsdFile::value_t params); /** * @brief Put the attacks in the attacks array. diff --git a/src/NotesLoaderSMA.cpp b/src/NotesLoaderSMA.cpp index 67c672a107..05149d8060 100644 --- a/src/NotesLoaderSMA.cpp +++ b/src/NotesLoaderSMA.cpp @@ -16,12 +16,12 @@ void SMALoader::ProcessMultipliers( TimingData &out, const int iRowsPerBeat, const RString sParam ) { - vector arrayMultiplierExpressions; + std::vector arrayMultiplierExpressions; split( sParam, ",", arrayMultiplierExpressions ); for( unsigned f=0; f arrayMultiplierValues; + std::vector arrayMultiplierValues; split( arrayMultiplierExpressions[f], "=", arrayMultiplierValues ); unsigned size = arrayMultiplierValues.size(); if( size < 2 ) @@ -44,12 +44,12 @@ void SMALoader::ProcessMultipliers( TimingData &out, const int iRowsPerBeat, con void SMALoader::ProcessBeatsPerMeasure( TimingData &out, const RString sParam ) { - vector vs1; + std::vector vs1; split( sParam, ",", vs1 ); for (RString const &s1 : vs1) { - vector vs2; + std::vector vs2; split( s1, "=", vs2 ); if( vs2.size() < 2 ) @@ -86,12 +86,12 @@ void SMALoader::ProcessBeatsPerMeasure( TimingData &out, const RString sParam ) void SMALoader::ProcessSpeeds( TimingData &out, const RString line, const int rowsPerBeat ) { - vector vs1; + std::vector vs1; split( line, ",", vs1 ); for (std::vector::const_iterator s1 = vs1.begin(); s1 != vs1.end(); ++s1) { - vector vs2; + std::vector vs2; vs2.clear(); // trying something. RString loopTmp = *s1; Trim( loopTmp ); @@ -163,7 +163,7 @@ bool SMALoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach Steps* pNewNotes = nullptr; int iRowsPerBeat = -1; // Start with an invalid value: needed for checking. - vector< pair > vBPMChanges, vStops; + std::vector> vBPMChanges, vStops; for( unsigned i=0; i arrayBeatChangeExpressions; + std::vector arrayBeatChangeExpressions; split( sParams[1], ",", arrayBeatChangeExpressions ); - - vector arrayBeatChangeValues; + + std::vector arrayBeatChangeValues; split( arrayBeatChangeExpressions[0], "=", arrayBeatChangeValues ); iRowsPerBeat = StringToInt(arrayBeatChangeValues[1]); } diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index 5bb053210a..d7f00e1d0a 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -357,7 +357,7 @@ void SetRadarValues(StepsTagInfo& info) { if(info.from_cache || info.for_load_edit) { - vector values; + std::vector values; split((*info.params)[1], ",", values, true); // Instead of trying to use the version to figure out how many // categories to expect, look at the number of values and split them @@ -643,12 +643,12 @@ ssc_parser_helper_t parser_helper; void SSCLoader::ProcessBPMs( TimingData &out, const RString sParam ) { - vector arrayBPMExpressions; + std::vector arrayBPMExpressions; split( sParam, ",", arrayBPMExpressions ); for( unsigned b=0; b arrayBPMValues; + std::vector arrayBPMValues; split( arrayBPMExpressions[b], "=", arrayBPMValues ); if( arrayBPMValues.size() != 2 ) { @@ -677,12 +677,12 @@ void SSCLoader::ProcessBPMs( TimingData &out, const RString sParam ) void SSCLoader::ProcessStops( TimingData &out, const RString sParam ) { - vector arrayStopExpressions; + std::vector arrayStopExpressions; split( sParam, ",", arrayStopExpressions ); for( unsigned b=0; b arrayStopValues; + std::vector arrayStopValues; split( arrayStopExpressions[b], "=", arrayStopValues ); if( arrayStopValues.size() != 2 ) { @@ -709,12 +709,12 @@ void SSCLoader::ProcessStops( TimingData &out, const RString sParam ) void SSCLoader::ProcessWarps( TimingData &out, const RString sParam, const float fVersion ) { - vector arrayWarpExpressions; + std::vector arrayWarpExpressions; split( sParam, ",", arrayWarpExpressions ); for( unsigned b=0; b arrayWarpValues; + std::vector arrayWarpValues; split( arrayWarpExpressions[b], "=", arrayWarpValues ); if( arrayWarpValues.size() != 2 ) { @@ -746,12 +746,12 @@ void SSCLoader::ProcessWarps( TimingData &out, const RString sParam, const float void SSCLoader::ProcessLabels( TimingData &out, const RString sParam ) { - vector arrayLabelExpressions; + std::vector arrayLabelExpressions; split( sParam, ",", arrayLabelExpressions ); for( unsigned b=0; b arrayLabelValues; + std::vector arrayLabelValues; split( arrayLabelExpressions[b], "=", arrayLabelValues ); if( arrayLabelValues.size() != 2 ) { @@ -780,12 +780,12 @@ void SSCLoader::ProcessLabels( TimingData &out, const RString sParam ) void SSCLoader::ProcessCombos( TimingData &out, const RString line, const int rowsPerBeat ) { - vector arrayComboExpressions; + std::vector arrayComboExpressions; split( line, ",", arrayComboExpressions ); for( unsigned f=0; f arrayComboValues; + std::vector arrayComboValues; split( arrayComboExpressions[f], "=", arrayComboValues ); unsigned size = arrayComboValues.size(); if( size < 2 ) @@ -805,12 +805,12 @@ void SSCLoader::ProcessCombos( TimingData &out, const RString line, const int ro void SSCLoader::ProcessScrolls( TimingData &out, const RString sParam ) { - vector vs1; + std::vector vs1; split( sParam, ",", vs1 ); for (RString const &s1 : vs1) { - vector vs2; + std::vector vs2; split( s1, "=", vs2 ); if( vs2.size() < 2 ) diff --git a/src/NotesWriterDWI.cpp b/src/NotesWriterDWI.cpp index 01b96ceb3d..ad46d738f1 100644 --- a/src/NotesWriterDWI.cpp +++ b/src/NotesWriterDWI.cpp @@ -20,8 +20,8 @@ RString OptimizeDWIString( RString holds, RString taps ); * @return the one singular character. */ static char OptimizeDWIPair( char c1, char c2 ) { - typedef pair cpair; - static map< cpair, char > joins; + typedef std::pair cpair; + static std::map joins; static bool Initialized = false; if(!Initialized) { @@ -45,9 +45,9 @@ static char OptimizeDWIPair( char c1, char c2 ) } if( c1 > c2 ) - swap( c1, c2 ); - - map< cpair, char >::const_iterator it = joins.find( cpair(c1, c2) ); + std::swap( c1, c2 ); + + std::map::const_iterator it = joins.find( cpair(c1, c2) ); ASSERT( it != joins.end() ); return it->second; @@ -355,7 +355,7 @@ bool NotesWriterDWI::Write( RString sPath, const Song &out ) f.PutLine( ssprintf("#TITLE:%s;", DwiEscape(out.GetTranslitFullTitle()).c_str()) ); f.PutLine( ssprintf("#ARTIST:%s;", DwiEscape(out.GetTranslitArtist()).c_str()) ); - const vector &bpms = out.m_SongTiming.GetTimingSegments(SEGMENT_BPM); + const std::vector &bpms = out.m_SongTiming.GetTimingSegments(SEGMENT_BPM); ASSERT_M(bpms[0]->GetRow() == 0, ssprintf("The first BPM Segment must be defined at row 0, not %d!", bpms[0]->GetRow()) ); f.PutLine( ssprintf("#FILE:%s;", DwiEscape(out.m_sMusicFile).c_str()) ); @@ -384,7 +384,7 @@ bool NotesWriterDWI::Write( RString sPath, const Song &out ) } // TODO: Also check for delays, add them as stops minus one row? - const vector &stops = out.m_SongTiming.GetTimingSegments(SEGMENT_STOP); + const std::vector &stops = out.m_SongTiming.GetTimingSegments(SEGMENT_STOP); if( !stops.empty() ) { f.Write( "#FREEZE:" ); @@ -413,7 +413,7 @@ bool NotesWriterDWI::Write( RString sPath, const Song &out ) f.PutLine( ";" ); } - const vector& vpSteps = out.GetAllSteps(); + const std::vector& vpSteps = out.GetAllSteps(); for( unsigned i=0; i &vBgc = out.GetBackgroundChanges(bl); + const std::vector &vBgc = out.GetBackgroundChanges(bl); JsonUtil::SerializeVectorObjects( vBgc, Serialize, root3 ); } } { - const vector &vBgc = out.GetForegroundChanges(); + const std::vector &vBgc = out.GetForegroundChanges(); JsonUtil::SerializeVectorObjects( vBgc, Serialize, root["ForegroundChanges"] ); } @@ -182,7 +182,7 @@ bool NotesWriterJson::WriteSong( const RString &sFile, const Song &out, bool bWr if( bWriteSteps ) { - vector vpSteps; + std::vector vpSteps; for (Steps * iter : out.GetAllSteps()) { if( iter->IsAutogen() ) diff --git a/src/NotesWriterSM.cpp b/src/NotesWriterSM.cpp index f5c8c9eb41..980455b6bd 100644 --- a/src/NotesWriterSM.cpp +++ b/src/NotesWriterSM.cpp @@ -77,7 +77,7 @@ static void WriteGlobalTags( RageFileBasic &f, Song &out ) f.Write( "#BPMS:" ); - const vector &bpms = timing.GetTimingSegments(SEGMENT_BPM); + const std::vector &bpms = timing.GetTimingSegments(SEGMENT_BPM); for( unsigned i=0; i &stops = timing.GetTimingSegments(SEGMENT_STOP); - const vector &delays = timing.GetTimingSegments(SEGMENT_DELAY); + const std::vector &stops = timing.GetTimingSegments(SEGMENT_STOP); + const std::vector &delays = timing.GetTimingSegments(SEGMENT_DELAY); - map allPauses; - const vector &warps = timing.GetTimingSegments(SEGMENT_WARP); + std::map allPauses; + const std::vector &warps = timing.GetTimingSegments(SEGMENT_WARP); unsigned wSize = warps.size(); if( wSize > 0 ) { @@ -111,14 +111,14 @@ static void WriteGlobalTags( RageFileBasic &f, Song &out ) const StopSegment *fs = ToStop( stops[i] ); // Handle warps on the same row by summing the values. Not sure this // plays out the same. -Kyz - map::iterator already_exists= allPauses.find(fs->GetBeat()); + std::map::iterator already_exists= allPauses.find(fs->GetBeat()); if(already_exists != allPauses.end()) { already_exists->second+= fs->GetPause(); } else { - allPauses.insert(pair(fs->GetBeat(), fs->GetPause())); + allPauses.insert(std::pair(fs->GetBeat(), fs->GetPause())); } } // Delays can't be negative: thus, no effect. @@ -126,19 +126,19 @@ static void WriteGlobalTags( RageFileBasic &f, Song &out ) { float fBeat = NoteRowToBeat( ss->GetRow()-1 ); float fPause = ToDelay(ss)->GetPause(); - map::iterator already_exists= allPauses.find(fBeat); + std::map::iterator already_exists= allPauses.find(fBeat); if(already_exists != allPauses.end()) { already_exists->second+= fPause; } else { - allPauses.insert(pair(fBeat, fPause)); + allPauses.insert(std::pair(fBeat, fPause)); } } f.Write( "#STOPS:" ); - vector stopLines; + std::vector stopLines; for (std::pair ap : allPauses) { stopLines.push_back(ssprintf("%.6f=%.6f", ap.first, ap.second)); @@ -194,7 +194,7 @@ static void WriteGlobalTags( RageFileBasic &f, Song &out ) * @brief Turn a vector of lines into a single line joined by newline characters. * @param lines the list of lines to join. * @return the joined lines. */ -static RString JoinLineList( vector &lines ) +static RString JoinLineList( std::vector &lines ) { for( unsigned i = 0; i < lines.size(); ++i ) TrimRight( lines[i] ); @@ -214,7 +214,7 @@ static RString JoinLineList( vector &lines ) * @return the #NOTES tag. */ static RString GetSMNotesTag( const Song &song, const Steps &in ) { - vector lines; + std::vector lines; lines.push_back( "" ); // Escape to prevent some clown from making a comment of "\r\n;" @@ -227,7 +227,7 @@ static RString GetSMNotesTag( const Song &song, const Steps &in ) lines.push_back( ssprintf( " %s:", DifficultyToString(in.GetDifficulty()).c_str() ) ); lines.push_back( ssprintf( " %d:", in.GetMeter() ) ); - vector asRadarValues; + std::vector asRadarValues; // OpenITG simfiles use 11 radar categories. int categories = 11; FOREACH_PlayerNumber( pn ) @@ -251,7 +251,7 @@ static RString GetSMNotesTag( const Song &song, const Steps &in ) return JoinLineList( lines ); } -bool NotesWriterSM::Write( RString sPath, Song &out, const vector& vpStepsToSave ) +bool NotesWriterSM::Write( RString sPath, Song &out, const std::vector& vpStepsToSave ) { int flags = RageFile::WRITE; @@ -267,7 +267,7 @@ bool NotesWriterSM::Write( RString sPath, Song &out, const vector& vpSte return Write( f, out, vpStepsToSave ); } -bool NotesWriterSM::Write( RageFileBasic &f, Song &out, const vector& vpStepsToSave ) +bool NotesWriterSM::Write( RageFileBasic &f, Song &out, const std::vector& vpStepsToSave ) { WriteGlobalTags( f, out ); @@ -288,7 +288,7 @@ void NotesWriterSM::GetEditFileContents( const Song *pSong, const Steps *pSteps, RString sDir = pSong->GetSongDir(); // "Songs/foo/bar"; strip off "Songs/". - vector asParts; + std::vector asParts; split( sDir, "/", asParts ); if( asParts.size() ) sDir = join( "/", asParts.begin()+1, asParts.end() ); diff --git a/src/NotesWriterSM.h b/src/NotesWriterSM.h index 705a884c93..769b50f420 100644 --- a/src/NotesWriterSM.h +++ b/src/NotesWriterSM.h @@ -12,8 +12,8 @@ namespace NotesWriterSM * @param sPath the path to write the file. * @param out the Song to be written out. * @return its success or failure. */ - bool Write( RageFileBasic &file, Song &out, const vector& vpStepsToSave ); - bool Write( RString sPath, Song &out, const vector& vpStepsToSave ); + bool Write( RageFileBasic &file, Song &out, const std::vector& vpStepsToSave ); + bool Write( RString sPath, Song &out, const std::vector& vpStepsToSave ); /** * @brief Get some contents about the edit file first. * @param pSong the Song in question. diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index 2abe6376fd..d7a05ea89d 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -19,7 +19,7 @@ * @brief Turn a vector of lines into a single line joined by newline characters. * @param lines the list of lines to join. * @return the joined lines. */ -static RString JoinLineList( vector &lines ) +static RString JoinLineList( std::vector &lines ) { for( unsigned i = 0; i < lines.size(); ++i ) TrimRight( lines[i] ); @@ -36,10 +36,10 @@ static RString JoinLineList( vector &lines ) // A utility class to write timing tags more easily! struct TimingTagWriter { - vector *m_pvsLines; + std::vector *m_pvsLines; RString m_sNext; - TimingTagWriter( vector *pvsLines ): m_pvsLines (pvsLines) { } + TimingTagWriter( std::vector* pvsLines ): m_pvsLines (pvsLines) { } void Write( const int row, const char *value ) { @@ -59,7 +59,7 @@ struct TimingTagWriter { }; -static void GetTimingTags( vector &lines, const TimingData &timing, bool bIsSong = false ) +static void GetTimingTags( std::vector &lines, const TimingData &timing, bool bIsSong = false ) { TimingTagWriter w ( &lines ); @@ -67,7 +67,7 @@ static void GetTimingTags( vector &lines, const TimingData &timing, boo unsigned i = 0; w.Init( "BPMS" ); - const vector &bpms = timing.GetTimingSegments(SEGMENT_BPM); + const std::vector &bpms = timing.GetTimingSegments(SEGMENT_BPM); for (; i < bpms.size(); i++) { const BPMSegment *bs = ToBPM( bpms[i] ); @@ -76,7 +76,7 @@ static void GetTimingTags( vector &lines, const TimingData &timing, boo w.Finish(); w.Init( "STOPS" ); - const vector &stops = timing.GetTimingSegments(SEGMENT_STOP); + const std::vector &stops = timing.GetTimingSegments(SEGMENT_STOP); for (i = 0; i < stops.size(); i++) { const StopSegment *ss = ToStop( stops[i] ); @@ -85,7 +85,7 @@ static void GetTimingTags( vector &lines, const TimingData &timing, boo w.Finish(); w.Init( "DELAYS" ); - const vector &delays = timing.GetTimingSegments(SEGMENT_DELAY); + const std::vector &delays = timing.GetTimingSegments(SEGMENT_DELAY); for (i = 0; i < delays.size(); i++) { const DelaySegment *ss = ToDelay( delays[i] ); @@ -94,7 +94,7 @@ static void GetTimingTags( vector &lines, const TimingData &timing, boo w.Finish(); w.Init( "WARPS" ); - const vector &warps = timing.GetTimingSegments(SEGMENT_WARP); + const std::vector &warps = timing.GetTimingSegments(SEGMENT_WARP); for (i = 0; i < warps.size(); i++) { const WarpSegment *ws = ToWarp( warps[i] ); @@ -102,7 +102,7 @@ static void GetTimingTags( vector &lines, const TimingData &timing, boo } w.Finish(); - const vector &tSigs = timing.GetTimingSegments(SEGMENT_TIME_SIG); + const std::vector &tSigs = timing.GetTimingSegments(SEGMENT_TIME_SIG); ASSERT( !tSigs.empty() ); w.Init( "TIMESIGNATURES" ); for (i = 0; i < tSigs.size(); i++) @@ -112,7 +112,7 @@ static void GetTimingTags( vector &lines, const TimingData &timing, boo } w.Finish(); - const vector &ticks = timing.GetTimingSegments(SEGMENT_TICKCOUNT); + const std::vector &ticks = timing.GetTimingSegments(SEGMENT_TICKCOUNT); ASSERT( !ticks.empty() ); w.Init( "TICKCOUNTS" ); for (i = 0; i < ticks.size(); i++) @@ -122,7 +122,7 @@ static void GetTimingTags( vector &lines, const TimingData &timing, boo } w.Finish(); - const vector &combos = timing.GetTimingSegments(SEGMENT_COMBO); + const std::vector &combos = timing.GetTimingSegments(SEGMENT_COMBO); ASSERT( !combos.empty() ); w.Init( "COMBOS" ); for (i = 0; i < combos.size(); i++) @@ -136,7 +136,7 @@ static void GetTimingTags( vector &lines, const TimingData &timing, boo w.Finish(); // Song Timing should only have the initial value. - const vector &speeds = timing.GetTimingSegments(SEGMENT_SPEED); + const std::vector &speeds = timing.GetTimingSegments(SEGMENT_SPEED); w.Init( "SPEEDS" ); for (i = 0; i < speeds.size(); i++) { @@ -146,7 +146,7 @@ static void GetTimingTags( vector &lines, const TimingData &timing, boo w.Finish(); w.Init( "SCROLLS" ); - const vector &scrolls = timing.GetTimingSegments(SEGMENT_SCROLL); + const std::vector &scrolls = timing.GetTimingSegments(SEGMENT_SCROLL); for (i = 0; i < scrolls.size(); i++) { ScrollSegment *ss = ToScroll( scrolls[i] ); @@ -156,7 +156,7 @@ static void GetTimingTags( vector &lines, const TimingData &timing, boo if( !bIsSong ) { - const vector &fakes = timing.GetTimingSegments(SEGMENT_FAKE); + const std::vector &fakes = timing.GetTimingSegments(SEGMENT_FAKE); w.Init( "FAKES" ); for (i = 0; i < fakes.size(); i++) { @@ -167,7 +167,7 @@ static void GetTimingTags( vector &lines, const TimingData &timing, boo } w.Init( "LABELS" ); - const vector &labels = timing.GetTimingSegments(SEGMENT_LABEL); + const std::vector &labels = timing.GetTimingSegments(SEGMENT_LABEL); for (i = 0; i < labels.size(); i++) { LabelSegment *ls = static_cast(labels[i]); @@ -235,7 +235,7 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) } { - vector vs = out.GetInstrumentTracksToVectorString(); + std::vector vs = out.GetInstrumentTracksToVectorString(); if( !vs.empty() ) { RString s = join( ",", vs ); @@ -349,7 +349,7 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) * @return the NoteData in RString form. */ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCache ) { - vector lines; + std::vector lines; lines.push_back( "" ); // Escape to prevent some clown from making a comment of "\r\n;" @@ -369,7 +369,7 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa lines.push_back(ssprintf("#MUSIC:%s;", music.c_str())); } - vector asRadarValues; + std::vector asRadarValues; FOREACH_PlayerNumber( pn ) { const RadarValues &rv = in.GetRadarValues( pn ); @@ -431,7 +431,7 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa return JoinLineList( lines ); } -bool NotesWriterSSC::Write( RString sPath, const Song &out, const vector& vpStepsToSave, bool bSavingCache ) +bool NotesWriterSSC::Write( RString sPath, const Song &out, const std::vector& vpStepsToSave, bool bSavingCache ) { int flags = RageFile::WRITE; @@ -480,7 +480,7 @@ void NotesWriterSSC::GetEditFileContents( const Song *pSong, const Steps *pSteps RString sDir = pSong->GetSongDir(); // "Songs/foo/bar"; strip off "Songs/". - vector asParts; + std::vector asParts; split( sDir, "/", asParts ); if( asParts.size() ) sDir = join( "/", asParts.begin()+1, asParts.end() ); diff --git a/src/NotesWriterSSC.h b/src/NotesWriterSSC.h index 4fdac9bef7..d9182ddefe 100644 --- a/src/NotesWriterSSC.h +++ b/src/NotesWriterSSC.h @@ -13,7 +13,7 @@ namespace NotesWriterSSC * @param vpStepsToSave the Steps to save. * @param bSavingCache a flag to see if we're saving certain cache data. * @return its success or failure. */ - bool Write( RString sPath, const Song &out, const vector& vpStepsToSave, bool bSavingCache ); + bool Write( RString sPath, const Song &out, const std::vector& vpStepsToSave, bool bSavingCache ); /** * @brief Get some contents about the edit file first. * @param pSong the Song in question. diff --git a/src/OptionRow.cpp b/src/OptionRow.cpp index 824a40bb17..7cbbfd3bcb 100644 --- a/src/OptionRow.cpp +++ b/src/OptionRow.cpp @@ -162,7 +162,7 @@ void OptionRow::ChoicesChanged( RowType type, bool reset_focus ) FOREACH_PlayerNumber( p ) { - vector &vbSelected = m_vbSelected[p]; + std::vector &vbSelected = m_vbSelected[p]; vbSelected.resize( 0 ); vbSelected.resize( m_pHand->m_Def.m_vsChoices.size(), false ); @@ -455,7 +455,7 @@ void OptionRow::AfterImportOptions( PlayerNumber pn ) void OptionRow::PositionUnderlines( PlayerNumber pn ) { - vector &vpUnderlines = m_Underline[pn]; + std::vector &vpUnderlines = m_Underline[pn]; if( vpUnderlines.empty() ) return; @@ -524,7 +524,7 @@ void OptionRow::UpdateText( PlayerNumber p ) RString sText = GetThemedItemText( iChoiceWithFocus ); // If player_no is 2 and there is no player 1: - int index = min( pn, m_textItems.size()-1 ); + int index = std::min(static_cast(pn), static_cast(m_textItems.size()) - 1); // TODO: Always have one textItem for each player @@ -626,7 +626,7 @@ void OptionRow::UpdateEnabledDisabled() unsigned item_no = m_pHand->m_Def.m_bOneChoiceForAllPlayers ? 0 : pn; // If player_no is 2 and there is no player 1: - item_no = min( item_no, m_textItems.size()-1 ); + item_no = std::min(item_no, m_textItems.size() - 1); BitmapText &bt = *m_textItems[item_no]; @@ -703,7 +703,7 @@ int OptionRow::GetOneSharedSelection( bool bAllowFail ) const void OptionRow::SetOneSelection( PlayerNumber pn, int iChoice ) { - vector &vb = m_vbSelected[pn]; + std::vector &vb = m_vbSelected[pn]; if( vb.empty() ) return; std::fill_n(vb.begin(), vb.size(), false); @@ -806,7 +806,7 @@ bool OptionRow::NotifyHandlerOfSelection(PlayerNumber pn, int choice) if(changed) { ChoicesChanged(m_RowType, false); - vector vpns; + std::vector vpns; FOREACH_HumanPlayer( p ) vpns.push_back( p ); ImportOptions(vpns); @@ -851,7 +851,7 @@ void OptionRow::Reload() { ChoicesChanged( m_RowType ); - vector vpns; + std::vector vpns; FOREACH_HumanPlayer( p ) vpns.push_back( p ); ImportOptions( vpns ); @@ -905,7 +905,7 @@ void OptionRow::HandleMessage( const Message &msg ) if( GetFirstItemGoesDown() ) \ vbSelected.insert( vbSelected.begin(), false ); -void OptionRow::ImportOptions( const vector &vpns ) +void OptionRow::ImportOptions( const std::vector &vpns ) { ASSERT( m_pHand->m_Def.m_vsChoices.size() > 0 ); @@ -926,7 +926,7 @@ void OptionRow::ImportOptions( const vector &vpns ) } } -int OptionRow::ExportOptions( const vector &vpns, bool bRowHasFocus[NUM_PLAYERS] ) +int OptionRow::ExportOptions( const std::vector &vpns, bool bRowHasFocus[NUM_PLAYERS] ) { ASSERT( m_pHand->m_Def.m_vsChoices.size() > 0 ); diff --git a/src/OptionRow.h b/src/OptionRow.h index 71f184e1e8..170f7be019 100644 --- a/src/OptionRow.h +++ b/src/OptionRow.h @@ -63,8 +63,8 @@ public: void SetModIcon( PlayerNumber pn, const RString &sText, GameCommand &gc ); - void ImportOptions( const vector &vpns ); - int ExportOptions( const vector &vpns, bool bRowHasFocus[NUM_PLAYERS] ); + void ImportOptions( const std::vector &vpns ); + int ExportOptions( const std::vector &vpns, bool bRowHasFocus[NUM_PLAYERS] ); enum RowType { @@ -134,8 +134,8 @@ protected: ActorFrame m_Frame; - vector m_textItems; // size depends on m_bRowIsLong and which players are joined - vector m_Underline[NUM_PLAYERS]; // size depends on m_bRowIsLong and which players are joined + std::vector m_textItems; // size depends on m_bRowIsLong and which players are joined + std::vector m_Underline[NUM_PLAYERS]; // size depends on m_bRowIsLong and which players are joined Actor *m_sprFrame; BitmapText *m_textTitle; @@ -146,7 +146,7 @@ protected: int m_iChoiceInRowWithFocus[NUM_PLAYERS]; // this choice has input focus // Only one will true at a time if m_pHand->m_Def.bMultiSelect - vector m_vbSelected[NUM_PLAYERS]; // size = m_pHand->m_Def.choices.size() + std::vector m_vbSelected[NUM_PLAYERS]; // size = m_pHand->m_Def.choices.size() Actor::TweenState m_tsDestination; // this should approach m_tsDestination. public: diff --git a/src/OptionRowHandler.cpp b/src/OptionRowHandler.cpp index 7eaeae7314..dd05ceadfb 100644 --- a/src/OptionRowHandler.cpp +++ b/src/OptionRowHandler.cpp @@ -91,7 +91,7 @@ void OptionRowHandler::GetIconTextAndGameCommand( int iFirstSelection, RString & gcOut.Init(); } -void OptionRowHandlerUtil::SelectExactlyOne( int iSelection, vector &vbSelectedOut ) +void OptionRowHandlerUtil::SelectExactlyOne( int iSelection, std::vector &vbSelectedOut ) { ASSERT_M( iSelection >= 0 && iSelection < (int) vbSelectedOut.size(), ssprintf("%d/%u",iSelection, unsigned(vbSelectedOut.size())) ); @@ -99,7 +99,7 @@ void OptionRowHandlerUtil::SelectExactlyOne( int iSelection, vector &vbSel vbSelectedOut[i] = i==iSelection; } -int OptionRowHandlerUtil::GetOneSelection( const vector &vbSelected ) +int OptionRowHandlerUtil::GetOneSelection( const std::vector &vbSelected ) { int iRet = -1; for( unsigned i=0; i m_aListEntries; + std::vector m_aListEntries; GameCommand m_Default; bool m_bUseModNameForIcon; - vector m_vsBroadcastOnExport; + std::vector m_vsBroadcastOnExport; OptionRowHandlerList() { Init(); } virtual void Init() @@ -244,11 +244,11 @@ public: } return true; } - void ImportOption( OptionRow *pRow, const vector &vpns, vector vbSelectedOut[NUM_PLAYERS] ) const + void ImportOption( OptionRow *pRow, const std::vector &vpns, std::vector vbSelectedOut[NUM_PLAYERS] ) const { for (PlayerNumber const &p : vpns) { - vector &vbSelOut = vbSelectedOut[p]; + std::vector &vbSelOut = vbSelectedOut[p]; bool bUseFallbackOption = true; @@ -309,11 +309,11 @@ public: } } - int ExportOption( const vector &vpns, const vector vbSelected[NUM_PLAYERS] ) const + int ExportOption( const std::vector &vpns, const std::vector vbSelected[NUM_PLAYERS] ) const { for (PlayerNumber const &p : vpns) { - const vector &vbSel = vbSelected[p]; + const std::vector &vbSel = vbSelected[p]; m_Default.Apply( p ); for( unsigned i=0; i &asSkinNames ) +static void SortNoteSkins( std::vector &asSkinNames ) { - set setSkinNames; + std::set setSkinNames; setSkinNames.insert( asSkinNames.begin(), asSkinNames.end() ); - vector asSorted; + std::vector asSorted; split( NOTE_SKIN_SORT_ORDER, ",", asSorted ); - set setUnusedSkinNames( setSkinNames ); + std::set setUnusedSkinNames( setSkinNames ); asSkinNames.clear(); for (RString const &sSkin : asSorted) @@ -386,7 +386,7 @@ class OptionRowHandlerListNoteSkins : public OptionRowHandlerList m_Def.m_bOneChoiceForAllPlayers = false; m_Def.m_bAllowThemeItems = false; // we theme the text ourself - vector arraySkinNames; + std::vector arraySkinNames; NOTESKIN->GetNoteSkinNames( arraySkinNames ); SortNoteSkins( arraySkinNames ); @@ -438,7 +438,7 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList m_Def.m_bOneChoiceForAllPlayers = (bool)PREFSMAN->m_bLockCourseDifficulties; m_Def.m_layoutType = StringToLayoutType( STEPS_ROW_LAYOUT_TYPE ); - vector vTrails; + std::vector vTrails; GAMESTATE->m_pCurCourse->GetTrails( vTrails, GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType ); for( unsigned i=0; i vpSteps; + std::vector vpSteps; Song *pSong = GAMESTATE->m_pCurSong; SongUtil::GetSteps( pSong, vpSteps, GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType ); StepsUtil::RemoveLockedSteps( pSong, vpSteps ); @@ -517,8 +517,8 @@ public: BroadcastOnChangePtr *m_ppStepsToFill; BroadcastOnChange *m_pDifficultyToFill; const BroadcastOnChange *m_pst; - vector m_vSteps; - vector m_vDifficulties; + std::vector m_vSteps; + std::vector m_vDifficulties; OptionRowHandlerSteps() { Init(); } void Init() @@ -618,16 +618,16 @@ public: m_ppStepsToFill->Set( m_vSteps[0] ); return true; } - virtual void ImportOption( OptionRow *pRow, const vector &vpns, vector vbSelectedOut[NUM_PLAYERS] ) const + virtual void ImportOption( OptionRow *pRow, const std::vector &vpns, std::vector vbSelectedOut[NUM_PLAYERS] ) const { for (PlayerNumber const &p : vpns) { - vector &vbSelOut = vbSelectedOut[p]; + std::vector &vbSelOut = vbSelectedOut[p]; ASSERT( m_vSteps.size() == vbSelOut.size() ); // look for matching steps - vector::const_iterator iter = find( m_vSteps.begin(), m_vSteps.end(), m_ppStepsToFill->Get() ); + std::vector::const_iterator iter = find( m_vSteps.begin(), m_vSteps.end(), m_ppStepsToFill->Get() ); if( iter != m_vSteps.end() ) { unsigned i = iter - m_vSteps.begin(); @@ -639,14 +639,14 @@ public: if( m_pDifficultyToFill ) { // use the old style for now. - for (vector::const_iterator d = m_vDifficulties.begin(); d != m_vDifficulties.end(); ++d) + for (std::vector::const_iterator d = m_vDifficulties.begin(); d != m_vDifficulties.end(); ++d) { unsigned i = d - m_vDifficulties.begin(); if( *d == GAMESTATE->m_PreferredDifficulty[p] ) { vbSelOut[i] = true; matched= true; - vector v; + std::vector v; v.push_back( p ); ExportOption( v, vbSelectedOut ); // current steps changed break; @@ -660,11 +660,11 @@ public: } } } - virtual int ExportOption( const vector &vpns, const vector vbSelected[NUM_PLAYERS] ) const + virtual int ExportOption( const std::vector &vpns, const std::vector vbSelected[NUM_PLAYERS] ) const { for (PlayerNumber const &p : vpns) { - const vector &vbSel = vbSelected[p]; + const std::vector &vbSel = vbSelected[p]; int index = OptionRowHandlerUtil::GetOneSelection( vbSel ); Difficulty dc = m_vDifficulties[index]; @@ -695,7 +695,7 @@ class OptionRowHandlerListCharacters: public OptionRowHandlerList m_aListEntries.push_back( mc ); } - vector vpCharacters; + std::vector vpCharacters; CHARMAN->GetCharacters( vpCharacters ); for( unsigned i=0; i vStyles; + std::vector vStyles; GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vStyles ); ASSERT( vStyles.size() != 0 ); for (Style const *s : vStyles) @@ -745,7 +745,7 @@ class OptionRowHandlerListGroups: public OptionRowHandlerList m_Def.m_sName = "Group"; m_Default.m_sSongGroup = GROUP_ALL; - vector vSongGroups; + std::vector vSongGroups; SONGMAN->GetSongGroupNames( vSongGroups ); ASSERT( vSongGroups.size() != 0 ); @@ -803,7 +803,7 @@ class OptionRowHandlerListSongsInCurrentSongGroup: public OptionRowHandlerList { virtual bool LoadInternal( const Commands & ) { - const vector &vpSongs = SONGMAN->GetSongs( GAMESTATE->m_sPreferredSongGroup ); + const std::vector &vpSongs = SONGMAN->GetSongs( GAMESTATE->m_sPreferredSongGroup ); if( GAMESTATE->m_pCurSong == nullptr ) GAMESTATE->m_pCurSong.Set( vpSongs[0] ); @@ -1161,7 +1161,7 @@ public: return effect; } - virtual void ImportOption( OptionRow *pRow, const vector &vpns, vector vbSelectedOut[NUM_PLAYERS] ) const + virtual void ImportOption( OptionRow *pRow, const std::vector &vpns, std::vector vbSelectedOut[NUM_PLAYERS] ) const { if(!m_TableIsSane) { @@ -1173,7 +1173,7 @@ public: for (PlayerNumber const &p : vpns) { - vector &vbSelOut = vbSelectedOut[p]; + std::vector &vbSelOut = vbSelectedOut[p]; /* Evaluate the LoadSelections(self,array,pn) function, where * array is a table representing vbSelectedOut. */ @@ -1218,7 +1218,7 @@ public: LUA->Release(L); } - virtual int ExportOption( const vector &vpns, const vector vbSelected[NUM_PLAYERS] ) const + virtual int ExportOption( const std::vector &vpns, const std::vector vbSelected[NUM_PLAYERS] ) const { if(!m_TableIsSane) { @@ -1231,12 +1231,12 @@ public: int effects = 0; for (PlayerNumber const &p : vpns) { - const vector &vbSel = vbSelected[p]; + const std::vector &vbSel = vbSelected[p]; /* Evaluate SaveSelections(self,array,pn) function, where array is * a table representing vbSelectedOut. */ - vector vbSelectedCopy = vbSel; + std::vector vbSelectedCopy = vbSel; // Create the vbSelectedOut table. LuaHelpers::CreateTableFromArrayB( L, vbSelectedCopy ); @@ -1361,23 +1361,23 @@ public: m_Def.m_sName = m_pOpt->name; return true; } - virtual void ImportOption( OptionRow *, const vector &vpns, vector vbSelectedOut[NUM_PLAYERS] ) const + virtual void ImportOption( OptionRow *, const std::vector &vpns, std::vector vbSelectedOut[NUM_PLAYERS] ) const { for (PlayerNumber const &p : vpns) { - vector &vbSelOut = vbSelectedOut[p]; + std::vector &vbSelOut = vbSelectedOut[p]; int iSelection = m_pOpt->Get(); OptionRowHandlerUtil::SelectExactlyOne( iSelection, vbSelOut ); } } - virtual int ExportOption( const vector &vpns, const vector vbSelected[NUM_PLAYERS] ) const + virtual int ExportOption( const std::vector &vpns, const std::vector vbSelected[NUM_PLAYERS] ) const { bool bChanged = false; for (PlayerNumber const &p : vpns) { - const vector &vbSel = vbSelected[p]; + const std::vector &vbSel = vbSelected[p]; int iSel = OptionRowHandlerUtil::GetOneSelection(vbSel); @@ -1403,7 +1403,7 @@ class OptionRowHandlerStepsType : public OptionRowHandler { public: BroadcastOnChange *m_pstToFill; - vector m_vStepsTypesToShow; + std::vector m_vStepsTypesToShow; OptionRowHandlerStepsType() { Init(); } void Init() @@ -1458,16 +1458,16 @@ public: return true; } - virtual void ImportOption( OptionRow *pRow, const vector &vpns, vector vbSelectedOut[NUM_PLAYERS] ) const + virtual void ImportOption( OptionRow *pRow, const std::vector &vpns, std::vector vbSelectedOut[NUM_PLAYERS] ) const { for (PlayerNumber const &p : vpns) { - vector &vbSelOut = vbSelectedOut[p]; + std::vector &vbSelOut = vbSelectedOut[p]; if( GAMESTATE->m_pCurSteps[0] ) { StepsType st = GAMESTATE->m_pCurSteps[0]->m_StepsType; - vector::const_iterator iter = find( m_vStepsTypesToShow.begin(), m_vStepsTypesToShow.end(), st ); + std::vector::const_iterator iter = find( m_vStepsTypesToShow.begin(), m_vStepsTypesToShow.end(), st ); if( iter != m_vStepsTypesToShow.end() ) { unsigned i = iter - m_vStepsTypesToShow.begin(); @@ -1478,11 +1478,11 @@ public: vbSelOut[0] = true; } } - virtual int ExportOption( const vector &vpns, const vector vbSelected[NUM_PLAYERS] ) const + virtual int ExportOption( const std::vector &vpns, const std::vector vbSelected[NUM_PLAYERS] ) const { for (PlayerNumber const &p : vpns) { - const vector &vbSel = vbSelected[p]; + const std::vector &vbSel = vbSelected[p]; int index = OptionRowHandlerUtil::GetOneSelection( vbSel ); m_pstToFill->Set( m_vStepsTypesToShow[index] ); @@ -1520,10 +1520,10 @@ public: m_Def.m_vsChoices.push_back( "" ); return true; } - virtual void ImportOption( OptionRow *pRow, const vector &vpns, vector vbSelectedOut[NUM_PLAYERS] ) const + virtual void ImportOption( OptionRow *pRow, const std::vector &vpns, std::vector vbSelectedOut[NUM_PLAYERS] ) const { } - virtual int ExportOption( const vector &vpns, const vector vbSelected[NUM_PLAYERS] ) const + virtual int ExportOption( const std::vector &vpns, const std::vector vbSelected[NUM_PLAYERS] ) const { if( vbSelected[PLAYER_1][0] || vbSelected[PLAYER_2][0] ) m_gc.ApplyToAllPlayers(); diff --git a/src/OptionRowHandler.h b/src/OptionRowHandler.h index 9937e93ef6..1cc33db673 100644 --- a/src/OptionRowHandler.h +++ b/src/OptionRowHandler.h @@ -50,8 +50,8 @@ struct OptionRowDefinition bool m_bOneChoiceForAllPlayers; SelectType m_selectType; LayoutType m_layoutType; - vector m_vsChoices; - set m_vEnabledForPlayers; // only players in this set may change focus to this row + std::vector m_vsChoices; + std::set m_vEnabledForPlayers; // only players in this set may change focus to this row int m_iDefault; bool m_bExportOnChange; /** @@ -148,7 +148,7 @@ class OptionRowHandler { public: OptionRowDefinition m_Def; - vector m_vsReloadRowMessages; // refresh this row on on these messages + std::vector m_vsReloadRowMessages; // refresh this row on on these messages OptionRowHandler(): m_Def(), m_vsReloadRowMessages() { } virtual ~OptionRowHandler() { } @@ -179,9 +179,9 @@ public: virtual ReloadChanged Reload() { return RELOAD_CHANGED_NONE; } virtual int GetDefaultOption() const { return -1; } - virtual void ImportOption( OptionRow *, const vector &, vector vbSelectedOut[NUM_PLAYERS] ) const { } + virtual void ImportOption( OptionRow *, const std::vector &, std::vector vbSelectedOut[NUM_PLAYERS] ) const { } // Returns an OPT mask. - virtual int ExportOption( const vector &, const vector vbSelected[NUM_PLAYERS] ) const { return 0; } + virtual int ExportOption( const std::vector &, const std::vector vbSelected[NUM_PLAYERS] ) const { return 0; } virtual void GetIconTextAndGameCommand( int iFirstSelection, RString &sIconTextOut, GameCommand &gcOut ) const; virtual RString GetScreen( int /* iChoice */ ) const { return RString(); } // Exists so that a lua function can act on the selection. Returns true if the choices should be reloaded. @@ -196,11 +196,11 @@ namespace OptionRowHandlerUtil OptionRowHandler* MakeNull(); OptionRowHandler* MakeSimple( const MenuRowDef &mrd ); - void SelectExactlyOne( int iSelection, vector &vbSelectedOut ); - int GetOneSelection( const vector &vbSelected ); + void SelectExactlyOne( int iSelection, std::vector &vbSelectedOut ); + int GetOneSelection( const std::vector &vbSelected ); } -inline void VerifySelected(SelectType st, vector &selected, const RString &sName) +inline void VerifySelected(SelectType st, std::vector &selected, const RString &sName) { int num_selected = 0; if( st == SELECT_ONE ) diff --git a/src/OptionsList.cpp b/src/OptionsList.cpp index 8130a6a6b5..a05fcfac39 100644 --- a/src/OptionsList.cpp +++ b/src/OptionsList.cpp @@ -50,7 +50,7 @@ void OptionListRow::SetFromHandler( const OptionRowHandler *pHandler ) if( pHandler == nullptr ) return; - int iNum = max( pHandler->m_Def.m_vsChoices.size(), m_Text.size() )+1; + unsigned int iNum = std::max( pHandler->m_Def.m_vsChoices.size(), m_Text.size() ) + 1; m_Text.resize( iNum, m_Text[0] ); m_Underlines.resize( iNum, m_Underlines[0] ); @@ -122,7 +122,7 @@ void OptionListRow::SetTextFromHandler( const OptionRowHandler *pHandler ) } } -void OptionListRow::SetUnderlines( const vector &aSelections, const OptionRowHandler *pHandler ) +void OptionListRow::SetUnderlines( const std::vector &aSelections, const OptionRowHandler *pHandler ) { for( unsigned i = 0; i < aSelections.size(); ++i ) { @@ -145,7 +145,7 @@ void OptionListRow::SetUnderlines( const vector &aSelections, const Option } else if( pTarget->m_Def.m_selectType == SELECT_MULTIPLE ) { - const vector &bTargetSelections = m_pOptions->m_bSelections.find(sDest)->second; + const std::vector &bTargetSelections = m_pOptions->m_bSelections.find(sDest)->second; for( unsigned j=0; jAddChild( m_Cursor ); - vector asDirectLines; + std::vector asDirectLines; split( DIRECT_LINES, ",", asDirectLines, true ); for (RString &s : asDirectLines) m_setDirectRows.insert(s); - vector setToLoad; + std::vector setToLoad; split( TOP_MENUS, ",", setToLoad ); m_setTopMenus.insert( setToLoad.begin(), setToLoad.end() ); @@ -301,9 +301,9 @@ OptionRowHandler *OptionsList::GetCurrentHandler() int OptionsList::GetOneSelection( RString sRow, bool bAllowFail ) const { - map >::const_iterator it = m_bSelections.find(sRow); + std::map >::const_iterator it = m_bSelections.find(sRow); ASSERT_M( it != m_bSelections.end(), sRow ); - const vector &bSelections = it->second; + const std::vector &bSelections = it->second; for( unsigned i=0; i &bSelections = m_bSelections[sCurrentRow]; + std::vector &bSelections = m_bSelections[sCurrentRow]; if( m_iMenuStackSelection == (int)bSelections.size() ) return false; @@ -396,7 +396,7 @@ bool OptionsList::Input( const InputEventPlus &input ) if( m_setDirectRows.find(sDest) != m_setDirectRows.end() && sDest.size() ) { const OptionRowHandler *pTarget = m_Rows[sDest]; - vector &bTargetSelections = m_bSelections[sDest]; + std::vector &bTargetSelections = m_bSelections[sDest]; if( pTarget->m_Def.m_selectType == SELECT_ONE ) { @@ -526,8 +526,8 @@ void OptionsList::TweenOnCurrentRow( bool bForward ) void OptionsList::ImportRow( RString sRow ) { - vector aSelections[NUM_PLAYERS]; - vector vpns; + std::vector aSelections[NUM_PLAYERS]; + std::vector vpns; vpns.push_back( m_pn ); OptionRowHandler *pHandler = m_Rows[sRow]; aSelections[ m_pn ].resize( pHandler->m_Def.m_vsChoices.size() ); @@ -543,10 +543,10 @@ void OptionsList::ExportRow( RString sRow ) if( m_setTopMenus.find(sRow) != m_setTopMenus.end() ) return; - vector aSelections[NUM_PLAYERS]; + std::vector aSelections[NUM_PLAYERS]; aSelections[m_pn] = m_bSelections[sRow]; - vector vpns; + std::vector vpns; vpns.push_back( m_pn ); m_Rows[sRow]->ExportOption( vpns, aSelections ); @@ -613,7 +613,7 @@ void OptionsList::Push( RString sDest ) void OptionsList::SelectItem( const RString &sRowName, int iMenuItem ) { const OptionRowHandler *pHandler = m_Rows[sRowName]; - vector &bSelections = m_bSelections[sRowName]; + std::vector &bSelections = m_bSelections[sRowName]; if( pHandler->m_Def.m_selectType == SELECT_MULTIPLE ) { @@ -638,11 +638,11 @@ void OptionsList::SelectItem( const RString &sRowName, int iMenuItem ) void OptionsList::SelectionsChanged( const RString &sRowName ) { const OptionRowHandler *pHandler = m_Rows[sRowName]; - vector &bSelections = m_bSelections[sRowName]; + std::vector &bSelections = m_bSelections[sRowName]; if( pHandler->m_Def.m_bOneChoiceForAllPlayers && m_pLinked != nullptr ) { - vector &bLinkedSelections = m_pLinked->m_bSelections[sRowName]; + std::vector &bLinkedSelections = m_pLinked->m_bSelections[sRowName]; bLinkedSelections = bSelections; if( m_pLinked->IsOpened() ) @@ -656,7 +656,7 @@ void OptionsList::SelectionsChanged( const RString &sRowName ) void OptionsList::UpdateMenuFromSelections() { - const vector &bCurrentSelections = m_bSelections.find(GetCurrentRow())->second; + const std::vector &bCurrentSelections = m_bSelections.find(GetCurrentRow())->second; m_Row[m_iCurrentRow].SetUnderlines( bCurrentSelections, GetCurrentHandler() ); m_Row[m_iCurrentRow].SetTextFromHandler( GetCurrentHandler() ); } @@ -665,7 +665,7 @@ bool OptionsList::Start() { OptionRowHandler *pHandler = GetCurrentHandler(); const RString &sCurrentRow = m_asMenuStack.back(); - vector &bSelections = m_bSelections[sCurrentRow]; + std::vector &bSelections = m_bSelections[sCurrentRow]; if( m_iMenuStackSelection == (int)bSelections.size() ) { Pop(); diff --git a/src/OptionsList.h b/src/OptionsList.h index 783e1d77c2..c478343be8 100644 --- a/src/OptionsList.h +++ b/src/OptionsList.h @@ -18,7 +18,7 @@ public: void Load( OptionsList *pOptions, const RString &sType ); void SetFromHandler( const OptionRowHandler *pHandler ); void SetTextFromHandler( const OptionRowHandler *pHandler ); - void SetUnderlines( const vector &aSelections, const OptionRowHandler *pHandler ); + void SetUnderlines( const std::vector &aSelections, const OptionRowHandler *pHandler ); void PositionCursor( Actor *pCursor, int iSelection ); @@ -27,9 +27,9 @@ public: private: OptionsList *m_pOptions; - vector m_Text; + std::vector m_Text; // underline for each ("self or child has selection") - vector m_Underlines; + std::vector m_Underlines; bool m_bItemsInTwoRows; @@ -88,18 +88,18 @@ private: bool m_bStartIsDown; bool m_bAcceptStartRelease; - vector m_asLoadedRows; - map m_Rows; - map > m_bSelections; - set m_setDirectRows; - set m_setTopMenus; // list of top-level menus, pointing to submenus + std::vector m_asLoadedRows; + std::map m_Rows; + std::map > m_bSelections; + std::set m_setDirectRows; + std::set m_setTopMenus; // list of top-level menus, pointing to submenus PlayerNumber m_pn; AutoActor m_Cursor; OptionListRow m_Row[2]; int m_iCurrentRow; - vector m_asMenuStack; + std::vector m_asMenuStack; int m_iMenuStackSelection; protected: GameButton m_GameButtonPreviousItem; diff --git a/src/PercentageDisplay.cpp b/src/PercentageDisplay.cpp index b67bdd9cc4..ae0f2950cd 100644 --- a/src/PercentageDisplay.cpp +++ b/src/PercentageDisplay.cpp @@ -154,7 +154,7 @@ void PercentageDisplay::Refresh() if( ShowDancePointsNotPercentage() ) { - sNumToDisplay = ssprintf( "%*d", m_iDancePointsDigits, max( 0, iActualDancePoints ) ); + sNumToDisplay = ssprintf( "%*d", m_iDancePointsDigits, std::max( 0, iActualDancePoints ) ); } else { diff --git a/src/Player.cpp b/src/Player.cpp index 0f53324bdb..d07164e373 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -49,14 +49,14 @@ void TimingWindowSecondsInit( size_t /*TimingWindow*/ i, RString &sNameOut, floa */ class JudgedRows { - vector m_vRows; + std::vector m_vRows; int m_iStart; int m_iOffset; void Resize( size_t iMin ) { - size_t iNewSize = max( 2*m_vRows.size(), iMin ); - vector vNewRows( m_vRows.begin() + m_iOffset, m_vRows.end() ); + size_t iNewSize = std::max( 2*m_vRows.size(), iMin ); + std::vector vNewRows( m_vRows.begin() + m_iOffset, m_vRows.end() ); vNewRows.reserve( iNewSize ); vNewRows.insert( vNewRows.end(), m_vRows.begin(), m_vRows.begin() + m_iOffset ); vNewRows.resize( iNewSize, false ); @@ -457,7 +457,7 @@ void Player::Init( fMaxBPM = (M_MOD_HIGH_CAP > 0 ? bpms.GetMaxWithin(M_MOD_HIGH_CAP) : bpms.GetMax()); - fMaxBPM = max( 0, fMaxBPM ); + fMaxBPM = std::max( 0.0f, fMaxBPM ); } // we can't rely on the displayed BPMs, so manually calculate. @@ -474,7 +474,7 @@ void Player::Init( e.pSong->m_SongTiming.GetActualBPM( fThrowAway, fMaxForEntry, M_MOD_HIGH_CAP ); else e.pSong->m_SongTiming.GetActualBPM( fThrowAway, fMaxForEntry ); - fMaxBPM = max( fMaxForEntry, fMaxBPM ); + fMaxBPM = std::max( fMaxForEntry, fMaxBPM ); } } else @@ -600,7 +600,7 @@ static void GenerateCacheDataStructure(PlayerState *pPlayerState, const NoteData pPlayerState->m_CacheDisplayedBeat.clear(); - const vector vScrolls = pPlayerState->GetDisplayedTiming().GetTimingSegments( SEGMENT_SCROLL ); + const std::vector vScrolls = pPlayerState->GetDisplayedTiming().GetTimingSegments( SEGMENT_SCROLL ); float displayedBeat = 0.0f; float lastRealBeat = 0.0f; @@ -879,7 +879,7 @@ void Player::Update( float fDeltaTime ) float fMiniPercent = m_pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_MINI]; float fTinyPercent = m_pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_TINY]; - float fJudgmentZoom = min( powf(0.5f, fMiniPercent+fTinyPercent), 1.0f ); + float fJudgmentZoom = std::min( powf(0.5f, fMiniPercent+fTinyPercent), 1.0f ); // Update Y positions { @@ -953,7 +953,7 @@ void Player::Update( float fDeltaTime ) ASSERT( m_pPlayerState != nullptr ); // TODO: Remove use of PlayerNumber. - vector GameI; + std::vector GameI; GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( col, m_pPlayerState->m_PlayerNumber, GameI ); bool bIsHoldingButton= INPUTMAPPER->IsBeingPressed(GameI); @@ -1003,15 +1003,15 @@ void Player::Update( float fDeltaTime ) float largestWindow = 0.0f; const auto &disabledWindows = m_pPlayerState->m_PlayerOptions.GetCurrent().m_twDisabledWindows; if (!disabledWindows[TW_W1]) - largestWindow = max(largestWindow, GetWindowSeconds(TW_W1)); + largestWindow = std::max(largestWindow, GetWindowSeconds(TW_W1)); if (!disabledWindows[TW_W2]) - largestWindow = max(largestWindow, GetWindowSeconds(TW_W2)); + largestWindow = std::max(largestWindow, GetWindowSeconds(TW_W2)); if (!disabledWindows[TW_W3]) - largestWindow = max(largestWindow, GetWindowSeconds(TW_W3)); + largestWindow = std::max(largestWindow, GetWindowSeconds(TW_W3)); if (!disabledWindows[TW_W4]) - largestWindow = max(largestWindow, GetWindowSeconds(TW_W4)); + largestWindow = std::max(largestWindow, GetWindowSeconds(TW_W4)); if (!disabledWindows[TW_W5]) - largestWindow = max(largestWindow, GetWindowSeconds(TW_W5)); + largestWindow = std::max(largestWindow, GetWindowSeconds(TW_W5)); // We have to check the unjudged notes that are within the // timing window. Let's find the cutoff point! (lastCheckRow) @@ -1025,7 +1025,7 @@ void Player::Update( float fDeltaTime ) // note on a track (== column/arrow direction), so we have to // keep track for which tracks we have already seen an unjudged // note. - vector seenTracks(m_NoteData.GetNumTracks(), false); + std::vector seenTracks(m_NoteData.GetNumTracks(), false); for(auto iter = *m_pIterNeedsTapJudging; !iter.IsAtEnd() && iter.Row() <= lastCheckRow; ++iter) { @@ -1057,7 +1057,7 @@ void Player::Update( float fDeltaTime ) if (!tn.result.bHeld) { PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - vector input; + std::vector input; GAMESTATE->GetCurrentStyle(pn)->StyleInputToGameInput(track, pn, input); tn.result.bHeld = INPUTMAPPER->IsBeingPressed(input, m_pPlayerState->m_mp); @@ -1075,7 +1075,7 @@ void Player::Update( float fDeltaTime ) ++iter; } - vector vHoldNotesToGradeTogether; + std::vector vHoldNotesToGradeTogether; int iRowOfLastHoldNote = -1; NoteData::all_tracks_iterator iter = *m_pIterNeedsHoldJudging; // copy for( ; !iter.IsAtEnd() && iter.Row() <= iSongRow; ++iter ) @@ -1098,7 +1098,7 @@ void Player::Update( float fDeltaTime ) break; case TapNoteSubType_Roll: { - vector v; + std::vector v; v.push_back( trtn ); UpdateHoldNotes( iSongRow, fDeltaTime, v ); } @@ -1177,7 +1177,7 @@ void Player::Update( float fDeltaTime ) } // Update a group of holds with shared scoring/life. All of these holds will have the same start row. -void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector &vTN ) +void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, std::vector &vTN ) { ASSERT( !vTN.empty() ); @@ -1323,7 +1323,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector GameI; + std::vector GameI; GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( iTrack, pn, GameI ); bIsHoldingButton &= INPUTMAPPER->IsBeingPressed(GameI, m_pPlayerState->m_mp); @@ -1344,7 +1344,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vectorTrace(ssprintf("trying for min between iSongRow (%i) and iEndRow (%i) (duration %i)",iSongRow,iEndRow,tn.iDuration)); - tn.HoldResult.iLastHeldRow = min( iSongRow, iEndRow ); + tn.HoldResult.iLastHeldRow = std::min( iSongRow, iEndRow ); } } @@ -1388,7 +1388,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vectorTrace("fLife before minus: %f",fLife); fLife -= fDeltaTime / GetWindowSeconds(window); //LOG->Trace("fLife before clamp: %f",fLife); - fLife = max(0, fLife); + fLife = std::max(0.0f, fLife); //LOG->Trace("fLife after: %f",fLife); } break; @@ -1404,7 +1404,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() ) { float factor = (tn.subType == TapNoteSubType_Roll ? 2.0f * fLifeFraction : 10.0f * fLifeFraction - 8.5f); - m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", max(0.0f, min(1.0f, factor)) * fVol); + m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", std::max(0.0f, std::min(1.0f, factor)) * fVol); } } } @@ -1581,7 +1581,7 @@ void Player::ApplyWaitingTransforms() float fStartBeat, fEndBeat; mod.GetRealtimeAttackBeats( GAMESTATE->m_pCurSong, m_pPlayerState, fStartBeat, fEndBeat ); - fEndBeat = min( fEndBeat, m_NoteData.GetLastBeat() ); + fEndBeat = std::min( fEndBeat, m_NoteData.GetLastBeat() ); LOG->Trace( "Applying transform '%s' from %f to %f to '%s'", mod.sModifiers.c_str(), fStartBeat, fEndBeat, GAMESTATE->m_pCurSong->GetTranslitMainTitle().c_str() ); @@ -2003,7 +2003,7 @@ void Player::ScoreAllActiveHoldsLetGo() { // Since this is being called every frame, let's not check the whole array every time. // Instead, only check 1 beat back. Even 1 is overkill. - const int iStartCheckingAt = max( 0, iSongRow-BeatToNoteRow(1) ); + const int iStartCheckingAt = std::max( 0, iSongRow-BeatToNoteRow(1) ); NoteData::TrackMap::iterator begin, end; m_NoteData.GetTapNoteRangeInclusive( iTrack, iStartCheckingAt, iSongRow+1, begin, end ); for( ; begin != end; ++begin ) @@ -2082,7 +2082,7 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele // Let's not check the whole array every time. // Instead, only check 1 beat back. Even 1 is overkill. // Just update the life here and let Update judge the roll. - const int iStartCheckingAt = max( 0, iSongRow-BeatToNoteRow(1) ); + const int iStartCheckingAt = std::max( 0, iSongRow-BeatToNoteRow(1) ); NoteData::TrackMap::iterator begin, end; m_NoteData.GetTapNoteRangeInclusive( col, iStartCheckingAt, iSongRow+1, begin, end ); for( ; begin != end; ++begin ) @@ -2119,7 +2119,7 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele * Do this even if we're a little beyond the end of the hold note, to make sure * iLastHeldRow is clamped to iEndRow if the hold note is held all the way. */ //LOG->Trace("setting iLastHeldRow to min of iSongRow (%i) and iEndRow (%i)",iSongRow,iEndRow); - tn.HoldResult.iLastHeldRow = min( iSongRow, iEndRow ); + tn.HoldResult.iLastHeldRow = std::min( iSongRow, iEndRow ); } // If the song beat is in the range of this hold: @@ -2156,12 +2156,12 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele int iNumTracksHeld = 0; for( int t=0; t GameI; + std::vector GameI; GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( t, pn, GameI ); float secs_held= 0.0f; for(size_t i= 0; i < GameI.size(); ++i) { - secs_held= max(secs_held, INPUTMAPPER->GetSecsHeld( GameI[i] )); + secs_held= std::max(secs_held, INPUTMAPPER->GetSecsHeld( GameI[i] )); } if( secs_held > 0 && secs_held < m_fTimingWindowJump ) iNumTracksHeld++; @@ -2200,7 +2200,7 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele * Either option would fundamentally change the grading of two quick notes * "jack hammers." Hmm. */ - const int iStepSearchRows = max( + const int iStepSearchRows = std::max( BeatToNoteRow( m_Timing->GetBeatFromElapsedTime( m_pPlayerState->m_Position.m_fMusicSeconds + StepSearchDistance ) ) - iSongRow, iSongRow - BeatToNoteRow( m_Timing->GetBeatFromElapsedTime( m_pPlayerState->m_Position.m_fMusicSeconds - StepSearchDistance ) ) ) + ROWS_PER_BEAT; @@ -2652,7 +2652,7 @@ void Player::UpdateJudgedRows() // handle mines. { bAllJudged = true; - set setSounds; + std::set setSounds; NoteData::all_tracks_iterator iter = *m_pIterUnjudgedMineRows; // copy int iLastSeenRow = -1; for( ; !iter.IsAtEnd() && iter.Row() <= iEndRow; ++iter ) @@ -2790,7 +2790,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) if( !REQUIRE_STEP_ON_HOLD_HEADS ) { PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - vector GameI; + std::vector GameI; GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( iTrack, pn, GameI ); if( PREFSMAN->m_fPadStickSeconds > 0.f ) { @@ -2818,7 +2818,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) // Hold the panel while crossing a mine will cause the mine to explode // TODO: Remove use of PlayerNumber. PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - vector GameI; + std::vector GameI; GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( iTrack, pn, GameI ); if( PREFSMAN->m_fPadStickSeconds > 0.0f ) { @@ -2897,7 +2897,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) if( tickCurrent > 0 && r % ( ROWS_PER_BEAT / tickCurrent ) == 0 ) { - vector viColsWithHold; + std::vector viColsWithHold; int iNumHoldsHeldThisRow = 0; int iNumHoldsMissedThisRow = 0; @@ -3021,7 +3021,7 @@ void Player::HandleTapRowScore( unsigned row ) // new max combo if( m_pPlayerStageStats ) - m_pPlayerStageStats->m_iMaxCombo = max(m_pPlayerStageStats->m_iMaxCombo, iCurCombo); + m_pPlayerStageStats->m_iMaxCombo = std::max(m_pPlayerStageStats->m_iMaxCombo, iCurCombo); /* Use the real current beat, not the beat we've been passed. That's because * we want to record the current life/combo to the current time; eg. if it's @@ -3050,7 +3050,7 @@ void Player::HandleTapRowScore( unsigned row ) void Player::HandleHoldCheckpoint(int iRow, int iNumHoldsHeldThisRow, int iNumHoldsMissedThisRow, - const vector &viColsWithHold ) + const std::vector &viColsWithHold ) { bool bNoCheating = true; #ifdef DEBUG @@ -3146,16 +3146,16 @@ void Player::HandleHoldScore( const TapNote &tn ) float Player::GetMaxStepDistanceSeconds() { float fMax = 0; - fMax = max( fMax, GetWindowSeconds(TW_W5) ); - fMax = max( fMax, GetWindowSeconds(TW_W4) ); - fMax = max( fMax, GetWindowSeconds(TW_W3) ); - fMax = max( fMax, GetWindowSeconds(TW_W2) ); - fMax = max( fMax, GetWindowSeconds(TW_W1) ); - fMax = max( fMax, GetWindowSeconds(TW_Mine) ); - fMax = max( fMax, GetWindowSeconds(TW_Hold) ); - fMax = max( fMax, GetWindowSeconds(TW_Roll) ); - fMax = max( fMax, GetWindowSeconds(TW_Attack) ); - fMax = max( fMax, GetWindowSeconds(TW_Checkpoint) ); + fMax = std::max( fMax, GetWindowSeconds(TW_W5) ); + fMax = std::max( fMax, GetWindowSeconds(TW_W4) ); + fMax = std::max( fMax, GetWindowSeconds(TW_W3) ); + fMax = std::max( fMax, GetWindowSeconds(TW_W2) ); + fMax = std::max( fMax, GetWindowSeconds(TW_W1) ); + fMax = std::max( fMax, GetWindowSeconds(TW_Mine) ); + fMax = std::max( fMax, GetWindowSeconds(TW_Hold) ); + fMax = std::max( fMax, GetWindowSeconds(TW_Roll) ); + fMax = std::max( fMax, GetWindowSeconds(TW_Attack) ); + fMax = std::max( fMax, GetWindowSeconds(TW_Checkpoint) ); float f = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate * fMax; return f + m_fMaxInputLatencySeconds; } diff --git a/src/Player.h b/src/Player.h index 4c5b310a54..27e5f358af 100644 --- a/src/Player.h +++ b/src/Player.h @@ -76,7 +76,7 @@ public: int iRow; TapNote *pTN; }; - void UpdateHoldNotes( int iSongRow, float fDeltaTime, vector &vTN ); + void UpdateHoldNotes( int iSongRow, float fDeltaTime, std::vector &vTN ); void Init( const RString &sType, @@ -144,7 +144,7 @@ protected: void FlashGhostRow( int iRow ); void HandleTapRowScore( unsigned row ); void HandleHoldScore( const TapNote &tn ); - void HandleHoldCheckpoint( int iRow, int iNumHoldsHeldThisRow, int iNumHoldsMissedThisRow, const vector &viColsWithHold ); + void HandleHoldCheckpoint( int iRow, int iNumHoldsHeldThisRow, int iNumHoldsMissedThisRow, const std::vector &viColsWithHold ); void DrawTapJudgments(); void DrawHoldJudgments(); void SendComboMessages( unsigned int iOldCombo, unsigned int iOldMissCombo ); @@ -192,7 +192,7 @@ protected: NoteData &m_NoteData; NoteField *m_pNoteField; - vector m_vpHoldJudgment; + std::vector m_vpHoldJudgment; AutoActor m_sprJudgment; AutoActor m_sprCombo; @@ -226,9 +226,9 @@ protected: float m_fActiveRandomAttackStart; - vector m_vbFretIsDown; + std::vector m_vbFretIsDown; - vector m_vKeysounds; + std::vector m_vKeysounds; ThemeMetric GRAY_ARROWS_Y_STANDARD; ThemeMetric GRAY_ARROWS_Y_REVERSE; diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp index f57b503247..3c2af3358c 100644 --- a/src/PlayerOptions.cpp +++ b/src/PlayerOptions.cpp @@ -194,7 +194,7 @@ void PlayerOptions::Approach( const PlayerOptions& other, float fDeltaSeconds ) #undef DO_COPY } -static void AddPart( vector &AddTo, float level, RString name ) +static void AddPart( std::vector &AddTo, float level, RString name ) { if( level == 0 ) return; @@ -206,12 +206,12 @@ static void AddPart( vector &AddTo, float level, RString name ) RString PlayerOptions::GetString( bool bForceNoteSkin ) const { - vector v; + std::vector v; GetMods( v, bForceNoteSkin ); return join( ", ", v ); } -void PlayerOptions::GetMods( vector &AddTo, bool bForceNoteSkin ) const +void PlayerOptions::GetMods( std::vector &AddTo, bool bForceNoteSkin ) const { //RString sReturn; @@ -594,7 +594,7 @@ void PlayerOptions::GetMods( vector &AddTo, bool bForceNoteSkin ) const void PlayerOptions::FromString( const RString &sMultipleMods ) { RString sTemp = sMultipleMods; - vector vs; + std::vector vs; split( sTemp, ",", vs, true ); RString sThrowAway; for (RString &s : vs) @@ -622,7 +622,7 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut float level = 1; float speed = 1; - vector asParts; + std::vector asParts; split( sBit, " ", asParts, true ); for (RString const &s : asParts) @@ -656,7 +656,7 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut else if( s[0]=='*' ) { sscanf( s, "*%f", &speed ); - if( !isfinite(speed) ) + if( !std::isfinite(speed) ) speed = 1.0f; } } @@ -668,7 +668,7 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut static Regex mult("^([0-9]+(\\.[0-9]+)?)x$"); static Regex disabledWindows("(w[1-5])"); - vector matches; + std::vector matches; if( mult.Compare(sBit, matches) ) { StringConversion::FromString( matches[0], level ); @@ -679,7 +679,7 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut } else if( sscanf( sBit, "c%f", &level ) == 1 ) { - if( !isfinite(level) || level <= 0.0f ) + if( !std::isfinite(level) || level <= 0.0f ) level = CMOD_DEFAULT; SET_FLOAT( fScrollBPM ) SET_FLOAT( fTimeSpacing ) @@ -691,7 +691,7 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut { // OpenITG doesn't have this block: /* - if( !isfinite(level) || level <= 0.0f ) + if( !std::isfinite(level) || level <= 0.0f ) level = CMOD_DEFAULT; */ SET_FLOAT( fMaxScrollBPM ) @@ -1673,15 +1673,15 @@ bool PlayerOptions::IsEasierForCourseAndTrail( Course* pCourse, Trail* pTrail ) }); } -void PlayerOptions::GetLocalizedMods( vector &AddTo ) const +void PlayerOptions::GetLocalizedMods( std::vector &AddTo ) const { - vector vMods; + std::vector vMods; GetMods( vMods ); for (RString const &sOneMod : vMods) { ASSERT( !sOneMod.empty() ); - vector asTokens; + std::vector asTokens; split( sOneMod, " ", asTokens ); if( asTokens.empty() ) @@ -2136,7 +2136,7 @@ public: if(original_top >= 1 && lua_isnumber(L, 1)) { float speed= FArg(1); - if(!isfinite(speed) || speed <= 0.0f) + if(!std::isfinite(speed) || speed <= 0.0f) { luaL_error(L, "CMod speed must be finite and greater than 0."); } @@ -2197,7 +2197,7 @@ public: if(lua_isnumber(L, 1) && original_top >= 1) { float speed= FArg(1); - if(!isfinite(speed) || speed <= 0.0f) + if(!std::isfinite(speed) || speed <= 0.0f) { luaL_error(L, "MMod speed must be finite and greater than 0."); } diff --git a/src/PlayerOptions.h b/src/PlayerOptions.h index 7e8729ecbe..d70252a25f 100644 --- a/src/PlayerOptions.h +++ b/src/PlayerOptions.h @@ -119,8 +119,8 @@ public: void ResetPrefs( ResetPrefsType type ); void ResetSavedPrefs() { ResetPrefs(saved_prefs); }; void ResetSavedPrefsInvalidForCourse() { ResetPrefs(saved_prefs_invalid_for_course); } - void GetMods( vector &AddTo, bool bForceNoteSkin = false ) const; - void GetLocalizedMods( vector &AddTo ) const; + void GetMods( std::vector &AddTo, bool bForceNoteSkin = false ) const; + void GetLocalizedMods( std::vector &AddTo ) const; void FromString( const RString &sMultipleMods ); bool FromOneModString( const RString &sOneMod, RString &sErrorDetailOut ); // On error, return false and optionally set sErrorDetailOut void ChooseRandomModifiers(); diff --git a/src/PlayerStageStats.cpp b/src/PlayerStageStats.cpp index 09119d444d..7a93993b12 100644 --- a/src/PlayerStageStats.cpp +++ b/src/PlayerStageStats.cpp @@ -126,7 +126,7 @@ void PlayerStageStats::AddStats( const PlayerStageStats& other ) const float fOtherLastSecond = other.m_fLastSecond + m_fLastSecond + 1.0f; m_fLastSecond = fOtherLastSecond; - map::const_iterator it; + std::map::const_iterator it; for( it = other.m_fLifeRecord.begin(); it != other.m_fLifeRecord.end(); ++it ) { const float pos = it->first; @@ -221,21 +221,21 @@ Grade PlayerStageStats::GetGrade() const if( FullComboOfScore(TNS_W2) ) return Grade_Tier02; - grade = max( grade, Grade_Tier03 ); + grade = std::max( grade, Grade_Tier03 ); } if( GRADE_TIER01_IS_ALL_W2S ) { if( FullComboOfScore(TNS_W2) ) return Grade_Tier01; - grade = max( grade, Grade_Tier02 ); + grade = std::max( grade, Grade_Tier02 ); } if( GRADE_TIER02_IS_FULL_COMBO ) { if( FullComboOfScore(g_MinScoreToMaintainCombo) ) return Grade_Tier02; - grade = max( grade, Grade_Tier03 ); + grade = std::max( grade, Grade_Tier03 ); } return grade; @@ -255,7 +255,7 @@ float PlayerStageStats::MakePercentScore( int iActual, int iPossible ) float fPercent = iActual / (float)iPossible; // don't allow negative - fPercent = max( 0, fPercent ); + fPercent = std::max(0.0f, fPercent); int iPercentTotalDigits = 3 + CommonMetrics::PERCENT_SCORE_DECIMAL_PLACES; // "100" + "." + "00" @@ -366,8 +366,8 @@ void PlayerStageStats::SetLifeRecordAt( float fLife, float fStepsSecond ) if( fStepsSecond < 0 ) return; - m_fFirstSecond = min( fStepsSecond, m_fFirstSecond ); - m_fLastSecond = max( fStepsSecond, m_fLastSecond ); + m_fFirstSecond = std::min( fStepsSecond, m_fFirstSecond ); + m_fLastSecond = std::max( fStepsSecond, m_fLastSecond ); //LOG->Trace( "fLastSecond = %f", m_fLastSecond ); // fStepsSecond will usually be greater than any value already in the map, @@ -380,7 +380,7 @@ void PlayerStageStats::SetLifeRecordAt( float fLife, float fStepsSecond ) // entry. Then the second call of the frame occurs and sets the life for // the current time to a lower value. // -Kyz - map::iterator curr= m_fLifeRecord.find(fStepsSecond); + std::map::iterator curr= m_fLifeRecord.find(fStepsSecond); if(curr != m_fLifeRecord.end()) { if(curr->second != fLife) @@ -401,17 +401,17 @@ void PlayerStageStats::SetLifeRecordAt( float fLife, float fStepsSecond ) // we can eliminate record B without losing data. Only check the last three // records in the map since we're only inserting at the end, and we know all // earlier redundant records have already been removed. - map::iterator C = m_fLifeRecord.end(); + std::map::iterator C = m_fLifeRecord.end(); --C; if( C == m_fLifeRecord.begin() ) // no earlier records left return; - map::iterator B = C; + std::map::iterator B = C; --B; if( B == m_fLifeRecord.begin() ) // no earlier records left return; - map::iterator A = B; + std::map::iterator A = B; --A; if( A->second == B->second && B->second == C->second ) @@ -424,7 +424,7 @@ float PlayerStageStats::GetLifeRecordAt( float fStepsSecond ) const return 0; // Find the first element whose key is greater than k. - map::const_iterator it = m_fLifeRecord.upper_bound( fStepsSecond ); + std::map::const_iterator it = m_fLifeRecord.upper_bound( fStepsSecond ); // Find the last element whose key is less than or equal to k. if( it != m_fLifeRecord.begin() ) @@ -440,10 +440,10 @@ float PlayerStageStats::GetLifeRecordLerpAt( float fStepsSecond ) const return 0; // Find the first element whose key is greater than k. - map::const_iterator later = m_fLifeRecord.upper_bound( fStepsSecond ); + std::map::const_iterator later = m_fLifeRecord.upper_bound( fStepsSecond ); // Find the last element whose key is less than or equal to k. - map::const_iterator earlier = later; + std::map::const_iterator earlier = later; if( earlier != m_fLifeRecord.begin() ) --earlier; @@ -470,7 +470,7 @@ float PlayerStageStats::GetCurrentLife() const { if( m_fLifeRecord.empty() ) return 0; - map::const_iterator iter = m_fLifeRecord.end(); + std::map::const_iterator iter = m_fLifeRecord.end(); --iter; return iter->second; } @@ -488,8 +488,8 @@ void PlayerStageStats::UpdateComboList( float fSecond, bool bRollover ) if( !bRollover ) { - m_fFirstSecond = min( fSecond, m_fFirstSecond ); - m_fLastSecond = max( fSecond, m_fLastSecond ); + m_fFirstSecond = std::min( fSecond, m_fFirstSecond ); + m_fLastSecond = std::max( fSecond, m_fLastSecond ); //LOG->Trace( "fLastSecond = %f", fLastSecond ); } @@ -644,7 +644,7 @@ void PlayerStageStats::CalcAwards( PlayerNumber p, bool bGaveUp, bool bUsedAutop if( bGaveUp || bUsedAutoplay ) return; - deque &vPdas = GAMESTATE->m_vLastStageAwards[p]; + std::deque &vPdas = GAMESTATE->m_vLastStageAwards[p]; //LOG->Trace( "per difficulty awards" ); @@ -771,7 +771,7 @@ public: static int GetPlayedSteps( T* p, lua_State *L ) { lua_newtable(L); - for( int i = 0; i < (int) min(p->m_iStepsPlayed, (int) p->m_vpPossibleSteps.size()); ++i ) + for( int i = 0; i < (int) std::min(p->m_iStepsPlayed, (int) p->m_vpPossibleSteps.size()); ++i ) { p->m_vpPossibleSteps[i]->PushSelf(L); lua_rawseti( L, -2, i+1 ); diff --git a/src/PlayerStageStats.h b/src/PlayerStageStats.h index 3098fba4d2..d4cac6eda8 100644 --- a/src/PlayerStageStats.h +++ b/src/PlayerStageStats.h @@ -41,7 +41,7 @@ public: bool m_bJoined; bool m_bPlayerCanAchieveFullCombo; - vector m_vpPossibleSteps; + std::vector m_vpPossibleSteps; int m_iStepsPlayed; // how many of m_vpPossibleStepshow many of m_vpPossibleSteps were played /** * @brief How far into the music did the Player last before failing? @@ -98,7 +98,7 @@ public: float m_iNumControllerSteps; float m_fCaloriesBurned; - map m_fLifeRecord; + std::map m_fLifeRecord; void SetLifeRecordAt( float fLife, float fStepsSecond ); void GetLifeRecord( float *fLifeOut, int iNumSamples, float fStepsEndSecond ) const; float GetLifeRecordAt( float fStepsSecond ) const; @@ -137,7 +137,7 @@ public: Combo_t(): m_fStartSecond(0), m_fSizeSeconds(0), m_cnt(0), m_rollover(0) { } bool IsZero() const { return m_fStartSecond < 0; } }; - vector m_ComboList; + std::vector m_ComboList; float m_fFirstSecond; float m_fLastSecond; diff --git a/src/PlayerState.cpp b/src/PlayerState.cpp index 5ed8c66210..899c5c2df9 100644 --- a/src/PlayerState.cpp +++ b/src/PlayerState.cpp @@ -88,7 +88,7 @@ void PlayerState::Update( float fDelta ) m_PlayerOptions.Update( fDelta ); if( m_fSecondsUntilAttacksPhasedOut > 0 ) - m_fSecondsUntilAttacksPhasedOut = max( 0, m_fSecondsUntilAttacksPhasedOut - fDelta ); + m_fSecondsUntilAttacksPhasedOut = std::max( 0.0f, m_fSecondsUntilAttacksPhasedOut - fDelta ); } void PlayerState::SetPlayerNumber(PlayerNumber pn) @@ -248,7 +248,7 @@ public: static int GetPlayerOptionsArray( T* p, lua_State *L ) { ModsLevel m = Enum::Check( L, 1 ); - vector s; + std::vector s; p->m_PlayerOptions.Get(m).GetMods(s); LuaHelpers::CreateTableFromArray( s, L ); return 1; diff --git a/src/PlayerState.h b/src/PlayerState.h index 9ed4d1b4a7..0b76e3c890 100644 --- a/src/PlayerState.h +++ b/src/PlayerState.h @@ -70,13 +70,13 @@ public: * This vector will be populated on Player::Load() be used a lot in * ArrowEffects to determine the target beat in O(log N). */ - vector m_CacheDisplayedBeat; + std::vector m_CacheDisplayedBeat; /** * @brief Holds a vector sorted by beat, the cumulative number of notes from * the start of the song. This will be used by [insert more description here] */ - vector m_CacheNoteStat; + std::vector m_CacheNoteStat; /** * @brief Change the PlayerOptions to their default. @@ -114,7 +114,7 @@ public: bool m_bAttackEndedThisUpdate; // flag for other objects to watch (play sounds) AttackArray m_ActiveAttacks; - vector m_ModsToApply; + std::vector m_ModsToApply; // Haste int m_iTapsHitSinceLastHasteUpdate; diff --git a/src/Preference.h b/src/Preference.h index d96bcf2812..ad93e25d09 100644 --- a/src/Preference.h +++ b/src/Preference.h @@ -147,7 +147,7 @@ class Preference1D { public: typedef Preference PreferenceT; - vector m_v; + std::vector m_v; Preference1D( void pfn(size_t i, RString &sNameOut, T &defaultValueOut ), size_t N, PreferenceType type = PreferenceType::Mutable ) { diff --git a/src/PrefsManager.cpp b/src/PrefsManager.cpp index 8ed4f88dac..dd176edad1 100644 --- a/src/PrefsManager.cpp +++ b/src/PrefsManager.cpp @@ -370,7 +370,7 @@ void PrefsManager::RestoreGamePrefs() // load prefs GamePrefs gp; - map::const_iterator iter = m_mapGameNameToGamePrefs.find( m_sCurrentGame ); + std::map::const_iterator iter = m_mapGameNameToGamePrefs.find( m_sCurrentGame ); if( iter != m_mapGameNameToGamePrefs.end() ) gp = iter->second; diff --git a/src/PrefsManager.h b/src/PrefsManager.h index 7fd51004dc..b8f212cc48 100644 --- a/src/PrefsManager.h +++ b/src/PrefsManager.h @@ -143,7 +143,7 @@ protected: RString m_sTheme; RString m_sDefaultModifiers; }; - map m_mapGameNameToGamePrefs; + std::map m_mapGameNameToGamePrefs; public: Preference m_bWindowed; diff --git a/src/Profile.cpp b/src/Profile.cpp index 0f35e33244..ef6cf9ed03 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -231,7 +231,7 @@ RString Profile::GetDisplayNameOrHighScoreName() const Character *Profile::GetCharacter() const { - vector vpCharacters; + std::vector vpCharacters; CHARMAN->GetCharacters( vpCharacters ); for (Character *c : vpCharacters) { @@ -328,7 +328,7 @@ int Profile::GetTotalTrailsWithTopGrade( StepsType st, CourseDifficulty d, Grade int iCount = 0; // add course high scores - vector vCourses; + std::vector vCourses; SONGMAN->GetAllCourses( vCourses, false ); for (Course const *pCourse : vCourses) { @@ -336,7 +336,7 @@ int Profile::GetTotalTrailsWithTopGrade( StepsType st, CourseDifficulty d, Grade if( !pCourse->AllSongsAreFixed() ) continue; - vector vTrails; + std::vector vTrails; Trail* pTrail = pCourse->GetTrail( st, d ); if( pTrail == nullptr ) continue; @@ -357,7 +357,7 @@ float Profile::GetSongsPossible( StepsType st, Difficulty dc ) const int iTotalSteps = 0; // add steps high scores - const vector &vSongs = SONGMAN->GetAllSongs(); + const std::vector &vSongs = SONGMAN->GetAllSongs(); for( unsigned i=0; iNormallyDisplayed() ) continue; // skip - vector vSteps = pSong->GetAllSteps(); + std::vector vSteps = pSong->GetAllSteps(); for( unsigned j=0; j &vpCoursesOut ) +static void GetHighScoreCourses( std::vector &vpCoursesOut ) { vpCoursesOut.clear(); - vector vpCourses; + std::vector vpCourses; SONGMAN->GetAllCourses( vpCourses, false ); for (Course *c : vpCourses) @@ -463,7 +463,7 @@ static void GetHighScoreCourses( vector &vpCoursesOut ) float Profile::GetCoursesPossible( StepsType st, CourseDifficulty cd ) const { - vector vpCourses; + std::vector vpCourses; GetHighScoreCourses( vpCourses ); return std::count_if(vpCourses.begin(), vpCourses.end(), [&](Course const *c) { return c->GetTrail(st, cd) != nullptr; @@ -474,7 +474,7 @@ float Profile::GetCoursesActual( StepsType st, CourseDifficulty cd ) const { float fTotalPercents = 0; - vector vpCourses; + std::vector vpCourses; GetHighScoreCourses( vpCourses ); for (Course const *c : vpCourses) { @@ -545,7 +545,7 @@ int Profile::GetSongNumTimesPlayed( const SongID& songID ) const */ bool Profile::GetDefaultModifiers( const Game* pGameType, RString &sModifiersOut ) const { - map::const_iterator it; + std::map::const_iterator it; it = m_sDefaultModifiers.find( pGameType->m_szName ); if( it == m_sDefaultModifiers.end() ) return false; @@ -793,7 +793,7 @@ void Profile::GetAllUsedHighScoreNames(std::set& names) main_entry->second.sub_member.begin(); \ sub_entry != main_entry->second.sub_member.end(); ++sub_entry) \ { \ - for(vector::iterator high_score= \ + for(std::vector::iterator high_score= \ sub_entry->second.hsl.vHighScores.begin(); \ high_score != sub_entry->second.hsl.vHighScores.end(); \ ++high_score) \ @@ -859,11 +859,11 @@ void Profile::MergeScoresFromOtherProfile(Profile* other, bool skip_totals, MERGE_FIELD(m_iNumStagesPassedByGrade[i]); } #undef MERGE_FIELD - for(map::iterator other_cal= + for(std::map::iterator other_cal= other->m_mapDayToCaloriesBurned.begin(); other_cal != other->m_mapDayToCaloriesBurned.end(); ++other_cal) { - map::iterator this_cal= + std::map::iterator this_cal= m_mapDayToCaloriesBurned.find(other_cal->first); if(this_cal == m_mapDayToCaloriesBurned.end()) { @@ -938,7 +938,7 @@ void Profile::MergeScoresFromOtherProfile(Profile* other, bool skip_totals, // duplicates are removed because they come from the user mistakenly // merging a second time. -Kyz std::sort(m_vScreenshots.begin(), m_vScreenshots.end()); - vector::iterator unique_end= + std::vector::iterator unique_end= std::unique(m_vScreenshots.begin(), m_vScreenshots.end()); m_vScreenshots.erase(unique_end, m_vScreenshots.end()); } @@ -1100,7 +1100,7 @@ void Profile::HandleStatsPrefixChange(RString dir, bool require_signature) ProfileType type= m_Type; int priority= m_ListPriority; RString guid= m_sGuid; - map default_mods= m_sDefaultModifiers; + std::map default_mods= m_sDefaultModifiers; SortOrder sort_order= m_SortOrder; Difficulty last_diff= m_LastDifficulty; CourseDifficulty last_course_diff= m_LastCourseDifficulty; @@ -1186,7 +1186,7 @@ void Profile::LoadSongsFromDir(RString const& dir, ProfileSlot prof_slot) if(FILEMAN->DoesFileExist(songs_folder)) { LOG->Trace("Found songs folder in profile."); - vector song_folders; + std::vector song_folders; RageTimer song_load_start_time; song_load_start_time.Touch(); FILEMAN->GetDirListing(songs_folder + "/*", song_folders, true, true); @@ -1243,7 +1243,7 @@ ProfileLoadResult Profile::LoadStatsFromDir(RString dir, bool require_signature) } int iError; - unique_ptr pFile(FILEMAN->Open(fn, RageFile::READ, iError)); + std::unique_ptr pFile(FILEMAN->Open(fn, RageFile::READ, iError)); if(pFile.get() == nullptr) { LOG->Trace("Error opening %s: %s", fn.c_str(), strerror(iError)); @@ -1443,7 +1443,7 @@ XNode *Profile::SaveStatsXmlCreateNode() const bool Profile::SaveStatsXmlToDir( RString sDir, bool bSignData ) const { LOG->Trace( "SaveStatsXmlToDir: %s", sDir.c_str() ); - unique_ptr xml( SaveStatsXmlCreateNode() ); + std::unique_ptr xml( SaveStatsXmlCreateNode() ); sDir= sDir + PROFILEMAN->GetStatsPrefix(); // Save stats.xml @@ -1704,7 +1704,7 @@ ProfileLoadResult Profile::LoadEditableDataFromDir( RString sDir ) ini.GetValue( "Editable", "IsMale", m_IsMale ); // This is data that the user can change, so we have to validate it. - wstring wstr = RStringToWstring(m_sDisplayName); + std::wstring wstr = RStringToWstring(m_sDisplayName); if( wstr.size() > PROFILE_MAX_DISPLAY_NAME_LENGTH ) wstr = wstr.substr(0, PROFILE_MAX_DISPLAY_NAME_LENGTH); m_sDisplayName = WStringToRString(wstr); @@ -2102,7 +2102,7 @@ void Profile::LoadCourseScoresFromNode( const XNode* pCourseScores ) ASSERT( pCourseScores->GetName() == "CourseScores" ); - vector vpAllCourses; + std::vector vpAllCourses; SONGMAN->GetAllCourses( vpAllCourses, true ); FOREACH_CONST_Child( pCourseScores, pCourse ) @@ -2338,7 +2338,7 @@ XNode* Profile::SaveCalorieDataCreateNode() const float Profile::GetCaloriesBurnedForDay( DateTime day ) const { day.StripTime(); - map::const_iterator i = m_mapDayToCaloriesBurned.find( day ); + std::map::const_iterator i = m_mapDayToCaloriesBurned.find( day ); if( i == m_mapDayToCaloriesBurned.end() ) return 0; else @@ -2380,7 +2380,7 @@ void Profile::SaveStepsRecentScore( const Song* pSong, const Steps* pSteps, High ASSERT( h.stepsID.IsValid() ); h.hs = hs; - unique_ptr xml( new XNode("Stats") ); + std::unique_ptr xml( new XNode("Stats") ); xml->AppendChild( "MachineGuid", PROFILEMAN->GetMachineProfile()->m_sGuid ); XNode *recent = xml->AppendChild( new XNode("RecentSongScores") ); recent->AppendChild( h.CreateNode() ); @@ -2407,7 +2407,7 @@ void Profile::SaveCourseRecentScore( const Course* pCourse, const Trail* pTrail, h.trailID.FromTrail( pTrail ); h.hs = hs; - unique_ptr xml( new XNode("Stats") ); + std::unique_ptr xml( new XNode("Stats") ); xml->AppendChild( "MachineGuid", PROFILEMAN->GetMachineProfile()->m_sGuid ); XNode *recent = xml->AppendChild( new XNode("RecentCourseScores") ); recent->AppendChild( h.CreateNode() ); @@ -2416,7 +2416,7 @@ void Profile::SaveCourseRecentScore( const Course* pCourse, const Trail* pTrail, */ const Profile::HighScoresForASong *Profile::GetHighScoresForASong( const SongID& songID ) const { - map::const_iterator it; + std::map::const_iterator it; it = m_SongHighScores.find( songID ); if( it == m_SongHighScores.end() ) return nullptr; @@ -2425,7 +2425,7 @@ const Profile::HighScoresForASong *Profile::GetHighScoresForASong( const SongID& const Profile::HighScoresForACourse *Profile::GetHighScoresForACourse( const CourseID& courseID ) const { - map::const_iterator it; + std::map::const_iterator it; it = m_CourseHighScores.find( courseID ); if( it == m_CourseHighScores.end() ) return nullptr; @@ -2505,7 +2505,7 @@ RString Profile::MakeUniqueFileNameNoExtension( RString sDir, RString sFileNameB { FILEMAN->FlushDirCache( sDir ); // Find a file name for the screenshot - vector files; + std::vector files; GetDirListing( sDir + sFileNameBeginning+"*", files, false, false ); sort( files.begin(), files.end() ); @@ -2514,7 +2514,7 @@ RString Profile::MakeUniqueFileNameNoExtension( RString sDir, RString sFileNameB for( int i = files.size()-1; i >= 0; --i ) { static Regex re( "^" + sFileNameBeginning + "([0-9]{5})\\....$" ); - vector matches; + std::vector matches; if( !re.Compare( files[i], matches ) ) continue; diff --git a/src/Profile.h b/src/Profile.h index 267ccc71dc..412d09c9d8 100644 --- a/src/Profile.h +++ b/src/Profile.h @@ -199,7 +199,7 @@ public: static RString MakeGuid(); RString m_sGuid; - map m_sDefaultModifiers; + std::map m_sDefaultModifiers; SortOrder m_SortOrder; std::vector m_songs; Difficulty m_LastDifficulty; @@ -228,7 +228,7 @@ public: int m_iTotalLifts; /** @brief Is this a brand new profile? */ bool m_bNewProfile; - set m_UnlockedEntryIDs; + std::set m_UnlockedEntryIDs; /** * @brief Which machine did we play on last, based on the Guid? * @@ -240,7 +240,7 @@ public: /* These stats count twice in the machine profile if two players are playing; * that's the only approach that makes sense for ByDifficulty and ByMeter. */ int m_iNumSongsPlayedByPlayMode[NUM_PlayMode]; - map m_iNumSongsPlayedByStyle; + std::map m_iNumSongsPlayedByStyle; int m_iNumSongsPlayedByDifficulty[NUM_Difficulty]; int m_iNumSongsPlayedByMeter[MAX_METER+1]; /** @@ -320,7 +320,7 @@ public: // Screenshot Data - vector m_vScreenshots; + std::vector m_vScreenshots; void AddScreenshot( const Screenshot &screenshot ); int GetNextScreenshotIndex() { return m_vScreenshots.size(); } @@ -339,7 +339,7 @@ public: Calories(): fCals(0) {} float fCals; }; - map m_mapDayToCaloriesBurned; + std::map m_mapDayToCaloriesBurned; float GetCaloriesBurnedForDay( DateTime day ) const; /* diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp index 2e237a6c88..5f4c4a44a1 100644 --- a/src/ProfileManager.cpp +++ b/src/ProfileManager.cpp @@ -64,7 +64,7 @@ struct DirAndProfile profile.swap(other.profile); } }; -static vector g_vLocalProfile; +static std::vector g_vLocalProfile; static ThemeMetric FIXED_PROFILES ( "ProfileManager", "FixedProfiles" ); @@ -237,7 +237,7 @@ bool ProfileManager::LoadLocalProfileFromMachine( PlayerNumber pn ) return true; } -void ProfileManager::GetMemoryCardProfileDirectoriesToTry( vector &asDirsToTry ) +void ProfileManager::GetMemoryCardProfileDirectoriesToTry( std::vector &asDirsToTry ) { /* Try to load the preferred profile. */ asDirsToTry.push_back( PREFSMAN->m_sMemoryCardProfileSubdir.Get() ); @@ -254,7 +254,7 @@ bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn, bool bLoadEdits if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready ) return false; - vector asDirsToTry; + std::vector asDirsToTry; GetMemoryCardProfileDirectoriesToTry( asDirsToTry ); m_bNewProfile[pn] = true; @@ -325,7 +325,7 @@ bool ProfileManager::LoadFirstAvailableProfile( PlayerNumber pn, bool bLoadEdits bool ProfileManager::FastLoadProfileNameFromMemoryCard( RString sRootDir, RString &sName ) const { - vector asDirsToTry; + std::vector asDirsToTry; GetMemoryCardProfileDirectoriesToTry( asDirsToTry ); for( unsigned i = 0; i < asDirsToTry.size(); ++i ) @@ -430,7 +430,7 @@ void ProfileManager::UnloadAllLocalProfiles() g_vLocalProfile.clear(); } -static void add_category_to_global_list(vector& cat) +static void add_category_to_global_list(std::vector& cat) { g_vLocalProfile.insert(g_vLocalProfile.end(), cat.begin(), cat.end()); } @@ -439,7 +439,7 @@ void ProfileManager::RefreshLocalProfilesFromDisk() { UnloadAllLocalProfiles(); - vector profile_ids; + std::vector profile_ids; GetDirListing(USER_PROFILES_DIR + "*", profile_ids, true, true); // Profiles have 3 types: // 1. Guest profiles: @@ -450,7 +450,7 @@ void ProfileManager::RefreshLocalProfilesFromDisk() // Meant for use when testing things, listed last. // If the user renames a profile directory manually, that should not be a // problem. -Kyz - map > categorized_profiles; + std::map> categorized_profiles; // The type data for a profile is in its own file so that loading isn't // slowed down by copying temporary profiles around to make sure the list // is sorted. The profiles are loaded at the end. -Kyz @@ -459,7 +459,7 @@ void ProfileManager::RefreshLocalProfilesFromDisk() DirAndProfile derp; derp.sDir= id + "/"; derp.profile.LoadTypeFromDir(derp.sDir); - map >::iterator category= + std::map>::iterator category= categorized_profiles.find(derp.profile.m_Type); if(category == categorized_profiles.end()) { @@ -518,7 +518,7 @@ bool ProfileManager::CreateLocalProfile( RString sName, RString &sProfileIDOut ) // handled. -Kyz int max_profile_number= -1; int first_free_number= 0; - vector profile_ids; + std::vector profile_ids; GetLocalProfileIDs(profile_ids); for (std::vector::const_iterator id = profile_ids.begin(); id != profile_ids.end(); ++id) { @@ -531,7 +531,7 @@ bool ProfileManager::CreateLocalProfile( RString sName, RString &sProfileIDOut ) { ++first_free_number; } - max_profile_number= max(tmp, max_profile_number); + max_profile_number= std::max(tmp, max_profile_number); } } @@ -629,7 +629,7 @@ bool ProfileManager::DeleteLocalProfile( RString sProfileID ) // flush directory cache in an attempt to get this working FILEMAN->FlushDirCache( sProfileDir ); - for (vector::iterator i = g_vLocalProfile.begin(); i != g_vLocalProfile.end(); ++i) + for (std::vector::iterator i = g_vLocalProfile.begin(); i != g_vLocalProfile.end(); ++i) { if( i->sDir == sProfileDir ) { @@ -855,7 +855,7 @@ int ProfileManager::GetSongNumTimesPlayed( const Song* pSong, ProfileSlot slot ) void ProfileManager::AddStepsScore( const Song* pSong, const Steps* pSteps, PlayerNumber pn, const HighScore &hs_, int &iPersonalIndexOut, int &iMachineIndexOut ) { HighScore hs = hs_; - hs.SetPercentDP( max(0, hs.GetPercentDP()) ); // bump up negative scores + hs.SetPercentDP( std::max(0.0f, hs.GetPercentDP()) ); // bump up negative scores iPersonalIndexOut = -1; iMachineIndexOut = -1; @@ -909,7 +909,7 @@ void ProfileManager::IncrementStepsPlayCount( const Song* pSong, const Steps* pS void ProfileManager::AddCourseScore( const Course* pCourse, const Trail* pTrail, PlayerNumber pn, const HighScore &hs_, int &iPersonalIndexOut, int &iMachineIndexOut ) { HighScore hs = hs_; - hs.SetPercentDP(max( 0, hs.GetPercentDP()) ); // bump up negative scores + hs.SetPercentDP(std::max( 0.0f, hs.GetPercentDP()) ); // bump up negative scores iPersonalIndexOut = -1; iMachineIndexOut = -1; @@ -982,7 +982,7 @@ bool ProfileManager::IsPersistentProfile( ProfileSlot slot ) const } } -void ProfileManager::GetLocalProfileIDs( vector &vsProfileIDsOut ) const +void ProfileManager::GetLocalProfileIDs( std::vector &vsProfileIDsOut ) const { vsProfileIDsOut.clear(); for (DirAndProfile const &i : g_vLocalProfile) @@ -992,7 +992,7 @@ void ProfileManager::GetLocalProfileIDs( vector &vsProfileIDsOut ) cons } } -void ProfileManager::GetLocalProfileDisplayNames( vector &vsProfileDisplayNamesOut ) const +void ProfileManager::GetLocalProfileDisplayNames( std::vector &vsProfileDisplayNamesOut ) const { vsProfileDisplayNamesOut.clear(); for (DirAndProfile const &i : g_vLocalProfile) @@ -1126,14 +1126,14 @@ public: } static int GetLocalProfileIDs( T* p, lua_State *L ) { - vector vsProfileIDs; + std::vector vsProfileIDs; p->GetLocalProfileIDs(vsProfileIDs); LuaHelpers::CreateTableFromArray( vsProfileIDs, L ); return 1; } static int GetLocalProfileDisplayNames( T* p, lua_State *L ) { - vector vsProfileNames; + std::vector vsProfileNames; p->GetLocalProfileDisplayNames(vsProfileNames); LuaHelpers::CreateTableFromArray( vsProfileNames, L ); return 1; diff --git a/src/ProfileManager.h b/src/ProfileManager.h index cf3bf8a4d0..10ceb18bd7 100644 --- a/src/ProfileManager.h +++ b/src/ProfileManager.h @@ -38,8 +38,8 @@ public: void AddLocalProfileByID( Profile *pProfile, RString sProfileID ); // transfers ownership of pProfile bool RenameLocalProfile( RString sProfileID, RString sNewName ); bool DeleteLocalProfile( RString sProfileID ); - void GetLocalProfileIDs( vector &vsProfileIDsOut ) const; - void GetLocalProfileDisplayNames( vector &vsProfileDisplayNamesOut ) const; + void GetLocalProfileIDs( std::vector &vsProfileIDsOut ) const; + void GetLocalProfileDisplayNames( std::vector &vsProfileDisplayNamesOut ) const; int GetLocalProfileIndexFromID( RString sProfileID ) const; int GetNumLocalProfiles() const; @@ -102,7 +102,7 @@ public: void AddCategoryScore( StepsType st, RankingCategory rc, PlayerNumber pn, const HighScore &hs, int &iPersonalIndexOut, int &iMachineIndexOut ); void IncrementCategoryPlayCount( StepsType st, RankingCategory rc, PlayerNumber pn ); - static void GetMemoryCardProfileDirectoriesToTry( vector &asDirsToTry ); + static void GetMemoryCardProfileDirectoriesToTry( std::vector &asDirsToTry ); // Lua void PushSelf( lua_State *L ); diff --git a/src/RadarValues.cpp b/src/RadarValues.cpp index ea04503a8c..0371fa6d25 100644 --- a/src/RadarValues.cpp +++ b/src/RadarValues.cpp @@ -73,9 +73,9 @@ RString RadarValues::ToString( int iMaxValues ) const { if( iMaxValues == -1 ) iMaxValues = NUM_RadarCategory; - iMaxValues = min( iMaxValues, (int)NUM_RadarCategory ); + iMaxValues = std::min( iMaxValues, (int)NUM_RadarCategory ); - vector asRadarValues; + std::vector asRadarValues; for( int r=0; r < iMaxValues; r++ ) { asRadarValues.push_back(ssprintf("%.3f", (*this)[r])); @@ -86,7 +86,7 @@ RString RadarValues::ToString( int iMaxValues ) const void RadarValues::FromString( RString sRadarValues ) { - vector saValues; + std::vector saValues; split( sRadarValues, ",", saValues, true ); if( saValues.size() != NUM_RadarCategory ) diff --git a/src/RageBitmapTexture.cpp b/src/RageBitmapTexture.cpp index 419d9ea85d..dda1019f82 100644 --- a/src/RageBitmapTexture.cpp +++ b/src/RageBitmapTexture.cpp @@ -22,7 +22,7 @@ static void GetResolutionFromFileName( RString sPath, int &iWidth, int &iHeight * Be careful that this doesn't get mixed up with frame dimensions. */ static Regex re( "\\([^\\)]*res ([0-9]+)x([0-9]+).*\\)" ); - vector asMatches; + std::vector asMatches; if( !re.Compare(sPath, asMatches) ) return; @@ -110,21 +110,21 @@ void RageBitmapTexture::Create() RString sHintString = GetID().filename + actualID.AdditionalTextureHints; sHintString.MakeLower(); - if( sHintString.find("32bpp") != string::npos ) actualID.iColorDepth = 32; - else if( sHintString.find("16bpp") != string::npos ) actualID.iColorDepth = 16; - if( sHintString.find("dither") != string::npos ) actualID.bDither = true; - if( sHintString.find("stretch") != string::npos ) actualID.bStretch = true; - if( sHintString.find("mipmaps") != string::npos ) actualID.bMipMaps = true; - if( sHintString.find("nomipmaps") != string::npos ) actualID.bMipMaps = false; // check for "nomipmaps" after "mipmaps" + if( sHintString.find("32bpp") != std::string::npos ) actualID.iColorDepth = 32; + else if( sHintString.find("16bpp") != std::string::npos ) actualID.iColorDepth = 16; + if( sHintString.find("dither") != std::string::npos ) actualID.bDither = true; + if( sHintString.find("stretch") != std::string::npos ) actualID.bStretch = true; + if( sHintString.find("mipmaps") != std::string::npos ) actualID.bMipMaps = true; + if( sHintString.find("nomipmaps") != std::string::npos ) actualID.bMipMaps = false; // check for "nomipmaps" after "mipmaps" /* If the image is marked grayscale, then use all bits not used for alpha * for the intensity. This way, if an image has no alpha, you get an 8-bit * grayscale; if it only has boolean transparency, you get a 7-bit grayscale. */ - if( sHintString.find("grayscale") != string::npos ) actualID.iGrayscaleBits = 8-actualID.iAlphaBits; + if( sHintString.find("grayscale") != std::string::npos ) actualID.iGrayscaleBits = 8-actualID.iAlphaBits; /* This indicates that the only component in the texture is alpha; assume all * color is white. */ - if( sHintString.find("alphamap") != string::npos ) actualID.iGrayscaleBits = 0; + if( sHintString.find("alphamap") != std::string::npos ) actualID.iGrayscaleBits = 0; /* No iGrayscaleBits for images that are already paletted. We don't support * that; and that hint is intended for use on images that are already grayscale, @@ -133,7 +133,7 @@ void RageBitmapTexture::Create() actualID.iGrayscaleBits = -1; /* Cap the max texture size to the hardware max. */ - actualID.iMaxSize = min( actualID.iMaxSize, DISPLAY->GetMaxTextureSize() ); + actualID.iMaxSize = std::min( actualID.iMaxSize, DISPLAY->GetMaxTextureSize() ); /* Save information about the source. */ m_iSourceWidth = pImg->w; @@ -144,7 +144,7 @@ void RageBitmapTexture::Create() m_iImageHeight = m_iSourceHeight; /* if "doubleres" (high resolution) and we're not allowing high res textures, then image dimensions are half of the source */ - if( sHintString.find("doubleres") != string::npos ) + if( sHintString.find("doubleres") != std::string::npos ) { if( !StepMania::GetHighResolutionTextures() ) { @@ -154,8 +154,8 @@ void RageBitmapTexture::Create() } /* image size cannot exceed max size */ - m_iImageWidth = min( m_iImageWidth, actualID.iMaxSize ); - m_iImageHeight = min( m_iImageHeight, actualID.iMaxSize ); + m_iImageWidth = std::min( m_iImageWidth, actualID.iMaxSize ); + m_iImageHeight = std::min( m_iImageHeight, actualID.iMaxSize ); /* Texture dimensions need to be a power of two; jump to the next. */ m_iTextureWidth = power_of_two(m_iImageWidth); @@ -165,8 +165,8 @@ void RageBitmapTexture::Create() if( m_iTextureWidth < 8 || m_iTextureHeight < 8 ) { actualID.bStretch = true; - m_iTextureWidth = max( 8, m_iTextureWidth ); - m_iTextureHeight = max( 8, m_iTextureHeight ); + m_iTextureWidth = std::max( 8, m_iTextureWidth ); + m_iTextureHeight = std::max( 8, m_iTextureHeight ); } ASSERT_M( m_iTextureWidth <= actualID.iMaxSize, ssprintf("w %i, %i", m_iTextureWidth, actualID.iMaxSize) ); @@ -210,7 +210,7 @@ void RageBitmapTexture::Create() int iSourceAlphaBits = 8 - pImg->format->Loss[3]; // Don't use more than we were hinted to. - iSourceAlphaBits = min( actualID.iAlphaBits, iSourceAlphaBits ); + iSourceAlphaBits = std::min( actualID.iAlphaBits, iSourceAlphaBits ); switch( iSourceAlphaBits ) { @@ -276,7 +276,7 @@ void RageBitmapTexture::Create() // Otherwise, pixel/texel alignment will be off. int iDimensionMultiple = 2; - if( sHintString.find("doubleres") != string::npos ) + if( sHintString.find("doubleres") != std::string::npos ) { iDimensionMultiple = 4; } @@ -334,7 +334,7 @@ void RageBitmapTexture::Create() * with dimensions 1/2 of the source. So, cut down the source dimension here * after everything above is finished operating with the real image * source dimensions. */ - if( sHintString.find("doubleres") != string::npos ) + if( sHintString.find("doubleres") != std::string::npos ) { m_iSourceWidth = m_iSourceWidth / 2; m_iSourceHeight = m_iSourceHeight / 2; diff --git a/src/RageDisplay.cpp b/src/RageDisplay.cpp index 68e1c0558f..74b9fea7f5 100644 --- a/src/RageDisplay.cpp +++ b/src/RageDisplay.cpp @@ -41,7 +41,7 @@ struct Centering int m_iTranslateX, m_iTranslateY, m_iAddWidth, m_iAddHeight; }; -static vector g_CenteringStack( 1, Centering(0, 0, 0, 0) ); +static std::vector g_CenteringStack( 1, Centering(0, 0, 0, 0) ); RageDisplay* DISPLAY = nullptr; // global and accessible from anywhere in our program @@ -69,7 +69,7 @@ static LocalizedString SETVIDEOMODE_FAILED ( "RageDisplay", "SetVideoMode failed RString RageDisplay::SetVideoMode( VideoModeParams p, bool &bNeedReloadTextures ) { RString err; - vector vs; + std::vector vs; if( (err = this->TryVideoMode(p,bNeedReloadTextures)) == "" ) return RString(); @@ -277,7 +277,7 @@ void RageDisplay::SetDefaultRenderStates() // Matrix stuff class MatrixStack { - vector stack; + std::vector stack; public: MatrixStack(): stack() @@ -883,7 +883,7 @@ void RageDisplay::DrawTriangles( const RageSpriteVertex v[], int iNumVerts ) StatsAddVerts(iNumVerts); } -void RageDisplay::DrawCompiledGeometry( const RageCompiledGeometry *p, int iMeshIndex, const vector &vMeshes ) +void RageDisplay::DrawCompiledGeometry( const RageCompiledGeometry *p, int iMeshIndex, const std::vector &vMeshes ) { this->DrawCompiledGeometryInternal( p, iMeshIndex ); @@ -948,7 +948,7 @@ void RageDisplay::FrameLimitBeforeVsync( int iFPS ) } if( !HOOKS->AppHasFocus() ) - iDelayMicroseconds = max( iDelayMicroseconds, 10000 ); // give some time to other processes and threads + iDelayMicroseconds = std::max( iDelayMicroseconds, 10000 ); // give some time to other processes and threads if( iDelayMicroseconds > 0 ) usleep( iDelayMicroseconds ); @@ -968,7 +968,7 @@ RageCompiledGeometry::~RageCompiledGeometry() m_bNeedsNormals = false; } -void RageCompiledGeometry::Set( const vector &vMeshes, bool bNeedsNormals ) +void RageCompiledGeometry::Set( const std::vector &vMeshes, bool bNeedsNormals ) { m_bNeedsNormals = bNeedsNormals; @@ -981,8 +981,8 @@ void RageCompiledGeometry::Set( const vector &vMeshes, bool bNeedsNormal for( unsigned i=0; i &Vertices = mesh.Vertices; - const vector &Triangles = mesh.Triangles; + const std::vector &Vertices = mesh.Vertices; + const std::vector &Triangles = mesh.Triangles; MeshInfo& meshInfo = m_vMeshInfo[i]; meshInfo.m_bNeedsTextureMatrixScale = false; diff --git a/src/RageDisplay.h b/src/RageDisplay.h index 3d46ead273..d2c23a7c46 100644 --- a/src/RageDisplay.h +++ b/src/RageDisplay.h @@ -28,10 +28,10 @@ class RageCompiledGeometry public: virtual ~RageCompiledGeometry(); - void Set( const vector &vMeshes, bool bNeedsNormals ); + void Set( const std::vector &vMeshes, bool bNeedsNormals ); - virtual void Allocate( const vector &vMeshes ) = 0; // allocate space - virtual void Change( const vector &vMeshes ) = 0; // new data must be the same size as was passed to Set() + virtual void Allocate( const std::vector &vMeshes ) = 0; // allocate space + virtual void Change( const std::vector &vMeshes ) = 0; // new data must be the same size as was passed to Set() virtual void Draw( int iMeshIndex ) const = 0; protected: @@ -46,7 +46,7 @@ protected: int iTriangleCount; bool m_bNeedsTextureMatrixScale; }; - vector m_vMeshInfo; + std::vector m_vMeshInfo; bool m_bNeedsNormals; bool m_bAnyNeedsTextureMatrixScale; }; @@ -344,7 +344,7 @@ public: void DrawFan( const RageSpriteVertex v[], int iNumVerts ); void DrawStrip( const RageSpriteVertex v[], int iNumVerts ); void DrawTriangles( const RageSpriteVertex v[], int iNumVerts ); - void DrawCompiledGeometry( const RageCompiledGeometry *p, int iMeshIndex, const vector &vMeshes ); + void DrawCompiledGeometry( const RageCompiledGeometry *p, int iMeshIndex, const std::vector &vMeshes ); void DrawLineStrip( const RageSpriteVertex v[], int iNumVerts, float LineWidth ); void DrawSymmetricQuadStrip( const RageSpriteVertex v[], int iNumVerts ); void DrawCircle( const RageSpriteVertex &v, float radius ); diff --git a/src/RageDisplay_D3D.cpp b/src/RageDisplay_D3D.cpp index d415ab8b70..4015538082 100644 --- a/src/RageDisplay_D3D.cpp +++ b/src/RageDisplay_D3D.cpp @@ -303,7 +303,7 @@ D3DFORMAT FindBackBufferType(bool bWindowed, int iBPP) HRESULT hr; // If windowed, then bpp is ignored. Use whatever works. - vector vBackBufferFormats; // throw all possibilities in here + std::vector vBackBufferFormats; // throw all possibilities in here // When windowed, add all formats; otherwise add only formats that match dwBPP. if( iBPP == 32 || bWindowed ) @@ -775,19 +775,19 @@ void RageDisplay_D3D::SendCurrentMatrices() class RageCompiledGeometrySWD3D : public RageCompiledGeometry { public: - void Allocate( const vector &vMeshes ) + void Allocate( const std::vector &vMeshes ) { - m_vVertex.resize( max(1u, GetTotalVertices()) ); - m_vTriangles.resize( max(1u, GetTotalTriangles()) ); + m_vVertex.resize( std::max(1u, GetTotalVertices()) ); + m_vTriangles.resize( std::max(1u, GetTotalTriangles()) ); } - void Change( const vector &vMeshes ) + void Change( const std::vector &vMeshes ) { for( size_t i=0; i &Vertices = mesh.Vertices; - const vector &Triangles = mesh.Triangles; + const std::vector &Vertices = mesh.Vertices; + const std::vector &Triangles = mesh.Triangles; for( size_t j=0; j m_vVertex; - vector m_vTriangles; + std::vector m_vVertex; + std::vector m_vTriangles; }; RageCompiledGeometry* RageDisplay_D3D::CreateCompiledGeometry() @@ -850,9 +850,9 @@ void RageDisplay_D3D::DrawQuadsInternal( const RageSpriteVertex v[], int iNumVer int iNumIndices = iNumTriangles*3; // make a temporary index buffer - static vector vIndices; + static std::vector vIndices; size_t uOldSize = vIndices.size(); - size_t uNewSize = max(uOldSize, static_cast(iNumIndices)); + size_t uNewSize = std::max(uOldSize, static_cast(iNumIndices)); vIndices.resize( uNewSize ); for( uint16_t i=(uint16_t)uOldSize/6; i<(uint16_t)iNumQuads; i++ ) { @@ -886,9 +886,9 @@ void RageDisplay_D3D::DrawQuadStripInternal( const RageSpriteVertex v[], int iNu int iNumIndices = iNumTriangles*3; // make a temporary index buffer - static vector vIndices; + static std::vector vIndices; size_t uOldSize = vIndices.size(); - size_t uNewSize = max(uOldSize, static_cast(iNumIndices)); + size_t uNewSize = std::max(uOldSize, static_cast(iNumIndices)); vIndices.resize( uNewSize ); for( uint16_t i=(uint16_t)uOldSize/6; i<(uint16_t)iNumQuads; i++ ) { @@ -921,9 +921,9 @@ void RageDisplay_D3D::DrawSymmetricQuadStripInternal( const RageSpriteVertex v[] int iNumIndices = iNumTriangles*3; // make a temporary index buffer - static vector vIndices; + static std::vector vIndices; size_t uOldSize = vIndices.size(); - size_t uNewSize = max(uOldSize, static_cast(iNumIndices)); + size_t uNewSize = std::max(uOldSize, static_cast(iNumIndices)); vIndices.resize( uNewSize ); for( uint16_t i=(uint16_t)uOldSize/12; i<(uint16_t)iNumPieces; i++ ) { diff --git a/src/RageDisplay_GLES2.cpp b/src/RageDisplay_GLES2.cpp index 354397fa37..0e3e24c849 100644 --- a/src/RageDisplay_GLES2.cpp +++ b/src/RageDisplay_GLES2.cpp @@ -251,7 +251,7 @@ RageDisplay_GLES2::Init( const VideoModeParams &p, bool bAllowUnacceleratedRende // glGetString(GL_EXTENSIONS) doesn't work for GL3 core profiles. // this will be useful in the future. #if 0 - vector extensions; + std::vector extensions; const char *ext = 0; for (int i = 0; (ext = (const char*)glGetStringi(GL_EXTENSIONS, i)); i++) { @@ -266,7 +266,7 @@ RageDisplay_GLES2::Init( const VideoModeParams &p, bool bAllowUnacceleratedRende string type; for( size_t i = next; i segments; + std::vector segments; split(extensions[i], '_', segments); string this_type; if (segments.size() > 2) @@ -287,7 +287,7 @@ RageDisplay_GLES2::Init( const VideoModeParams &p, bool bAllowUnacceleratedRende string sList = ssprintf( " %s: ", type.c_str() ); while( next <= last ) { - vector segments; + std::vector segments; split( extensions[next], '_', segments ); string ext_short = join( "_", segments.begin()+2, segments.end() ); sList += ext_short; @@ -303,7 +303,7 @@ RageDisplay_GLES2::Init( const VideoModeParams &p, bool bAllowUnacceleratedRende } #else const char *szExtensionString = (const char *) glGetString(GL_EXTENSIONS); - vector asExtensions; + std::vector asExtensions; split( szExtensionString, " ", asExtensions ); sort( asExtensions.begin(), asExtensions.end() ); size_t iNextToPrint = 0; @@ -313,7 +313,7 @@ RageDisplay_GLES2::Init( const VideoModeParams &p, bool bAllowUnacceleratedRende RString sType; for( size_t i = iNextToPrint; i asBits; + std::vector asBits; split( asExtensions[i], "_", asBits ); RString sThisType; if (asBits.size() > 2) @@ -334,7 +334,7 @@ RageDisplay_GLES2::Init( const VideoModeParams &p, bool bAllowUnacceleratedRende RString sList = ssprintf( " %s: ", sType.c_str() ); while( iNextToPrint <= iLastToPrint ) { - vector asBits; + std::vector asBits; split( asExtensions[iNextToPrint], "_", asBits ); RString sShortExt = join( "_", asBits.begin()+2, asBits.end() ); sList += sShortExt; @@ -485,11 +485,11 @@ class RageCompiledGeometryGLES2 : public RageCompiledGeometry { public: - void Allocate( const vector &vMeshes ) + void Allocate( const std::vector &vMeshes ) { // TODO } - void Change( const vector &vMeshes ) + void Change( const std::vector &vMeshes ) { // TODO } diff --git a/src/RageDisplay_Null.cpp b/src/RageDisplay_Null.cpp index da0dfe3c8a..505b5adbb4 100644 --- a/src/RageDisplay_Null.cpp +++ b/src/RageDisplay_Null.cpp @@ -129,8 +129,8 @@ class RageCompiledGeometryNull : public RageCompiledGeometry { public: - void Allocate( const vector & ) {} - void Change( const vector & ) {} + void Allocate( const std::vector & ) {} + void Change( const std::vector & ) {} void Draw( int iMeshIndex ) const {} }; diff --git a/src/RageDisplay_OGL.cpp b/src/RageDisplay_OGL.cpp index 4b67af125a..2f428c57ce 100644 --- a/src/RageDisplay_OGL.cpp +++ b/src/RageDisplay_OGL.cpp @@ -281,7 +281,7 @@ RString GetInfoLog( GLhandleARB h ) return sRet; } -GLhandleARB CompileShader( GLenum ShaderType, RString sFile, vector asDefines ) +GLhandleARB CompileShader( GLenum ShaderType, RString sFile, std::vector asDefines ) { /* XXX: This would not be necessary if it wasn't for the special case for Cel. */ if (ShaderType == GL_FRAGMENT_SHADER_ARB && !glewIsSupported("GL_VERSION_2_0")) @@ -308,8 +308,8 @@ GLhandleARB CompileShader( GLenum ShaderType, RString sFile, vector asD LOG->Trace( "Compiling shader %s", sFile.c_str() ); GLhandleARB hShader = glCreateShaderObjectARB( ShaderType ); - vector apData; - vector aiLength; + std::vector apData; + std::vector aiLength; for (RString &s : asDefines) { s = ssprintf( "#define %s\n", s.c_str() ); @@ -342,7 +342,7 @@ GLhandleARB CompileShader( GLenum ShaderType, RString sFile, vector asD return hShader; } -GLhandleARB LoadShader( GLenum ShaderType, RString sFile, vector asDefines ) +GLhandleARB LoadShader( GLenum ShaderType, RString sFile, std::vector asDefines ) { /* Vertex shaders are supported by more hardware than fragment shaders. * If this causes any trouble I will have to up the requirement for both @@ -413,7 +413,7 @@ void InitShaders() // xxx: replace this with a ShaderManager or something that reads in // the shaders and determines shader type by file extension. -aj // argh shaders in stepmania are painful -colby - vector asDefines; + std::vector asDefines; // used for scrolling textures (I think) g_bTextureMatrixShader = LoadShader( GL_VERTEX_SHADER_ARB, "Data/Shaders/GLSL/Texture matrix scaling.vert", asDefines ); @@ -489,7 +489,7 @@ RString RageDisplay_Legacy::Init( const VideoModeParams &p, bool bAllowUnacceler LOG->Info( "OGL Extensions:" ); { const char *szExtensionString = (const char *) glGetString(GL_EXTENSIONS); - vector asExtensions; + std::vector asExtensions; split( szExtensionString, " ", asExtensions ); sort( asExtensions.begin(), asExtensions.end() ); size_t iNextToPrint = 0; @@ -499,7 +499,7 @@ RString RageDisplay_Legacy::Init( const VideoModeParams &p, bool bAllowUnacceler RString sType; for( size_t i = iNextToPrint; i asBits; + std::vector asBits; split( asExtensions[i], "_", asBits ); RString sThisType; if (asBits.size() > 2) @@ -520,7 +520,7 @@ RString RageDisplay_Legacy::Init( const VideoModeParams &p, bool bAllowUnacceler RString sList = ssprintf( " %s: ", sType.c_str() ); while( iNextToPrint <= iLastToPrint ) { - vector asBits; + std::vector asBits; split( asExtensions[iNextToPrint], "_", asBits ); RString sShortExt = join( "_", asBits.begin()+2, asBits.end() ); sList += sShortExt; @@ -1033,23 +1033,26 @@ class RageCompiledGeometrySWOGL : public RageCompiledGeometry { public: - void Allocate( const vector &vMeshes ) + void Allocate( const std::vector &vMeshes ) { /* Always allocate at least 1 entry, so &x[0] is valid. */ - m_vPosition.resize( max(1u, GetTotalVertices()) ); - m_vTexture.resize( max(1u, GetTotalVertices()) ); - m_vNormal.resize( max(1u, GetTotalVertices()) ); - m_vTexMatrixScale.resize( max(1u, GetTotalVertices()) ); - m_vTriangles.resize( max(1u, GetTotalTriangles()) ); + const unsigned int verticesCount = std::max(1u, GetTotalVertices()); + const unsigned int trianglesCount = std::max(1u, GetTotalTriangles()); + + m_vPosition.resize(verticesCount); + m_vTexture.resize(verticesCount); + m_vNormal.resize(verticesCount); + m_vTexMatrixScale.resize(verticesCount); + m_vTriangles.resize(trianglesCount); } - void Change( const vector &vMeshes ) + void Change( const std::vector &vMeshes ) { for( unsigned i=0; i &Vertices = mesh.Vertices; - const vector &Triangles = mesh.Triangles; + const std::vector &Vertices = mesh.Vertices; + const std::vector &Triangles = mesh.Triangles; for( unsigned j=0; j m_vPosition; - vector m_vTexture; - vector m_vNormal; - vector m_vTriangles; - vector m_vTexMatrixScale; + std::vector m_vPosition; + std::vector m_vTexture; + std::vector m_vNormal; + std::vector m_vTriangles; + std::vector m_vTexMatrixScale; }; class InvalidateObject; -static set g_InvalidateList; +static std::set g_InvalidateList; class InvalidateObject { public: @@ -1160,8 +1163,8 @@ public: /* This is called when our OpenGL context is invalidated. */ void Invalidate(); - void Allocate( const vector &vMeshes ); - void Change( const vector &vMeshes ); + void Allocate( const std::vector &vMeshes ); + void Change( const std::vector &vMeshes ); void Draw( int iMeshIndex ) const; }; @@ -1293,7 +1296,7 @@ void RageCompiledGeometryHWOGL::Invalidate() UploadData(); } -void RageCompiledGeometryHWOGL::Allocate( const vector &vMeshes ) +void RageCompiledGeometryHWOGL::Allocate( const std::vector &vMeshes ) { DebugFlushGLErrors(); @@ -1343,7 +1346,7 @@ void RageCompiledGeometryHWOGL::Allocate( const vector &vMeshes ) GL_STATIC_DRAW_ARB ); } -void RageCompiledGeometryHWOGL::Change( const vector &vMeshes ) +void RageCompiledGeometryHWOGL::Change( const std::vector &vMeshes ) { RageCompiledGeometrySWOGL::Change( vMeshes ); @@ -1505,9 +1508,9 @@ void RageDisplay_Legacy::DrawSymmetricQuadStripInternal( const RageSpriteVertex int iNumIndices = iNumTriangles*3; // make a temporary index buffer - static vector vIndices; + static std::vector vIndices; unsigned uOldSize = vIndices.size(); - unsigned uNewSize = max(uOldSize,(unsigned)iNumIndices); + unsigned uNewSize = std::max(uOldSize,(unsigned)iNumIndices); vIndices.resize( uNewSize ); for( uint16_t i=(uint16_t)uOldSize/12; i<(uint16_t)iNumPieces; i++ ) { @@ -2603,7 +2606,7 @@ uintptr_t RageDisplay_Legacy::CreateRenderTarget( const RenderTargetParam ¶m uintptr_t RageDisplay_Legacy::GetRenderTarget() { - for( map::const_iterator it = g_mapRenderTargets.begin(); it != g_mapRenderTargets.end(); ++it ) + for( std::map::const_iterator it = g_mapRenderTargets.begin(); it != g_mapRenderTargets.end(); ++it ) if( it->second == g_pCurrentRenderTarget ) return it->first; return 0; diff --git a/src/RageDisplay_OGL_Helpers.cpp b/src/RageDisplay_OGL_Helpers.cpp index 862292c857..8b97d4c8a3 100644 --- a/src/RageDisplay_OGL_Helpers.cpp +++ b/src/RageDisplay_OGL_Helpers.cpp @@ -11,7 +11,7 @@ namespace { - map g_Strings; + std::map g_Strings; void InitStringMap() { static bool bInitialized = false; @@ -44,11 +44,11 @@ RString RageDisplay_Legacy_Helpers::GLToString( GLenum e ) return ssprintf( "%i", int(e) ); } /* -static void GetGLExtensions( set &ext ) +static void GetGLExtensions( std::set &ext ) { const char *szBuf = (const char *) glGetString( GL_EXTENSIONS ); - vector asList; + std::vector asList; split( szBuf, " ", asList ); for( unsigned i = 0; i < asList.size(); ++i ) diff --git a/src/RageFileBasic.cpp b/src/RageFileBasic.cpp index ae654717b3..31c9e71ce4 100644 --- a/src/RageFileBasic.cpp +++ b/src/RageFileBasic.cpp @@ -108,7 +108,7 @@ int RageFileObj::Read( void *pBuffer, size_t iBytes ) if( m_pReadBuffer != nullptr && m_iReadBufAvail ) { /* Copy data out of the buffer first. */ - int iFromBuffer = min( (int) iBytes, m_iReadBufAvail ); + int iFromBuffer = std::min( (int) iBytes, m_iReadBufAvail ); memcpy( pBuffer, m_pReadBuf, iFromBuffer ); if( m_bCRC32Enabled ) CRC32( m_iCRC32, pBuffer, iFromBuffer ); @@ -169,7 +169,7 @@ int RageFileObj::Read( RString &sBuffer, int iBytes ) { int ToRead = sizeof(buf); if( iBytes != -1 ) - ToRead = min( ToRead, iBytes-iRet ); + ToRead = std::min( ToRead, iBytes-iRet ); const int iGot = Read( buf, ToRead ); if( iGot == 0 ) diff --git a/src/RageFileDriver.cpp b/src/RageFileDriver.cpp index 7497181d66..60cf7e27e1 100644 --- a/src/RageFileDriver.cpp +++ b/src/RageFileDriver.cpp @@ -10,7 +10,7 @@ RageFileDriver::~RageFileDriver() int RageFileDriver::GetPathValue( const RString &sPath ) { - vector asParts; + std::vector asParts; split( sPath, "/", asParts, true ); RString sPartialPath; @@ -42,7 +42,7 @@ int RageFileDriver::GetPathValue( const RString &sPath ) return 0; } -void RageFileDriver::GetDirListing( const RString &sPath, vector &asAddTo, bool bOnlyDirs, bool bReturnPathToo ) +void RageFileDriver::GetDirListing( const RString &sPath, std::vector &asAddTo, bool bOnlyDirs, bool bReturnPathToo ) { FDB->GetDirListing( sPath, asAddTo, bOnlyDirs, bReturnPathToo ); } diff --git a/src/RageFileDriver.h b/src/RageFileDriver.h index b486dc3d22..3920fe11f4 100644 --- a/src/RageFileDriver.h +++ b/src/RageFileDriver.h @@ -13,7 +13,7 @@ public: RageFileDriver( FilenameDB *pDB ) { FDB = pDB; } virtual ~RageFileDriver(); virtual RageFileBasic *Open( const RString &sPath, int iMode, int &iError ) = 0; - virtual void GetDirListing( const RString &sPath, vector &asAddTo, bool bOnlyDirs, bool bReturnPathToo ); + virtual void GetDirListing( const RString &sPath, std::vector &asAddTo, bool bOnlyDirs, bool bReturnPathToo ); virtual RageFileManager::FileType GetFileType( const RString &sPath ); virtual int GetFileSizeInBytes( const RString &sFilePath ); virtual int GetFileHash( const RString &sPath ); diff --git a/src/RageFileDriverDeflate.cpp b/src/RageFileDriverDeflate.cpp index 5d2fe24471..04cf006c8c 100644 --- a/src/RageFileDriverDeflate.cpp +++ b/src/RageFileDriverDeflate.cpp @@ -82,7 +82,7 @@ int RageFileObjInflate::ReadInternal( void *buf, size_t bytes ) * possible for a .gz to contain a header claiming 500k of data, but to actually * contain much more deflated data. */ ASSERT_M( m_iFilePos <= m_iUncompressedSize, ssprintf("%i, %i",m_iFilePos, m_iUncompressedSize) ); - bytes = min( bytes, size_t(m_iUncompressedSize-m_iFilePos) ); + bytes = std::min( bytes, size_t(m_iUncompressedSize-m_iFilePos) ); bool done=false; int ret = 0; @@ -173,7 +173,7 @@ int RageFileObjInflate::SeekInternal( int iPos ) char buf[1024*4]; while( iOffset ) { - int got = ReadInternal( buf, min( (int) sizeof(buf), iOffset ) ); + int got = ReadInternal( buf, std::min( (int) sizeof(buf), iOffset ) ); if( got == -1 ) return -1; @@ -313,7 +313,7 @@ int RageFileObjDeflate::FlushInternal() */ RageFileObjInflate *GunzipFile( RageFileBasic *pFile_, RString &sError, uint32_t *iCRC32 ) { - unique_ptr pFile(pFile_); + std::unique_ptr pFile(pFile_); sError = ""; diff --git a/src/RageFileDriverDirectHelpers.cpp b/src/RageFileDriverDirectHelpers.cpp index 3cfa48a984..a7b9f6f718 100644 --- a/src/RageFileDriverDirectHelpers.cpp +++ b/src/RageFileDriverDirectHelpers.cpp @@ -78,7 +78,7 @@ bool WinMoveFile( RString sOldPath, RString sNewPath ) bool CreateDirectories( RString Path ) { // XXX: handle "//foo/bar" paths in Windows - vector parts; + std::vector parts; RString curpath; // If Path is absolute, add the initial slash ("ignore empty" will remove it). @@ -303,8 +303,8 @@ void DirectFilenameDB::PopulateFileSet( FileSet &fs, const RString &path ) */ static const RString IGNORE_MARKER_BEGINNING = "ignore-"; - vector vsFilesToRemove; - for( set::iterator iter = fs.files.lower_bound(IGNORE_MARKER_BEGINNING); + std::vector vsFilesToRemove; + for( std::set::iterator iter = fs.files.lower_bound(IGNORE_MARKER_BEGINNING); iter != fs.files.end(); ++iter ) { @@ -320,7 +320,7 @@ void DirectFilenameDB::PopulateFileSet( FileSet &fs, const RString &path ) // Erase the file corresponding to the ignore marker File fileToDelete; fileToDelete.SetName( iter ); - set::iterator iter2 = fs.files.find( fileToDelete ); + std::set::iterator iter2 = fs.files.find( fileToDelete ); if( iter2 != fs.files.end() ) fs.files.erase( iter2 ); } diff --git a/src/RageFileDriverMemory.cpp b/src/RageFileDriverMemory.cpp index 477be38a3e..5e93ee8214 100644 --- a/src/RageFileDriverMemory.cpp +++ b/src/RageFileDriverMemory.cpp @@ -53,8 +53,8 @@ int RageFileObjMem::ReadInternal( void *buffer, size_t bytes ) { LockMut(m_pFile->m_Mutex); - m_iFilePos = min( m_iFilePos, GetFileSize() ); - bytes = min( bytes, (size_t) GetFileSize() - m_iFilePos ); + m_iFilePos = std::min( m_iFilePos, GetFileSize() ); + bytes = std::min( bytes, (size_t) GetFileSize() - m_iFilePos ); if( bytes == 0 ) return 0; memcpy( buffer, &m_pFile->m_sBuf[m_iFilePos], bytes ); @@ -166,7 +166,7 @@ bool RageFileDriverMem::Remove( const RString &sPath ) /* Unregister the file. */ FDB->DelFile( sPath ); - vector::iterator it = find( m_Files.begin(), m_Files.end(), pFile ); + std::vector::iterator it = find( m_Files.begin(), m_Files.end(), pFile ); ASSERT( it != m_Files.end() ); m_Files.erase( it ); diff --git a/src/RageFileDriverMemory.h b/src/RageFileDriverMemory.h index d3467f94fe..7d1d6bda75 100644 --- a/src/RageFileDriverMemory.h +++ b/src/RageFileDriverMemory.h @@ -43,7 +43,7 @@ public: private: RageMutex m_Mutex; - vector m_Files; + std::vector m_Files; }; #endif diff --git a/src/RageFileDriverReadAhead.cpp b/src/RageFileDriverReadAhead.cpp index 57b8966cd1..207e84304a 100644 --- a/src/RageFileDriverReadAhead.cpp +++ b/src/RageFileDriverReadAhead.cpp @@ -121,7 +121,7 @@ int RageFileDriverReadAhead::ReadInternal( void *pBuffer, size_t iBytes ) if( m_bReadAheadNeeded && m_iFilePos < (int) m_sBuffer.size() ) { // If we can serve data out of the buffer, use it. - iRet = min( iBytes, m_sBuffer.size() - m_iFilePos ); + iRet = std::min( iBytes, m_sBuffer.size() - m_iFilePos ); memcpy( pBuffer, m_sBuffer.data() + m_iFilePos, iRet ); } else diff --git a/src/RageFileDriverSlice.cpp b/src/RageFileDriverSlice.cpp index 157941505b..a61b244442 100644 --- a/src/RageFileDriverSlice.cpp +++ b/src/RageFileDriverSlice.cpp @@ -39,7 +39,7 @@ int RageFileDriverSlice::ReadInternal( void *buf, size_t bytes ) m_pFile->Seek( m_iFilePos+m_iOffset ); const int bytes_left = m_iFileSize-this->m_iFilePos; - const int got = m_pFile->Read( buf, min( (int) bytes, bytes_left ) ); + const int got = m_pFile->Read( buf, std::min( (int) bytes, bytes_left ) ); if( got == -1 ) { SetError( m_pFile->GetError() ); @@ -55,7 +55,7 @@ int RageFileDriverSlice::ReadInternal( void *buf, size_t bytes ) int RageFileDriverSlice::SeekInternal( int offset ) { ASSERT( offset >= 0 ); - offset = min( offset, m_iFileSize ); + offset = std::min( offset, m_iFileSize ); int ret = m_pFile->Seek( m_iOffset + offset ); if( ret == -1 ) diff --git a/src/RageFileDriverTimeout.cpp b/src/RageFileDriverTimeout.cpp index c234441350..09a155a654 100644 --- a/src/RageFileDriverTimeout.cpp +++ b/src/RageFileDriverTimeout.cpp @@ -101,7 +101,7 @@ private: RageFileDriver *m_pChildDriver; /* List of files to delete: */ - vector m_apDeletedFiles; + std::vector m_apDeletedFiles; RageMutex m_DeletedFilesLock; /* REQ_OPEN, REQ_POPULATE_FILE_SET, REQ_FLUSH_DIR_CACHE, REQ_REMOVE, REQ_MOVE: */ @@ -139,7 +139,7 @@ private: char *m_pRequestBuffer; /* in */ }; -static vector g_apWorkers; +static std::vector g_apWorkers; static RageMutex g_apWorkersMutex("WorkersMutex"); /* Set the timeout length, and reset the timer. */ @@ -197,7 +197,7 @@ void ThreadedFileWorker::HandleRequest( int iRequest ) { { m_DeletedFilesLock.Lock(); - vector apDeletedFiles = m_apDeletedFiles; + std::vector apDeletedFiles = m_apDeletedFiles; m_apDeletedFiles.clear(); m_DeletedFilesLock.Unlock(); diff --git a/src/RageFileDriverZip.cpp b/src/RageFileDriverZip.cpp index dbd1fe7dc5..ee66d686c4 100644 --- a/src/RageFileDriverZip.cpp +++ b/src/RageFileDriverZip.cpp @@ -95,7 +95,7 @@ bool RageFileDriverZip::ReadEndCentralRecord( int &iTotalEntries, int &iCentralD /* Find the end of central directory record, and seek to it. */ bool RageFileDriverZip::SeekToEndCentralRecord() { - const int iSearchTo = max( m_pZip->GetFileSize() - 1024*32, 0 ); + const int iSearchTo = std::max( m_pZip->GetFileSize() - 1024*32, 0 ); int iRealPos = m_pZip->GetFileSize(); while( iRealPos > 0 && iRealPos >= iSearchTo ) @@ -104,7 +104,7 @@ bool RageFileDriverZip::SeekToEndCentralRecord() * the case where the signature crosses the block boundary. */ char buf[1024*4]; iRealPos -= sizeof(buf) - 4; - iRealPos = max( 0, iRealPos ); + iRealPos = std::max( 0, iRealPos ); m_pZip->Seek( iRealPos ); int iGot = m_pZip->Read( buf, sizeof(buf) ); diff --git a/src/RageFileDriverZip.h b/src/RageFileDriverZip.h index 2f28740290..c708c09396 100644 --- a/src/RageFileDriverZip.h +++ b/src/RageFileDriverZip.h @@ -42,7 +42,7 @@ private: bool m_bFileOwned; RageFileBasic *m_pZip; - vector m_pFiles; + std::vector m_pFiles; RString m_sPath; RString m_sComment; diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index 8208989833..737f896815 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -43,10 +43,10 @@ struct LoadedDriver RString GetPath( const RString &sPath ) const; }; -static vector g_pDrivers; -static map g_mFileDriverMap; +static std::vector g_pDrivers; +static std::map g_mFileDriverMap; -static void ReferenceAllDrivers( vector &apDriverList ) +static void ReferenceAllDrivers( std::vector &apDriverList ) { g_Mutex->Lock(); apDriverList = g_pDrivers; @@ -55,7 +55,7 @@ static void ReferenceAllDrivers( vector &apDriverList ) g_Mutex->Unlock(); } -static void UnreferenceAllDrivers( vector &apDriverList ) +static void UnreferenceAllDrivers( std::vector &apDriverList ) { g_Mutex->Lock(); for( unsigned i = 0; i < apDriverList.size(); ++i ) @@ -281,7 +281,7 @@ public: /* Never flush FDB, except in LoadFromDrivers. */ void FlushDirCache( const RString &sPath ) { } - void LoadFromDrivers( const vector &apDrivers ) + void LoadFromDrivers( const std::vector &apDrivers ) { /* XXX: Even though these two operations lock on their own, lock around * them, too. That way, nothing can sneak in and get incorrect @@ -367,7 +367,7 @@ static RString GetDirOfExecutable( RString argv0 ) if( !path ) path = _PATH_DEFPATH; - vector vPath; + std::vector vPath; split( path, ":", vPath ); for (RString &i : vPath) { @@ -495,7 +495,7 @@ RString LoadedDriver::GetPath( const RString &sPath ) const bool ilt( const RString &a, const RString &b ) { return a.CompareNoCase(b) < 0; } bool ieq( const RString &a, const RString &b ) { return a.CompareNoCase(b) == 0; } -void RageFileManager::GetDirListing( const RString &sPath_, vector &AddTo, bool bOnlyDirs, bool bReturnPathToo ) +void RageFileManager::GetDirListing( const RString &sPath_, std::vector &AddTo, bool bOnlyDirs, bool bReturnPathToo ) { RString sPath = sPath_; NormalizePath( sPath ); @@ -506,7 +506,7 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector &Add if( sPath.find("/..") != std::string::npos ) return; - vector apDriverList; + std::vector apDriverList; ReferenceAllDrivers( apDriverList ); int iDriversThatReturnedFiles = 0; @@ -547,14 +547,14 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector &Add { /* More than one driver returned files. Remove duplicates (case-insensitively). */ sort( AddTo.begin()+iOldSize, AddTo.end(), ilt ); - vector::iterator it = unique( AddTo.begin()+iOldSize, AddTo.end(), ieq ); + std::vector::iterator it = unique( AddTo.begin()+iOldSize, AddTo.end(), ieq ); AddTo.erase( it, AddTo.end() ); } } -void RageFileManager::GetDirListingWithMultipleExtensions( const RString &sPath, vector const& ExtensionList, vector &AddTo, bool bOnlyDirs, bool bReturnPathToo ) +void RageFileManager::GetDirListingWithMultipleExtensions( const RString &sPath, std::vector const& ExtensionList, std::vector &AddTo, bool bOnlyDirs, bool bReturnPathToo ) { - for(vector::const_iterator curr_ext= ExtensionList.begin(); + for(std::vector::const_iterator curr_ext= ExtensionList.begin(); curr_ext != ExtensionList.end(); ++curr_ext) { GetDirListing(sPath + "*." + (*curr_ext), AddTo, bOnlyDirs, bReturnPathToo); @@ -567,7 +567,7 @@ bool RageFileManager::Move( const RString &fromPath_, const RString &toPath_ ) RString fromPath = fromPath_; RString toPath = toPath_; - vector aDriverList; + std::vector aDriverList; ReferenceAllDrivers( aDriverList ); NormalizePath( fromPath ); @@ -626,7 +626,7 @@ bool RageFileManager::Remove( const RString &sPath_ ) { RString sPath = sPath_; - vector apDriverList; + std::vector apDriverList; ReferenceAllDrivers( apDriverList ); NormalizePath( sPath ); @@ -745,7 +745,7 @@ void RageFileManager::Unmount( const RString &sType, const RString &sRoot_, cons /* Find all drivers we want to delete. Remove them from g_pDrivers, and move them * into aDriverListToUnmount. */ - vector apDriverListToUnmount; + std::vector apDriverListToUnmount; g_Mutex->Lock(); for( unsigned i = 0; i < g_pDrivers.size(); ++i ) { @@ -812,7 +812,7 @@ bool RageFileManager::IsMounted( RString MountPoint ) return false; } -void RageFileManager::GetLoadedDrivers( vector &asMounts ) +void RageFileManager::GetLoadedDrivers( std::vector &asMounts ) { LockMut( *g_Mutex ); @@ -856,7 +856,7 @@ RageFileManager::FileType RageFileManager::GetFileType( const RString &sPath_ ) NormalizePath( sPath ); - vector apDriverList; + std::vector apDriverList; ReferenceAllDrivers( apDriverList ); RageFileManager::FileType ret = TYPE_NONE; @@ -882,7 +882,7 @@ int RageFileManager::GetFileSizeInBytes( const RString &sPath_ ) NormalizePath( sPath ); - vector apDriverList; + std::vector apDriverList; ReferenceAllDrivers( apDriverList ); int iRet = -1; @@ -906,7 +906,7 @@ int RageFileManager::GetFileHash( const RString &sPath_ ) NormalizePath( sPath ); - vector apDriverList; + std::vector apDriverList; ReferenceAllDrivers( apDriverList ); int iRet = -1; @@ -930,8 +930,8 @@ RString RageFileManager::ResolvePath(const RString &path) NormalizePath(tmpPath); RString resolvedPath = tmpPath; - - vector apDriverList; + + std::vector apDriverList; ReferenceAllDrivers( apDriverList ); for( unsigned i = 0; i < apDriverList.size(); ++i ) @@ -960,7 +960,7 @@ RString RageFileManager::ResolvePath(const RString &path) return resolvedPath; } -static bool SortBySecond( const pair &a, const pair &b ) +static bool SortBySecond( const std::pair &a, const std::pair &b ) { return a.second < b.second; } @@ -1009,7 +1009,7 @@ RageFileBasic *RageFileManager::Open( const RString &sPath_, int mode, int &err void RageFileManager::CacheFile( const RageFileBasic *fb, const RString &sPath_ ) { - map::iterator it = g_mFileDriverMap.find( fb ); + std::map::iterator it = g_mFileDriverMap.find( fb ); ASSERT_M( it != g_mFileDriverMap.end(), ssprintf("No recorded driver for file: %s", sPath_.c_str()) ); @@ -1022,7 +1022,7 @@ void RageFileManager::CacheFile( const RageFileBasic *fb, const RString &sPath_ RageFileBasic *RageFileManager::OpenForReading( const RString &sPath, int mode, int &err ) { - vector apDriverList; + std::vector apDriverList; ReferenceAllDrivers( apDriverList ); for( unsigned i = 0; i < apDriverList.size(); ++i ) @@ -1070,10 +1070,10 @@ RageFileBasic *RageFileManager::OpenForWriting( const RString &sPath, int mode, * If the given path can not be created, return -1. This happens if a path * that needs to be a directory is a file, or vice versa. */ - vector apDriverList; + std::vector apDriverList; ReferenceAllDrivers( apDriverList ); - vector< pair > Values; + std::vector> Values; for( unsigned i = 0; i < apDriverList.size(); ++i ) { LoadedDriver &ld = *apDriverList[i]; @@ -1085,7 +1085,7 @@ RageFileBasic *RageFileManager::OpenForWriting( const RString &sPath, int mode, if( value == -1 ) continue; - Values.push_back( make_pair( i, value ) ); + Values.push_back( std::make_pair( i, value ) ); } stable_sort( Values.begin(), Values.end(), SortBySecond ); @@ -1154,17 +1154,17 @@ int GetFileSizeInBytes( const RString &sPath ) return FILEMAN->GetFileSizeInBytes( sPath ); } -void GetDirListing( const RString &sPath, vector &AddTo, bool bOnlyDirs, bool bReturnPathToo ) +void GetDirListing( const RString &sPath, std::vector &AddTo, bool bOnlyDirs, bool bReturnPathToo ) { FILEMAN->GetDirListing( sPath, AddTo, bOnlyDirs, bReturnPathToo ); } -void GetDirListingRecursive( const RString &sDir, const RString &sMatch, vector &AddTo ) +void GetDirListingRecursive( const RString &sDir, const RString &sMatch, std::vector &AddTo ) { ASSERT( sDir.Right(1) == "/" ); - vector vsFiles; + std::vector vsFiles; GetDirListing( sDir+sMatch, vsFiles, false, true ); - vector vsDirs; + std::vector vsDirs; GetDirListing( sDir+"*", vsDirs, true, true ); for( int i=0; i<(int)vsDirs.size(); i++ ) { @@ -1180,12 +1180,12 @@ void GetDirListingRecursive( const RString &sDir, const RString &sMatch, vector< } } -void GetDirListingRecursive( RageFileDriver *prfd, const RString &sDir, const RString &sMatch, vector &AddTo ) +void GetDirListingRecursive( RageFileDriver *prfd, const RString &sDir, const RString &sMatch, std::vector &AddTo ) { ASSERT( sDir.Right(1) == "/" ); - vector vsFiles; + std::vector vsFiles; prfd->GetDirListing( sDir+sMatch, vsFiles, false, true ); - vector vsDirs; + std::vector vsDirs; prfd->GetDirListing( sDir+"*", vsDirs, true, true ); for( int i=0; i<(int)vsDirs.size(); i++ ) { @@ -1205,7 +1205,7 @@ bool DeleteRecursive( RageFileDriver *prfd, const RString &sDir ) { ASSERT( sDir.Right(1) == "/" ); - vector vsFiles; + std::vector vsFiles; prfd->GetDirListing( sDir+"*", vsFiles, false, true ); for (RString const &s : vsFiles) { @@ -1222,7 +1222,7 @@ bool DeleteRecursive( const RString &sDir ) { ASSERT( sDir.Right(1) == "/" ); - vector vsFiles; + std::vector vsFiles; GetDirListing( sDir+"*", vsFiles, false, true ); for (RString const &s : vsFiles) { @@ -1246,7 +1246,7 @@ unsigned int GetHashForDirectory( const RString &sDir ) hash += GetHashForString( sDir ); - vector arrayFiles; + std::vector arrayFiles; GetDirListing( sDir+"*", arrayFiles, false ); for( unsigned i=0; iGetFileHash(SArg(1)) ); return 1; } static int GetDirListing( T* p, lua_State *L ) { - vector vDirs; + std::vector vDirs; bool bOnlyDirs = false; bool bReturnPathToo = false; diff --git a/src/RageFileManager.h b/src/RageFileManager.h index bf6138764a..68e4260d43 100644 --- a/src/RageFileManager.h +++ b/src/RageFileManager.h @@ -25,9 +25,9 @@ public: void MountInitialFilesystems(); void MountUserFilesystems(); - void GetDirListing( const RString &sPath, vector &AddTo, bool bOnlyDirs, bool bReturnPathToo ); + void GetDirListing( const RString &sPath, std::vector &AddTo, bool bOnlyDirs, bool bReturnPathToo ); void GetDirListingWithMultipleExtensions(const RString &sPath, - vector const& ExtensionList, vector &AddTo, + std::vector const& ExtensionList, std::vector &AddTo, bool bOnlyDirs= false, bool bReturnPathToo= false); bool Move( const RString &fromPath, const RString &toPath ); bool Copy( const std::string &fromPath, const std::string &toPath ); @@ -63,7 +63,7 @@ public: { RString Type, Root, MountPoint; }; - void GetLoadedDrivers( vector &asMounts ); + void GetLoadedDrivers( std::vector &asMounts ); void FlushDirCache( const RString &sPath = RString() ); diff --git a/src/RageFileManager_ReadAhead.cpp b/src/RageFileManager_ReadAhead.cpp index c0370ecf5d..6090d37a86 100644 --- a/src/RageFileManager_ReadAhead.cpp +++ b/src/RageFileManager_ReadAhead.cpp @@ -110,7 +110,7 @@ private: }; -static vector g_apReadAheads; +static std::vector g_apReadAheads; void RageFileManagerReadAhead::Init() { } void RageFileManagerReadAhead::Shutdown() diff --git a/src/RageInput.cpp b/src/RageInput.cpp index ceca0e6beb..21794d97ac 100644 --- a/src/RageInput.cpp +++ b/src/RageInput.cpp @@ -16,8 +16,8 @@ namespace { InputHandler *m_pDevice; }; - vector m_InputHandlers; - map g_mapDeviceToHandler; + std::vector m_InputHandlers; + std::map g_mapDeviceToHandler; } RageInput::RageInput() @@ -57,7 +57,7 @@ void RageInput::LoadDrivers() g_mapDeviceToHandler.clear(); // Init optional devices. - vector apDevices; + std::vector apDevices; InputHandler::Create( g_sInputDrivers, apDevices ); for( unsigned i = 0; i < apDevices.size(); ++i ) @@ -86,7 +86,7 @@ bool RageInput::DevicesChanged() return false; } -void RageInput::GetDevicesAndDescriptions( vector& vDevicesOut ) const +void RageInput::GetDevicesAndDescriptions( std::vector& vDevicesOut ) const { for( unsigned i = 0; i < m_InputHandlers.size(); ++i ) m_InputHandlers[i].m_pDevice->GetDevicesAndDescriptions( vDevicesOut ); @@ -106,7 +106,7 @@ void RageInput::AddHandler( InputHandler *pHandler ) hand.m_pDevice = pHandler; m_InputHandlers.push_back(hand); - vector aDeviceInfo; + std::vector aDeviceInfo; hand.m_pDevice->GetDevicesAndDescriptions( aDeviceInfo ); for (InputDeviceInfo const &idi : aDeviceInfo) g_mapDeviceToHandler[idi.id] = pHandler; @@ -115,7 +115,7 @@ void RageInput::AddHandler( InputHandler *pHandler ) /** @brief Return the first InputDriver for the requested InputDevice. */ InputHandler *RageInput::GetHandlerForDevice( const InputDevice id ) { - map::iterator it = g_mapDeviceToHandler.find(id); + std::map::iterator it = g_mapDeviceToHandler.find(id); if( it == g_mapDeviceToHandler.end() ) return nullptr; return it->second; @@ -159,10 +159,10 @@ InputDeviceState RageInput::GetInputDeviceState( InputDevice id ) RString RageInput::GetDisplayDevicesString() const { - vector vDevices; + std::vector vDevices; GetDevicesAndDescriptions( vDevices ); - vector vs; + std::vector vs; for( unsigned i=0; i public: static int GetDescriptions( T* p, lua_State *L ) { - vector vDevices; + std::vector vDevices; p->GetDevicesAndDescriptions( vDevices ); - vector vsDescriptions; + std::vector vsDescriptions; for (InputDeviceInfo const &idi : vDevices) vsDescriptions.push_back( idi.sDesc ); LuaHelpers::CreateTableFromArray( vsDescriptions, L ); diff --git a/src/RageInput.h b/src/RageInput.h index ff58fc76ce..6fbe1c1980 100644 --- a/src/RageInput.h +++ b/src/RageInput.h @@ -18,7 +18,7 @@ public: void LoadDrivers(); void Update(); bool DevicesChanged(); - void GetDevicesAndDescriptions( vector& vOut ) const; + void GetDevicesAndDescriptions( std::vector& vOut ) const; void WindowReset(); void AddHandler( InputHandler *pHandler ); InputHandler *GetHandlerForDevice( const InputDevice id ); diff --git a/src/RageInputDevice.cpp b/src/RageInputDevice.cpp index 9271f387a3..bf8d9030dc 100644 --- a/src/RageInputDevice.cpp +++ b/src/RageInputDevice.cpp @@ -16,8 +16,8 @@ XToString( InputDeviceState ); XToLocalizedString( InputDeviceState ); LuaXType(InputDevice); -static map g_mapNamesToString; -static map g_mapStringToNames; +static std::map g_mapNamesToString; +static std::map g_mapStringToNames; static void InitNames() { if( !g_mapNamesToString.empty() ) @@ -148,7 +148,7 @@ RString DeviceButtonToString( DeviceButton key ) // Check the name map first to allow making names for keys that are inside // the ascii range. -Kyz - map::const_iterator it = g_mapNamesToString.find( key ); + std::map::const_iterator it = g_mapNamesToString.find( key ); if( it != g_mapNamesToString.end() ) return it->second; @@ -188,7 +188,7 @@ DeviceButton StringToDeviceButton( const RString& s ) if( sscanf(s, "Mouse %i", &i) == 1 ) return enum_add2( MOUSE_LEFT, i ); - map::const_iterator it = g_mapStringToNames.find( s ); + std::map::const_iterator it = g_mapStringToNames.find( s ); if( it != g_mapStringToNames.end() ) return it->second; diff --git a/src/RageInputDevice.h b/src/RageInputDevice.h index bd93899cab..8c97172fcd 100644 --- a/src/RageInputDevice.h +++ b/src/RageInputDevice.h @@ -384,7 +384,7 @@ inline bool operator>=(DeviceInput const &lhs, DeviceInput const &rhs) return !operator<(lhs, rhs); } -typedef vector DeviceInputList; +typedef std::vector DeviceInputList; #endif /* diff --git a/src/RageLog.cpp b/src/RageLog.cpp index f6fe00d4dd..eee07b5c33 100644 --- a/src/RageLog.cpp +++ b/src/RageLog.cpp @@ -51,7 +51,7 @@ RageLog* LOG; // global and accessible from anywhere in the program * * The identifier is never displayed, so we can use a simple local object to * map/unmap, using any mechanism to generate unique IDs. */ -static map LogMaps; +static std::map LogMaps; #define LOG_PATH "/Logs/log.txt" #define INFO_PATH "/Logs/info.txt" @@ -97,7 +97,7 @@ RageLog::~RageLog() { /* Add the mapped log data to info.txt. */ const RString AdditionalLog = GetAdditionalLog(); - vector AdditionalLogLines; + std::vector AdditionalLogLines; split( AdditionalLog, "\n", AdditionalLogLines ); for( unsigned i = 0; i < AdditionalLogLines.size(); ++i ) { @@ -256,7 +256,7 @@ void RageLog::Write( int where, const RString &sLine ) LockMut( *g_Mutex ); const char *const sWarningSeparator = "/////////////////////////////////////////"; - vector asLines; + std::vector asLines; split( sLine, "\n", asLines, false ); if( where & WRITE_LOUD ) { @@ -334,7 +334,7 @@ void RageLog::AddToInfo( const RString &str ) { const RString txt( NEWLINE "Staticlog limit reached" NEWLINE ); - const unsigned pos = min( staticlog_size, sizeof(staticlog) - txt.size() ); + const unsigned int pos = std::min(staticlog_size, sizeof(staticlog) - txt.size()); memcpy( staticlog+pos, txt.data(), txt.size() ); limit_reached = true; return; @@ -396,14 +396,14 @@ void RageLog::UpdateMappedLog() for (auto const &i : LogMaps) str += ssprintf( "%s" NEWLINE, i.second.c_str() ); - g_AdditionalLogSize = min( sizeof(g_AdditionalLogStr), str.size()+1 ); + g_AdditionalLogSize = std::min( sizeof(g_AdditionalLogStr), str.size()+1 ); memcpy( g_AdditionalLogStr, str.c_str(), g_AdditionalLogSize ); g_AdditionalLogStr[ sizeof(g_AdditionalLogStr)-1 ] = 0; } const char *RageLog::GetAdditionalLog() { - int size = min( g_AdditionalLogSize, (int) sizeof(g_AdditionalLogStr)-1 ); + int size = std::min( g_AdditionalLogSize, (int) sizeof(g_AdditionalLogStr)-1 ); g_AdditionalLogStr[size] = 0; return g_AdditionalLogStr; } diff --git a/src/RageMath.cpp b/src/RageMath.cpp index 626752037f..acff3a48d3 100644 --- a/src/RageMath.cpp +++ b/src/RageMath.cpp @@ -18,12 +18,12 @@ void RageVec3ClearBounds( RageVector3 &mins, RageVector3 &maxs ) void RageVec3AddToBounds( const RageVector3 &p, RageVector3 &mins, RageVector3 &maxs ) { - mins.x = min( mins.x, p.x ); - mins.y = min( mins.y, p.y ); - mins.z = min( mins.z, p.z ); - maxs.x = max( maxs.x, p.x ); - maxs.y = max( maxs.y, p.y ); - maxs.z = max( maxs.z, p.z ); + mins.x = std::min( mins.x, p.x ); + mins.y = std::min( mins.y, p.y ); + mins.z = std::min( mins.z, p.z ); + maxs.x = std::max( maxs.x, p.x ); + maxs.y = std::max( maxs.y, p.y ); + maxs.z = std::max( maxs.z, p.z ); } void RageVec2Normalize( RageVector2* pOut, const RageVector2* pV ) @@ -41,7 +41,7 @@ void RageVec3Normalize( RageVector3* pOut, const RageVector3* pV ) pOut->z = pV->z * scale; } -void VectorFloatNormalize(vector& v) +void VectorFloatNormalize(std::vector& v) { ASSERT_M(v.size() == 3, "Can't normalize a non-3D vector."); float scale = 1.0f / sqrtf(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); diff --git a/src/RageMath.h b/src/RageMath.h index 1f6295a9e8..75ee89487f 100644 --- a/src/RageMath.h +++ b/src/RageMath.h @@ -19,7 +19,7 @@ void RageVec3AddToBounds( const RageVector3 &p, RageVector3 &mins, RageVector3 & void RageVec2Normalize( RageVector2* pOut, const RageVector2* pV ); void RageVec3Normalize( RageVector3* pOut, const RageVector3* pV ); -void VectorFloatNormalize(vector& v); +void VectorFloatNormalize(std::vector& v); void RageVec3Cross(RageVector3* ret, RageVector3 const* a, RageVector3 const* b); void RageVec3TransformCoord( RageVector3* pOut, const RageVector3* pV, const RageMatrix* pM ); void RageVec3TransformNormal( RageVector3* pOut, const RageVector3* pV, const RageMatrix* pM ); diff --git a/src/RageModelGeometry.cpp b/src/RageModelGeometry.cpp index e3bde013ec..e4c6027498 100644 --- a/src/RageModelGeometry.cpp +++ b/src/RageModelGeometry.cpp @@ -135,8 +135,8 @@ void RageModelGeometry::LoadMilkshapeAscii( const RString& _sPath, bool bNeedsNo for( int i = 0; i < nNumMeshes; i++ ) { msMesh &mesh = m_Meshes[i]; - vector &Vertices = mesh.Vertices; - vector &Triangles = mesh.Triangles; + std::vector &Vertices = mesh.Vertices; + std::vector &Triangles = mesh.Triangles; if( f.GetLine( sLine ) <= 0 ) THROW; @@ -205,7 +205,7 @@ void RageModelGeometry::LoadMilkshapeAscii( const RString& _sPath, bool bNeedsNo if( sscanf(sLine, "%d", &nNumNormals) != 1 ) THROW; - vector Normals; + std::vector Normals; Normals.resize( nNumNormals ); for( int j = 0; j < nNumNormals; j++ ) { diff --git a/src/RageModelGeometry.h b/src/RageModelGeometry.h index 2cc7c0f73d..7f22ce2db1 100644 --- a/src/RageModelGeometry.h +++ b/src/RageModelGeometry.h @@ -22,7 +22,7 @@ public: int m_iRefCount; - vector m_Meshes; + std::vector m_Meshes; RageCompiledGeometry* m_pCompiledGeometry; // video memory copy of geometry shared by all meshes RageVector3 m_vMins, m_vMaxs; diff --git a/src/RageSound.cpp b/src/RageSound.cpp index 0eaea35777..5c632ac6cb 100644 --- a/src/RageSound.cpp +++ b/src/RageSound.cpp @@ -613,7 +613,7 @@ RageSoundParams::StopMode_t RageSound::GetStopMode() const if( m_Param.StopMode != RageSoundParams::M_AUTO ) return m_Param.StopMode; - if( m_sFilePath.find("loop") != string::npos ) + if( m_sFilePath.find("loop") != std::string::npos ) return RageSoundParams::M_LOOP; else return RageSoundParams::M_STOP; @@ -621,19 +621,19 @@ RageSoundParams::StopMode_t RageSound::GetStopMode() const void RageSound::SetStopModeFromString( const RString &sStopMode ) { - if( sStopMode.find("stop") != string::npos ) + if( sStopMode.find("stop") != std::string::npos ) { m_Param.StopMode = RageSoundParams::M_STOP; } - else if( sStopMode.find("loop") != string::npos ) + else if( sStopMode.find("loop") != std::string::npos ) { m_Param.StopMode = RageSoundParams::M_LOOP; } - else if( sStopMode.find("continue") != string::npos ) + else if( sStopMode.find("continue") != std::string::npos ) { m_Param.StopMode = RageSoundParams::M_CONTINUE; } - else if( sStopMode.find("auto") != string::npos ) + else if( sStopMode.find("auto") != std::string::npos ) { m_Param.StopMode = RageSoundParams::M_AUTO; } diff --git a/src/RageSoundManager.cpp b/src/RageSoundManager.cpp index 39c119a826..8ed8f892ad 100644 --- a/src/RageSoundManager.cpp +++ b/src/RageSoundManager.cpp @@ -110,7 +110,7 @@ void RageSoundManager::Update() /* Scan m_mapPreloadedSounds for sounds that are no longer loaded, and delete them. */ g_SoundManMutex.Lock(); /* lock for access to m_mapPreloadedSounds, owned_sounds */ { - map::iterator it, next; + std::map::iterator it, next; it = m_mapPreloadedSounds.begin(); while( it != m_mapPreloadedSounds.end() ) @@ -157,7 +157,7 @@ RageSoundReader *RageSoundManager::GetLoadedSound( const RString &sPath_ ) RString sPath(sPath_); sPath.MakeLower(); - map::const_iterator it; + std::map::const_iterator it; it = m_mapPreloadedSounds.find( sPath ); if( it == m_mapPreloadedSounds.end() ) return nullptr; @@ -176,7 +176,7 @@ void RageSoundManager::AddLoadedSound( const RString &sPath_, RageSoundReader_Pr * used in GetLoadedSound. */ RString sPath(sPath_); sPath.MakeLower(); - map::const_iterator it; + std::map::const_iterator it; it = m_mapPreloadedSounds.find( sPath ); ASSERT_M( it == m_mapPreloadedSounds.end(), sPath ); diff --git a/src/RageSoundManager.h b/src/RageSoundManager.h index a732fa06f2..a5998e8d2a 100644 --- a/src/RageSoundManager.h +++ b/src/RageSoundManager.h @@ -48,7 +48,7 @@ public: void low_sample_count_workaround(); private: - map m_mapPreloadedSounds; + std::map m_mapPreloadedSounds; RageSoundDriver *m_pDriver; diff --git a/src/RageSoundPosMap.cpp b/src/RageSoundPosMap.cpp index a3a0940ebd..c49f1ad85c 100644 --- a/src/RageSoundPosMap.cpp +++ b/src/RageSoundPosMap.cpp @@ -23,7 +23,7 @@ struct pos_map_t struct pos_map_impl { - list m_Queue; + std::list m_Queue; void Cleanup(); }; @@ -106,7 +106,7 @@ void pos_map_queue::Insert( int64_t iSourceFrame, int iFrames, int64_t iDestFram void pos_map_impl::Cleanup() { /* Scan backwards until we have at least pos_map_backlog_frames. */ - list::iterator it = m_Queue.end(); + std::list::iterator it = m_Queue.end(); int iTotalFrames = 0; while( iTotalFrames < pos_map_backlog_frames ) { diff --git a/src/RageSoundReader_Chain.cpp b/src/RageSoundReader_Chain.cpp index 1d51c3ef0e..701f8f4c5a 100644 --- a/src/RageSoundReader_Chain.cpp +++ b/src/RageSoundReader_Chain.cpp @@ -63,7 +63,7 @@ int RageSoundReader_Chain::LoadSound( RString sPath ) { sPath.MakeLower(); - map::const_iterator it = m_apNamedSounds.find( sPath ); + std::map::const_iterator it = m_apNamedSounds.find( sPath ); if( it != m_apNamedSounds.end() ) { const RageSoundReader *pReader = it->second; @@ -119,7 +119,7 @@ void RageSoundReader_Chain::Finish() * which will be converted as needed, or have the same number of channels. */ m_iChannels = 1; for (RageSoundReader *it : m_apLoadedSounds) - m_iChannels = max( m_iChannels, it->GetNumChannels() ); + m_iChannels = std::max( m_iChannels, it->GetNumChannels() ); if( m_iChannels > 2 ) { @@ -235,7 +235,7 @@ void RageSoundReader_Chain::ActivateSound( Sound *s ) void RageSoundReader_Chain::ReleaseSound( Sound *s ) { - vector::iterator it = find( m_apActiveSounds.begin(), m_apActiveSounds.end(), s ); + std::vector::iterator it = find( m_apActiveSounds.begin(), m_apActiveSounds.end(), s ); ASSERT( it != m_apActiveSounds.end() ); RageSoundReader *&pSound = s->pSound; @@ -312,7 +312,7 @@ int RageSoundReader_Chain::Read( float *pBuffer, int iFrames ) int iOffsetFrame = m_aSounds[m_iNextSound].GetOffsetFrame( m_iActualSampleRate ); ASSERT_M( iOffsetFrame >= m_iCurrentFrame, ssprintf("%i %i", iOffsetFrame, m_iCurrentFrame) ); int iFramesToRead = iOffsetFrame - m_iCurrentFrame; - iFrames = min( iFramesToRead, iFrames ); + iFrames = std::min( iFramesToRead, iFrames ); } if( m_apActiveSounds.size() == 1 && @@ -342,7 +342,7 @@ int RageSoundReader_Chain::Read( float *pBuffer, int iFrames ) RageSoundMixBuffer mix; /* Read iFrames from each sound. */ float Buffer[2048]; - iFrames = min( iFrames, (int) (ARRAYLEN(Buffer) / m_iChannels) ); + iFrames = std::min( iFrames, (int) (ARRAYLEN(Buffer) / m_iChannels) ); for( unsigned i = 0; i < m_apActiveSounds.size(); ) { RageSoundReader *pSound = m_apActiveSounds[i]->pSound; @@ -390,7 +390,7 @@ int RageSoundReader_Chain::GetLength() const const RageSoundReader *pSound = m_apLoadedSounds[sound.iIndex]; int iThisLength = pSound->GetLength(); if( iThisLength ) - iLength = max( iLength, iThisLength + sound.iOffsetMS ); + iLength = std::max( iLength, iThisLength + sound.iOffsetMS ); } return iLength; } @@ -404,7 +404,7 @@ int RageSoundReader_Chain::GetLength_Fast() const const RageSoundReader *pSound = m_apLoadedSounds[sound.iIndex]; int iThisLength = pSound->GetLength_Fast(); if( iThisLength ) - iLength = max( iLength, iThisLength + sound.iOffsetMS ); + iLength = std::max( iLength, iThisLength + sound.iOffsetMS ); } return iLength; } diff --git a/src/RageSoundReader_Chain.h b/src/RageSoundReader_Chain.h index 9cc402ea5c..da2eb6801e 100644 --- a/src/RageSoundReader_Chain.h +++ b/src/RageSoundReader_Chain.h @@ -49,8 +49,8 @@ private: int m_iActualSampleRate; unsigned m_iChannels; - map m_apNamedSounds; - vector m_apLoadedSounds; + std::map m_apNamedSounds; + std::vector m_apLoadedSounds; struct Sound { @@ -62,12 +62,12 @@ private: int GetOffsetFrame( int iSampleRate ) const { return int( int64_t(iOffsetMS) * iSampleRate / 1000 ); } bool operator<( const Sound &rhs ) const { return iOffsetMS < rhs.iOffsetMS; } }; - vector m_aSounds; + std::vector m_aSounds; /* Read state: */ int m_iCurrentFrame; unsigned m_iNextSound; - vector m_apActiveSounds; + std::vector m_apActiveSounds; void ActivateSound( Sound *s ); void ReleaseSound( Sound *s ); diff --git a/src/RageSoundReader_ChannelSplit.cpp b/src/RageSoundReader_ChannelSplit.cpp index 09b8f37d9d..c26e549e5b 100644 --- a/src/RageSoundReader_ChannelSplit.cpp +++ b/src/RageSoundReader_ChannelSplit.cpp @@ -74,11 +74,11 @@ public: RageSoundReader *m_pSource; - set m_apSounds; + std::set m_apSounds; /* m_sBuffer[0] corresponds to frame number m_iBufferPositionFrames. */ int m_iBufferPositionFrames; - vector m_sBuffer; + std::vector m_sBuffer; }; int RageSoundReader_Split::GetLength() const { return m_pImpl->m_pSource->GetLength(); } @@ -156,7 +156,7 @@ int RageSoundReader_Split::Read( float *pBuf, int iFrames ) if( iFramesAvailable == 0 && iRet < 0 ) return iRet; - iFramesAvailable = min( iFramesAvailable, iFramesWanted ); + iFramesAvailable = std::min( iFramesAvailable, iFramesWanted ); { RageSoundMixBuffer mix; @@ -186,14 +186,14 @@ int RageSoundSplitterImpl::ReadBuffer() int iMaxFrameRequested = INT_MIN; for (RageSoundReader_Split *snd : m_apSounds) { - iMinFrameRequested = min( iMinFrameRequested, snd->m_iPositionFrame ); - iMaxFrameRequested = max( iMaxFrameRequested, snd->m_iPositionFrame + snd->m_iRequestFrames ); + iMinFrameRequested = std::min( iMinFrameRequested, snd->m_iPositionFrame ); + iMaxFrameRequested = std::max( iMaxFrameRequested, snd->m_iPositionFrame + snd->m_iRequestFrames ); } if( iMinFrameRequested > m_iBufferPositionFrames ) { int iEraseFrames = iMinFrameRequested - m_iBufferPositionFrames; - iEraseFrames = min( iEraseFrames, (int) m_sBuffer.size() ); + iEraseFrames = std::min( iEraseFrames, (int) m_sBuffer.size() ); m_sBuffer.erase( m_sBuffer.begin(), m_sBuffer.begin() + iEraseFrames * m_pSource->GetNumChannels() ); m_iBufferPositionFrames += iEraseFrames; } @@ -229,7 +229,7 @@ int RageSoundSplitterImpl::ReadBuffer() void RageSoundReader_Split::AddSourceChannelToSound( int iFromChannel, int iToChannel ) { m_aChannels.push_back( ChannelMap(iFromChannel, iToChannel) ); - m_iNumOutputChannels = max( m_iNumOutputChannels, iToChannel + 1 ); + m_iNumOutputChannels = std::max( m_iNumOutputChannels, iToChannel + 1 ); } RageSoundSplitter::RageSoundSplitter( RageSoundReader *pSource ) diff --git a/src/RageSoundReader_ChannelSplit.h b/src/RageSoundReader_ChannelSplit.h index e6cb9859ad..829d2dc676 100644 --- a/src/RageSoundReader_ChannelSplit.h +++ b/src/RageSoundReader_ChannelSplit.h @@ -39,7 +39,7 @@ private: int m_iToChannel; ChannelMap( int iFromChannel, int iToChannel ) { m_iFromChannel = iFromChannel; m_iToChannel = iToChannel; } }; - vector m_aChannels; + std::vector m_aChannels; int m_iPositionFrame; int m_iRequestFrames; diff --git a/src/RageSoundReader_Extend.cpp b/src/RageSoundReader_Extend.cpp index fb04eff1fc..e000a19828 100644 --- a/src/RageSoundReader_Extend.cpp +++ b/src/RageSoundReader_Extend.cpp @@ -31,7 +31,7 @@ int RageSoundReader_Extend::SetPosition( int iFrame ) m_bIgnoreFadeInFrames = false; m_iPositionFrames = iFrame; - int iRet = m_pSource->SetPosition( max(iFrame, 0) ); + int iRet = m_pSource->SetPosition( std::max(iFrame, 0) ); if( iRet < 0 ) return iRet; @@ -59,8 +59,8 @@ int RageSoundReader_Extend::GetData( float *pBuffer, int iFrames ) if( m_iLengthFrames != -1 ) { int iFramesLeft = GetEndFrame() - m_iPositionFrames; - iFramesLeft = max( 0, iFramesLeft ); - iFramesToRead = min( iFramesToRead, iFramesLeft ); + iFramesLeft = std::max( 0, iFramesLeft ); + iFramesToRead = std::min( iFramesToRead, iFramesLeft ); } if( iFrames && !iFramesToRead ) @@ -68,7 +68,7 @@ int RageSoundReader_Extend::GetData( float *pBuffer, int iFrames ) if( m_iPositionFrames < 0 ) { - iFramesToRead = min( iFramesToRead, -m_iPositionFrames ); + iFramesToRead = std::min( iFramesToRead, -m_iPositionFrames ); memset( pBuffer, 0, iFramesToRead * sizeof(float) * this->GetNumChannels() ); return iFramesToRead; } @@ -93,7 +93,7 @@ int RageSoundReader_Extend::Read( float *pBuffer, int iFrames ) { iFramesRead = iFrames; if( m_StopMode != M_CONTINUE ) - iFramesRead = min( GetEndFrame() - m_iPositionFrames, iFramesRead ); + iFramesRead = std::min( GetEndFrame() - m_iPositionFrames, iFramesRead ); memset( pBuffer, 0, iFramesRead * sizeof(float) * this->GetNumChannels() ); } } diff --git a/src/RageSoundReader_FileReader.cpp b/src/RageSoundReader_FileReader.cpp index 3dee62fe85..e9a174f703 100644 --- a/src/RageSoundReader_FileReader.cpp +++ b/src/RageSoundReader_FileReader.cpp @@ -111,9 +111,9 @@ RageSoundReader_FileReader *RageSoundReader_FileReader::OpenFile( RString filena *pPrebuffer = false; } } - set FileTypes; - vector const& sound_exts= ActorUtil::GetTypeExtensionList(FT_Sound); - for(vector::const_iterator curr= sound_exts.begin(); + std::set FileTypes; + std::vector const& sound_exts= ActorUtil::GetTypeExtensionList(FT_Sound); + for(std::vector::const_iterator curr= sound_exts.begin(); curr != sound_exts.end(); ++curr) { FileTypes.insert(*curr); @@ -135,7 +135,7 @@ RageSoundReader_FileReader *RageSoundReader_FileReader::OpenFile( RString filena FileTypes.erase( format ); } - for( set::iterator it = FileTypes.begin(); bKeepTrying && it != FileTypes.end(); ++it ) + for( std::set::iterator it = FileTypes.begin(); bKeepTrying && it != FileTypes.end(); ++it ) { RageSoundReader_FileReader *NewSample = TryOpenFile( pFile->Copy(), error, *it, bKeepTrying ); if( NewSample ) diff --git a/src/RageSoundReader_MP3.cpp b/src/RageSoundReader_MP3.cpp index 8d254ed223..0059c29637 100644 --- a/src/RageSoundReader_MP3.cpp +++ b/src/RageSoundReader_MP3.cpp @@ -214,7 +214,7 @@ struct madlib_t } }; - typedef map tocmap_t; + typedef std::map tocmap_t; tocmap_t tocmap; /* Position in the file of inbuf: */ @@ -296,7 +296,7 @@ bool RageSoundReader_MP3::handle_first_frame() if( mad->xingtag.type == xing::INFO ) return false; - mad->header_bytes = max( mad->header_bytes, get_this_frame_byte(mad) ); + mad->header_bytes = std::max( mad->header_bytes, get_this_frame_byte(mad) ); mad->has_xing = true; @@ -563,7 +563,7 @@ int RageSoundReader_MP3::resync() /* Seek backwards up to 4k. */ const int origpos = mad->inbuf_filepos; - const int seekpos = max( 0, origpos - 1024*4 ); + const int seekpos = std::max( 0, origpos - 1024*4 ); seek_stream_to_byte( seekpos ); /* Agh. This is annoying. We want to decode enough so that the next frame @@ -700,7 +700,7 @@ int RageSoundReader_MP3::Read( float *buf, int iFrames ) { if( mad->outleft > 0 ) { - int iFramesToCopy = min( iFrames, int(mad->outleft / GetNumChannels()) ); + int iFramesToCopy = std::min( iFrames, int(mad->outleft / GetNumChannels()) ); const int iSamplesToCopy = iFramesToCopy * GetNumChannels(); const int iBytesToCopy = iSamplesToCopy * sizeof(float); @@ -822,7 +822,7 @@ int RageSoundReader_MP3::SetPosition_toc( int iFrame, bool Xing ) if( bytepos != -1 ) { /* Seek backwards up to 4k. */ - const int seekpos = max( 0, bytepos - 1024*4 ); + const int seekpos = std::max( 0, bytepos - 1024*4 ); seek_stream_to_byte( seekpos ); do diff --git a/src/RageSoundReader_Merge.cpp b/src/RageSoundReader_Merge.cpp index 50c8b9ef9f..1419395e65 100644 --- a/src/RageSoundReader_Merge.cpp +++ b/src/RageSoundReader_Merge.cpp @@ -60,7 +60,7 @@ void RageSoundReader_Merge::Finish( int iPreferredSampleRate ) * which will be converted as needed, or have the same number of channels. */ m_iChannels = 1; for (RageSoundReader *it : m_aSounds) - m_iChannels = max( m_iChannels, it->GetNumChannels() ); + m_iChannels = std::max( m_iChannels, it->GetNumChannels() ); /* * We might get different sample rates from our sources. If they're all the same @@ -91,7 +91,7 @@ void RageSoundReader_Merge::Finish( int iPreferredSampleRate ) * channels. */ if( m_iChannels > 2 ) { - vector aSounds; + std::vector aSounds; for (RageSoundReader *it : m_aSounds) { if( it->GetNumChannels() != m_iChannels ) @@ -177,8 +177,8 @@ int RageSoundReader_Merge::Read( float *pBuffer, int iFrames ) * happens may be a bug, such as sounds at different speeds. */ - vector aNextSourceFrames; - vector aRatios; + std::vector aNextSourceFrames; + std::vector aRatios; aNextSourceFrames.resize( m_aSounds.size() ); aRatios.resize( m_aSounds.size() ); for( unsigned i = 0; i < m_aSounds.size(); ++i ) @@ -213,7 +213,7 @@ int RageSoundReader_Merge::Read( float *pBuffer, int iFrames ) * read now, so we don't advance past it. */ int iMaxSourceFramesToRead = aNextSourceFrames[i] - iMinPosition; int iMaxStreamFramesToRead = lrintf( iMaxSourceFramesToRead / m_fCurrentStreamToSourceRatio ); - iFrames = min( iFrames, iMaxStreamFramesToRead ); + iFrames = std::min( iFrames, iMaxStreamFramesToRead ); // LOG->Warn( "RageSoundReader_Merge: sound positions moving at different rates" ); } } @@ -232,7 +232,7 @@ int RageSoundReader_Merge::Read( float *pBuffer, int iFrames ) RageSoundMixBuffer mix; float Buffer[2048]; - iFrames = min( iFrames, (int) (ARRAYLEN(Buffer) / m_iChannels) ); + iFrames = std::min( iFrames, (int) (ARRAYLEN(Buffer) / m_iChannels) ); /* Read iFrames from each sound. */ for( unsigned i = 0; i < m_aSounds.size(); ++i ) @@ -292,7 +292,7 @@ int RageSoundReader_Merge::GetLength() const { int iLength = 0; for( unsigned i = 0; i < m_aSounds.size(); ++i ) - iLength = max( iLength, m_aSounds[i]->GetLength() ); + iLength = std::max( iLength, m_aSounds[i]->GetLength() ); return iLength; } @@ -300,7 +300,7 @@ int RageSoundReader_Merge::GetLength_Fast() const { int iLength = 0; for( unsigned i = 0; i < m_aSounds.size(); ++i ) - iLength = max( iLength, m_aSounds[i]->GetLength_Fast() ); + iLength = std::max( iLength, m_aSounds[i]->GetLength_Fast() ); return iLength; } diff --git a/src/RageSoundReader_Merge.h b/src/RageSoundReader_Merge.h index 571a7bce3e..f97ad1d8e6 100644 --- a/src/RageSoundReader_Merge.h +++ b/src/RageSoundReader_Merge.h @@ -35,7 +35,7 @@ private: int m_iSampleRate; unsigned m_iChannels; - vector m_aSounds; + std::vector m_aSounds; /* Read state: */ int m_iNextSourceFrame; diff --git a/src/RageSoundReader_Pan.cpp b/src/RageSoundReader_Pan.cpp index 3b8d505154..f6cd2f8e9e 100644 --- a/src/RageSoundReader_Pan.cpp +++ b/src/RageSoundReader_Pan.cpp @@ -32,7 +32,7 @@ int RageSoundReader_Pan::Read( float *pBuf, int iFrames ) unsigned RageSoundReader_Pan::GetNumChannels() const { - return max( 2u, RageSoundReader_Filter::GetNumChannels() ); + return std::max( 2u, RageSoundReader_Filter::GetNumChannels() ); } bool RageSoundReader_Pan::SetProperty( const RString &sProperty, float fValue ) diff --git a/src/RageSoundReader_PostBuffering.cpp b/src/RageSoundReader_PostBuffering.cpp index cda6219435..4ae16c2849 100644 --- a/src/RageSoundReader_PostBuffering.cpp +++ b/src/RageSoundReader_PostBuffering.cpp @@ -35,7 +35,7 @@ int RageSoundReader_PostBuffering::Read( float *pBuf, int iFrames ) // Square the master so lower volumes are more sensitive. // This lines up better with perceived volume. float fVolume = m_fVolume * g_fMasterVolume * g_fMasterVolume; - fVolume = clamp( fVolume, 0, 1 ); + fVolume = clamp( fVolume, 0.0f, 1.0f ); g_Mutex.Unlock(); if( fVolume != 1.0f ) diff --git a/src/RageSoundReader_Preload.cpp b/src/RageSoundReader_Preload.cpp index b5e97ac395..178f955723 100644 --- a/src/RageSoundReader_Preload.cpp +++ b/src/RageSoundReader_Preload.cpp @@ -144,7 +144,7 @@ int RageSoundReader_Preload::Read( float *pBuffer, int iFrames ) const int iSizeFrames = m_Buffer->size() / framesize; const int iFramesAvail = iSizeFrames - m_iPosition; - iFrames = min( iFrames, iFramesAvail ); + iFrames = std::min( iFrames, iFramesAvail ); if( iFrames == 0 ) return END_OF_FILE; if( m_bBufferIs16Bit ) diff --git a/src/RageSoundReader_Resample_Good.cpp b/src/RageSoundReader_Resample_Good.cpp index d36bd5f8bc..caa93ab367 100644 --- a/src/RageSoundReader_Resample_Good.cpp +++ b/src/RageSoundReader_Resample_Good.cpp @@ -64,7 +64,7 @@ namespace for( int n = 0; n < iLen; ++n ) { float fN1 = fabsf((n-p)/p); - float fNum = fBeta * sqrtf( max(1-fN1*fN1, 0) ); + float fNum = fBeta * sqrtf( std::max(1-fN1*fN1, 0.0f) ); fNum = BesselI0( fNum ); float fVal = fNum/fDenom; pBuf[n] *= fVal; @@ -104,7 +104,7 @@ namespace void NormalizeVector( float *pBuf, int iSize ) { - float fTotal = accumulate( &pBuf[0], &pBuf[iSize], 0.0f ); + float fTotal = std::accumulate( &pBuf[0], &pBuf[iSize], 0.0f ); MultiplyVector( &pBuf[0], &pBuf[iSize], 1/fTotal ); } @@ -402,14 +402,14 @@ namespace PolyphaseFilterCache { /* Cache filter data, and reuse it without copying. All operations after creation * are const, so this doesn't cause thread-safety problems. */ - typedef map, PolyphaseFilter *> FilterMap; + typedef std::map, PolyphaseFilter*> FilterMap; static RageMutex PolyphaseFiltersLock("PolyphaseFiltersLock"); static FilterMap g_mapPolyphaseFilters; const PolyphaseFilter *MakePolyphaseFilter( int iUpFactor, float fCutoffFrequency ) { PolyphaseFiltersLock.Lock(); - pair params( make_pair(iUpFactor, fCutoffFrequency) ); + std::pair params( std::make_pair(iUpFactor, fCutoffFrequency) ); FilterMap::const_iterator it = g_mapPolyphaseFilters.find(params); if( it != g_mapPolyphaseFilters.end() ) { @@ -440,7 +440,7 @@ namespace PolyphaseFilterCache * Round the cutoff down, if possible; it's better to filter out too much than * too little. */ PolyphaseFiltersLock.Lock(); - pair params( make_pair(iUpFactor, fCutoffFrequency + 0.0001f) ); + std::pair params( std::make_pair(iUpFactor, fCutoffFrequency + 0.0001f) ); FilterMap::const_iterator it = g_mapPolyphaseFilters.upper_bound( params ); if( it != g_mapPolyphaseFilters.begin() ) --it; @@ -470,7 +470,7 @@ public: m_iUpFactor = iUpFactor; m_pPolyphase = nullptr; - int iFilterIncrement = max( (iMaxDownFactor - iMinDownFactor)/10, 1 ); + int iFilterIncrement = std::max( (iMaxDownFactor - iMinDownFactor)/10, 1 ); for( int iDownFactor = iMinDownFactor; iDownFactor <= iMaxDownFactor; iDownFactor += iFilterIncrement ) { float fCutoffFrequency = GetCutoffFrequency( iDownFactor ); @@ -529,7 +529,7 @@ private: float fCutoffFrequency; fCutoffFrequency = 1.0f / (2*m_iUpFactor); - fCutoffFrequency = min( fCutoffFrequency, 1.0f / (2*iDownFactor) ); + fCutoffFrequency = std::min( fCutoffFrequency, 1.0f / (2*iDownFactor) ); return fCutoffFrequency; } diff --git a/src/RageSoundReader_Resample_Good.h b/src/RageSoundReader_Resample_Good.h index 7a3bd44efe..3190e1cdbe 100644 --- a/src/RageSoundReader_Resample_Good.h +++ b/src/RageSoundReader_Resample_Good.h @@ -39,7 +39,7 @@ private: void ReopenResampler(); void GetFactors( int &iDownFactor, int &iUpFactor ) const; - vector m_apResamplers; /* one per channel */ + std::vector m_apResamplers; /* one per channel */ int m_iSampleRate; float m_fRate; diff --git a/src/RageSoundReader_SpeedChange.cpp b/src/RageSoundReader_SpeedChange.cpp index 919f9a4c24..a49aaf4f27 100644 --- a/src/RageSoundReader_SpeedChange.cpp +++ b/src/RageSoundReader_SpeedChange.cpp @@ -180,8 +180,8 @@ int RageSoundReader_SpeedChange::Step() { ChannelInfo &c = m_Channels[i]; ASSERT( c.m_iCorrelatedPos <= m_iDataBufferAvailFrames ); - iToDelete = min( iToDelete, c.m_iCorrelatedPos ); - //iToDelete = min( iToDelete, m_iDataBufferAvailFrames ); + iToDelete = std::min( iToDelete, c.m_iCorrelatedPos ); + //iToDelete = std::min( iToDelete, m_iDataBufferAvailFrames ); } EraseData( iToDelete ); @@ -189,7 +189,7 @@ int RageSoundReader_SpeedChange::Step() { int iMaxPositionNeeded = m_iUncorrelatedPos + GetToleranceFrames() + GetWindowSizeFrames(); for( size_t i = 0; i < m_Channels.size(); ++i ) - iMaxPositionNeeded = max( iMaxPositionNeeded, m_Channels[i].m_iCorrelatedPos + GetWindowSizeFrames() ); + iMaxPositionNeeded = std::max( iMaxPositionNeeded, m_Channels[i].m_iCorrelatedPos + GetWindowSizeFrames() ); int iGot = FillData( iMaxPositionNeeded ); if( iGot < 0 ) @@ -229,7 +229,7 @@ int RageSoundReader_SpeedChange::GetCursorAvail() const for( size_t i = 0; i < m_Channels.size(); ++i ) { int iCursorAvailForChannel = (m_iDataBufferAvailFrames-m_Channels[i].m_iCorrelatedPos) - m_iPos; - iCursorAvail = min( iCursorAvail, iCursorAvailForChannel ); + iCursorAvail = std::min( iCursorAvail, iCursorAvailForChannel ); } return iCursorAvail; @@ -264,7 +264,7 @@ int RageSoundReader_SpeedChange::Read( float *pBuf, int iFrames ) /* copy GetWindowSizeFrames() from iCorrelatedPos */ int iFramesLen = iFrames; - int iFramesAvail = min( iCursorAvail, iFramesLen ); + int iFramesAvail = std::min( iCursorAvail, iFramesLen ); iFrames -= iFramesAvail; int iFramesRead = iFramesAvail; diff --git a/src/RageSoundReader_SpeedChange.h b/src/RageSoundReader_SpeedChange.h index 82b2817ca9..4fb90fdf66 100644 --- a/src/RageSoundReader_SpeedChange.h +++ b/src/RageSoundReader_SpeedChange.h @@ -40,11 +40,11 @@ protected: int m_iDataBufferAvailFrames; struct ChannelInfo { - vector m_DataBuffer; + std::vector m_DataBuffer; int m_iCorrelatedPos; int m_iLastCorrelatedPos; }; - vector m_Channels; + std::vector m_Channels; int m_iUncorrelatedPos; int m_iPos; diff --git a/src/RageSoundReader_ThreadedBuffer.cpp b/src/RageSoundReader_ThreadedBuffer.cpp index db7efb2ce0..9105cd2d76 100644 --- a/src/RageSoundReader_ThreadedBuffer.cpp +++ b/src/RageSoundReader_ThreadedBuffer.cpp @@ -203,7 +203,7 @@ void RageSoundReader_ThreadedBuffer::BufferingThread() int iFramesToFill = g_iReadBlockSizeFrames; if( GetFilledFrames() < g_iMinFillFrames ) - iFramesToFill = max( iFramesToFill, g_iMinFillFrames - GetFilledFrames() ); + iFramesToFill = std::max( iFramesToFill, g_iMinFillFrames - GetFilledFrames() ); int iRet = FillFrames( iFramesToFill ); @@ -279,7 +279,7 @@ int RageSoundReader_ThreadedBuffer::FillBlock() unsigned iBufSize; float *pBuf = m_DataBuffer.get_write_pointer( &iBufSize ); ASSERT( (iBufSize % iSamplesPerFrame) == 0 ); - iGotFrames = m_pSource->RetriedRead( pBuf, min(g_iReadBlockSizeFrames, iBufSize / iSamplesPerFrame), &iNextSourceFrame, &fRate ); + iGotFrames = m_pSource->RetriedRead( pBuf, std::min(g_iReadBlockSizeFrames, iBufSize / iSamplesPerFrame), &iNextSourceFrame, &fRate ); } m_Event.Lock(); @@ -315,7 +315,7 @@ int RageSoundReader_ThreadedBuffer::Read( float *pBuffer, int iFrames ) /* Delete any empty mappings from the beginning, but don't empty the list, * so we always have the current position and rate. If we delete an item, * the rate or position has probably changed, so return. */ - list::iterator it = m_StreamPosition.begin(); + std::list::iterator it = m_StreamPosition.begin(); ++it; if( it != m_StreamPosition.end() && !m_StreamPosition.front().iFramesBuffered ) { @@ -330,7 +330,7 @@ int RageSoundReader_ThreadedBuffer::Read( float *pBuffer, int iFrames ) if( m_StreamPosition.front().iFramesBuffered ) { Mapping &pos = m_StreamPosition.front(); - int iFramesToRead = min( iFrames, pos.iFramesBuffered ); + int iFramesToRead = std::min( iFrames, pos.iFramesBuffered ); int iSamplesPerFrame = this->GetNumChannels(); m_DataBuffer.read( pBuffer, iFramesToRead * iSamplesPerFrame ); pos.iPositionOfFirstFrame += iFramesToRead; diff --git a/src/RageSoundReader_ThreadedBuffer.h b/src/RageSoundReader_ThreadedBuffer.h index 4b22cc4e67..bcf0c6b371 100644 --- a/src/RageSoundReader_ThreadedBuffer.h +++ b/src/RageSoundReader_ThreadedBuffer.h @@ -56,7 +56,7 @@ private: Mapping(): iFramesBuffered(0), iPositionOfFirstFrame(0), fRate(1.0f) {} }; - list m_StreamPosition; + std::list m_StreamPosition; bool m_bEOF; diff --git a/src/RageSoundReader_Vorbisfile.cpp b/src/RageSoundReader_Vorbisfile.cpp index caad3a6ce8..78972aa357 100644 --- a/src/RageSoundReader_Vorbisfile.cpp +++ b/src/RageSoundReader_Vorbisfile.cpp @@ -169,7 +169,7 @@ int RageSoundReader_Vorbisfile::Read( float *buf, int iFrames ) /* In bytes: */ int iSilentFrames = curofs - read_offset; - iSilentFrames = min( iSilentFrames, (int) iFrames ); + iSilentFrames = std::min( iSilentFrames, (int) iFrames ); int silence = iSilentFrames * bytes_per_frame; CHECKPOINT_M( ssprintf("p %i,%i: %i frames of silence needed", curofs, read_offset, silence) ); diff --git a/src/RageSoundReader_WAV.cpp b/src/RageSoundReader_WAV.cpp index 5adad7adc9..5f7908d82d 100644 --- a/src/RageSoundReader_WAV.cpp +++ b/src/RageSoundReader_WAV.cpp @@ -134,7 +134,7 @@ struct WavReaderPCM: public WavReader if( !iBytesLeftInDataChunk ) return RageSoundReader::END_OF_FILE; - len = min( len, iBytesLeftInDataChunk ); + len = std::min( len, iBytesLeftInDataChunk ); int iGot = m_File.Read( buf, len ); int iGotSamples = iGot / iBytesPerSample; @@ -192,7 +192,7 @@ struct WavReaderPCM: public WavReader struct WavReaderADPCM: public WavReader { public: - vector m_iaCoef1, m_iaCoef2; + std::vector m_iaCoef1, m_iaCoef2; int16_t m_iFramesPerBlock; float *m_pBuffer; int m_iBufferAvail, m_iBufferUsed; @@ -286,7 +286,7 @@ public: } /* We've read the block header; read the rest. Don't read past the end of the data chunk. */ - int iMaxSize = min( (int) m_WavData.m_iBlockAlign - 7 * m_WavData.m_iChannels, (m_WavData.m_iDataChunkSize+m_WavData.m_iDataChunkPos) - m_File.Tell() ); + int iMaxSize = std::min( (int) m_WavData.m_iBlockAlign - 7 * m_WavData.m_iChannels, (m_WavData.m_iDataChunkSize+m_WavData.m_iDataChunkPos) - m_File.Tell() ); char *pBuf = (char *) alloca( iMaxSize ); @@ -343,7 +343,7 @@ public: 768, 614, 512, 409, 307, 230, 230, 230 }; iDelta[c] = int16_t( (iDelta[c] * aAdaptionTable[iErrorDeltaUnsigned]) / (1<<8) ); - iDelta[c] = max( (int16_t) 16, iDelta[c] ); + iDelta[c] = std::max( (int16_t) 16, iDelta[c] ); iSamp2[c] = iSamp1[c]; iSamp1[c] = iNewSample; @@ -392,7 +392,7 @@ public: const int iBlockHeaderSize = 7 * m_WavData.m_iChannels; if( iExtraBytes > iBlockHeaderSize ) { - const int iExtraADPCMNibbles = max( 0, iExtraBytes-iBlockHeaderSize )*2; + const int iExtraADPCMNibbles = std::max( 0, iExtraBytes-iBlockHeaderSize )*2; const int iExtraADPCMFrames = iExtraADPCMNibbles/m_WavData.m_iChannels; iFrames += 2+iExtraADPCMFrames; diff --git a/src/RageSoundUtil.cpp b/src/RageSoundUtil.cpp index 0164c4a053..6c801d4de0 100644 --- a/src/RageSoundUtil.cpp +++ b/src/RageSoundUtil.cpp @@ -30,8 +30,8 @@ void RageSoundUtil::Pan( float *buffer, int frames, float fPos ) if( bSwap ) { - swap( fLeftFactors[0], fRightFactors[0] ); - swap( fLeftFactors[1], fRightFactors[1] ); + std::swap( fLeftFactors[0], fRightFactors[0] ); + std::swap( fLeftFactors[1], fRightFactors[1] ); } for( int samp = 0; samp < frames; ++samp ) diff --git a/src/RageSurfaceUtils.cpp b/src/RageSurfaceUtils.cpp index f6756f32e9..b079e43134 100644 --- a/src/RageSurfaceUtils.cpp +++ b/src/RageSurfaceUtils.cpp @@ -347,9 +347,9 @@ int RageSurfaceUtils::FindSurfaceTraits( const RageSurface *img ) alpha = (val & img->format->Amask); if( alpha == 0 ) - alpha_type = max( alpha_type, NEEDS_BOOL_ALPHA ); + alpha_type = std::max( alpha_type, NEEDS_BOOL_ALPHA ); else if( alpha != max_alpha ) - alpha_type = max( alpha_type, NEEDS_FULL_ALPHA ); + alpha_type = std::max( alpha_type, NEEDS_FULL_ALPHA ); row += img->format->BytesPerPixel; } @@ -652,8 +652,8 @@ void RageSurfaceUtils::Blit( const RageSurface *src, RageSurface *dst, int width width = src->w; if( height == -1 ) height = src->h; - width = min( src->w, dst->w ); - height = min( src->h, dst->h ); + width = std::min( src->w, dst->w ); + height = std::min( src->h, dst->h ); /* Try each blit until we find one that works; run them in order of efficiency, * so we use the fastest blit possible. */ @@ -835,7 +835,7 @@ RageSurface *RageSurfaceUtils::LoadSurface( RString file ) * This gives us a generic way to handle arbitrary 8-bit texture formats. */ RageSurface *RageSurfaceUtils::PalettizeToGrayscale( const RageSurface *src_surf, int GrayBits, int AlphaBits ) { - AlphaBits = min( AlphaBits, 8-src_surf->format->Loss[3] ); + AlphaBits = std::min( AlphaBits, 8-src_surf->format->Loss[3] ); const int TotalBits = GrayBits + AlphaBits; ASSERT( TotalBits <= 8 ); diff --git a/src/RageSurfaceUtils_Palettize.cpp b/src/RageSurfaceUtils_Palettize.cpp index ee96958f0a..458267e598 100644 --- a/src/RageSurfaceUtils_Palettize.cpp +++ b/src/RageSurfaceUtils_Palettize.cpp @@ -144,7 +144,7 @@ void RageSurfaceUtils::Palettize( RageSurface *&pImg, int iColors, bool bDither } maxval = newmaxval; } - newcolors = min( colors, iColors ); + newcolors = std::min( colors, iColors ); // Apply median-cut to histogram, making the new acolormap. acolormap = mediancut( achv, colors, pImg->h * pImg->w, maxval, newcolors ); @@ -298,7 +298,7 @@ void RageSurfaceUtils::Palettize( RageSurface *&pImg, int iColors, bool bDither if( bDither ) { - swap( thiserr, nexterr ); + std::swap( thiserr, nexterr ); fs_direction = !fs_direction; } } @@ -379,17 +379,17 @@ static acolorhist_item *mediancut( acolorhist_item *achv, int colors, int sum, i { int v; v = achv[indx + i].acolor[0]; - mins[0] = min( mins[0], v ); - maxs[0] = max( maxs[0], v ); + mins[0] = std::min( mins[0], v ); + maxs[0] = std::max( maxs[0], v ); v = achv[indx + i].acolor[1]; - mins[1] = min( mins[1], v ); - maxs[1] = max( maxs[1], v ); + mins[1] = std::min( mins[1], v ); + maxs[1] = std::max( maxs[1], v ); v = achv[indx + i].acolor[2]; - mins[2] = min( mins[2], v ); - maxs[2] = max( maxs[2], v ); + mins[2] = std::min( mins[2], v ); + maxs[2] = std::max( maxs[2], v ); v = achv[indx + i].acolor[3]; - mins[3] = min( mins[3], v ); - maxs[3] = max( maxs[3], v ); + mins[3] = std::min( mins[3], v ); + maxs[3] = std::max( maxs[3], v ); } // Find the largest dimension, and sort by that component. @@ -401,10 +401,10 @@ static acolorhist_item *mediancut( acolorhist_item *achv, int colors, int sum, i switch( iMax ) { - case 0: sort( &achv[indx], &achv[indx+clrs], compare_index_0 ); break; - case 1: sort( &achv[indx], &achv[indx+clrs], compare_index_1 ); break; - case 2: sort( &achv[indx], &achv[indx+clrs], compare_index_2 ); break; - case 3: sort( &achv[indx], &achv[indx+clrs], compare_index_3 ); break; + case 0: std::sort( &achv[indx], &achv[indx+clrs], compare_index_0 ); break; + case 1: std::sort( &achv[indx], &achv[indx+clrs], compare_index_1 ); break; + case 2: std::sort( &achv[indx], &achv[indx+clrs], compare_index_2 ); break; + case 3: std::sort( &achv[indx], &achv[indx+clrs], compare_index_3 ); break; } } /* Now find the median based on the counts, so that about half the @@ -426,7 +426,7 @@ static acolorhist_item *mediancut( acolorhist_item *achv, int colors, int sum, i bv[boxes].colors = clrs - j; bv[boxes].sum = sm - lowersum; ++boxes; - sort( &bv[0], &bv[boxes], CompareBySumDescending ); + std::sort( &bv[0], &bv[boxes], CompareBySumDescending ); } /* Ok, we've got enough boxes. Now choose a representative color for @@ -471,13 +471,13 @@ static acolorhist_item *mediancut( acolorhist_item *achv, int colors, int sum, i lSum += achv[indx + i].value; } r = r / lSum; - r = min( r, (long) maxval ); + r = std::min( r, (long) maxval ); g = g / lSum; - g = min( g, (long) maxval ); + g = std::min( g, (long) maxval ); b = b / lSum; - b = min( b, (long) maxval ); + b = std::min( b, (long) maxval ); a = a / lSum; - a = min( a, (long) maxval ); + a = std::min( a, (long) maxval ); PAM_ASSIGN( acolormap[bi].acolor, (uint8_t)r, (uint8_t)g, (uint8_t)b, (uint8_t)a ); #endif // REP_AVERAGE_PIXELS } diff --git a/src/RageSurfaceUtils_Zoom.cpp b/src/RageSurfaceUtils_Zoom.cpp index b519645512..0dd9fc134d 100644 --- a/src/RageSurfaceUtils_Zoom.cpp +++ b/src/RageSurfaceUtils_Zoom.cpp @@ -5,7 +5,6 @@ #include "RageUtil.h" #include -using namespace std; /* Coordinate 0x0 represents the exact top-left corner of a bitmap. .5x.5 * represents the center of the top-left pixel; 1x1 is the center of the top @@ -14,7 +13,7 @@ using namespace std; * (Look at a grid: map coordinates to the lines, not the squares between the * lines.) */ -static void InitVectors( vector &s0, vector &s1, vector &percent, int src, int dst ) +static void InitVectors( std::vector &s0, std::vector &s1, std::vector &percent, int src, int dst ) { if( src >= dst ) { @@ -83,8 +82,8 @@ static void ZoomSurface( const RageSurface * src, RageSurface * dst ) { /* For each destination coordinate, two source rows, two source columns * and the percentage of the first row and first column: */ - vector esx0, esx1, esy0, esy1; - vector ex0, ey0; + std::vector esx0, esx1, esy0, esy1; + std::vector ex0, ey0; InitVectors( esx0, esx1, ex0, src->w, dst->w ); InitVectors( esy0, esy1, ey0, src->h, dst->h ); diff --git a/src/RageSurface_Load.cpp b/src/RageSurface_Load.cpp index da384d9723..19e71e41cb 100644 --- a/src/RageSurface_Load.cpp +++ b/src/RageSurface_Load.cpp @@ -85,9 +85,9 @@ RageSurface *RageSurfaceUtils::LoadFile( const RString &sPath, RString &error, b } } - set FileTypes; - vector const& exts= ActorUtil::GetTypeExtensionList(FT_Bitmap); - for(vector::const_iterator curr= exts.begin(); + std::set FileTypes; + std::vector const& exts= ActorUtil::GetTypeExtensionList(FT_Bitmap); + for(std::vector::const_iterator curr= exts.begin(); curr != exts.end(); ++curr) { FileTypes.insert(*curr); @@ -107,7 +107,7 @@ RageSurface *RageSurfaceUtils::LoadFile( const RString &sPath, RString &error, b FileTypes.erase( format ); } - for( set::iterator it = FileTypes.begin(); bKeepTrying && it != FileTypes.end(); ++it ) + for( std::set::iterator it = FileTypes.begin(); bKeepTrying && it != FileTypes.end(); ++it ) { RageSurface *ret = TryOpenFile( sPath, bHeaderOnly, error, *it, bKeepTrying ); if( ret ) diff --git a/src/RageSurface_Load_BMP.cpp b/src/RageSurface_Load_BMP.cpp index 53269d9cf6..156e744eee 100644 --- a/src/RageSurface_Load_BMP.cpp +++ b/src/RageSurface_Load_BMP.cpp @@ -79,7 +79,7 @@ static RageSurfaceUtils::OpenResult LoadBMP( RageFile &f, RageSurface *&img, RSt FATAL_ERROR( ssprintf( "BI_BITFIELDS unexpected with bpp %u", iBPP ) ); int iFileBPP = iBPP; - iBPP = max( iBPP, 8u ); + iBPP = std::max( iBPP, 8u ); int Rmask = 0, Gmask = 0, Bmask = 0, Amask = 0; switch( iBPP ) diff --git a/src/RageSurface_Load_JPEG.cpp b/src/RageSurface_Load_JPEG.cpp index 2eb0b0cada..48f028c150 100644 --- a/src/RageSurface_Load_JPEG.cpp +++ b/src/RageSurface_Load_JPEG.cpp @@ -93,7 +93,7 @@ void RageFile_JPEG_skip_input_data( j_decompress_ptr cinfo, long num_bytes ) { RageFile_source_mgr *src = (RageFile_source_mgr *) cinfo->src; - int in_buffer = min( (long) src->pub.bytes_in_buffer, num_bytes ); + int in_buffer = std::min( (long) src->pub.bytes_in_buffer, num_bytes ); src->pub.next_input_byte += in_buffer; src->pub.bytes_in_buffer -= in_buffer; num_bytes -= in_buffer; diff --git a/src/RageSurface_Load_XPM.cpp b/src/RageSurface_Load_XPM.cpp index ed6e6731a1..fdf9f3ab58 100644 --- a/src/RageSurface_Load_XPM.cpp +++ b/src/RageSurface_Load_XPM.cpp @@ -33,9 +33,9 @@ RageSurface *RageSurface_Load_XPM( char * const *xpm, RString &error ) return nullptr; } - vector colors; + std::vector colors; - map name_to_color; + std::map name_to_color; for( int i = 0; i < num_colors; ++i ) { CheckLine(); @@ -94,7 +94,7 @@ RageSurface *RageSurface_Load_XPM( char * const *xpm, RString &error ) for( int x = 0; x < width; ++x ) { RString color_name = row.substr( x*color_length, color_length ); - map::const_iterator it; + std::map::const_iterator it; it = name_to_color.find( color_name ); if( it == name_to_color.end() ) { diff --git a/src/RageTexture.cpp b/src/RageTexture.cpp index 55586ef849..a9f93073fd 100644 --- a/src/RageTexture.cpp +++ b/src/RageTexture.cpp @@ -45,7 +45,7 @@ void RageTexture::CreateFrameRects() void RageTexture::GetFrameDimensionsFromFileName( RString sPath, int* piFramesWide, int* piFramesHigh, int source_width, int source_height ) { static Regex match( " ([0-9]+)x([0-9]+)([\\. ]|$)" ); - vector asMatch; + std::vector asMatch; if( !match.Compare(sPath, asMatch) ) { *piFramesWide = *piFramesHigh = 1; diff --git a/src/RageTexture.h b/src/RageTexture.h index d299e297f3..6c553afa2e 100644 --- a/src/RageTexture.h +++ b/src/RageTexture.h @@ -77,7 +77,7 @@ protected: int m_iTextureWidth, m_iTextureHeight; // dimensions of the texture in memory int m_iImageWidth, m_iImageHeight; // dimensions of the image in the texture int m_iFramesWide, m_iFramesHigh; // The number of frames of animation in each row and column of this texture - vector m_TextureCoordRects; // size = m_iFramesWide * m_iFramesHigh + std::vector m_TextureCoordRects; // size = m_iFramesWide * m_iFramesHigh virtual void CreateFrameRects(); }; diff --git a/src/RageTextureManager.cpp b/src/RageTextureManager.cpp index 1363c59929..7840ab4bac 100644 --- a/src/RageTextureManager.cpp +++ b/src/RageTextureManager.cpp @@ -33,9 +33,9 @@ RageTextureManager* TEXTUREMAN = nullptr; // global and accessible from anywhe namespace { - map m_mapPathToTexture; - map m_textures_to_update; - map m_texture_ids_by_pointer; + std::map m_mapPathToTexture; + std::map m_textures_to_update; + std::map m_texture_ids_by_pointer; }; RageTextureManager::RageTextureManager(): @@ -68,7 +68,7 @@ void RageTextureManager::AdjustTextureID( RageTextureID &ID ) const { if( ID.iColorDepth == -1 ) ID.iColorDepth = m_Prefs.m_iTextureColorDepth; - ID.iMaxSize = min( ID.iMaxSize, m_Prefs.m_iMaxTextureResolution ); + ID.iMaxSize = std::min( ID.iMaxSize, m_Prefs.m_iMaxTextureResolution ); if( m_Prefs.m_bMipMaps ) ID.bMipMaps = true; } @@ -196,7 +196,7 @@ RageTexture* RageTextureManager::CopyTexture( RageTexture *pCopy ) void RageTextureManager::VolatileTexture( RageTextureID ID ) { RageTexture* pTexture = LoadTextureInternal( ID ); - pTexture->GetPolicy() = min( pTexture->GetPolicy(), RageTextureID::TEX_VOLATILE ); + pTexture->GetPolicy() = std::min( pTexture->GetPolicy(), RageTextureID::TEX_VOLATILE ); UnloadTexture( pTexture ); } @@ -234,18 +234,18 @@ void RageTextureManager::DeleteTexture( RageTexture *t ) ASSERT( t->m_iRefCount == 0 ); //LOG->Trace( "RageTextureManager: deleting '%s'.", t->GetID().filename.c_str() ); - map::iterator id_entry= + std::map::iterator id_entry= m_texture_ids_by_pointer.find(t); if(id_entry != m_texture_ids_by_pointer.end()) { - map::iterator tex_entry= + std::map::iterator tex_entry= m_mapPathToTexture.find(id_entry->second); if(tex_entry != m_mapPathToTexture.end()) { m_mapPathToTexture.erase(tex_entry); SAFE_DELETE(t); } - map::iterator tex_update_entry= + std::map::iterator tex_update_entry= m_textures_to_update.find(id_entry->second); if(tex_update_entry != m_textures_to_update.end()) { @@ -257,13 +257,13 @@ void RageTextureManager::DeleteTexture( RageTexture *t ) else { FAIL_M("Tried to delete a texture that wasn't in the ids by pointer list."); - for (map::iterator iter = m_mapPathToTexture.begin(); iter != m_mapPathToTexture.end(); ++iter) + for (std::map::iterator iter = m_mapPathToTexture.begin(); iter != m_mapPathToTexture.end(); ++iter) { if( iter->second == t ) { m_mapPathToTexture.erase( iter ); // remove map entry SAFE_DELETE( t ); // free the texture - map::iterator tex_update_entry= + std::map::iterator tex_update_entry= m_textures_to_update.find(iter->first); if(tex_update_entry != m_textures_to_update.end()) { diff --git a/src/RageTexturePreloader.h b/src/RageTexturePreloader.h index 4f893ffe9a..bfe97badd6 100644 --- a/src/RageTexturePreloader.h +++ b/src/RageTexturePreloader.h @@ -17,7 +17,7 @@ public: void Swap( RageTexturePreloader &rhs ) { swap( m_apTextures, rhs.m_apTextures ); } private: - vector m_apTextures; + std::vector m_apTextures; }; #endif diff --git a/src/RageThreads.cpp b/src/RageThreads.cpp index 8cec411e70..ea5ff1294d 100644 --- a/src/RageThreads.cpp +++ b/src/RageThreads.cpp @@ -35,7 +35,7 @@ bool RageThread::s_bSystemSupportsTLS = false; bool RageThread::s_bIsShowingDialog = false; #define MAX_THREADS 128 -//static vector *g_MutexList = nullptr; /* watch out for static initialization order problems */ +//static std::vector *g_MutexList = nullptr; /* watch out for static initialization order problems */ struct ThreadSlot { @@ -397,7 +397,7 @@ void Checkpoints::SetCheckpoint( const char *file, int line, const char *message LOG->Trace( "%s", slot->m_Checkpoints[slot->m_iCurCheckpoint].m_szFormattedBuf ); ++slot->m_iCurCheckpoint; - slot->m_iNumCheckpoints = max( slot->m_iNumCheckpoints, slot->m_iCurCheckpoint ); + slot->m_iNumCheckpoints = std::max( slot->m_iNumCheckpoints, slot->m_iCurCheckpoint ); slot->m_iCurCheckpoint %= CHECKPOINT_COUNT; } @@ -474,7 +474,7 @@ void RageMutex::MarkLockedMutex() ASSERT( ID < MAX_MUTEXES ); /* This is a queue of all mutexes that must be locked before ID, if at all. */ - vector before; + std::vector before; /* Iterate over all locked mutexes that are locked by this thread. */ for( unsigned i = 0; i < g_MutexList->size(); ++i ) @@ -521,7 +521,7 @@ void RageMutex::MarkLockedMutex() } /* XXX: How can g_FreeMutexIDs and g_MutexList be threadsafed? */ -static set *g_FreeMutexIDs = nullptr; +static std::set *g_FreeMutexIDs = nullptr; #endif RageMutex::RageMutex( const RString &name ): @@ -531,7 +531,7 @@ RageMutex::RageMutex( const RString &name ): /* if( g_FreeMutexIDs == nullptr ) { - g_FreeMutexIDs = new set; + g_FreeMutexIDs = new std::set; for( int i = 0; i < MAX_MUTEXES; ++i ) g_FreeMutexIDs->insert( i ); } @@ -555,7 +555,7 @@ RageMutex::RageMutex( const RString &name ): g_FreeMutexIDs->erase( g_FreeMutexIDs->begin() ); if( g_MutexList == nullptr ) - g_MutexList = new vector; + g_MutexList = new std::vector; g_MutexList->push_back( this ); */ @@ -565,7 +565,7 @@ RageMutex::~RageMutex() { delete m_pMutex; /* - vector::iterator it = find( g_MutexList->begin(), g_MutexList->end(), this ); + std::vector::iterator it = find( g_MutexList->begin(), g_MutexList->end(), this ); ASSERT( it != g_MutexList->end() ); g_MutexList->erase( it ); if( g_MutexList->empty() ) diff --git a/src/RageUtil.cpp b/src/RageUtil.cpp index 8c0135974d..ca4d447a1f 100644 --- a/src/RageUtil.cpp +++ b/src/RageUtil.cpp @@ -273,7 +273,7 @@ bool HexToBinary( const RString &s, RString &sOut ) float HHMMSSToSeconds( const RString &sHHMMSS ) { - vector arrayBits; + std::vector arrayBits; split( sHHMMSS, ":", arrayBits, false ); while( arrayBits.size() < 3 ) @@ -300,7 +300,7 @@ RString SecondsToMMSSMsMs( float fSecs ) const int iMinsDisplay = (int)fSecs/60; const int iSecsDisplay = (int)fSecs - iMinsDisplay*60; const int iLeftoverDisplay = (int) ( (fSecs - iMinsDisplay*60 - iSecsDisplay) * 100 ); - RString sReturn = ssprintf( "%02d:%02d.%02d", iMinsDisplay, iSecsDisplay, min(99,iLeftoverDisplay) ); + RString sReturn = ssprintf( "%02d:%02d.%02d", iMinsDisplay, iSecsDisplay, std::min(99,iLeftoverDisplay) ); return sReturn; } @@ -309,7 +309,7 @@ RString SecondsToMSSMsMs( float fSecs ) const int iMinsDisplay = (int)fSecs/60; const int iSecsDisplay = (int)fSecs - iMinsDisplay*60; const int iLeftoverDisplay = (int) ( (fSecs - iMinsDisplay*60 - iSecsDisplay) * 100 ); - RString sReturn = ssprintf( "%01d:%02d.%02d", iMinsDisplay, iSecsDisplay, min(99,iLeftoverDisplay) ); + RString sReturn = ssprintf( "%01d:%02d.%02d", iMinsDisplay, iSecsDisplay, std::min(99,iLeftoverDisplay) ); return sReturn; } @@ -318,7 +318,7 @@ RString SecondsToMMSSMsMsMs( float fSecs ) const int iMinsDisplay = (int)fSecs/60; const int iSecsDisplay = (int)fSecs - iMinsDisplay*60; const int iLeftoverDisplay = (int) ( (fSecs - iMinsDisplay*60 - iSecsDisplay) * 1000 ); - RString sReturn = ssprintf( "%02d:%02d.%03d", iMinsDisplay, iSecsDisplay, min(999,iLeftoverDisplay) ); + RString sReturn = ssprintf( "%02d:%02d.%03d", iMinsDisplay, iSecsDisplay, std::min(999,iLeftoverDisplay) ); return sReturn; } @@ -355,11 +355,11 @@ RString Commify(const RString& num, const RString& sep, const RString& dot) size_t num_end= num.size(); size_t dot_pos= num.find(dot); size_t dash_pos= num.find('-'); - if(dot_pos != string::npos) + if(dot_pos != std::string::npos) { num_end= dot_pos; } - if(dash_pos != string::npos) + if(dash_pos != std::string::npos) { num_start= dash_pos + 1; } @@ -696,7 +696,7 @@ static const LanguageInfo g_langs[] = {"zu", "Zulu"}, }; -void GetLanguageInfos( vector &vAddTo ) +void GetLanguageInfos( std::vector &vAddTo ) { for( unsigned i=0; i &sSource) +RString join( const RString &sDeliminator, const std::vector &sSource) { if( sSource.empty() ) return RString(); @@ -737,7 +737,7 @@ RString join( const RString &sDeliminator, const vector &sSource) return sTmp; } -RString join( const RString &sDelimitor, vector::const_iterator begin, vector::const_iterator end ) +RString join( const RString &sDelimitor, std::vector::const_iterator begin, std::vector::const_iterator end ) { if( begin == end ) return RString(); @@ -745,7 +745,7 @@ RString join( const RString &sDelimitor, vector::const_iterator begin, RString sRet; size_t final_size= 0; size_t delim_size= sDelimitor.size(); - for(vector::const_iterator curr= begin; curr != end; ++curr) + for(std::vector::const_iterator curr= begin; curr != end; ++curr) { final_size+= curr->size(); if(curr != end) @@ -834,7 +834,7 @@ static int DelimitorLength( wchar_t Delimitor ) } template -void do_split( const S &Source, const C Delimitor, vector &AddIt, const bool bIgnoreEmpty ) +void do_split( const S &Source, const C Delimitor, std::vector &AddIt, const bool bIgnoreEmpty ) { /* Short-circuit if the source is empty; we want to return an empty vector if * the string is empty, even if bIgnoreEmpty is true. */ @@ -866,7 +866,7 @@ void do_split( const S &Source, const C Delimitor, vector &AddIt, const bool } while ( startpos <= Source.size() ); } -void split( const RString &sSource, const RString &sDelimitor, vector &asAddIt, const bool bIgnoreEmpty ) +void split( const RString &sSource, const RString &sDelimitor, std::vector &asAddIt, const bool bIgnoreEmpty ) { if( sDelimitor.size() == 1 ) do_split( sSource, sDelimitor[0], asAddIt, bIgnoreEmpty ); @@ -874,7 +874,7 @@ void split( const RString &sSource, const RString &sDelimitor, vector & do_split( sSource, sDelimitor, asAddIt, bIgnoreEmpty ); } -void split( const wstring &sSource, const wstring &sDelimitor, vector &asAddIt, const bool bIgnoreEmpty ) +void split( const std::wstring &sSource, const std::wstring &sDelimitor, std::vector &asAddIt, const bool bIgnoreEmpty ) { if( sDelimitor.size() == 1 ) do_split( sSource, sDelimitor[0], asAddIt, bIgnoreEmpty ); @@ -903,7 +903,7 @@ void do_split( const S &Source, const S &Delimitor, int &begin, int &size, int l { // Start points to the beginning of the last delimiter. Move it up. begin += size+Delimitor.size(); - begin = min( begin, len ); + begin = std::min( begin, len ); } size = 0; @@ -933,7 +933,7 @@ void split( const RString &Source, const RString &Delimitor, int &begin, int &si do_split( Source, Delimitor, begin, size, len, bIgnoreEmpty ); } -void split( const wstring &Source, const wstring &Delimitor, int &begin, int &size, int len, const bool bIgnoreEmpty ) +void split( const std::wstring &Source, const std::wstring &Delimitor, int &begin, int &size, int len, const bool bIgnoreEmpty ) { do_split( Source, Delimitor, begin, size, len, bIgnoreEmpty ); } @@ -943,7 +943,7 @@ void split( const RString &Source, const RString &Delimitor, int &begin, int &si do_split( Source, Delimitor, begin, size, Source.size(), bIgnoreEmpty ); } -void split( const wstring &Source, const wstring &Delimitor, int &begin, int &size, const bool bIgnoreEmpty ) +void split( const std::wstring &Source, const std::wstring &Delimitor, int &begin, int &size, const bool bIgnoreEmpty ) { do_split( Source, Delimitor, begin, size, Source.size(), bIgnoreEmpty ); } @@ -957,7 +957,7 @@ void splitpath( const RString &sPath, RString &sDir, RString &sFilename, RString { sDir = sFilename = sExt = ""; - vector asMatches; + std::vector asMatches; /* * One level of escapes for the regex, one for C. Ew. @@ -986,7 +986,7 @@ void splitpath( const RString &sPath, RString &sDir, RString &sFilename, RString RString custom_songify_path(RString const& path) { - vector parts; + std::vector parts; split(path, "/", parts, false); if(parts.size() < 2) { @@ -1027,8 +1027,8 @@ RString GetFileNameWithoutExtension( const RString &sPath ) void MakeValidFilename( RString &sName ) { - wstring wsName = RStringToWstring( sName ); - wstring wsInvalid = L"/\\:*?\"<>|"; + std::wstring wsName = RStringToWstring( sName ); + std::wstring wsInvalid = L"/\\:*?\"<>|"; for( unsigned i = 0; i < wsName.size(); ++i ) { wchar_t w = wsName[i]; @@ -1053,9 +1053,9 @@ void MakeValidFilename( RString &sName ) sName = WStringToRString( wsName ); } -bool FindFirstFilenameContaining(const vector& filenames, - RString& out, const vector& starts_with, - const vector& contains, const vector& ends_with) +bool FindFirstFilenameContaining(const std::vector& filenames, + RString& out, const std::vector& starts_with, + const std::vector& contains, const std::vector& ends_with) { for(size_t i= 0; i < filenames.size(); ++i) { @@ -1075,7 +1075,7 @@ bool FindFirstFilenameContaining(const vector& filenames, if(lower_size >= ends_with[s].size()) { size_t end_pos= lower_size - ends_with[s].size(); - if(!lower.compare(end_pos, string::npos, ends_with[s])) + if(!lower.compare(end_pos, std::string::npos, ends_with[s])) { out= filenames[i]; return true; @@ -1084,7 +1084,7 @@ bool FindFirstFilenameContaining(const vector& filenames, } for(size_t s= 0; s < contains.size(); ++s) { - if(lower.find(contains[s]) != string::npos) + if(lower.find(contains[s]) != std::string::npos) { out= filenames[i]; return true; @@ -1208,7 +1208,7 @@ bool DirectoryIsEmpty( const RString &sDir ) if( !DoesFileExist(sDir) ) return true; - vector asFileNames; + std::vector asFileNames; GetDirListing( sDir, asFileNames ); return asFileNames.empty(); } @@ -1223,7 +1223,7 @@ bool CompareRStringsDesc( const RString &sStr1, const RString &sStr2 ) return sStr1.CompareNoCase( sStr2 ) > 0; } -void SortRStringArray( vector &arrayRStrings, const bool bSortAscending ) +void SortRStringArray( std::vector &arrayRStrings, const bool bSortAscending ) { sort( arrayRStrings.begin(), arrayRStrings.end(), bSortAscending?CompareRStringsAsc:CompareRStringsDesc ); @@ -1231,7 +1231,7 @@ void SortRStringArray( vector &arrayRStrings, const bool bSortAscending float calc_mean( const float *pStart, const float *pEnd ) { - return accumulate( pStart, pEnd, 0.f ) / distance( pStart, pEnd ); + return std::accumulate( pStart, pEnd, 0.f ) / std::distance( pStart, pEnd ); } float calc_stddev( const float *pStart, const float *pEnd, bool bSample ) @@ -1243,13 +1243,13 @@ float calc_stddev( const float *pStart, const float *pEnd, bool bSample ) float fDev = 0.0f; for( const float *i=pStart; i != pEnd; ++i ) fDev += (*i - fMean) * (*i - fMean); - fDev /= distance( pStart, pEnd ) - (bSample ? 1 : 0); + fDev /= std::distance( pStart, pEnd ) - (bSample ? 1 : 0); fDev = sqrtf( fDev ); return fDev; } -bool CalcLeastSquares( const vector< pair > &vCoordinates, +bool CalcLeastSquares( const std::vector> &vCoordinates, float &fSlope, float &fIntercept, float &fError ) { if( vCoordinates.empty() ) @@ -1277,7 +1277,7 @@ bool CalcLeastSquares( const vector< pair > &vCoordinates, return true; } -void FilterHighErrorPoints( vector< pair > &vCoordinates, +void FilterHighErrorPoints( std::vector> &vCoordinates, float fSlope, float fIntercept, float fCutoff ) { unsigned int iOut = 0; @@ -1365,7 +1365,7 @@ static bool CVSOrSVN( const RString& s ) s.Right(3).EqualsNoCase(".hg"); } -void StripCvsAndSvn( vector &vs ) +void StripCvsAndSvn( std::vector &vs ) { RemoveIf( vs, CVSOrSVN ); } @@ -1375,7 +1375,7 @@ static bool MacResourceFork( const RString& s ) return s.Left(2).EqualsNoCase("._"); } -void StripMacResourceForks( vector &vs ) +void StripMacResourceForks( std::vector &vs ) { RemoveIf( vs, MacResourceFork ); } @@ -1403,7 +1403,7 @@ RString DerefRedir( const RString &_path ) sPath2 += "*"; - vector matches; + std::vector matches; GetDirListing( sPath2, matches, false, true ); if( matches.empty() ) @@ -1451,7 +1451,7 @@ bool GetFileContents( const RString &sPath, RString &sOut, bool bOneLine ) return true; } -bool GetFileContents( const RString &sFile, vector &asOut ) +bool GetFileContents( const RString &sFile, std::vector &asOut ) { RageFile file; if( !file.Open(sFile) ) @@ -1529,7 +1529,7 @@ bool Regex::Compare( const RString &sStr ) return iRet >= 0; } -bool Regex::Compare( const RString &sStr, vector &asMatches ) +bool Regex::Compare( const RString &sStr, std::vector &asMatches ) { asMatches.clear(); @@ -1558,7 +1558,7 @@ bool Regex::Compare( const RString &sStr, vector &asMatches ) // http://us3.php.net/manual/en/function.preg-replace.php bool Regex::Replace( const RString &sReplacement, const RString &sSubject, RString &sOut ) { - vector asMatches; + std::vector asMatches; if( !Compare(sSubject, asMatches) ) return false; @@ -1877,7 +1877,7 @@ void MakeLower( wchar_t *p, size_t iLen ) float StringToFloat( const RString &sString ) { float fOut = std::strtof(sString, nullptr); - if (!isfinite(fOut)) + if (!std::isfinite(fOut)) { fOut = 0.0f; } @@ -1889,12 +1889,12 @@ bool StringToFloat( const RString &sString, float &fOut ) char *endPtr = nullptr; fOut = std::strtof(sString, &endPtr); - return sString.size() && *endPtr == '\0' && isfinite(fOut); + return sString.size() && *endPtr == '\0' && std::isfinite(fOut); } RString FloatToString( const float &num ) { - stringstream ss; + std::stringstream ss; ss << num; return ss.str(); } @@ -1946,9 +1946,9 @@ long long StringToLLong( const std::string& str, std::size_t* pos, int base, lon const wchar_t INVALID_CHAR = 0xFFFD; /* U+FFFD REPLACEMENT CHARACTER */ -wstring RStringToWstring( const RString &s ) +std::wstring RStringToWstring( const RString &s ) { - wstring ret; + std::wstring ret; ret.reserve( s.size() ); for( unsigned start = 0; start < s.size(); ) { @@ -1970,7 +1970,7 @@ wstring RStringToWstring( const RString &s ) return ret; } -RString WStringToRString( const wstring &sStr ) +RString WStringToRString( const std::wstring &sStr ) { RString sRet; @@ -1988,7 +1988,7 @@ RString WcharToUTF8( wchar_t c ) } // &a; -> a -void ReplaceEntityText( RString &sText, const map &m ) +void ReplaceEntityText( RString &sText, const std::map &m ) { RString sRet; @@ -2024,7 +2024,7 @@ void ReplaceEntityText( RString &sText, const map &m ) RString sElement = sText.substr( iStart+1, iEnd-iStart-1 ); sElement.MakeLower(); - map::const_iterator it = m.find( sElement ); + std::map::const_iterator it = m.find( sElement ); if( it == m.end() ) { sRet.append( sText, iStart, iEnd-iStart+1 ); @@ -2041,7 +2041,7 @@ void ReplaceEntityText( RString &sText, const map &m ) } // abcd -> &a; &b; &c; &d; -void ReplaceEntityText( RString &sText, const map &m ) +void ReplaceEntityText( RString &sText, const std::map &m ) { RString sFind; @@ -2071,7 +2071,7 @@ void ReplaceEntityText( RString &sText, const map &m ) char sElement = sText[iStart]; - map::const_iterator it = m.find( sElement ); + std::map::const_iterator it = m.find( sElement ); ASSERT( it != m.end() ); const RString &sTo = it->second; @@ -2357,7 +2357,7 @@ namespace StringConversion { const char *endptr = sValue.data() + sValue.size(); out = strtof( sValue, (char **) &endptr ); - if( endptr != sValue.data() && isfinite( out ) ) + if( endptr != sValue.data() && std::isfinite( out ) ) return true; out = 0; return false; diff --git a/src/RageUtil.h b/src/RageUtil.h index e9f15e57c1..927da6f730 100644 --- a/src/RageUtil.h +++ b/src/RageUtil.h @@ -23,21 +23,8 @@ class RageFileDriver; extern const RString CUSTOM_SONG_PATH; -/* Common harmless mismatches. All min(T,T) and max(T,T) cases are handled - * by the generic template we get from . */ -inline float min( float a, int b ) { return a < b? a:b; } -inline float min( int a, float b ) { return a < b? a:b; } -inline float max( float a, int b ) { return a > b? a:b; } -inline float max( int a, float b ) { return a > b? a:b; } -inline unsigned long min( unsigned int a, unsigned long b ) { return a < b? a:b; } -inline unsigned long min( unsigned long a, unsigned int b ) { return a < b? a:b; } -inline unsigned long long min( unsigned int a, unsigned long long b ) { return a < b? a:b; } -inline unsigned long max( unsigned int a, unsigned long b ) { return a > b? a:b; } -inline unsigned long max( unsigned long a, unsigned int b ) { return a > b? a:b; } -inline unsigned long long max( unsigned int a, unsigned long long b ) { return a > b? a:b; } - /** @brief If outside the range from low to high, bring it within range. */ -#define clamp(val,low,high) ( max( (low), min((val),(high)) ) ) +#define clamp(val,low,high) ( std::max( (low), std::min((val),(high)) ) ) /** * @brief Scales x so that l1 corresponds to l2 and h1 corresponds to h2. @@ -91,7 +78,7 @@ inline void wrap( float &x, float n ) inline float fracf( float f ) { return f - truncf(f); } template -void CircularShift( vector &v, int dist ) +void CircularShift( std::vector &v, int dist ) { for( int i = abs(dist); i>0; i-- ) { @@ -390,9 +377,9 @@ RString GetFileNameWithoutExtension( const RString &sPath ); void MakeValidFilename( RString &sName ); bool FindFirstFilenameContaining( - const vector& filenames, RString& out, - const vector& starts_with, - const vector& contains, const vector& ends_with); + const std::vector& filenames, RString& out, + const std::vector& starts_with, + const std::vector& contains, const std::vector& ends_with); extern const wchar_t INVALID_CHAR; @@ -415,7 +402,7 @@ bool StringToFloat( const RString &sString, float &fOut ); template inline bool operator>>(const RString& lhs, T& rhs) { - return !!(istringstream(lhs) >> rhs); + return !!(std::istringstream(lhs) >> rhs); } // Exception-safe wrappers around stoi and friends @@ -424,34 +411,34 @@ int StringToInt( const std::string& str, std::size_t* pos = 0, int base = 10, in long StringToLong( const std::string& str, std::size_t* pos = 0, int base = 10, long exceptVal = 0 ); long long StringToLLong( const std::string& str, std::size_t* pos = 0, int base = 10, long long exceptVal = 0 ); -RString WStringToRString( const wstring &sString ); +RString WStringToRString( const std::wstring &sString ); RString WcharToUTF8( wchar_t c ); -wstring RStringToWstring( const RString &sString ); +std::wstring RStringToWstring( const RString &sString ); struct LanguageInfo { const char *szIsoCode; const char *szEnglishName; }; -void GetLanguageInfos( vector &vAddTo ); +void GetLanguageInfos( std::vector &vAddTo ); const LanguageInfo *GetLanguageInfo( const RString &sIsoCode ); RString GetLanguageNameFromISO639Code( RString sName ); -// Splits a RString into an vector according the Delimitor. -void split( const RString &sSource, const RString &sDelimitor, vector& asAddIt, const bool bIgnoreEmpty = true ); -void split( const wstring &sSource, const wstring &sDelimitor, vector &asAddIt, const bool bIgnoreEmpty = true ); +// Splits a RString into an std::vector according the Delimitor. +void split( const RString &sSource, const RString &sDelimitor, std::vector& asAddIt, const bool bIgnoreEmpty = true ); +void split( const std::wstring &sSource, const std::wstring &sDelimitor, std::vector &asAddIt, const bool bIgnoreEmpty = true ); /* In-place split. */ void split( const RString &sSource, const RString &sDelimitor, int &iBegin, int &iSize, const bool bIgnoreEmpty = true ); -void split( const wstring &sSource, const wstring &sDelimitor, int &iBegin, int &iSize, const bool bIgnoreEmpty = true ); +void split( const std::wstring &sSource, const std::wstring &sDelimitor, int &iBegin, int &iSize, const bool bIgnoreEmpty = true ); /* In-place split of partial string. */ void split( const RString &sSource, const RString &sDelimitor, int &iBegin, int &iSize, int iLen, const bool bIgnoreEmpty ); /* no default to avoid ambiguity */ -void split( const wstring &sSource, const wstring &sDelimitor, int &iBegin, int &iSize, int iLen, const bool bIgnoreEmpty ); +void split( const std::wstring &sSource, const std::wstring &sDelimitor, int &iBegin, int &iSize, int iLen, const bool bIgnoreEmpty ); -// Joins a vector to create a RString according the Deliminator. -RString join( const RString &sDelimitor, const vector& sSource ); -RString join( const RString &sDelimitor, vector::const_iterator begin, vector::const_iterator end ); +// Joins a std::vector to create a RString according the Deliminator. +RString join( const RString &sDelimitor, const std::vector& sSource ); +RString join( const RString &sDelimitor, std::vector::const_iterator begin, std::vector::const_iterator end ); // These methods escapes a string for saving in a .sm or .crs file RString SmEscape( const RString &sUnescaped ); @@ -477,7 +464,7 @@ bool DirectoryIsEmpty( const RString &sPath ); bool CompareRStringsAsc( const RString &sStr1, const RString &sStr2 ); bool CompareRStringsDesc( const RString &sStr1, const RString &sStr2 ); -void SortRStringArray( vector &asAddTo, const bool bSortAscending = true ); +void SortRStringArray( std::vector &asAddTo, const bool bSortAscending = true ); /* Find the mean and standard deviation of all numbers in [start,end). */ float calc_mean( const float *pStart, const float *pEnd ); @@ -494,14 +481,14 @@ float calc_stddev( const float *pStart, const float *pEnd, bool bSample = false * Y distance from the chosen line. * Returns true on success, false on failure. */ -bool CalcLeastSquares( const vector< pair > &vCoordinates, +bool CalcLeastSquares( const std::vector > &vCoordinates, float &fSlope, float &fIntercept, float &fError ); /* * This method throws away any points that are more than fCutoff away from * the line defined by fSlope and fIntercept. */ -void FilterHighErrorPoints( vector< pair > &vCoordinates, +void FilterHighErrorPoints( std::vector > &vCoordinates, float fSlope, float fIntercept, float fCutoff ); template @@ -527,12 +514,12 @@ bool BeginsWith( const RString &sTestThis, const RString &sBeginning ); bool EndsWith( const RString &sTestThis, const RString &sEnding ); RString URLEncode( const RString &sStr ); -void StripCvsAndSvn( vector &vs ); // Removes various versioning system metafolders. -void StripMacResourceForks( vector &vs ); // Removes files starting with "._" +void StripCvsAndSvn( std::vector &vs ); // Removes various versioning system metafolders. +void StripMacResourceForks( std::vector &vs ); // Removes files starting with "._" RString DerefRedir( const RString &sPath ); bool GetFileContents( const RString &sPath, RString &sOut, bool bOneLine = false ); -bool GetFileContents( const RString &sFile, vector &asOut ); +bool GetFileContents( const RString &sFile, std::vector &asOut ); class Regex { @@ -544,7 +531,7 @@ public: bool IsSet() const { return !m_sPattern.empty(); } void Set( const RString &str ); bool Compare( const RString &sStr ); - bool Compare( const RString &sStr, vector &asMatches ); + bool Compare( const RString &sStr, std::vector &asMatches ); bool Replace( const RString &sReplacement, const RString &sSubject, RString &sOut ); private: @@ -557,8 +544,8 @@ private: }; -void ReplaceEntityText( RString &sText, const map &m ); -void ReplaceEntityText( RString &sText, const map &m ); +void ReplaceEntityText( RString &sText, const std::map &m ); +void ReplaceEntityText( RString &sText, const std::map &m ); void Replace_Unicode_Markers( RString &Text ); RString WcharDisplayText( wchar_t c ); @@ -574,7 +561,7 @@ extern unsigned char g_UpperCase[256]; extern unsigned char g_LowerCase[256]; /* ASCII-only case insensitivity. */ -struct char_traits_char_nocase: public char_traits +struct char_traits_char_nocase: public std::char_traits { static inline bool eq( char c1, char c2 ) { return g_UpperCase[(unsigned char)c1] == g_UpperCase[(unsigned char)c2]; } @@ -613,13 +600,13 @@ struct char_traits_char_nocase: public char_traits return nullptr; } }; -typedef basic_string istring; +typedef std::basic_string istring; /* Compatibility/convenience shortcuts. These are actually defined in RageFileManager.h, but * declared here since they're used in many places. */ -void GetDirListing( const RString &sPath, vector &AddTo, bool bOnlyDirs=false, bool bReturnPathToo=false ); -void GetDirListingRecursive( const RString &sDir, const RString &sMatch, vector &AddTo ); /* returns path too */ -void GetDirListingRecursive( RageFileDriver *prfd, const RString &sDir, const RString &sMatch, vector &AddTo ); /* returns path too */ +void GetDirListing( const RString &sPath, std::vector &AddTo, bool bOnlyDirs=false, bool bReturnPathToo=false ); +void GetDirListingRecursive( const RString &sDir, const RString &sMatch, std::vector &AddTo ); /* returns path too */ +void GetDirListingRecursive( RageFileDriver *prfd, const RString &sDir, const RString &sMatch, std::vector &AddTo ); /* returns path too */ bool DeleteRecursive( const RString &sDir ); /* delete the dir and all files/subdirs inside it */ bool DeleteRecursive( RageFileDriver *prfd, const RString &sDir ); /* delete the dir and all files/subdirs inside it */ bool DoesFileExist( const RString &sPath ); @@ -649,13 +636,13 @@ bool FileCopy( const RString &sSrcFile, const RString &sDstFile ); bool FileCopy( RageFileBasic &in, RageFileBasic &out, RString &sError, bool *bReadError = nullptr ); template -void GetAsNotInBs( const vector &as, const vector &bs, vector &difference ) +void GetAsNotInBs( const std::vector &as, const std::vector &bs, std::vector &difference ) { - vector bsUnmatched = bs; - // Cannot use FOREACH_CONST here because vector::const_iterator is an implicit type. - for( typename vector::const_iterator a = as.begin(); a != as.end(); ++a ) + std::vector bsUnmatched = bs; + // Cannot use FOREACH_CONST here because std::vector::const_iterator is an implicit type. + for( typename std::vector::const_iterator a = as.begin(); a != as.end(); ++a ) { - typename vector::iterator iter = find( bsUnmatched.begin(), bsUnmatched.end(), *a ); + typename std::vector::iterator iter = find( bsUnmatched.begin(), bsUnmatched.end(), *a ); if( iter != bsUnmatched.end() ) bsUnmatched.erase( iter ); else @@ -664,7 +651,7 @@ void GetAsNotInBs( const vector &as, const vector &bs, vector &differen } template -void GetConnectsDisconnects( const vector &before, const vector &after, vector &disconnects, vector &connects ) +void GetConnectsDisconnects( const std::vector &before, const std::vector &after, std::vector &disconnects, std::vector &connects ) { GetAsNotInBs( before, after, disconnects ); GetAsNotInBs( after, before, connects ); diff --git a/src/RageUtil_AutoPtr.h b/src/RageUtil_AutoPtr.h index bae6abf939..44f8d31299 100644 --- a/src/RageUtil_AutoPtr.h +++ b/src/RageUtil_AutoPtr.h @@ -43,8 +43,8 @@ public: void Swap( AutoPtrCopyOnWrite &rhs ) { - swap( m_pPtr, rhs.m_pPtr ); - swap( m_iRefCount, rhs.m_iRefCount ); + std::swap( m_pPtr, rhs.m_pPtr ); + std::swap( m_iRefCount, rhs.m_iRefCount ); } inline AutoPtrCopyOnWrite &operator=( const AutoPtrCopyOnWrite &rhs ) @@ -150,7 +150,7 @@ public: { HiddenPtrTraits::Delete( m_pPtr ); } - void Swap( HiddenPtr &rhs ) { swap( m_pPtr, rhs.m_pPtr ); } + void Swap( HiddenPtr &rhs ) { std::swap( m_pPtr, rhs.m_pPtr ); } HiddenPtr &operator=( T *p ) { diff --git a/src/RageUtil_BackgroundLoader.cpp b/src/RageUtil_BackgroundLoader.cpp index 51cccb9ef2..48efc1d5a9 100644 --- a/src/RageUtil_BackgroundLoader.cpp +++ b/src/RageUtil_BackgroundLoader.cpp @@ -33,7 +33,7 @@ BackgroundLoader::BackgroundLoader(): static void DeleteEmptyDirectories( RString sDir ) { - vector asNewDirs; + std::vector asNewDirs; GetDirListing( sDir + "/*", asNewDirs, false, true ); for( unsigned i = 0; i < asNewDirs.size(); ++i ) { @@ -56,7 +56,7 @@ BackgroundLoader::~BackgroundLoader() m_LoadThread.Wait(); /* Delete all leftover cached files. */ - map::iterator it; + std::map::iterator it; for( it = m_FinishedRequests.begin(); it != m_FinishedRequests.end(); ++it ) FILEMAN->Remove( GetCachePath( it->first ) ); @@ -101,7 +101,7 @@ void BackgroundLoader::LoadThread() { /* If the file already exists, short circuit. */ LockMut( m_Mutex ); - map::iterator it; + std::map::iterator it; it = m_FinishedRequests.find( sFile ); if( it != m_FinishedRequests.end() ) { @@ -190,7 +190,7 @@ bool BackgroundLoader::IsCacheFileFinished( const RString &sFile, RString &sActu return true; } - map::iterator it; + std::map::iterator it; it = m_FinishedRequests.find( sFile ); if( it == m_FinishedRequests.end() ) return false; @@ -212,7 +212,7 @@ void BackgroundLoader::FinishedWithCachedFile( RString sFile ) if( sFile == "" ) return; - map::iterator it; + std::map::iterator it; it = m_FinishedRequests.find( sFile ); ASSERT_M( it != m_FinishedRequests.end(), sFile ); diff --git a/src/RageUtil_BackgroundLoader.h b/src/RageUtil_BackgroundLoader.h index 36b0a142f5..9d051a46b9 100644 --- a/src/RageUtil_BackgroundLoader.h +++ b/src/RageUtil_BackgroundLoader.h @@ -47,10 +47,10 @@ private: * while doing expensive operations, like reading files. */ RageMutex m_Mutex; - vector m_CacheRequests; + std::vector m_CacheRequests; /* Filename to number of completed requests */ - map m_FinishedRequests; + std::map m_FinishedRequests; bool m_sThreadIsActive; bool m_sThreadShouldAbort; diff --git a/src/RageUtil_CharConversions.cpp b/src/RageUtil_CharConversions.cpp index 8f7a679cc3..0c02fe0250 100644 --- a/src/RageUtil_CharConversions.cpp +++ b/src/RageUtil_CharConversions.cpp @@ -18,7 +18,7 @@ static bool CodePageConvert( RString &sText, int iCodePage ) return false; /* error */ } - wstring sOut; + std::wstring sOut; sOut.append( iSize, ' ' ); /* Nonportable: */ iSize = MultiByteToWideChar( iCodePage, MB_ERR_INVALID_CHARS, sText.data(), sText.size(), (wchar_t *) sOut.data(), iSize ); @@ -127,7 +127,7 @@ bool ConvertString( RString &str, const RString &encodings ) if( str.empty() ) return true; - vector lst; + std::vector lst; split( encodings, ",", lst ); for(unsigned i = 0; i < lst.size(); ++i) diff --git a/src/RageUtil_CircularBuffer.h b/src/RageUtil_CircularBuffer.h index a6b0814522..7dc0863326 100644 --- a/src/RageUtil_CircularBuffer.h +++ b/src/RageUtil_CircularBuffer.h @@ -234,7 +234,7 @@ public: if( buffer_size > sizes[0] + sizes[1] ) return false; - const int from_first = min( buffer_size, sizes[0] ); + const int from_first = std::min( buffer_size, sizes[0] ); memcpy( p[0], buffer, from_first*sizeof(T) ); if( buffer_size > sizes[0] ) memcpy( p[1], buffer+from_first, (buffer_size-sizes[0])*sizeof(T) ); @@ -256,7 +256,7 @@ public: if( buffer_size > sizes[0] + sizes[1] ) return false; - const int from_first = min( buffer_size, sizes[0] ); + const int from_first = std::min( buffer_size, sizes[0] ); memcpy( buffer, p[0], from_first*sizeof(T) ); if( buffer_size > sizes[0] ) memcpy( buffer+from_first, p[1], (buffer_size-sizes[0])*sizeof(T) ); diff --git a/src/RageUtil_FileDB.cpp b/src/RageUtil_FileDB.cpp index ac11a91a6a..b5a5b65ccc 100644 --- a/src/RageUtil_FileDB.cpp +++ b/src/RageUtil_FileDB.cpp @@ -5,7 +5,7 @@ #include "RageLog.h" /* Search for "beginning*containing*ending". */ -void FileSet::GetFilesMatching( const RString &sBeginning_, const RString &sContaining_, const RString &sEnding_, vector &asOut, bool bOnlyDirs ) const +void FileSet::GetFilesMatching( const RString &sBeginning_, const RString &sContaining_, const RString &sEnding_, std::vector &asOut, bool bOnlyDirs ) const { /* "files" is a case-insensitive mapping, by filename. Use lower_bound to figure * out where to start. */ @@ -16,7 +16,7 @@ void FileSet::GetFilesMatching( const RString &sBeginning_, const RString &sCont RString sEnding = sEnding_; sEnding.MakeLower(); - set::const_iterator i = files.lower_bound( File(sBeginning) ); + std::set::const_iterator i = files.lower_bound( File(sBeginning) ); for( ; i != files.end(); ++i ) { const File &f = *i; @@ -39,7 +39,7 @@ void FileSet::GetFilesMatching( const RString &sBeginning_, const RString &sCont /* Check end. */ if( end_pos < 0 ) continue; /* can't end with it */ - if( sPath.compare(end_pos, string::npos, sEnding) ) + if( sPath.compare(end_pos, std::string::npos, sEnding) ) continue; /* doesn't end with it */ /* Check sContaining. Do this last, since it's the slowest (substring @@ -57,9 +57,9 @@ void FileSet::GetFilesMatching( const RString &sBeginning_, const RString &sCont } } -void FileSet::GetFilesEqualTo( const RString &sStr, vector &asOut, bool bOnlyDirs ) const +void FileSet::GetFilesEqualTo( const RString &sStr, std::vector &asOut, bool bOnlyDirs ) const { - set::const_iterator i = files.find( File(sStr) ); + std::set::const_iterator i = files.find( File(sStr) ); if( i == files.end() ) return; @@ -71,7 +71,7 @@ void FileSet::GetFilesEqualTo( const RString &sStr, vector &asOut, bool RageFileManager::FileType FileSet::GetFileType( const RString &sPath ) const { - set::const_iterator i = files.find( File(sPath) ); + std::set::const_iterator i = files.find( File(sPath) ); if( i == files.end() ) return RageFileManager::TYPE_NONE; @@ -80,7 +80,7 @@ RageFileManager::FileType FileSet::GetFileType( const RString &sPath ) const int FileSet::GetFileSize( const RString &sPath ) const { - set::const_iterator i = files.find( File(sPath) ); + std::set::const_iterator i = files.find( File(sPath) ); if( i == files.end() ) return -1; return i->size; @@ -88,7 +88,7 @@ int FileSet::GetFileSize( const RString &sPath ) const int FileSet::GetFileHash( const RString &sPath ) const { - set::const_iterator i = files.find( File(sPath) ); + std::set::const_iterator i = files.find( File(sPath) ); if( i == files.end() ) return -1; return i->hash + i->size; @@ -189,7 +189,7 @@ bool FilenameDB::ResolvePath( RString &sPath ) RString p = sPath.substr( iBegin, iSize ); ASSERT_M( p.size() != 1 || p[0] != '.', sPath ); // no . ASSERT_M( p.size() != 2 || p[0] != '.' || p[1] != '.', sPath ); // no .. - set::const_iterator it = fs->files.find( File(p) ); + std::set::const_iterator it = fs->files.find( File(p) ); /* If there were no matches, the path isn't found. */ if( it == fs->files.end() ) @@ -212,7 +212,7 @@ bool FilenameDB::ResolvePath( RString &sPath ) return true; } -void FilenameDB::GetFilesMatching( const RString &sDir, const RString &sBeginning, const RString &sContaining, const RString &sEnding, vector &asOut, bool bOnlyDirs ) +void FilenameDB::GetFilesMatching( const RString &sDir, const RString &sBeginning, const RString &sContaining, const RString &sEnding, std::vector &asOut, bool bOnlyDirs ) { ASSERT( !m_Mutex.IsLockedByThisThread() ); @@ -221,7 +221,7 @@ void FilenameDB::GetFilesMatching( const RString &sDir, const RString &sBeginnin m_Mutex.Unlock(); /* locked by GetFileSet */ } -void FilenameDB::GetFilesEqualTo( const RString &sDir, const RString &sFile, vector &asOut, bool bOnlyDirs ) +void FilenameDB::GetFilesEqualTo( const RString &sDir, const RString &sFile, std::vector &asOut, bool bOnlyDirs ) { ASSERT( !m_Mutex.IsLockedByThisThread() ); @@ -231,7 +231,7 @@ void FilenameDB::GetFilesEqualTo( const RString &sDir, const RString &sFile, vec } -void FilenameDB::GetFilesSimpleMatch( const RString &sDir, const RString &sMask, vector &asOut, bool bOnlyDirs ) +void FilenameDB::GetFilesSimpleMatch( const RString &sDir, const RString &sMask, std::vector &asOut, bool bOnlyDirs ) { /* Does this contain a wildcard? */ size_t first_pos = sMask.find_first_of( '*' ); @@ -287,7 +287,7 @@ FileSet *FilenameDB::GetFileSet( const RString &sDir_, bool bCreate ) for(;;) { /* Look for the directory. */ - map::iterator i = dirs.find( sLower ); + std::map::iterator i = dirs.find( sLower ); if( !bCreate ) { if( i == dirs.end() ) @@ -351,7 +351,7 @@ FileSet *FilenameDB::GetFileSet( const RString &sDir_, bool bCreate ) FileSet *pParent = GetFileSet( sParent ); if( pParent != nullptr ) { - set::iterator it = pParent->files.find( File(Basename(sDir)) ); + std::set::iterator it = pParent->files.find( File(Basename(sDir)) ); if( it != pParent->files.end() ) pParentDirp = const_cast(&it->dirp); } @@ -387,11 +387,11 @@ void FilenameDB::AddFile( const RString &sPath_, int iSize, int iHash, void *pPr if( sPath[0] != '/' ) sPath = "/" + sPath; - vector asParts; + std::vector asParts; split( sPath, "/", asParts, false ); - vector::const_iterator begin = asParts.begin(); - vector::const_iterator end = asParts.end(); + std::vector::const_iterator begin = asParts.begin(); + std::vector::const_iterator end = asParts.end(); bool IsDir = true; if( sPath[sPath.size()-1] != '/' ) @@ -431,7 +431,7 @@ void FilenameDB::AddFile( const RString &sPath_, int iSize, int iHash, void *pPr /* Remove the given FileSet, and all dirp pointers to it. This means the cache has * expired, not that the directory is necessarily gone; don't actually delete the file * from the parent. */ -void FilenameDB::DelFileSet( map::iterator dir ) +void FilenameDB::DelFileSet( std::map::iterator dir ) { /* If this isn't locked, dir may not be valid. */ ASSERT( m_Mutex.IsLockedByThisThread() ); @@ -442,10 +442,10 @@ void FilenameDB::DelFileSet( map::iterator dir ) FileSet *fs = dir->second; /* Remove any stale dirp pointers. */ - for( map::iterator it = dirs.begin(); it != dirs.end(); ++it ) + for( std::map::iterator it = dirs.begin(); it != dirs.end(); ++it ) { FileSet *Clean = it->second; - for( set::iterator f = Clean->files.begin(); f != Clean->files.end(); ++f ) + for( std::set::iterator f = Clean->files.begin(); f != Clean->files.end(); ++f ) { File &ff = (File &) *f; if( ff.dirp == fs ) @@ -463,7 +463,7 @@ void FilenameDB::DelFile( const RString &sPath ) RString lower = sPath; lower.MakeLower(); - map::iterator fsi = dirs.find( lower ); + std::map::iterator fsi = dirs.find( lower ); DelFileSet( fsi ); /* Delete sPath from its parent. */ @@ -522,7 +522,7 @@ void FilenameDB::FlushDirCache( const RString & /* sDir */ ) if( it != dirs.end() ) { FileSet *pParent = it->second; - set::iterator fileit = pParent->files.find( File(Basename(sDir)) ); + std::set::iterator fileit = pParent->files.find( File(Basename(sDir)) ); if( fileit != pParent->files.end() ) fileit->dirp = nullptr; } @@ -545,7 +545,7 @@ const File *FilenameDB::GetFile( const RString &sPath ) SplitPath(sPath, Dir, Name); FileSet *fs = GetFileSet( Dir ); - set::iterator it; + std::set::iterator it; it = fs->files.find( File(Name) ); if( it == fs->files.end() ) return nullptr; @@ -568,7 +568,7 @@ void *FilenameDB::GetFilePriv( const RString &path ) -void FilenameDB::GetDirListing( const RString &sPath_, vector &asAddTo, bool bOnlyDirs, bool bReturnPathToo ) +void FilenameDB::GetDirListing( const RString &sPath_, std::vector &asAddTo, bool bOnlyDirs, bool bReturnPathToo ) { RString sPath = sPath_; // LOG->Trace( "GetDirListing( %s )", sPath.c_str() ); diff --git a/src/RageUtil_FileDB.h b/src/RageUtil_FileDB.h index 52a7f95816..933375c1d0 100644 --- a/src/RageUtil_FileDB.h +++ b/src/RageUtil_FileDB.h @@ -63,7 +63,7 @@ inline bool operator!=(File const &lhs, File const &rhs) /** @brief This represents a directory. */ struct FileSet { - set files; + std::set files; RageTimer age; /* @@ -77,8 +77,8 @@ struct FileSet void GetFilesMatching( const RString &sBeginning, const RString &sContaining, const RString &sEnding, - vector &asOut, bool bOnlyDirs ) const; - void GetFilesEqualTo( const RString &pat, vector &out, bool bOnlyDirs ) const; + std::vector &asOut, bool bOnlyDirs ) const; + void GetFilesEqualTo( const RString &pat, std::vector &out, bool bOnlyDirs ) const; RageFileManager::FileType GetFileType( const RString &sPath ) const; int GetFileSize( const RString &sPath ) const; @@ -98,7 +98,7 @@ public: /* This handles at most two * wildcards. If we need anything more complicated, * we'll need to use fnmatch or regex. */ - void GetFilesSimpleMatch( const RString &sDir, const RString &sFile, vector &asOut, bool bOnlyDirs ); + void GetFilesSimpleMatch( const RString &sDir, const RString &sFile, std::vector &asOut, bool bOnlyDirs ); /* Search for "path" case-insensitively and replace it with the correct * case. If only a portion of the path exists, resolve as much as possible. @@ -108,7 +108,7 @@ public: RageFileManager::FileType GetFileType( const RString &sPath ); int GetFileSize( const RString &sPath ); int GetFileHash( const RString &sFilePath ); - void GetDirListing( const RString &sPath, vector &asAddTo, bool bOnlyDirs, bool bReturnPathToo ); + void GetDirListing( const RString &sPath, std::vector &asAddTo, bool bOnlyDirs, bool bReturnPathToo ); void FlushDirCache( const RString &sDir = RString() ); @@ -123,15 +123,15 @@ protected: FileSet *GetFileSet( const RString &sDir, bool create=true ); /* Directories we have cached: */ - map dirs; + std::map dirs; int ExpireSeconds; - void GetFilesEqualTo( const RString &sDir, const RString &sName, vector &asOut, bool bOnlyDirs ); + void GetFilesEqualTo( const RString &sDir, const RString &sName, std::vector &asOut, bool bOnlyDirs ); void GetFilesMatching( const RString &sDir, - const RString &sBeginning, const RString &sContaining, const RString &sEnding, - vector &asOut, bool bOnlyDirs ); - void DelFileSet( map::iterator dir ); + const RString &sBeginning, const RString &sContaining, const RString &sEnding, + std::vector &asOut, bool bOnlyDirs ); + void DelFileSet( std::map::iterator dir ); /* The given path wasn't cached. Cache it. */ virtual void PopulateFileSet( FileSet & /* fs */, const RString & /* sPath */ ) { } diff --git a/src/RandomSample.cpp b/src/RandomSample.cpp index 1e9ee8fae4..4e46305c05 100644 --- a/src/RandomSample.cpp +++ b/src/RandomSample.cpp @@ -50,14 +50,15 @@ bool RandomSample::LoadSoundDir( RString sDir, int iMaxToLoad ) sDir += "/"; #endif - vector arraySoundFiles; + std::vector arraySoundFiles; GetDirListing( sDir + "*.mp3", arraySoundFiles ); GetDirListing( sDir + "*.oga", arraySoundFiles ); GetDirListing( sDir + "*.ogg", arraySoundFiles ); GetDirListing( sDir + "*.wav", arraySoundFiles ); - random_shuffle( arraySoundFiles.begin(), arraySoundFiles.end() ); - arraySoundFiles.resize( min( arraySoundFiles.size(), (unsigned)iMaxToLoad ) ); + std::random_shuffle( arraySoundFiles.begin(), arraySoundFiles.end() ); + const unsigned int newSize = std::min(arraySoundFiles.size(), static_cast(iMaxToLoad)); + arraySoundFiles.resize(newSize); for( unsigned i=0; i m_pSamples; + std::vector m_pSamples; int m_iIndexLastPlayed; }; diff --git a/src/ReceptorArrow.cpp b/src/ReceptorArrow.cpp index eb744769ba..26b54dd4f3 100644 --- a/src/ReceptorArrow.cpp +++ b/src/ReceptorArrow.cpp @@ -20,7 +20,7 @@ void ReceptorArrow::Load( const PlayerState* pPlayerState, int iColNo ) m_iColNo = iColNo; const PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - vector GameI; + std::vector GameI; GAMESTATE->GetCurrentStyle(pn)->StyleInputToGameInput(iColNo, pn, GameI); NOTESKIN->SetPlayerNumber( pn ); // FIXME? Does this cause a problem when game inputs on different diff --git a/src/ReceptorArrowRow.cpp b/src/ReceptorArrowRow.cpp index 933b65e36c..ae87cc56e1 100644 --- a/src/ReceptorArrowRow.cpp +++ b/src/ReceptorArrowRow.cpp @@ -31,7 +31,7 @@ void ReceptorArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOff } } -void ReceptorArrowRow::SetColumnRenderers(vector& renderers) +void ReceptorArrowRow::SetColumnRenderers(std::vector& renderers) { ASSERT_M(renderers.size() == m_ReceptorArrow.size(), "Notefield has different number of columns than receptor row."); for(size_t c= 0; c < m_ReceptorArrow.size(); ++c) diff --git a/src/ReceptorArrowRow.h b/src/ReceptorArrowRow.h index a65cd407bb..5b32d9e1ae 100644 --- a/src/ReceptorArrowRow.h +++ b/src/ReceptorArrowRow.h @@ -17,7 +17,7 @@ public: virtual void DrawPrimitives(); void Load( const PlayerState* pPlayerState, float fYReverseOffset ); - void SetColumnRenderers(vector& renderers); + void SetColumnRenderers(std::vector& renderers); void Step( int iCol, TapNoteScore score ); void SetPressed( int iCol ); @@ -30,8 +30,8 @@ protected: float m_fYReverseOffsetPixels; float m_fFadeToFailPercent; - vector const* m_renderers; - vector m_ReceptorArrow; + std::vector const* m_renderers; + std::vector m_ReceptorArrow; }; #endif diff --git a/src/RollingNumbers.cpp b/src/RollingNumbers.cpp index 09f6fd9167..3da9a84f25 100644 --- a/src/RollingNumbers.cpp +++ b/src/RollingNumbers.cpp @@ -77,10 +77,10 @@ void RollingNumbers::DrawPrimitives() // draw leading part DrawPart(diffuse_temp, stroke_temp, - max(0, original_crop_left), max(1-f, original_crop_right)); + std::max((float) 0, original_crop_left), std::max(1-f, original_crop_right)); // draw regular color part DrawPart(diffuse_orig, stroke_orig, - max(f, original_crop_left), max(0, original_crop_right)); + std::max(f, original_crop_left), std::max(0.0f, original_crop_right)); m_pTempState->crop.left= original_crop_left; m_pTempState->crop.right= original_crop_right; diff --git a/src/SampleHistory.cpp b/src/SampleHistory.cpp index 52d3aeba68..6ed53923a9 100644 --- a/src/SampleHistory.cpp +++ b/src/SampleHistory.cpp @@ -22,7 +22,7 @@ SampleHistory::SampleHistory() float SampleHistory::GetSampleNum( float fSamplesAgo ) const { - fSamplesAgo = min( fSamplesAgo, (float) m_afHistory.size() - 1 ); + fSamplesAgo = std::min( fSamplesAgo, (float) m_afHistory.size() - 1 ); if( fSamplesAgo < 0 ) fSamplesAgo = 0; if( m_afHistory.size() == 0 ) @@ -52,7 +52,7 @@ void SampleHistory::AddSample( float fSample, float fDeltaTime ) { while( fDeltaTime > 0.0001f ) { - float fTime = min( m_fToSample, fDeltaTime ); + float fTime = std::min( m_fToSample, fDeltaTime ); m_fToSample -= fTime; fDeltaTime -= fTime; diff --git a/src/SampleHistory.h b/src/SampleHistory.h index 635e806b27..112c5d470f 100644 --- a/src/SampleHistory.h +++ b/src/SampleHistory.h @@ -11,7 +11,7 @@ public: private: float GetSampleNum( float fSamplesAgo ) const; - vector m_afHistory; + std::vector m_afHistory; int m_iLastHistory; int m_iHistorySamplesPerSecond; float m_fHistorySeconds; diff --git a/src/ScoreDisplayBattle.cpp b/src/ScoreDisplayBattle.cpp index f3903e56b8..d4a051ffdc 100644 --- a/src/ScoreDisplayBattle.cpp +++ b/src/ScoreDisplayBattle.cpp @@ -25,7 +25,7 @@ ScoreDisplayBattle::ScoreDisplayBattle() this->AddChild( &m_ItemIcon[i] ); } - vector asIconPaths; + std::vector asIconPaths; GetDirListing( THEME->GetCurThemeDir()+"Graphic/ScoreDisplayBattle icon*", asIconPaths ); for( unsigned j=0; j &, - const vector &, - const vector & ) { } + const std::vector &, + const std::vector &, + const std::vector & ) { } virtual void DrawPrimitives() { } virtual void Update( float /* fDelta */ ) { } diff --git a/src/ScoreKeeperNormal.cpp b/src/ScoreKeeperNormal.cpp index 0f6c344c24..e0e18a2548 100644 --- a/src/ScoreKeeperNormal.cpp +++ b/src/ScoreKeeperNormal.cpp @@ -32,9 +32,9 @@ ScoreKeeperNormal::ScoreKeeperNormal( PlayerState *pPlayerState, PlayerStageStat } void ScoreKeeperNormal::Load( - const vector& apSongs, - const vector& apSteps, - const vector &asModifiers ) + const std::vector& apSongs, + const std::vector& apSteps, + const std::vector &asModifiers ) { m_apSteps = apSteps; ASSERT( apSongs.size() == apSteps.size() ); @@ -451,9 +451,9 @@ void ScoreKeeperNormal::HandleComboInternal( int iNumHitContinueCombo, int iNumH // Regular combo if( m_ComboIsPerRow ) { - iNumHitContinueCombo = min( iNumHitContinueCombo, 1 ); - iNumHitMaintainCombo = min( iNumHitMaintainCombo, 1 ); - iNumBreakCombo = min( iNumBreakCombo, 1 ); + iNumHitContinueCombo = std::min( iNumHitContinueCombo, 1 ); + iNumHitMaintainCombo = std::min( iNumHitMaintainCombo, 1 ); + iNumBreakCombo = std::min( iNumBreakCombo, 1 ); } if( iNumHitContinueCombo > 0 || iNumHitMaintainCombo > 0 ) @@ -478,7 +478,7 @@ void ScoreKeeperNormal::HandleRowComboInternal( TapNoteScore tns, int iNumTapsIn { if( m_ComboIsPerRow ) { - iNumTapsInRow = min( iNumTapsInRow, 1); + iNumTapsInRow = std::min( iNumTapsInRow, 1); } TimingData &td = *GAMESTATE->m_pCurSteps[m_pPlayerState->m_PlayerNumber]->GetTimingData(); if ( tns >= m_MinScoreToContinueCombo ) @@ -648,7 +648,7 @@ int ScoreKeeperNormal::GetPossibleDancePoints( NoteData* ndPre, NoteData* ndPost /* The logic here is that if you use a modifier that adds notes, you should * have to hit the new notes to get a high grade. However, if you use one * that removes notes, they should simply be counted as misses. */ - return max( + return std::max( GetPossibleDancePoints(ndPre, td, fSongSeconds), GetPossibleDancePoints(ndPost, td, fSongSeconds) ); } @@ -676,7 +676,7 @@ int ScoreKeeperNormal::GetPossibleGradePoints( NoteData* ndPre, NoteData* ndPost /* The logic here is that if you use a modifier that adds notes, you should * have to hit the new notes to get a high grade. However, if you use one * that removes notes, they should simply be counted as misses. */ - return max( + return std::max( GetPossibleGradePoints( ndPre, td, fSongSeconds ), GetPossibleGradePoints( ndPost, td, fSongSeconds ) ); } @@ -723,7 +723,7 @@ int ScoreKeeperNormal::TapNoteScoreToDancePoints( TapNoteScore tns, bool bBeginn case TNS_CheckpointMiss:iWeight = g_iPercentScoreWeight.GetValue(SE_CheckpointMiss); break; } if( bBeginner && PREFSMAN->m_bMercifulBeginner ) - iWeight = max( 0, iWeight ); + iWeight = std::max( 0, iWeight ); return iWeight; } @@ -739,7 +739,7 @@ int ScoreKeeperNormal::HoldNoteScoreToDancePoints( HoldNoteScore hns, bool bBegi case HNS_Missed: iWeight = g_iPercentScoreWeight.GetValue(SE_Missed); break; } if( bBeginner && PREFSMAN->m_bMercifulBeginner ) - iWeight = max( 0, iWeight ); + iWeight = std::max( 0, iWeight ); return iWeight; } @@ -767,7 +767,7 @@ int ScoreKeeperNormal::TapNoteScoreToGradePoints( TapNoteScore tns, bool bBeginn case TNS_CheckpointMiss:iWeight = g_iGradeWeight.GetValue(SE_CheckpointMiss); break; } if( bBeginner && PREFSMAN->m_bMercifulBeginner ) - iWeight = max( 0, iWeight ); + iWeight = std::max( 0, iWeight ); return iWeight; } @@ -783,7 +783,7 @@ int ScoreKeeperNormal::HoldNoteScoreToGradePoints( HoldNoteScore hns, bool bBegi case HNS_Missed: iWeight = g_iGradeWeight.GetValue(SE_Missed); break; } if( bBeginner && PREFSMAN->m_bMercifulBeginner ) - iWeight = max( 0, iWeight ); + iWeight = std::max( 0, iWeight ); return iWeight; } diff --git a/src/ScoreKeeperNormal.h b/src/ScoreKeeperNormal.h index c648765b21..c8643b24c8 100644 --- a/src/ScoreKeeperNormal.h +++ b/src/ScoreKeeperNormal.h @@ -47,7 +47,7 @@ class ScoreKeeperNormal: public ScoreKeeper ThemeMetric m_toasty_min_tns; ThemeMetric m_toasty_trigger; - vector m_apSteps; + std::vector m_apSteps; virtual void AddTapScore( TapNoteScore tns ); virtual void AddHoldScore( HoldNoteScore hns ); @@ -62,9 +62,9 @@ public: ScoreKeeperNormal( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats ); void Load( - const vector& apSongs, - const vector& apSteps, - const vector &asModifiers ); + const std::vector& apSongs, + const std::vector& apSteps, + const std::vector &asModifiers ); // before a song plays (called multiple times if course) void OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData ); diff --git a/src/ScoreKeeperShared.cpp b/src/ScoreKeeperShared.cpp index 6686adf4f2..170f1f63fa 100644 --- a/src/ScoreKeeperShared.cpp +++ b/src/ScoreKeeperShared.cpp @@ -12,9 +12,9 @@ ScoreKeeperShared::ScoreKeeperShared( PlayerState *pPlayerState, PlayerStageStat } void ScoreKeeperShared::Load( - const vector &apSongs, - const vector &apSteps, - const vector &asModifiers ) + const std::vector &apSongs, + const std::vector &apSteps, + const std::vector &asModifiers ) { if( m_pPlayerState->m_PlayerNumber != GAMESTATE->GetMasterPlayerNumber() ) return; diff --git a/src/ScoreKeeperShared.h b/src/ScoreKeeperShared.h index 317565294a..10b4fe7ff0 100644 --- a/src/ScoreKeeperShared.h +++ b/src/ScoreKeeperShared.h @@ -11,9 +11,9 @@ public: ScoreKeeperShared( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats ); virtual void Load( - const vector &apSongs, - const vector &apSteps, - const vector &asModifiers ); + const std::vector &apSongs, + const std::vector &apSteps, + const std::vector &asModifiers ); virtual void DrawPrimitives(); virtual void Update( float fDelta ); diff --git a/src/Screen.cpp b/src/Screen.cpp index f52ec27d74..d2954f6f57 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -61,7 +61,7 @@ void Screen::Init() PlayCommandNoRecurse( Message("Init") ); - vector asList; + std::vector asList; split( PREPARE_SCREENS, ",", asList ); for( unsigned i = 0; i < asList.size(); ++i ) { @@ -109,7 +109,7 @@ void Screen::Update( float fDeltaTime ) { ActorFrame::Update( fDeltaTime ); - m_fLockInputSecs = max( 0, m_fLockInputSecs-fDeltaTime ); + m_fLockInputSecs = std::max( 0.0f, m_fLockInputSecs-fDeltaTime ); /* We need to ensure two things: * 1. Messages must be sent in the order of delay. If two messages are sent @@ -136,7 +136,7 @@ void Screen::Update( float fDeltaTime ) if( m_QueuedMessages[i].fDelayRemaining > 0.0001f ) { m_QueuedMessages[i].fDelayRemaining -= fDeltaTime; - m_QueuedMessages[i].fDelayRemaining = max( m_QueuedMessages[i].fDelayRemaining, 0.0001f ); + m_QueuedMessages[i].fDelayRemaining = std::max( m_QueuedMessages[i].fDelayRemaining, 0.0001f ); } else { @@ -355,7 +355,7 @@ bool Screen::PassInputToLua(const InputEventPlus& input) lua_setfield(L, -2, "PlayerNumber"); Enum::Push(L, input.mp); lua_setfield(L, -2, "MultiPlayer"); - for(map::iterator callback= m_InputCallbacks.begin(); + for(std::map::iterator callback= m_InputCallbacks.begin(); callback != m_InputCallbacks.end() && !handled; ++callback) { callback->second.PushSelf(L); @@ -370,7 +370,7 @@ bool Screen::PassInputToLua(const InputEventPlus& input) m_CallingInputCallbacks= false; if(!m_DelayedCallbackRemovals.empty()) { - for(vector::iterator key= m_DelayedCallbackRemovals.begin(); + for(std::vector::iterator key= m_DelayedCallbackRemovals.begin(); key != m_DelayedCallbackRemovals.end(); ++key) { InternalRemoveCallback(*key); @@ -400,7 +400,7 @@ void Screen::RemoveInputCallback(lua_State* L) void Screen::InternalRemoveCallback(callback_key_t key) { - map::iterator iter= m_InputCallbacks.find(key); + std::map::iterator iter= m_InputCallbacks.find(key); if(iter != m_InputCallbacks.end()) { m_InputCallbacks.erase(iter); diff --git a/src/Screen.h b/src/Screen.h index 3ed00bdf50..d24f08a54f 100644 --- a/src/Screen.h +++ b/src/Screen.h @@ -94,7 +94,7 @@ protected: float fDelayRemaining; }; /** @brief The list of messages that are sent to a Screen. */ - vector m_QueuedMessages; + std::vector m_QueuedMessages; static bool SortMessagesByDelayRemaining(const QueuedScreenMessage &m1, const QueuedScreenMessage &m2); InputQueueCodeSet m_Codes; @@ -151,8 +151,8 @@ private: // void* is the key so that we can use lua_topointer to find the callback // to remove when removing a callback. typedef void const* callback_key_t; - map m_InputCallbacks; - vector m_DelayedCallbackRemovals; + std::map m_InputCallbacks; + std::vector m_DelayedCallbackRemovals; bool m_CallingInputCallbacks; void InternalRemoveCallback(callback_key_t key); }; diff --git a/src/ScreenBookkeeping.cpp b/src/ScreenBookkeeping.cpp index 4f29ee32c6..55270d41bf 100644 --- a/src/ScreenBookkeeping.cpp +++ b/src/ScreenBookkeeping.cpp @@ -145,7 +145,7 @@ void ScreenBookkeeping::UpdateView() { Profile *pProfile = PROFILEMAN->GetMachineProfile(); - vector vpSongs; + std::vector vpSongs; int iCount = 0; for (Song *pSong : SONGMAN->GetAllSongs()) { diff --git a/src/ScreenBookkeeping.h b/src/ScreenBookkeeping.h index ec8bbab9e2..d3d167fe30 100644 --- a/src/ScreenBookkeeping.h +++ b/src/ScreenBookkeeping.h @@ -38,7 +38,7 @@ private: void UpdateView(); int m_iViewIndex; - vector m_vBookkeepingViews; + std::vector m_vBookkeepingViews; BitmapText m_textAllTime; BitmapText m_textTitle; diff --git a/src/ScreenContinue.cpp b/src/ScreenContinue.cpp index b3c4404e24..eccde881f0 100644 --- a/src/ScreenContinue.cpp +++ b/src/ScreenContinue.cpp @@ -70,7 +70,7 @@ bool ScreenContinue::Input( const InputEventPlus &input ) case GAME_BUTTON_RIGHT: { float fSeconds = floorf(m_MenuTimer->GetSeconds()) - 0.0001f; - fSeconds = max( fSeconds, 0.0001f ); // don't set to 0 + fSeconds = std::max( fSeconds, 0.0001f ); // don't set to 0 m_MenuTimer->SetSeconds( fSeconds ); Message msg("HurryTimer"); msg.SetParam( "PlayerNumber", input.pn ); diff --git a/src/ScreenDebugOverlay.cpp b/src/ScreenDebugOverlay.cpp index ee697d877d..ed163696d3 100644 --- a/src/ScreenDebugOverlay.cpp +++ b/src/ScreenDebugOverlay.cpp @@ -57,14 +57,14 @@ static LocalizedString MUTE_ACTIONS_ON ("ScreenDebugOverlay", "Mute actions on") static LocalizedString MUTE_ACTIONS_OFF ("ScreenDebugOverlay", "Mute actions off"); class IDebugLine; -static vector *g_pvpSubscribers = nullptr; +static std::vector *g_pvpSubscribers = nullptr; class IDebugLine { public: IDebugLine() { if( g_pvpSubscribers == nullptr ) - g_pvpSubscribers = new vector; + g_pvpSubscribers = new std::vector; g_pvpSubscribers->push_back( this ); } virtual ~IDebugLine() { } @@ -125,7 +125,7 @@ struct MapDebugToDI DeviceInput toggleMute; DeviceInput debugButton[MAX_DEBUG_LINES]; DeviceInput gameplayButton[MAX_DEBUG_LINES]; - map pageButton; + std::map pageButton; void Clear() { holdForDebug1.MakeInvalid(); @@ -160,9 +160,9 @@ static RString GetDebugButtonName( const IDebugLine *pLine ) } template -static bool GetKeyFromMap( const map &m, const V &val, U &key ) +static bool GetKeyFromMap( const std::map &m, const V &val, U &key ) { - for( typename map::const_iterator iter = m.begin(); iter != m.end(); ++iter ) + for( typename std::map::const_iterator iter = m.begin(); iter != m.end(); ++iter ) { if( iter->second == val ) { @@ -227,7 +227,7 @@ void ScreenDebugOverlay::Init() g_Mappings.pageButton[DeviceInput(DEVICE_KEYBOARD, KEY_F8)] = 3; } - map iNextDebugButton; + std::map iNextDebugButton; int iNextGameplayButton = 0; for (IDebugLine *p : *g_pvpSubscribers) { @@ -265,7 +265,7 @@ void ScreenDebugOverlay::Init() this->AddChild( &m_textHeader ); auto start = m_asPages.begin(); - for (vector::const_iterator s = m_asPages.begin(); s != m_asPages.end(); ++s) + for (std::vector::const_iterator s = m_asPages.begin(); s != m_asPages.end(); ++s) { int iPage = s - start; @@ -360,7 +360,7 @@ void ScreenDebugOverlay::Update( float fDeltaTime ) void ScreenDebugOverlay::UpdateText() { auto start = m_asPages.begin(); - for (vector::const_iterator s = m_asPages.begin(); s != m_asPages.end(); ++s) + for (std::vector::const_iterator s = m_asPages.begin(); s != m_asPages.end(); ++s) { int iPage = s - start; m_vptextPages[iPage]->PlayCommand( (iPage == m_iCurrentPage) ? "GainFocus" : "LoseFocus" ); @@ -369,7 +369,7 @@ void ScreenDebugOverlay::UpdateText() // todo: allow changing of various spacing/location things -aj int iOffset = 0; auto subStart = g_pvpSubscribers->begin(); - for (vector::const_iterator p = subStart; p != g_pvpSubscribers->end(); ++p) + for (std::vector::const_iterator p = subStart; p != g_pvpSubscribers->end(); ++p) { RString sPageName = (*p)->GetPageName(); @@ -425,9 +425,9 @@ void ScreenDebugOverlay::UpdateText() } template -static bool GetValueFromMap( const map &m, const U &key, V &val ) +static bool GetValueFromMap( const std::map &m, const U &key, V &val ) { - typename map::const_iterator it = m.find(key); + typename std::map::const_iterator it = m.find(key); if( it == m.end() ) return false; val = it->second; @@ -470,7 +470,7 @@ bool ScreenDebugOverlay::Input( const InputEventPlus &input ) } auto start = g_pvpSubscribers->begin(); - for (vector::const_iterator p = start; p != g_pvpSubscribers->end(); ++p) + for (std::vector::const_iterator p = start; p != g_pvpSubscribers->end(); ++p) { RString sPageName = (*p)->GetPageName(); @@ -910,10 +910,10 @@ static void FillProfileStats( Profile *pProfile ) PREFSMAN->m_iMaxHighScoresPerListForMachine.Get(): PREFSMAN->m_iMaxHighScoresPerListForPlayer.Get(); - vector vpAllSongs = SONGMAN->GetAllSongs(); + std::vector vpAllSongs = SONGMAN->GetAllSongs(); for (Song const *pSong : vpAllSongs) { - vector vpAllSteps = pSong->GetAllSteps(); + std::vector vpAllSteps = pSong->GetAllSteps(); for (Steps const *pSteps : vpAllSteps) { if( rand() % 5 ) @@ -926,11 +926,11 @@ static void FillProfileStats( Profile *pProfile ) } } - vector vpAllCourses; + std::vector vpAllCourses; SONGMAN->GetAllCourses( vpAllCourses, true ); for (Course const *pCourse : vpAllCourses) { - vector vpAllTrails; + std::vector vpAllTrails; pCourse->GetAllTrails( vpAllTrails ); for (Trail const *pTrail : vpAllTrails) { diff --git a/src/ScreenDebugOverlay.h b/src/ScreenDebugOverlay.h index 992f17b2a2..1fce77e2a8 100644 --- a/src/ScreenDebugOverlay.h +++ b/src/ScreenDebugOverlay.h @@ -24,15 +24,15 @@ private: void UpdateText(); RString GetCurrentPageName() const { return m_asPages[m_iCurrentPage]; } - vector m_asPages; + std::vector m_asPages; int m_iCurrentPage; bool m_bForcedHidden; Quad m_Quad; BitmapText m_textHeader; - vector m_vptextPages; - vector m_vptextButton; - vector m_vptextFunction; + std::vector m_vptextPages; + std::vector m_vptextButton; + std::vector m_vptextFunction; }; diff --git a/src/ScreenDemonstration.cpp b/src/ScreenDemonstration.cpp index 021635eb35..0df9c52f5e 100644 --- a/src/ScreenDemonstration.cpp +++ b/src/ScreenDemonstration.cpp @@ -29,9 +29,9 @@ void ScreenDemonstration::Init() // Choose a Style { - vector v; + std::vector v; split( ALLOW_STYLE_TYPES, ",", v ); - vector vStyleTypeAllow; + std::vector vStyleTypeAllow; for (RString const &s : v) { StyleType st = StringToStyleType( s ); @@ -39,7 +39,7 @@ void ScreenDemonstration::Init() vStyleTypeAllow.push_back( st ); } - vector vStylePossible; + std::vector vStylePossible; GAMEMAN->GetDemonstrationStylesForGame( GAMESTATE->m_pCurGame, vStylePossible ); for( int i=(int)(vStylePossible.size())-1; i>=0; i-- ) { diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index ba5f905039..4b1f3f2714 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -127,7 +127,7 @@ static const char *EditStateNames[] = { XToString( EditState ); LuaXType( EditState ); -map name_to_edit_button; +std::map name_to_edit_button; void ScreenEdit::InitEditMappings() { @@ -537,13 +537,13 @@ void ScreenEdit::LoadKeymapSectionIntoMappingsMember(XNode const* section, MapEd if(section == nullptr) {return;} // Not an error, sections are optional. -Kyz FOREACH_CONST_Attr(section, attr) { - map::iterator name_entry= + std::map::iterator name_entry= name_to_edit_button.find(attr->first); if(name_entry != name_to_edit_button.end()) { RString joined_names; attr->second->GetValue(joined_names); - vector key_names; + std::vector key_names; split(joined_names, DEVICE_INPUT_SEPARATOR, key_names, false); for(size_t k= 0; k < key_names.size() && k < NUM_EDIT_TO_DEVICE_SLOTS; ++k) { @@ -720,8 +720,8 @@ enum RowCountChoice #define RCC_CHOICES RCC_4TH, "4m", "2m", "1m", "2nd", "4th","8th","12th","16th","24th","32nd","48th","64th","192nd" -int GetRowsFromAnswers(int choice, const vector& answers); -int GetRowsFromAnswers(int choice, const vector& answers) +int GetRowsFromAnswers(int choice, const std::vector& answers); +int GetRowsFromAnswers(int choice, const std::vector& answers) { if(answers.empty()) { @@ -1317,8 +1317,8 @@ static bool EnabledIfSet2GlobalMovieSongGroupAndGenre() { return ScreenMiniMenu: static RString GetOneBakedRandomFile( Song *pSong, bool bTryGenre = true ) { - vector vsPaths; - vector vsNames; + std::vector vsPaths; + std::vector vsNames; BackgroundUtil::GetGlobalRandomMovies( pSong, "", @@ -1630,7 +1630,7 @@ void ScreenEdit::MakeFilteredMenuDef( const MenuDef* pDef, MenuDef &menu ) menu = *pDef; menu.rows.clear(); - vector aRows; + std::vector aRows; for (MenuRowDef const &r : pDef->rows) { // Don't add rows that aren't applicable to this edit mode. @@ -1676,14 +1676,14 @@ void ScreenEdit::Update( float fDeltaTime ) for( int t=0; tGetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_iColsPerPlayer; t++ ) // for each track { - vector GameI; + std::vector GameI; GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->StyleInputToGameInput( t, PLAYER_1, GameI ); float fSecsHeld= 0.0f; for(size_t i= 0; i < GameI.size(); ++i) { - fSecsHeld= max(fSecsHeld, INPUTMAPPER->GetSecsHeld(GameI[i])); + fSecsHeld= std::max(fSecsHeld, INPUTMAPPER->GetSecsHeld(GameI[i])); } - fSecsHeld = min( fSecsHeld, m_RemoveNoteButtonLastChanged.Ago() ); + fSecsHeld = std::min( fSecsHeld, m_RemoveNoteButtonLastChanged.Ago() ); if( fSecsHeld == 0 ) continue; @@ -1698,9 +1698,9 @@ void ScreenEdit::Update( float fDeltaTime ) continue; float fStartedHoldingSeconds = m_pSoundMusic->GetPositionSeconds() - fSecsHeld; - float fStartBeat = max( fStartPlayingAtBeat, m_pSteps->GetTimingData()->GetBeatFromElapsedTime(fStartedHoldingSeconds) ); - float fEndBeat = max( fStartBeat, GetBeat() ); - fEndBeat = min( fEndBeat, fStopPlayingAtBeat ); + float fStartBeat = std::max( fStartPlayingAtBeat, m_pSteps->GetTimingData()->GetBeatFromElapsedTime(fStartedHoldingSeconds) ); + float fEndBeat = std::max( fStartBeat, GetBeat() ); + fEndBeat = std::min( fEndBeat, fStopPlayingAtBeat ); // Round start and end to the nearest snap interval fStartBeat = Quantize( fStartBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); @@ -1736,7 +1736,7 @@ void ScreenEdit::Update( float fDeltaTime ) bool bButtonIsBeingPressed = false; for( int t=0; tGetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_iColsPerPlayer; t++ ) // for each track { - vector GameI; + std::vector GameI; GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->StyleInputToGameInput( t, PLAYER_1, GameI ); if( INPUTMAPPER->IsBeingPressed(GameI) ) bButtonIsBeingPressed = true; @@ -1779,9 +1779,9 @@ void ScreenEdit::Update( float fDeltaTime ) PlayTicks(); } -static vector FindAllAttacksAtTime(const AttackArray& attacks, float fStartTime) +static std::vector FindAllAttacksAtTime(const AttackArray& attacks, float fStartTime) { - vector ret; + std::vector ret; for (unsigned i = 0; i < attacks.size(); ++i) { if (fabs(attacks[i].fStartSecond - fStartTime) < 0.001f) @@ -1939,7 +1939,7 @@ void ScreenEdit::UpdateTextInfo() const StepsTypeCategory &cat = GAMEMAN->GetStepsTypeInfo(m_pSteps->m_StepsType).m_StepsTypeCategory; if (cat == StepsTypeCategory_Couple || cat == StepsTypeCategory_Routine) { - pair tmp = m_NoteDataEdit.GetNumTapNotesTwoPlayer(); + std::pair tmp = m_NoteDataEdit.GetNumTapNotesTwoPlayer(); sText += ssprintf(NUM_STEPS_FORMAT_TWO_PLAYER.GetValue(), TAP_STEPS.GetValue().c_str(), tmp.first, tmp.second); @@ -2385,8 +2385,8 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) } else { - m_NoteFieldEdit.m_iEndMarker = max( m_NoteFieldEdit.m_iBeginMarker, iCurrentRow ); - m_NoteFieldEdit.m_iBeginMarker = min( m_NoteFieldEdit.m_iBeginMarker, iCurrentRow ); + m_NoteFieldEdit.m_iEndMarker = std::max( m_NoteFieldEdit.m_iBeginMarker, iCurrentRow ); + m_NoteFieldEdit.m_iBeginMarker = std::min( m_NoteFieldEdit.m_iBeginMarker, iCurrentRow ); } } else // both markers are laid @@ -2453,14 +2453,14 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) // Get all Steps of this StepsType const StepsType st = pSteps->m_StepsType; - vector vSteps; + std::vector vSteps; SongUtil::GetSteps( GAMESTATE->m_pCurSong, vSteps, st ); // Sort them by difficulty. StepsUtil::SortStepsByTypeAndDifficulty( vSteps ); // Find out what index the current Steps are - vector::iterator it = find( vSteps.begin(), vSteps.end(), pSteps ); + std::vector::iterator it = find( vSteps.begin(), vSteps.end(), pSteps ); ASSERT( it != vSteps.end() ); switch( EditB ) @@ -2572,7 +2572,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) } else { - vector &stops = timing.GetTimingSegments(SEGMENT_STOP); + std::vector &stops = timing.GetTimingSegments(SEGMENT_STOP); seg->SetPause(seg->GetPause() + fDelta); if( seg->GetPause() <= 0 ) stops.erase( stops.begin()+i, stops.begin()+i+1); @@ -2618,7 +2618,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) } else { - vector &stops = timing.GetTimingSegments(SEGMENT_DELAY); + std::vector &stops = timing.GetTimingSegments(SEGMENT_DELAY); seg->SetPause(seg->GetPause() + fDelta); if( seg->GetPause() <= 0 ) stops.erase( stops.begin()+i, stops.begin()+i+1); @@ -2689,12 +2689,12 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) if( EditB == EDIT_BUTTON_SAMPLE_LENGTH_DOWN || EditB == EDIT_BUTTON_SAMPLE_LENGTH_UP ) { m_pSong->m_fMusicSampleLengthSeconds += fDelta; - m_pSong->m_fMusicSampleLengthSeconds = max(m_pSong->m_fMusicSampleLengthSeconds,0); + m_pSong->m_fMusicSampleLengthSeconds = std::max(m_pSong->m_fMusicSampleLengthSeconds, 0.0f); } else { m_pSong->m_fMusicSampleStartSeconds += fDelta; - m_pSong->m_fMusicSampleStartSeconds = max(m_pSong->m_fMusicSampleStartSeconds,0); + m_pSong->m_fMusicSampleStartSeconds = std::max(m_pSong->m_fMusicSampleStartSeconds, 0.0f); } (fDelta>0 ? m_soundValueIncrease : m_soundValueDecrease).Play(true); SetDirty( true ); @@ -2716,7 +2716,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { // Fill in option names - vector vThrowAway; + std::vector vThrowAway; MenuDef &menu = g_BackgroundChange; @@ -2817,7 +2817,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) g_CourseMode.rows[0].choices.push_back( CommonMetrics::LocalizeOptionItem("Off",false) ); g_CourseMode.rows[0].iDefaultChoice = 0; - vector courses; + std::vector courses; SONGMAN->GetAllCourses( courses, false ); for( unsigned i = 0; i < courses.size(); ++i ) { @@ -3008,7 +3008,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) if( g_iDefaultRecordLength.Get() == -1 ) { m_iStartPlayingAt = BeatToNoteRow(GetAppropriatePosition().m_fSongBeat); - m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() + 1 ); + m_iStopPlayingAt = std::max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() + 1 ); } else { @@ -3017,7 +3017,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) } if( GAMESTATE->m_pCurSteps[0]->IsAnEdit() ) - m_iStopPlayingAt = min( m_iStopPlayingAt, BeatToNoteRow(GetMaximumBeatForNewNote()) ); + m_iStopPlayingAt = std::min( m_iStopPlayingAt, BeatToNoteRow(GetMaximumBeatForNewNote()) ); if( m_iStartPlayingAt >= m_iStopPlayingAt ) { @@ -3030,7 +3030,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) return true; case EDIT_BUTTON_RECORD_FROM_CURSOR: m_iStartPlayingAt = BeatToNoteRow(GetAppropriatePosition().m_fSongBeat); - m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() ); + m_iStopPlayingAt = std::max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() ); TransitionEditState( STATE_RECORDING ); return true; @@ -3199,7 +3199,7 @@ bool ScreenEdit::InputRecordPaused( const InputEventPlus &input, EditButton Edit m_iStopPlayingAt += iSize; if( GAMESTATE->m_pCurSteps[0]->IsAnEdit() ) - m_iStopPlayingAt = min( m_iStopPlayingAt, BeatToNoteRow(GetMaximumBeatForNewNote()) ); + m_iStopPlayingAt = std::min( m_iStopPlayingAt, BeatToNoteRow(GetMaximumBeatForNewNote()) ); } TransitionEditState( STATE_RECORDING ); @@ -3387,14 +3387,14 @@ void ScreenEdit::TransitionEditState( EditState em ) m_Foreground.Unload(); // Restore the cursor position + Quantize + Clamp - SetBeat( max( 0, Quantize( m_fBeatToReturnTo, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ) ) ); + SetBeat( std::max( 0.0f, Quantize( m_fBeatToReturnTo, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ) ) ); GAMESTATE->m_bInStepEditor = true; break; case STATE_PLAYING: case STATE_RECORDING: { - m_NoteDataEdit.RevalidateATIs(vector(), false); + m_NoteDataEdit.RevalidateATIs(std::vector(), false); if( bStateChanging ) AdjustSync::ResetOriginalSyncData(); @@ -3538,8 +3538,8 @@ void ScreenEdit::ScrollTo( float fDestinationBeat ) continue; // create a new hold note - int iStartRow = BeatToNoteRow( min(fOriginalBeat, fDestinationBeat) ); - int iEndRow = BeatToNoteRow( max(fOriginalBeat, fDestinationBeat) ); + int iStartRow = BeatToNoteRow( std::min(fOriginalBeat, fDestinationBeat) ); + int iEndRow = BeatToNoteRow( std::max(fOriginalBeat, fDestinationBeat) ); // Don't SaveUndo. We want to undo the whole hold, not just the last segment // that the user made. Dragging the hold bigger can only absorb and remove @@ -3569,7 +3569,7 @@ void ScreenEdit::ScrollTo( float fDestinationBeat ) m_NoteFieldEdit.m_iBeginMarker = m_iShiftAnchor; m_NoteFieldEdit.m_iEndMarker = iDestinationRow; if( m_NoteFieldEdit.m_iBeginMarker > m_NoteFieldEdit.m_iEndMarker ) - swap( m_NoteFieldEdit.m_iBeginMarker, m_NoteFieldEdit.m_iEndMarker ); + std::swap( m_NoteFieldEdit.m_iBeginMarker, m_NoteFieldEdit.m_iEndMarker ); } } @@ -3644,7 +3644,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) else if( SM == SM_BackFromAreaMenu ) { AreaMenuChoice amc = static_cast(ScreenMiniMenu::s_iLastRowCode); - const vector &answers = ScreenMiniMenu::s_viLastAnswers; + const std::vector &answers = ScreenMiniMenu::s_viLastAnswers; HandleAreaMenuChoice( amc, answers ); } else if( SM == SM_BackFromAlterMenu ) @@ -3864,7 +3864,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) const int tracks = m_NoteDataEdit.GetNumTracks(); const int row = this->GetRow(); unsigned int sound = ScreenMiniMenu::s_viLastAnswers[track]; - vector &kses = m_pSong->m_vsKeysoundFile; + std::vector &kses = m_pSong->m_vsKeysoundFile; if (track < tracks) { @@ -3930,7 +3930,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) const int row = this->GetRow(); const TapNote &oldNote = m_NoteDataEdit.GetTapNote(track, row); TapNote newNote = oldNote; // need to lose the const. not feeling like casting. - vector &kses = m_pSong->m_vsKeysoundFile; + std::vector &kses = m_pSong->m_vsKeysoundFile; unsigned pos = find(kses.begin(), kses.end(), answer) - kses.begin(); if (pos == kses.size()) { @@ -4018,7 +4018,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) AttackArray &attacks = (GAMESTATE->m_bIsUsingStepTiming ? m_pSteps->m_Attacks : m_pSong->m_Attacks); Attack &attack = attacks[attackInProcess]; - vector mods; + std::vector mods; split(attack.sModifiers, ",", mods); RString mod = ScreenTextEntry::s_sLastAnswer; Trim(mod); @@ -4046,7 +4046,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) AttackArray &attacks = (GAMESTATE->m_bIsUsingStepTiming ? m_pSteps->m_Attacks : m_pSong->m_Attacks); Attack &attack = attacks[attackInProcess]; - vector mods; + std::vector mods; split(attack.sModifiers, ",", mods); modInProcess = option; if (option == 0) // adjusting the starting time @@ -4102,7 +4102,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) float startTime = timing.GetElapsedTimeFromBeat(GetBeat()); AttackArray &attacks = (GAMESTATE->m_bIsUsingStepTiming ? m_pSteps->m_Attacks : m_pSong->m_Attacks); - vector points = FindAllAttacksAtTime(attacks, startTime); + std::vector points = FindAllAttacksAtTime(attacks, startTime); if (attackChoice == (int)points.size()) { // TODO: Add attack code. @@ -4142,7 +4142,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) 0, nullptr)); g_IndividualAttack.rows[1].SetOneUnthemedChoice(std::to_string(attack.fSecsRemaining)); - vector mods; + std::vector mods; split(attack.sModifiers, ",", mods); for (unsigned i = 0; i < mods.size(); ++i) { @@ -4382,8 +4382,8 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) // At this point, the last good song copy is in use. Song *pSong = GAMESTATE->m_pCurSong; - const vector &apSteps = pSong->GetAllSteps(); - vector apToDelete; + const std::vector &apSteps = pSong->GetAllSteps(); + std::vector apToDelete; for (Steps *s : apSteps) { // If we're not on the same style, let it go. @@ -4572,7 +4572,7 @@ static void ChangeStepCredit( const RString &sNew ) static void ChangeStepMeter( const RString &sNew ) { int diff = StringToInt(sNew); - GAMESTATE->m_pCurSteps[PLAYER_1]->SetMeter(max(diff, 1)); + GAMESTATE->m_pCurSteps[PLAYER_1]->SetMeter(std::max(diff, 1)); } static void ChangeStepMusic(const RString& sNew) @@ -4799,12 +4799,12 @@ static LocalizedString SAVE_CHANGES_BEFORE_EXITING ( "ScreenEdit", "Do you want int ScreenEdit::GetSongOrNotesEnd() { - return max(m_iStartPlayingAt, max(m_NoteDataEdit.GetLastRow(), + return std::max(m_iStartPlayingAt, std::max(m_NoteDataEdit.GetLastRow(), BeatToNoteRow(m_pSteps->GetTimingData()->GetBeatFromElapsedTime( GAMESTATE->m_pCurSong->m_fMusicLengthSeconds)))); } -void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAnswers ) +void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const std::vector &iAnswers ) { GAMESTATE->SetProcessedTimingData(m_pSteps->GetTimingData()); switch( c ) @@ -4828,7 +4828,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns case play_selection_start_to_end: { m_iStartPlayingAt = m_NoteFieldEdit.m_iBeginMarker; - m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() ); + m_iStopPlayingAt = std::max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() ); TransitionEditState( STATE_PLAYING ); } break; @@ -4906,7 +4906,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns const StepsTypeCategory &cat = GAMEMAN->GetStepsTypeInfo(pSteps->m_StepsType).m_StepsTypeCategory; if (cat == StepsTypeCategory_Couple || cat == StepsTypeCategory_Routine) { - pair tmp = m_NoteDataEdit.GetNumTapNotesTwoPlayer(); + std::pair tmp = m_NoteDataEdit.GetNumTapNotesTwoPlayer(); g_StepsData.rows[tap_notes].SetOneUnthemedChoice( ssprintf("%d / %d", tmp.first, tmp.second) ); tmp = m_NoteDataEdit.GetNumJumpsTwoPlayer(); g_StepsData.rows[jumps].SetOneUnthemedChoice( ssprintf("%d / %d", tmp.first, tmp.second) ); @@ -5022,7 +5022,7 @@ static LocalizedString CONFIRM_CLEAR("ScreenEdit", "Are you sure you want to cle static bool ConvertMappingInputToMapping(RString const& mapstr, int* mapping, RString& error) { - vector mapping_input; + std::vector mapping_input; split(mapstr, ",", mapping_input); size_t tracks_for_type= GAMEMAN->GetStepsTypeInfo(GAMESTATE->m_pCurSteps[0]->m_StepsType).iNumTracks; if(mapping_input.size() > tracks_for_type) @@ -5082,7 +5082,7 @@ void ScreenEdit::HandleArbitraryRemapping(RString const& mapstr) m_Clipboard = OldClipboard; } -void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector &answers, bool allow_undo, bool prompt_clear) +void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const std::vector &answers, bool allow_undo, bool prompt_clear) { ASSERT_M(m_NoteFieldEdit.m_iBeginMarker!=-1 && m_NoteFieldEdit.m_iEndMarker!=-1, "You can only alter a selection of notes with a selection to begin with!"); @@ -5466,7 +5466,7 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector &ans } -void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector &iAnswers, bool bAllowUndo ) +void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const std::vector &iAnswers, bool bAllowUndo ) { bool bSaveUndo = true; switch( c ) @@ -5588,7 +5588,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector &iAns CheckNumberOfNotesAndUndo(); } -void ScreenEdit::HandleStepsDataChoice( StepsDataChoice c, const vector &iAnswers ) +void ScreenEdit::HandleStepsDataChoice( StepsDataChoice c, const std::vector &iAnswers ) { return; // nothing is done with the choices. Yet. } @@ -5601,7 +5601,7 @@ static LocalizedString ENTER_NEW_METER( "ScreenEdit", "Enter a new meter." ); static LocalizedString ENTER_MIN_BPM ("ScreenEdit","Enter a new min BPM."); static LocalizedString ENTER_MAX_BPM ("ScreenEdit","Enter a new max BPM."); static LocalizedString ENTER_NEW_STEP_MUSIC("ScreenEdit", "Enter the music file for this chart."); -void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const vector &iAnswers ) +void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const std::vector &iAnswers ) { Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; Difficulty dc = (Difficulty)iAnswers[difficulty]; @@ -5710,7 +5710,7 @@ static LocalizedString ENTER_ARTIST_TRANSLIT ("ScreenEdit","Enter a new artist static LocalizedString ENTER_LAST_SECOND_HINT ("ScreenEdit","Enter a new last second hint."); static LocalizedString ENTER_PREVIEW_START ("ScreenEdit","Enter a new preview start."); static LocalizedString ENTER_PREVIEW_LENGTH ("ScreenEdit","Enter a new preview length."); -void ScreenEdit::HandleSongInformationChoice( SongInformationChoice c, const vector &iAnswers ) +void ScreenEdit::HandleSongInformationChoice( SongInformationChoice c, const std::vector &iAnswers ) { Song* pSong = GAMESTATE->m_pCurSong; pSong->m_DisplayBPMType = static_cast(iAnswers[display_bpm]); @@ -5789,7 +5789,7 @@ static LocalizedString ENTER_SPEED_MODE_VALUE ( "ScreenEdit", "Enter a new Spe static LocalizedString ENTER_SCROLL_VALUE ( "ScreenEdit", "Enter a new Scroll value." ); static LocalizedString ENTER_FAKE_VALUE ( "ScreenEdit", "Enter a new Fake value." ); static LocalizedString CONFIRM_TIMING_ERASE ( "ScreenEdit", "Are you sure you want to erase this chart's timing data?" ); -void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice c, const vector &iAnswers ) +void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice c, const std::vector &iAnswers ) { switch( c ) { @@ -5953,7 +5953,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice } void ScreenEdit::HandleTimingDataChangeChoice(TimingDataChangeChoice choice, - const vector& answers) + const std::vector& answers) { TimingSegmentType change_type= TimingSegmentType_Invalid; switch(choice) @@ -6022,7 +6022,7 @@ void ScreenEdit::HandleTimingDataChangeChoice(TimingDataChangeChoice choice, } } -void ScreenEdit::HandleBGChangeChoice( BGChangeChoice c, const vector &iAnswers ) +void ScreenEdit::HandleBGChangeChoice( BGChangeChoice c, const std::vector &iAnswers ) { BackgroundChange newChange; @@ -6162,7 +6162,7 @@ void ScreenEdit::CopyToLastSave() ASSERT( GAMESTATE->m_pCurSteps[PLAYER_1] != nullptr ); m_SongLastSave = *GAMESTATE->m_pCurSong; m_vStepsLastSave.clear(); - const vector &vSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( GAMESTATE->m_pCurSteps[PLAYER_1]->m_StepsType ); + const std::vector &vSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( GAMESTATE->m_pCurSteps[PLAYER_1]->m_StepsType ); for (Steps *it : vSteps) m_vStepsLastSave.push_back( *it ); } @@ -6173,7 +6173,7 @@ void ScreenEdit::CopyFromLastSave() // 1) No steps can be created by ScreenEdit // 2) No steps can be deleted by ScreenEdit (except possibly when we exit) *GAMESTATE->m_pCurSong = m_SongLastSave; - const vector &vSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( GAMESTATE->m_pCurSteps[PLAYER_1]->m_StepsType ); + const std::vector &vSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( GAMESTATE->m_pCurSteps[PLAYER_1]->m_StepsType ); ASSERT_M( vSteps.size() == m_vStepsLastSave.size(), ssprintf("Step sizes don't match: %d, %d", int(vSteps.size()), int(m_vStepsLastSave.size())) ); for( unsigned i = 0; i < vSteps.size(); ++i ) *vSteps[i] = m_vStepsLastSave[i]; @@ -6224,7 +6224,7 @@ void ScreenEdit::Undo() { if( m_bHasUndo ) { - swap( m_Undo, m_NoteDataEdit ); + std::swap( m_Undo, m_NoteDataEdit ); SCREENMAN->SystemMessage( UNDO ); } else @@ -6315,7 +6315,7 @@ float ScreenEdit::GetMaximumBeatForMoving() const * so that users can delete garbage steps past then end that they have * have inserted in a text editor. Once they delete all steps on * GetLastBeat() and move off of that beat, they won't be able to return. */ - fEndBeat = max( fEndBeat, m_NoteDataEdit.GetLastBeat() ); + fEndBeat = std::max( fEndBeat, m_NoteDataEdit.GetLastBeat() ); return fEndBeat; } @@ -6323,7 +6323,7 @@ float ScreenEdit::GetMaximumBeatForMoving() const struct EditHelpLine { const char *szEnglishDescription; - vector veb; + std::vector veb; EditHelpLine( const char *_szEnglishDescription, @@ -6402,21 +6402,21 @@ static void ProcessKeyName( RString &s ) s.Replace( "Key_", "" ); } -static void ProcessKeyNames( vector &vs, bool doSort ) +static void ProcessKeyNames( std::vector &vs, bool doSort ) { for (RString &s : vs) ProcessKeyName( s ); if (doSort) sort( vs.begin(), vs.end() ); - vector::iterator toDelete = unique( vs.begin(), vs.end() ); + std::vector::iterator toDelete = unique( vs.begin(), vs.end() ); vs.erase(toDelete, vs.end()); } -static RString GetDeviceButtonsLocalized( const vector &veb, const MapEditToDI &editmap ) +static RString GetDeviceButtonsLocalized( const std::vector &veb, const MapEditToDI &editmap ) { - vector vsPress; - vector vsHold; + std::vector vsPress; + std::vector vsHold; for (EditButton const &eb : veb) { if( !IsMapped( eb, editmap ) ) @@ -6448,7 +6448,7 @@ void ScreenEdit::DoStepAttackMenu() float startTime = timing.GetElapsedTimeFromBeat(GetBeat()); AttackArray &attacks = (GAMESTATE->m_bIsUsingStepTiming ? m_pSteps->m_Attacks : m_pSong->m_Attacks); - vector points = FindAllAttacksAtTime(attacks, startTime); + std::vector points = FindAllAttacksAtTime(attacks, startTime); g_AttackAtTimeMenu.rows.clear(); unsigned index = 0; @@ -6489,9 +6489,9 @@ static LocalizedString NEWKEYSND("ScreenEdit", "New Sound"); void ScreenEdit::DoKeyboardTrackMenu() { g_KeysoundTrack.rows.clear(); - vector &kses = m_pSong->m_vsKeysoundFile; + std::vector &kses = m_pSong->m_vsKeysoundFile; - vector choices; + std::vector choices; for (RString const &ks : kses) { choices.push_back(ks); diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index 758a585f4a..9495c3f857 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -365,7 +365,7 @@ protected: void RevertFromDisk(); Song m_SongLastSave; - vector m_vStepsLastSave; + std::vector m_vStepsLastSave; // for MODE_RECORD @@ -416,8 +416,8 @@ public: MAIN_MENU_CHOICE_INVALID }; int GetSongOrNotesEnd(); - void HandleMainMenuChoice( MainMenuChoice c, const vector &iAnswers ); - void HandleMainMenuChoice( MainMenuChoice c ) { const vector v; HandleMainMenuChoice( c, v ); } + void HandleMainMenuChoice( MainMenuChoice c, const std::vector &iAnswers ); + void HandleMainMenuChoice( MainMenuChoice c ) { const std::vector v; HandleMainMenuChoice( c, v ); } MainMenuChoice m_CurrentAction; /** @brief How does one alter a selection of NoteData? */ @@ -465,18 +465,18 @@ public: }; void HandleArbitraryRemapping(RString const& mapstr); void HandleAlterMenuChoice(AlterMenuChoice choice, - const vector &answers, bool allow_undo= true, + const std::vector &answers, bool allow_undo= true, bool prompt_clear= true); void HandleAlterMenuChoice(AlterMenuChoice c, bool allow_undo= true, bool prompt_clear= true) { - const vector v; HandleAlterMenuChoice(c, v, allow_undo, prompt_clear); + const std::vector v; HandleAlterMenuChoice(c, v, allow_undo, prompt_clear); } - void HandleAreaMenuChoice( AreaMenuChoice c, const vector &iAnswers, bool bAllowUndo = true ); + void HandleAreaMenuChoice( AreaMenuChoice c, const std::vector &iAnswers, bool bAllowUndo = true ); void HandleAreaMenuChoice( AreaMenuChoice c, bool bAllowUndo = true ) { - const vector v; HandleAreaMenuChoice( c, v, bAllowUndo ); + const std::vector v; HandleAreaMenuChoice( c, v, bAllowUndo ); } /** @brief How should the selected notes be transformed? */ enum TurnType @@ -554,7 +554,7 @@ public: step_music, NUM_STEPS_INFORMATION_CHOICES }; - void HandleStepsInformationChoice( StepsInformationChoice c, const vector &iAnswers ); + void HandleStepsInformationChoice( StepsInformationChoice c, const std::vector &iAnswers ); enum StepsDataChoice { @@ -574,7 +574,7 @@ public: chaos, NUM_STEPS_DATA_CHOICES }; - void HandleStepsDataChoice(StepsDataChoice c, const vector &answers); + void HandleStepsDataChoice(StepsDataChoice c, const std::vector &answers); enum SongInformationChoice { @@ -595,7 +595,7 @@ public: max_bpm, NUM_SONG_INFORMATION_CHOICES }; - void HandleSongInformationChoice( SongInformationChoice c, const vector &iAnswers ); + void HandleSongInformationChoice( SongInformationChoice c, const std::vector &iAnswers ); enum TimingDataInformationChoice { @@ -625,7 +625,7 @@ public: NUM_TIMING_DATA_INFORMATION_CHOICES }; void HandleTimingDataInformationChoice (TimingDataInformationChoice c, - const vector &iAnswers ); + const std::vector &iAnswers ); enum TimingDataChangeChoice { @@ -644,7 +644,7 @@ public: NUM_TimingDataChangeChoices }; void HandleTimingDataChangeChoice(TimingDataChangeChoice choice, - const vector& answers); + const std::vector& answers); enum BGChangeChoice { @@ -686,7 +686,7 @@ public: * It is important that this is only called in Song Timing mode. * @param c the Background Change style requested. * @param iAnswers the other settings involving the change. */ - void HandleBGChangeChoice( BGChangeChoice c, const vector &iAnswers ); + void HandleBGChangeChoice( BGChangeChoice c, const std::vector &iAnswers ); enum CourseAttackChoice { diff --git a/src/ScreenEvaluation.cpp b/src/ScreenEvaluation.cpp index d77e57c745..bc5fb502fe 100644 --- a/src/ScreenEvaluation.cpp +++ b/src/ScreenEvaluation.cpp @@ -129,7 +129,7 @@ void ScreenEvaluation::Init() GAMESTATE->m_pCurSteps[p].Set( GAMESTATE->m_pCurSong->GetAllSteps()[0] ); if( GAMESTATE->m_pCurCourse ) { - vector apTrails; + std::vector apTrails; GAMESTATE->m_pCurCourse->GetAllTrails( apTrails ); if( apTrails.size() ) GAMESTATE->m_pCurTrail[p].Set( apTrails[0] ); @@ -311,7 +311,7 @@ void ScreenEvaluation::Init() m_textPlayerOptions[p].SetName( ssprintf("PlayerOptionsP%d",p+1) ); ActorUtil::LoadAllCommands( m_textPlayerOptions[p], m_sName ); SET_XY( m_textPlayerOptions[p] ); - vector v; + std::vector v; PlayerOptions po = GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.GetPreferred(); if( PLAYER_OPTIONS_HIDE_FAIL_TYPE ) po.m_FailType = (FailType)0; // blank out the fail type so that it won't show in the mods list @@ -666,7 +666,7 @@ void ScreenEvaluation::Init() Grade best_grade = Grade_NoData; FOREACH_PlayerNumber( p ) - best_grade = min( best_grade, grade[p] ); + best_grade = std::min( best_grade, grade[p] ); if( m_pStageStats->m_EarnedExtraStage != EarnedExtraStage_No ) { diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index b3c6299b83..74ee8311d7 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -248,8 +248,8 @@ bool PlayerInfo::IsEnabled() FAIL_M("Invalid non-dummy player."); } -vector::iterator -GetNextEnabledPlayerInfo( vector::iterator iter, vector &v ) +std::vector::iterator +GetNextEnabledPlayerInfo( std::vector::iterator iter, std::vector &v ) { for( ; iter != v.end(); ++iter ) { @@ -260,8 +260,8 @@ GetNextEnabledPlayerInfo( vector::iterator iter, vector return iter; } -vector::iterator -GetNextEnabledPlayerInfoNotDummy( vector::iterator iter, vector &v ) +std::vector::iterator +GetNextEnabledPlayerInfoNotDummy( std::vector::iterator iter, std::vector &v ) { for( ; iter != v.end(); iter++ ) { @@ -274,8 +274,8 @@ GetNextEnabledPlayerInfoNotDummy( vector::iterator iter, vector::iterator -GetNextEnabledPlayerNumberInfo( vector::iterator iter, vector &v ) +std::vector::iterator +GetNextEnabledPlayerNumberInfo( std::vector::iterator iter, std::vector &v ) { for( ; iter != v.end(); ++iter ) { @@ -290,8 +290,8 @@ GetNextEnabledPlayerNumberInfo( vector::iterator iter, vector::iterator -GetNextPlayerNumberInfo( vector::iterator iter, vector &v ) +std::vector::iterator +GetNextPlayerNumberInfo( std::vector::iterator iter, std::vector &v ) { for( ; iter != v.end(); ++iter ) { @@ -304,8 +304,8 @@ GetNextPlayerNumberInfo( vector::iterator iter, vector & return iter; } -vector::iterator -GetNextVisiblePlayerInfo( vector::iterator iter, vector &v ) +std::vector::iterator +GetNextVisiblePlayerInfo( std::vector::iterator iter, std::vector &v ) { for( ; iter != v.end(); ++iter ) { @@ -605,7 +605,7 @@ void ScreenGameplay::Init() pi->m_pn+1, player_x, screen_space, left_edge[pi->m_pn], field_space, left_marge, right_marge, style_width, field_zoom); */ - pi->GetPlayerState()->m_NotefieldZoom= min(1.0f, field_zoom); + pi->GetPlayerState()->m_NotefieldZoom= std::min(1.0f, field_zoom); pi->m_pPlayer->SetX(player_x); pi->m_pPlayer->RunCommands( PLAYER_INIT_COMMAND ); @@ -964,10 +964,10 @@ void ScreenGameplay::InitSongQueues() { Steps *pOldSteps = pi->m_vpStepsQueue[i]; - vector vpSteps; + std::vector vpSteps; SongUtil::GetSteps( pSong, vpSteps, pOldSteps->m_StepsType ); StepsUtil::SortNotesArrayByDifficulty( vpSteps ); - vector::iterator iter = find( vpSteps.begin(), vpSteps.end(), pOldSteps ); + std::vector::iterator iter = find( vpSteps.begin(), vpSteps.end(), pOldSteps ); int iIndexBase = 0; if( iter != vpSteps.end() ) { @@ -1377,7 +1377,7 @@ void ScreenGameplay::LoadLights() // No explicit lights. Create autogen lights. RString sDifficulty = PREFSMAN->m_sLightsStepsDifficulty; - vector asDifficulties; + std::vector asDifficulties; split( sDifficulty, ",", asDifficulties ); // Always use the steps from the primary steps type so that lights are consistent over single and double styles. @@ -1452,7 +1452,7 @@ void ScreenGameplay::StartPlayingSong( float fMinTimeToNotes, float fMinTimeToMu { const float fFirstSecond = GAMESTATE->m_pCurSong->GetFirstSecond(); float fStartDelay = fMinTimeToNotes - fFirstSecond; - fStartDelay = max( fStartDelay, fMinTimeToMusic ); + fStartDelay = std::max( fStartDelay, fMinTimeToMusic ); p.m_StartSecond = -fStartDelay; } @@ -1610,11 +1610,11 @@ void ScreenGameplay::GetMusicEndTiming( float &fSecondsToStartFadingOutMusic, fl /* Make sure we keep going long enough to register a miss for the last note, and * never start fading before the last note. */ - fSecondsToStartFadingOutMusic = max( fSecondsToStartFadingOutMusic, fLastStepSeconds ); - fSecondsToStartTransitioningOut = max( fSecondsToStartTransitioningOut, fLastStepSeconds ); + fSecondsToStartFadingOutMusic = std::max( fSecondsToStartFadingOutMusic, fLastStepSeconds ); + fSecondsToStartTransitioningOut = std::max( fSecondsToStartTransitioningOut, fLastStepSeconds ); /* Make sure the fade finishes before the transition finishes. */ - fSecondsToStartTransitioningOut = max( fSecondsToStartTransitioningOut, fSecondsToStartFadingOutMusic + MUSIC_FADE_OUT_SECONDS - fTransitionLength ); + fSecondsToStartTransitioningOut = std::max( fSecondsToStartTransitioningOut, fSecondsToStartFadingOutMusic + MUSIC_FADE_OUT_SECONDS - fTransitionLength ); } void ScreenGameplay::Update( float fDeltaTime ) @@ -2050,7 +2050,7 @@ void ScreenGameplay::UpdateHasteRate() // In Battle/Rave mode, the players don't have life meters. if(pi->m_pLifeMeter) { - fMaxLife= max(fMaxLife, pi->m_pLifeMeter->GetLife()); + fMaxLife= std::max(fMaxLife, pi->m_pLifeMeter->GetLife()); } else { @@ -2116,7 +2116,7 @@ void ScreenGameplay::UpdateHasteRate() * means that the player is only eligible to slow the song down when * they are down to their last accumulated second. -Kyz */ // 1 second left is full speed_add, 0 seconds left is no speed_add. - float clamp_secs= max(0, GAMESTATE->m_fAccumulatedHasteSeconds); + float clamp_secs= std::max(0.0f, GAMESTATE->m_fAccumulatedHasteSeconds); speed_add = speed_add * clamp_secs; } fSpeed += speed_add; @@ -2175,7 +2175,7 @@ void ScreenGameplay::UpdateLights() if( bBlink ) { - vector gi; + std::vector gi; pStyle->StyleInputToGameInput( t, pi->m_pn, gi ); for(size_t i= 0; i < gi.size(); ++i) { @@ -2220,7 +2220,7 @@ void ScreenGameplay::SendCrossedMessages() float fSongBeat = GAMESTATE->m_pCurSong->m_SongTiming.GetBeatFromElapsedTime( fPositionSeconds ); int iRowNow = BeatToNoteRowNotRounded( fSongBeat ); - iRowNow = max( 0, iRowNow ); + iRowNow = std::max( 0, iRowNow ); for( int r=iRowLastCrossed+1; r<=iRowNow; r++ ) { @@ -2258,7 +2258,7 @@ void ScreenGameplay::SendCrossedMessages() float fSongBeat = GAMESTATE->m_pCurSong->m_SongTiming.GetBeatFromElapsedTime( fPositionSeconds ); int iRowNow = BeatToNoteRowNotRounded( fSongBeat ); - iRowNow = max( 0, iRowNow ); + iRowNow = std::max( 0, iRowNow ); int &iRowLastCrossed = iRowLastCrossedAll[i]; FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( nd, r, iRowLastCrossed+1, iRowNow+1 ) @@ -2827,8 +2827,8 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) ASSERT(course != nullptr); // Need to store these so they can be used to refetch the players' // trails after they're invalidated. - vector trail_sts; - vector trail_cds; + std::vector trail_sts; + std::vector trail_cds; FOREACH_EnabledPlayerInfo(m_vPlayerInfo, pi) { Trail* trail= GAMESTATE->m_pCurTrail[pi->GetStepsAndTrailIndex()]; @@ -2918,7 +2918,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) } } } - else if( ScreenMessageHelpers::ScreenMessageToString(SM).find("0Combo") != string::npos ) + else if( ScreenMessageHelpers::ScreenMessageToString(SM).find("0Combo") != std::string::npos ) { int iCombo; RString sCropped = ScreenMessageHelpers::ScreenMessageToString(SM).substr(3); @@ -2994,7 +2994,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) { float fMaxAliveSeconds = 0; FOREACH_EnabledPlayer(p) - fMaxAliveSeconds = max( fMaxAliveSeconds, STATSMAN->m_CurStageStats.m_player[p].m_fAliveSeconds ); + fMaxAliveSeconds = std::max( fMaxAliveSeconds, STATSMAN->m_CurStageStats.m_player[p].m_fAliveSeconds ); m_textSurviveTime.SetText( "TIME: " + SecondsToMMSSMsMs(fMaxAliveSeconds) ); ON_COMMAND( m_textSurviveTime ); } @@ -3144,7 +3144,7 @@ void ScreenGameplay::SaveReplay() p->AppendChild( pi->m_pPlayer->GetNoteData().CreateNode() ); // Find a file name for the replay - vector files; + std::vector files; GetDirListing( "Save/Replays/replay*", files, false, false ); sort( files.begin(), files.end() ); @@ -3154,7 +3154,7 @@ void ScreenGameplay::SaveReplay() for( int i = files.size()-1; i >= 0; --i ) { static Regex re( "^replay([0-9]{5})\\....$" ); - vector matches; + std::vector matches; if( !re.Compare( files[i], matches ) ) continue; diff --git a/src/ScreenGameplay.h b/src/ScreenGameplay.h index 70f208a48c..6da740c3c4 100644 --- a/src/ScreenGameplay.h +++ b/src/ScreenGameplay.h @@ -93,12 +93,12 @@ public: * @brief The list of Steps a player has to go through in this set. * * The size may be greater than 1 if playing a course. */ - vector m_vpStepsQueue; + std::vector m_vpStepsQueue; /** * @brief The list of attack modifiers a player has to go through in this set. * * The size may be greater than 1 if playing a course. */ - vector m_asModifiersQueue; + std::vector m_asModifiersQueue; /** @brief The LifeMeter showing a Player's health. */ LifeMeter *m_pLifeMeter; @@ -177,8 +177,8 @@ public: void FailFadeRemovePlayer(PlayerNumber pn); void BeginBackingOutFromGameplay(); - vector m_HasteTurningPoints; // Values at which the meaning of GAMESTATE->m_fHasteRate changes. - vector m_HasteAddAmounts; // Amounts that are added to speed depending on what turning point has been passed. + std::vector m_HasteTurningPoints; // Values at which the meaning of GAMESTATE->m_fHasteRate changes. + std::vector m_HasteAddAmounts; // Amounts that are added to speed depending on what turning point has been passed. float m_fHasteTimeBetweenUpdates; // Seconds between haste updates. float m_fHasteLifeSwitchPoint; // Life amount below which GAMESTATE->m_fHasteRate is based on the life amount. @@ -262,7 +262,7 @@ protected: * @brief The songs left to play. * * The size can be greater than 1 if playing a course. */ - vector m_apSongsQueue; + std::vector m_apSongsQueue; float m_fTimeSinceLastDancingComment; // this counter is only running while STATE_DANCING @@ -319,8 +319,8 @@ protected: /** @brief The NoteData that controls the lights on an arcade cabinet. */ NoteData m_CabinetLightsNoteData; - vector m_vPlayerInfo; // filled by SGameplay derivatives in FillPlayerInfo - virtual void FillPlayerInfo( vector &vPlayerInfoOut ) = 0; + std::vector m_vPlayerInfo; // filled by SGameplay derivatives in FillPlayerInfo + virtual void FillPlayerInfo( std::vector &vPlayerInfoOut ) = 0; virtual PlayerInfo &GetPlayerInfoForInput( const InputEventPlus& iep ) { return m_vPlayerInfo[iep.pn]; } RageTimer m_timerGameplaySeconds; @@ -331,22 +331,22 @@ protected: bool m_delaying_ready_announce; }; -vector::iterator GetNextEnabledPlayerInfo ( vector::iterator iter, vector &v ); -vector::iterator GetNextEnabledPlayerInfoNotDummy ( vector::iterator iter, vector &v ); -vector::iterator GetNextEnabledPlayerNumberInfo ( vector::iterator iter, vector &v ); -vector::iterator GetNextPlayerNumberInfo ( vector::iterator iter, vector &v ); -vector::iterator GetNextVisiblePlayerInfo ( vector::iterator iter, vector &v ); +std::vector::iterator GetNextEnabledPlayerInfo ( std::vector::iterator iter, std::vector &v ); +std::vector::iterator GetNextEnabledPlayerInfoNotDummy ( std::vector::iterator iter, std::vector &v ); +std::vector::iterator GetNextEnabledPlayerNumberInfo ( std::vector::iterator iter, std::vector &v ); +std::vector::iterator GetNextPlayerNumberInfo ( std::vector::iterator iter, std::vector &v ); +std::vector::iterator GetNextVisiblePlayerInfo ( std::vector::iterator iter, std::vector &v ); /** @brief Get each enabled Player's info. */ -#define FOREACH_EnabledPlayerInfo( v, pi ) for( vector::iterator pi = GetNextEnabledPlayerInfo (v.begin(),v); pi != v.end(); pi = GetNextEnabledPlayerInfo(++pi,v) ) +#define FOREACH_EnabledPlayerInfo( v, pi ) for( std::vector::iterator pi = GetNextEnabledPlayerInfo (v.begin(),v); pi != v.end(); pi = GetNextEnabledPlayerInfo(++pi,v) ) /** @brief Get each enabled Player's info as long as it's not a dummy player. */ -#define FOREACH_EnabledPlayerInfoNotDummy( v, pi ) for( vector::iterator pi = GetNextEnabledPlayerInfoNotDummy (v.begin(),v); pi != v.end(); pi = GetNextEnabledPlayerInfoNotDummy(++pi,v) ) +#define FOREACH_EnabledPlayerInfoNotDummy( v, pi ) for( std::vector::iterator pi = GetNextEnabledPlayerInfoNotDummy (v.begin(),v); pi != v.end(); pi = GetNextEnabledPlayerInfoNotDummy(++pi,v) ) /** @brief Get each enabled Player Number's info. */ -#define FOREACH_EnabledPlayerNumberInfo( v, pi ) for( vector::iterator pi = GetNextEnabledPlayerNumberInfo (v.begin(),v); pi != v.end(); pi = GetNextEnabledPlayerNumberInfo(++pi,v) ) +#define FOREACH_EnabledPlayerNumberInfo( v, pi ) for( std::vector::iterator pi = GetNextEnabledPlayerNumberInfo (v.begin(),v); pi != v.end(); pi = GetNextEnabledPlayerNumberInfo(++pi,v) ) /** @brief Get each Player Number's info, regardless of whether it's enabled or not. */ -#define FOREACH_PlayerNumberInfo( v, pi ) for( vector::iterator pi = GetNextPlayerNumberInfo (v.begin(),v); pi != v.end(); pi = GetNextPlayerNumberInfo(++pi,v) ) +#define FOREACH_PlayerNumberInfo( v, pi ) for( std::vector::iterator pi = GetNextPlayerNumberInfo (v.begin(),v); pi != v.end(); pi = GetNextPlayerNumberInfo(++pi,v) ) /** @brief Get each visible Player's info. */ -#define FOREACH_VisiblePlayerInfo( v, pi ) for( vector::iterator pi = GetNextVisiblePlayerInfo (v.begin(),v); pi != v.end(); pi = GetNextVisiblePlayerInfo(++pi,v) ) +#define FOREACH_VisiblePlayerInfo( v, pi ) for( std::vector::iterator pi = GetNextVisiblePlayerInfo (v.begin(),v); pi != v.end(); pi = GetNextVisiblePlayerInfo(++pi,v) ) #endif diff --git a/src/ScreenGameplayLesson.cpp b/src/ScreenGameplayLesson.cpp index b2e337fb89..b21599abb9 100644 --- a/src/ScreenGameplayLesson.cpp +++ b/src/ScreenGameplayLesson.cpp @@ -30,7 +30,7 @@ void ScreenGameplayLesson::Init() // Load pages Song *pSong = GAMESTATE->m_pCurSong; RString sDir = pSong->GetSongDir(); - vector vs; + std::vector vs; GetDirListing( sDir+"Page*", vs, true, true ); m_vPages.resize( vs.size() ); int i = 0; diff --git a/src/ScreenGameplayLesson.h b/src/ScreenGameplayLesson.h index 201667280b..a5ac4a3687 100644 --- a/src/ScreenGameplayLesson.h +++ b/src/ScreenGameplayLesson.h @@ -21,7 +21,7 @@ protected: void ChangeLessonPage( int iDir ); void ResetAndRestartCurrentSong(); - vector m_vPages; + std::vector m_vPages; int m_iCurrentPageIndex; enum Try diff --git a/src/ScreenGameplayNormal.cpp b/src/ScreenGameplayNormal.cpp index 1b508d7c65..9dc1a1e182 100644 --- a/src/ScreenGameplayNormal.cpp +++ b/src/ScreenGameplayNormal.cpp @@ -5,7 +5,7 @@ REGISTER_SCREEN_CLASS( ScreenGameplayNormal ); -void ScreenGameplayNormal::FillPlayerInfo( vector &vPlayerInfoOut ) +void ScreenGameplayNormal::FillPlayerInfo( std::vector &vPlayerInfoOut ) { vPlayerInfoOut.resize( NUM_PLAYERS ); FOREACH_PlayerNumber( p ) diff --git a/src/ScreenGameplayNormal.h b/src/ScreenGameplayNormal.h index 8937db429f..eee494a9b9 100644 --- a/src/ScreenGameplayNormal.h +++ b/src/ScreenGameplayNormal.h @@ -8,7 +8,7 @@ class ScreenGameplayNormal : public ScreenGameplay { public: - virtual void FillPlayerInfo( vector &vPlayerInfoOut ); + virtual void FillPlayerInfo( std::vector &vPlayerInfoOut ); }; diff --git a/src/ScreenGameplayShared.cpp b/src/ScreenGameplayShared.cpp index aab8ab80a5..8c97765ee9 100644 --- a/src/ScreenGameplayShared.cpp +++ b/src/ScreenGameplayShared.cpp @@ -9,7 +9,7 @@ REGISTER_SCREEN_CLASS( ScreenGameplayShared ); -void ScreenGameplayShared::FillPlayerInfo( vector &vPlayerInfoOut ) +void ScreenGameplayShared::FillPlayerInfo( std::vector &vPlayerInfoOut ) { const PlayerNumber master = GAMESTATE->GetMasterPlayerNumber(); const PlayerNumber other = (master == PLAYER_1? PLAYER_2:PLAYER_1); diff --git a/src/ScreenGameplayShared.h b/src/ScreenGameplayShared.h index 3d8eae6a7c..3cf9d255e6 100644 --- a/src/ScreenGameplayShared.h +++ b/src/ScreenGameplayShared.h @@ -6,7 +6,7 @@ class ScreenGameplayShared : public ScreenGameplay { protected: - virtual void FillPlayerInfo( vector &vPlayerInfoOut ); + virtual void FillPlayerInfo( std::vector &vPlayerInfoOut ); virtual PlayerInfo &GetPlayerInfoForInput( const InputEventPlus& iep ); }; diff --git a/src/ScreenGameplaySyncMachine.cpp b/src/ScreenGameplaySyncMachine.cpp index 6b37689559..e9ed7db8e6 100644 --- a/src/ScreenGameplaySyncMachine.cpp +++ b/src/ScreenGameplaySyncMachine.cpp @@ -33,7 +33,7 @@ void ScreenGameplaySyncMachine::Init() GAMESTATE->m_pCurSong.Set( &m_Song ); // Needs proper StepsType -freem - vector vpSteps; + std::vector vpSteps; SongUtil::GetPlayableSteps( &m_Song, vpSteps ); ASSERT_M(vpSteps.size() > 0, "No playable steps for ScreenGameplaySyncMachine"); Steps *pSteps = vpSteps[0]; diff --git a/src/ScreenHighScores.cpp b/src/ScreenHighScores.cpp index eb6d9609f0..5ea4bb39d7 100644 --- a/src/ScreenHighScores.cpp +++ b/src/ScreenHighScores.cpp @@ -21,7 +21,7 @@ LuaXType( HighScoresType ); REGISTER_SCREEN_CLASS( ScreenHighScores ); -static void GetAllSongsToShow( vector &vpOut, int iNumMostRecentScoresToShow ) +static void GetAllSongsToShow( std::vector &vpOut, int iNumMostRecentScoresToShow ) { vpOut.clear(); for (Song *s : SONGMAN->GetAllSongs()) @@ -42,10 +42,10 @@ static void GetAllSongsToShow( vector &vpOut, int iNumMostRecentScoresToS } } -static void GetAllCoursesToShow( vector &vpOut, CourseType ct, int iNumMostRecentScoresToShow ) +static void GetAllCoursesToShow( std::vector &vpOut, CourseType ct, int iNumMostRecentScoresToShow ) { vpOut.clear(); - vector vpCourses; + std::vector vpCourses; if( ct == CourseType_Invalid ) SONGMAN->GetAllCourses( vpCourses, false ); else @@ -75,7 +75,7 @@ ScoreScroller::ScoreScroller() this->DeleteChildrenWhenDone(); } -void ScoreScroller::SetDisplay( const vector &DifficultiesToShow ) +void ScoreScroller::SetDisplay( const std::vector &DifficultiesToShow ) { m_DifficultiesToShow = DifficultiesToShow; ShiftSubActors( INT_MAX ); @@ -161,7 +161,7 @@ void ScoreScroller::ConfigureActor( Actor *pActor, int iItem ) void ScoreScroller::LoadSongs( int iNumRecentScores ) { - vector vpSongs; + std::vector vpSongs; GetAllSongsToShow( vpSongs, iNumRecentScores ); m_vScoreRowItemData.resize( vpSongs.size() ); for( unsigned i=0; i vpCourses; + std::vector vpCourses; GetAllCoursesToShow( vpCourses, ct, iNumRecentScores ); m_vScoreRowItemData.resize( vpCourses.size() ); for( unsigned i=0; i vdast; + std::vector vdast; for( int i=0; i DifficultyAndStepsType; +typedef std::pair DifficultyAndStepsType; enum HighScoresType { @@ -27,13 +27,13 @@ public: void LoadSongs( int iNumRecentScores ); void LoadCourses( CourseType ct, int iNumRecentScores ); void Load( RString sClassName ); - void SetDisplay( const vector &DifficultiesToShow ); + void SetDisplay( const std::vector &DifficultiesToShow ); bool Scroll( int iDir ); void ScrollTop(); protected: virtual void ConfigureActor( Actor *pActor, int iItem ); - vector m_DifficultiesToShow; + std::vector m_DifficultiesToShow; struct ScoreRowItemData // for all_steps and all_courses { @@ -42,7 +42,7 @@ protected: Song *m_pSong; Course *m_pCourse; }; - vector m_vScoreRowItemData; + std::vector m_vScoreRowItemData; ThemeMetric SCROLLER_ITEMS_TO_DRAW; ThemeMetric SCROLLER_SECONDS_PER_ITEM; diff --git a/src/ScreenHowToPlay.cpp b/src/ScreenHowToPlay.cpp index 5e2a7ac1fe..49dd41b390 100644 --- a/src/ScreenHowToPlay.cpp +++ b/src/ScreenHowToPlay.cpp @@ -89,7 +89,7 @@ void ScreenHowToPlay::Init() } // Display a character - vector vpCharacters; + std::vector vpCharacters; CHARMAN->GetCharacters( vpCharacters ); if( (bool)USE_CHARACTER && vpCharacters.size() && HaveAllCharAnimations() ) { diff --git a/src/ScreenInstallOverlay.cpp b/src/ScreenInstallOverlay.cpp index a8b4f0b7c9..3c12ffb59b 100644 --- a/src/ScreenInstallOverlay.cpp +++ b/src/ScreenInstallOverlay.cpp @@ -45,7 +45,7 @@ PlayAfterLaunchInfo DoInstalls( CommandLineActions::CommandLineArgs args ); static void Parse( const RString &sDir, PlayAfterLaunchInfo &out ) { - vector vsDirParts; + std::vector vsDirParts; split( sDir, "/", vsDirParts, true ); if( vsDirParts.size() == 3 && vsDirParts[0].EqualsNoCase("Songs") ) out.sSongDir = "/" + sDir; @@ -61,12 +61,12 @@ static void InstallSmzip( const RString &sZipFile, PlayAfterLaunchInfo &out ) if( !FILEMAN->Mount( "zip", sZipFile, TEMP_ZIP_MOUNT_POINT ) ) FAIL_M("Failed to mount " + sZipFile ); - vector vsFiles; + std::vector vsFiles; { - vector vsRawFiles; + std::vector vsRawFiles; GetDirListingRecursive( TEMP_ZIP_MOUNT_POINT, "*", vsRawFiles); - vector vsPrettyFiles; + std::vector vsPrettyFiles; for (RString const &s : vsRawFiles) { if( GetExtension(s).EqualsNoCase("ctl") ) @@ -188,7 +188,7 @@ void ScreenInstallOverlay::Update( float fDeltaTime ) pSong = SONGMAN->GetSongFromDir( playAfterLaunchInfo.sSongDir ); if( pSong ) { - vector vpStyle; + std::vector vpStyle; GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vpStyle, false ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_bSideIsJoined[0] = true; diff --git a/src/ScreenJukebox.cpp b/src/ScreenJukebox.cpp index 82b6608ae5..2042925b98 100644 --- a/src/ScreenJukebox.cpp +++ b/src/ScreenJukebox.cpp @@ -29,7 +29,7 @@ void ScreenJukebox::SetSong() { ThemeMetric ALLOW_ADVANCED_MODIFIERS(m_sName,"AllowAdvancedModifiers"); - vector vSongs; + std::vector vSongs; /* Check to see if there is a theme course. If there is a course that has * the exact same name as the theme, then we pick a song from this course. */ @@ -47,7 +47,7 @@ void ScreenJukebox::SetSong() // Calculate what difficulties to show - vector vDifficultiesToShow; + std::vector vDifficultiesToShow; if( m_bDemonstration ) { // HACK: This belongs in ScreenDemonstration. @@ -103,10 +103,10 @@ void ScreenJukebox::SetSong() { /* If we have a modifier course containing this song, apply its * modifiers. Only check fixed course entries. */ - vector apCourses; + std::vector apCourses; SONGMAN->GetAllCourses( apCourses, false ); - vector apOptions; - vector apPossibleCourses; + std::vector apOptions; + std::vector apPossibleCourses; for( unsigned j = 0; j < apCourses.size(); ++j ) { Course *lCourse = apCourses[j]; @@ -126,8 +126,8 @@ void ScreenJukebox::SetSong() RString s = a.sModifiers; s.MakeLower(); // todo: allow themers to modify this list? -aj - if( s.find("dark") != string::npos || - s.find("stealth") != string::npos ) + if( s.find("dark") != std::string::npos || + s.find("stealth") != std::string::npos ) { bModsAreOkToShow = false; break; diff --git a/src/ScreenManager.cpp b/src/ScreenManager.cpp index aaa7981c00..c5dabaabaa 100644 --- a/src/ScreenManager.cpp +++ b/src/ScreenManager.cpp @@ -79,7 +79,7 @@ static Preference g_bDelayedScreenLoad( "DelayedScreenLoad", false ); //static Preference g_bPruneFonts( "PruneFonts", true ); // Screen registration -static map *g_pmapRegistrees = nullptr; +static std::map *g_pmapRegistrees = nullptr; /** @brief Utility functions for the ScreenManager. */ namespace ScreenManagerUtil @@ -105,13 +105,13 @@ namespace ScreenManagerUtil Actor *g_pSharedBGA; // BGA object that's persistent between screens RString m_sPreviousTopScreen; - vector g_ScreenStack; // bottommost to topmost - vector g_OverlayScreens; - set g_setGroupedScreens; - set g_setPersistantScreens; + std::vector g_ScreenStack; // bottommost to topmost + std::vector g_OverlayScreens; + std::set g_setGroupedScreens; + std::set g_setPersistantScreens; - vector g_vPreparedScreens; - vector g_vPreparedBackgrounds; + std::vector g_vPreparedScreens; + std::vector g_vPreparedBackgrounds; // Add a screen to g_ScreenStack. This is the only function that adds to g_ScreenStack. void PushLoadedScreen( const LoadedScreen &ls ) @@ -150,7 +150,7 @@ namespace ScreenManagerUtil * return it in ls. */ bool GetPreppedScreen( const RString &sScreenName, LoadedScreen &ls ) { - for (vector::iterator s = g_vPreparedScreens.begin(); s != g_vPreparedScreens.end(); ++s) + for (std::vector::iterator s = g_vPreparedScreens.begin(); s != g_vPreparedScreens.end(); ++s) { if( s->m_pScreen->GetName() == sScreenName ) { @@ -185,7 +185,7 @@ namespace ScreenManagerUtil * us (this excludes screens where m_bDeleteWhenDone is false). * Clear the prepared lists. The contents of apOut must be * freed by the caller. */ - void GrabPreparedActors( vector &apOut ) + void GrabPreparedActors( std::vector &apOut ) { for (LoadedScreen const &s : g_vPreparedScreens) if( s.m_bDeleteWhenDone ) @@ -203,7 +203,7 @@ namespace ScreenManagerUtil * reset the screen group and list of persistant screens. */ void DeletePreparedScreens() { - vector apActorsToDelete; + std::vector apActorsToDelete; GrabPreparedActors( apActorsToDelete ); BeforeDeleteScreen(); @@ -219,9 +219,9 @@ using namespace ScreenManagerUtil; RegisterScreenClass::RegisterScreenClass( const RString& sClassName, CreateScreenFn pfn ) { if( g_pmapRegistrees == nullptr ) - g_pmapRegistrees = new map; + g_pmapRegistrees = new std::map; - map::iterator iter = g_pmapRegistrees->find( sClassName ); + std::map::iterator iter = g_pmapRegistrees->find( sClassName ); ASSERT_M( iter == g_pmapRegistrees->end(), ssprintf("Screen class '%s' already registered.", sClassName.c_str()) ); (*g_pmapRegistrees)[sClassName] = pfn; @@ -301,7 +301,7 @@ void ScreenManager::ReloadOverlayScreens() // reload overlay screens RString sOverlays = THEME->GetMetric( "Common","OverlayScreens" ); - vector asOverlays; + std::vector asOverlays; split( sOverlays, ",", asOverlays ); for( unsigned i=0; iGetMetric( sScreenName,"Class" ); - map::iterator iter = g_pmapRegistrees->find( sClassName ); + std::map::iterator iter = g_pmapRegistrees->find( sClassName ); if( iter == g_pmapRegistrees->end() ) { LuaHelpers::ReportScriptErrorFmt("Screen \"%s\" has an invalid class \"%s\".", sScreenName.c_str(), sClassName.c_str()); @@ -685,7 +685,7 @@ bool ScreenManager::ActivatePreparedScreenAndBackground( const RString &sScreenN } else { - for (vector::iterator a = g_vPreparedBackgrounds.begin(); a != g_vPreparedBackgrounds.end(); ++a) + for (std::vector::iterator a = g_vPreparedBackgrounds.begin(); a != g_vPreparedBackgrounds.end(); ++a) { if( (*a)->GetName() == sNewBGA ) { @@ -734,7 +734,7 @@ void ScreenManager::LoadDelayedScreen() * cleanup, so it doesn't get deleted by cleanup. */ bool bLoaded = ActivatePreparedScreenAndBackground( sScreenName ); - vector apActorsToDelete; + std::vector apActorsToDelete; if( g_setGroupedScreens.find(sScreenName) == g_setGroupedScreens.end() ) { /* It's time to delete all old prepared screens. Depending on diff --git a/src/ScreenMapControllers.cpp b/src/ScreenMapControllers.cpp index 5b9889b7d8..a7609059a2 100644 --- a/src/ScreenMapControllers.cpp +++ b/src/ScreenMapControllers.cpp @@ -73,7 +73,7 @@ void ScreenMapControllers::Init() else { /* Map the specified buttons. */ - vector asBits; + std::vector asBits; split( sButtons, ",", asBits ); for( unsigned i=0; i::iterator found= m_SetList.find(to_add); + std::set::iterator found= m_SetList.find(to_add); if(found == m_SetList.end()) { m_SetList.insert(to_add); @@ -622,7 +622,7 @@ void ScreenMapControllers::Refresh() } m_LineScroller.SetDestinationItem( - static_cast(min(m_CurButton, m_MaxDestItem))); + static_cast(std::min(m_CurButton, m_MaxDestItem))); } void ScreenMapControllers::DismissWarning() @@ -791,7 +791,7 @@ void ScreenMapControllers::ExitAction() bool ScreenMapControllers::SanityCheckWrapper() { - vector reasons_not_sane; + std::vector reasons_not_sane; INPUTMAPPER->SanityCheckMappings(reasons_not_sane); if(reasons_not_sane.empty()) { diff --git a/src/ScreenMapControllers.h b/src/ScreenMapControllers.h index 7f6600bbaf..e9dda46ab0 100644 --- a/src/ScreenMapControllers.h +++ b/src/ScreenMapControllers.h @@ -58,7 +58,7 @@ private: // owned by m_Line BitmapText *m_textMappedTo[NUM_GameController][NUM_SHOWN_GAME_TO_DEVICE_SLOTS]; }; - vector m_KeysToMap; + std::vector m_KeysToMap; BitmapText m_textDevices; @@ -95,8 +95,8 @@ private: return m_slot < rhs.m_slot; } }; - set m_SetList; - set::iterator m_SetListCurrent; + std::set m_SetList; + std::set::iterator m_SetListCurrent; bool m_InSetListMode; typedef void (ScreenMapControllers::* action_fun_t)(); @@ -116,9 +116,9 @@ private: void ExitAction(); bool SanityCheckWrapper(); - vector m_Actions; + std::vector m_Actions; - vector m_Line; + std::vector m_Line; ActorScroller m_LineScroller; RageSound m_soundChange; diff --git a/src/ScreenMessage.cpp b/src/ScreenMessage.cpp index c8b81f4d4b..700284365d 100644 --- a/src/ScreenMessage.cpp +++ b/src/ScreenMessage.cpp @@ -17,12 +17,12 @@ AutoScreenMessage(SM_Pause); AutoScreenMessage(SM_Success); AutoScreenMessage(SM_Failure); -static map *m_pScreenMessages; +static std::map *m_pScreenMessages; ScreenMessage ScreenMessageHelpers::ToScreenMessage( const RString &sName ) { if( m_pScreenMessages == nullptr ) - m_pScreenMessages = new map; + m_pScreenMessages = new std::map; if( m_pScreenMessages->find( sName ) == m_pScreenMessages->end() ) (*m_pScreenMessages)[sName] = (ScreenMessage)sName; diff --git a/src/ScreenMiniMenu.cpp b/src/ScreenMiniMenu.cpp index d7102786dc..5828c9a068 100644 --- a/src/ScreenMiniMenu.cpp +++ b/src/ScreenMiniMenu.cpp @@ -18,7 +18,7 @@ AutoScreenMessage( SM_GoToCancel ); bool ScreenMiniMenu::s_bCancelled = false; int ScreenMiniMenu::s_iLastRowCode = -1; -vector ScreenMiniMenu::s_viLastAnswers; +std::vector ScreenMiniMenu::s_viLastAnswers; // Hooks for profiling void PrepareToLoadScreen( const RString &sScreenName ) {} @@ -79,8 +79,8 @@ void ScreenMiniMenu::LoadMenu( const MenuDef* pDef ) m_vMenuRows = pDef->rows; s_viLastAnswers.resize( m_vMenuRows.size() ); - // Convert from m_vMenuRows to vector - vector vHands; + // Convert from m_vMenuRows to std::vector + std::vector vHands; for( unsigned r=0; r vpns; + std::vector vpns; FOREACH_PlayerNumber( p ) vpns.push_back( p ); for( unsigned i=0; i &vpns ) +void ScreenMiniMenu::ImportOptions( int r, const std::vector &vpns ) { OptionRow &optrow = *m_pRows[r]; const MenuRowDef &mr = m_vMenuRows[r]; @@ -124,7 +124,7 @@ void ScreenMiniMenu::ImportOptions( int r, const vector &vpns ) optrow.SetOneSharedSelection( mr.iDefaultChoice ); } -void ScreenMiniMenu::ExportOptions( int r, const vector &vpns ) +void ScreenMiniMenu::ExportOptions( int r, const std::vector &vpns ) { if( r == GetCurrentRow() ) s_iLastRowCode = m_vMenuRows[r].iRowCode; diff --git a/src/ScreenMiniMenu.h b/src/ScreenMiniMenu.h index 9de080364b..a8fa5b31bf 100644 --- a/src/ScreenMiniMenu.h +++ b/src/ScreenMiniMenu.h @@ -16,7 +16,7 @@ struct MenuRowDef MenuRowUpdateEnabled pfnEnabled; // if ! nullptr, used instead of bEnabled EditMode emShowIn; int iDefaultChoice; - vector choices; + std::vector choices; bool bThemeTitle; bool bThemeItems; @@ -52,7 +52,7 @@ struct MenuRowDef } MenuRowDef(int r, RString n, bool e, EditMode s, - bool bTT, bool bTI, int d, vector options): + bool bTT, bool bTI, int d, std::vector options): iRowCode(r), sName(n), bEnabled(e), pfnEnabled(nullptr), emShowIn(s), iDefaultChoice(d), choices(), bThemeTitle(bTT), bThemeItems(bTI) @@ -126,7 +126,7 @@ struct MenuRowDef struct MenuDef { RString sClassName; - vector rows; + std::vector rows; MenuDef( RString c, MenuRowDef r0=MenuRowDef(), MenuRowDef r1=MenuRowDef(), MenuRowDef r2=MenuRowDef(), @@ -169,8 +169,8 @@ public: protected: virtual void AfterChangeValueOrRow( PlayerNumber pn ); - virtual void ImportOptions( int iRow, const vector &vpns ); - virtual void ExportOptions( int iRow, const vector &vpns ); + virtual void ImportOptions( int iRow, const std::vector &vpns ); + virtual void ExportOptions( int iRow, const std::vector &vpns ); virtual bool FocusedItemEndsScreen( PlayerNumber pn ) const; @@ -179,14 +179,14 @@ protected: ScreenMessage m_SMSendOnOK; ScreenMessage m_SMSendOnCancel; - vector m_vMenuRows; + std::vector m_vMenuRows; public: ScreenMiniMenu(): m_SMSendOnOK(), m_SMSendOnCancel(), m_vMenuRows() {} static bool s_bCancelled; static int s_iLastRowCode; - static vector s_viLastAnswers; + static std::vector s_viLastAnswers; }; #endif diff --git a/src/ScreenNameEntry.cpp b/src/ScreenNameEntry.cpp index cd39ab7473..978f492dd8 100644 --- a/src/ScreenNameEntry.cpp +++ b/src/ScreenNameEntry.cpp @@ -50,7 +50,7 @@ static int g_iNumCharsToDrawBehind; static int g_iNumCharsToDrawTotal; static float g_fFakeBeatsPerSec; -void ScreenNameEntry::ScrollingText::Init( const RString &sName, const vector &xs ) +void ScreenNameEntry::ScrollingText::Init( const RString &sName, const std::vector &xs ) { SetName( sName ); m_Xs = xs; @@ -192,7 +192,7 @@ void ScreenNameEntry::Init() SO_GROUP_CALL( GAMESTATE->m_SongOptions, ModsLevel_Stage, Init ); } - vector aFeats[NUM_PLAYERS]; + std::vector aFeats[NUM_PLAYERS]; // Find out if players deserve to enter their name FOREACH_PlayerNumber( p ) @@ -259,10 +259,10 @@ void ScreenNameEntry::Init() } const Style* pStyle = GAMESTATE->GetCurrentStyle(p); - const int iMaxCols = min( int(ABS_MAX_RANKING_NAME_LENGTH), pStyle->m_iColsPerPlayer ); + const int iMaxCols = std::min( int(ABS_MAX_RANKING_NAME_LENGTH), pStyle->m_iColsPerPlayer ); m_ColToStringIndex[p].insert(m_ColToStringIndex[p].begin(), pStyle->m_iColsPerPlayer, -1); int CurrentStringIndex = 0; - vector xs; + std::vector xs; for( int iCol=0; iCol gi; + std::vector gi; GAMESTATE->GetCurrentStyle(p)->StyleInputToGameInput( iCol, p, gi ); bool gi_is_start= false; for(size_t i= 0; i < gi.size(); ++i) diff --git a/src/ScreenNameEntry.h b/src/ScreenNameEntry.h index 53ef34a102..a4056eb628 100644 --- a/src/ScreenNameEntry.h +++ b/src/ScreenNameEntry.h @@ -23,7 +23,7 @@ private: public: ScrollingText() : m_bDone(true) { } inline void SetDone() { m_bDone = true; } - void Init( const RString &sName, const vector &xs ); + void Init( const RString &sName, const std::vector &xs ); virtual bool EarlyAbortDraw() const { return m_bDone; } virtual void DrawPrimitives(); char GetClosestChar( float fFakeBeat ) const; @@ -31,7 +31,7 @@ private: private: float GetClosestCharYOffset( float fFakeBeat ) const; - vector m_Xs; + std::vector m_Xs; bool m_bDone; BitmapText m_Stamp; static RString g_sNameChars; @@ -50,7 +50,7 @@ private: bool m_bStillEnteringName[NUM_PLAYERS]; ScrollingText m_Text[NUM_PLAYERS]; - vector m_ColToStringIndex[NUM_PLAYERS]; + std::vector m_ColToStringIndex[NUM_PLAYERS]; }; #endif diff --git a/src/ScreenNameEntryTraditional.cpp b/src/ScreenNameEntryTraditional.cpp index 7547804337..f39e631c2d 100644 --- a/src/ScreenNameEntryTraditional.cpp +++ b/src/ScreenNameEntryTraditional.cpp @@ -28,7 +28,7 @@ void ScreenNameEntryTraditional::Init() for( int z = 0; z < 3; ++z ) { StageStats ss; - const vector &apSongs = SONGMAN->GetAllSongs(); + const std::vector &apSongs = SONGMAN->GetAllSongs(); ss.m_vpPlayedSongs.push_back( apSongs[rand()%apSongs.size()] ); ss.m_vpPossibleSongs = ss.m_vpPlayedSongs; ss.m_playMode = GAMESTATE->m_PlayMode; @@ -77,7 +77,7 @@ void ScreenNameEntryTraditional::BeginScreen() /* Find out if players are entering their name. */ FOREACH_PlayerNumber( pn ) { - vector aFeats; + std::vector aFeats; GAMESTATE->GetRankingFeats( pn, aFeats ); bool bNoStagesLeft = GAMESTATE->m_iPlayerStageTokens[pn] <= 0; @@ -184,7 +184,7 @@ bool ScreenNameEntryTraditional::Finish( PlayerNumber pn ) void ScreenNameEntryTraditional::UpdateSelectionText( PlayerNumber pn ) { - wstring sText = m_sSelection[pn]; + std::wstring sText = m_sSelection[pn]; if( !m_bFinalized[pn] && (int) sText.size() < MAX_RANKING_NAME_LENGTH ) sText += L"_"; diff --git a/src/ScreenNameEntryTraditional.h b/src/ScreenNameEntryTraditional.h index 526543ea34..3cf65b03a2 100644 --- a/src/ScreenNameEntryTraditional.h +++ b/src/ScreenNameEntryTraditional.h @@ -29,7 +29,7 @@ public: /** @brief How long can the name be for ranking purposes? */ ThemeMetric MAX_RANKING_NAME_LENGTH; - wstring m_sSelection[NUM_PLAYERS]; + std::wstring m_sSelection[NUM_PLAYERS]; bool m_bEnteringName[NUM_PLAYERS]; bool m_bFinalized[NUM_PLAYERS]; }; diff --git a/src/ScreenOptions.cpp b/src/ScreenOptions.cpp index 6baa43c04a..7eea338622 100644 --- a/src/ScreenOptions.cpp +++ b/src/ScreenOptions.cpp @@ -199,7 +199,7 @@ void ScreenOptions::Init() m_OptionRowTypeExit.Load( OPTION_ROW_EXIT_METRICS_GROUP, this ); } -void ScreenOptions::InitMenu( const vector &vHands ) +void ScreenOptions::InitMenu( const std::vector &vHands ) { LOG->Trace( "ScreenOptions::InitMenu()" ); @@ -255,7 +255,7 @@ void ScreenOptions::InitMenu( const vector &vHands ) void ScreenOptions::RestartOptions() { m_exprRowPositionTransformFunction.ClearCache(); - vector vpns; + std::vector vpns; FOREACH_HumanPlayer( p ) vpns.push_back( p ); @@ -564,7 +564,7 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM ) } else if( SM == SM_ExportOptions ) { - vector vpns; + std::vector vpns; FOREACH_HumanPlayer( p ) vpns.push_back( p ); for( unsigned r=0; rIsHumanPlayer(PLAYER_1)? m_iCurrentRow[PLAYER_1]: m_iCurrentRow[PLAYER_2]; int P2Choice = GAMESTATE->IsHumanPlayer(PLAYER_2)? m_iCurrentRow[PLAYER_2]: m_iCurrentRow[PLAYER_1]; - vector Rows( m_pRows ); + std::vector Rows( m_pRows ); OptionRow *pSeparateExitRow = nullptr; if( (bool)SEPARATE_EXIT_ROW && !Rows.empty() && Rows.back()->GetRowType() == OptionRow::RowType_Exit ) @@ -612,30 +612,30 @@ void ScreenOptions::PositionRows( bool bTween ) if( m_InputMode == INPUTMODE_SHARE_CURSOR || !BothPlayersActivated ) { // Simply center the cursor. - first_start = max( P1Choice - halfsize, 0 ); + first_start = std::max( P1Choice - halfsize, 0 ); first_end = first_start + total; second_start = second_end = first_end; } else { // First half: - const int earliest = min( P1Choice, P2Choice ); - first_start = max( earliest - halfsize/2, 0 ); + const int earliest = std::min( P1Choice, P2Choice ); + first_start = std::max( earliest - halfsize/2, 0 ); first_end = first_start + halfsize; // Second half: - const int latest = max( P1Choice, P2Choice ); + const int latest = std::max( P1Choice, P2Choice ); - second_start = max( latest - halfsize/2, 0 ); + second_start = std::max( latest - halfsize/2, 0 ); // Don't overlap. - second_start = max( second_start, first_end ); + second_start = std::max( second_start, first_end ); second_end = second_start + halfsize; } - first_end = min( first_end, (int) Rows.size() ); - second_end = min( second_end, (int) Rows.size() ); + first_end = std::min( first_end, (int) Rows.size() ); + second_end = std::min( second_end, (int) Rows.size() ); /* If less than total (and Rows.size()) are displayed, fill in the empty * space intelligently. */ @@ -678,7 +678,7 @@ void ScreenOptions::PositionRows( bool bTween ) else if( i >= first_end && i < second_start ) fPos = ((int)NUM_ROWS_SHOWN)/2-0.5f; else if( i >= second_end ) fPos = ((int)NUM_ROWS_SHOWN)-0.5f; - Actor::TweenState tsDestination = m_exprRowPositionTransformFunction.GetTransformCached( fPos, i, min( (int)Rows.size(), (int)NUM_ROWS_SHOWN ) ); + Actor::TweenState tsDestination = m_exprRowPositionTransformFunction.GetTransformCached( fPos, i, std::min( (int)Rows.size(), (int)NUM_ROWS_SHOWN ) ); bool bHidden = i < first_start || @@ -855,7 +855,7 @@ void ScreenOptions::ProcessMenuStart( const InputEventPlus &input ) * something. Apply it now, and don't go to the next screen. */ if( !FocusedItemEndsScreen(input.pn) ) { - vector vpns; + std::vector vpns; vpns.push_back( input.pn ); ExportOptions( iCurRow, vpns ); return; @@ -1144,7 +1144,7 @@ void ScreenOptions::ChangeValueInRowRelative( int iRow, PlayerNumber pn, int iDe if( row.GetRowDef().m_bExportOnChange ) { - vector vpns; + std::vector vpns; FOREACH_HumanPlayer( p ) vpns.push_back( p ); ExportOptions( iRow, vpns ); diff --git a/src/ScreenOptions.h b/src/ScreenOptions.h index ca4e632af2..93131cc588 100644 --- a/src/ScreenOptions.h +++ b/src/ScreenOptions.h @@ -37,7 +37,7 @@ public: ScreenOptions(); virtual void Init(); virtual void BeginScreen(); - void InitMenu( const vector &vHands ); + void InitMenu( const std::vector &vHands ); virtual ~ScreenOptions(); virtual void Update( float fDeltaTime ); virtual bool Input( const InputEventPlus &input ); @@ -51,8 +51,8 @@ public: friend class LunaScreenOptions; protected: - virtual void ImportOptions( int iRow, const vector &vpns ) = 0; - virtual void ExportOptions( int iRow, const vector &vpns ) = 0; + virtual void ImportOptions( int iRow, const std::vector &vpns ) = 0; + virtual void ExportOptions( int iRow, const std::vector &vpns ) = 0; void RestartOptions(); void GetWidthXY( PlayerNumber pn, int iRow, int iChoiceOnRow, @@ -106,7 +106,7 @@ protected: // derived classes need access to these void SetInputMode( InputMode im ) { m_InputMode = im; } /** @brief Map menu lines to m_OptionRow entries. */ - vector m_pRows; + std::vector m_pRows; /** @brief The current row each player is on. */ int m_iCurrentRow[NUM_PLAYERS]; diff --git a/src/ScreenOptionsCourseOverview.cpp b/src/ScreenOptionsCourseOverview.cpp index 9c19669924..204f8dcdaa 100644 --- a/src/ScreenOptionsCourseOverview.cpp +++ b/src/ScreenOptionsCourseOverview.cpp @@ -75,7 +75,7 @@ void ScreenOptionsCourseOverview::Init() void ScreenOptionsCourseOverview::BeginScreen() { - vector vHands; + std::vector vHands; FOREACH_ENUM( CourseOverviewRow, rowIndex ) { const MenuRowDef &mr = g_MenuRows[rowIndex]; @@ -96,12 +96,12 @@ ScreenOptionsCourseOverview::~ScreenOptionsCourseOverview() } -void ScreenOptionsCourseOverview::ImportOptions( int iRow, const vector &vpns ) +void ScreenOptionsCourseOverview::ImportOptions( int iRow, const std::vector &vpns ) { //OptionRow &row = *m_pRows[iRow]; } -void ScreenOptionsCourseOverview::ExportOptions( int iRow, const vector &vpns ) +void ScreenOptionsCourseOverview::ExportOptions( int iRow, const std::vector &vpns ) { OptionRow &row = *m_pRows[iRow]; int iIndex = row.GetOneSharedSelection( true ); diff --git a/src/ScreenOptionsCourseOverview.h b/src/ScreenOptionsCourseOverview.h index 47b8e960eb..534f8d7e76 100644 --- a/src/ScreenOptionsCourseOverview.h +++ b/src/ScreenOptionsCourseOverview.h @@ -13,8 +13,8 @@ public: protected: private: - virtual void ImportOptions( int row, const vector &vpns ); - virtual void ExportOptions( int row, const vector &vpns ); + virtual void ImportOptions( int row, const std::vector &vpns ); + virtual void ExportOptions( int row, const std::vector &vpns ); virtual void HandleScreenMessage( const ScreenMessage SM ); virtual void AfterChangeValueInRow( int iRow, PlayerNumber pn ); diff --git a/src/ScreenOptionsEditCourse.cpp b/src/ScreenOptionsEditCourse.cpp index ee1953283e..3cefda31ae 100644 --- a/src/ScreenOptionsEditCourse.cpp +++ b/src/ScreenOptionsEditCourse.cpp @@ -14,7 +14,7 @@ #include "Style.h" #include "Steps.h" -static void GetStepsForSong( Song *pSong, vector &vpStepsOut ) +static void GetStepsForSong( Song *pSong, std::vector &vpStepsOut ) { SongUtil::GetSteps( pSong, vpStepsOut, GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType ); // xxx: If the StepsType isn't valid for the current game, this will cause @@ -63,7 +63,7 @@ public: return RELOAD_CHANGED_ALL; } - virtual void ImportOption( OptionRow *pRow, const vector &vpns, vector vbSelectedOut[NUM_PLAYERS] ) const + virtual void ImportOption( OptionRow *pRow, const std::vector &vpns, std::vector vbSelectedOut[NUM_PLAYERS] ) const { Trail *pTrail = GAMESTATE->m_pCurTrail[PLAYER_1]; Steps *pSteps; @@ -73,7 +73,7 @@ public: pSteps = pTrail->m_vEntries[ m_iEntryIndex ].pSteps; } - vector::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), pSteps ); + std::vector::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), pSteps ); if( iter == m_vpSteps.end() ) { pRow->SetOneSharedSelection( 0 ); @@ -85,7 +85,7 @@ public: } } - virtual int ExportOption( const vector &vpns, const vector vbSelected[NUM_PLAYERS] ) const + virtual int ExportOption( const std::vector &vpns, const std::vector vbSelected[NUM_PLAYERS] ) const { return 0; } @@ -96,7 +96,7 @@ public: protected: int m_iEntryIndex; - vector m_vpSteps; + std::vector m_vpSteps; }; @@ -169,7 +169,7 @@ static RString MakeMinutesString( int mins ) void ScreenOptionsEditCourse::BeginScreen() { - vector vHands; + std::vector vHands; FOREACH_ENUM( EditCourseRow, rowIndex ) { @@ -252,7 +252,7 @@ ScreenOptionsEditCourse::~ScreenOptionsEditCourse() } -void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector &vpns ) +void ScreenOptionsEditCourse::ImportOptions( int iRow, const std::vector &vpns ) { OptionRow &row = *m_pRows[iRow]; if( row.GetRowType() == OptionRow::RowType_Exit ) @@ -278,7 +278,7 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vectorm_pCurCourse->m_vEntries.size() ) pSong = GAMESTATE->m_pCurCourse->m_vEntries[iEntryIndex].songID.ToSong(); - vector::iterator iter = find( m_vpSongs.begin(), m_vpSongs.end(), pSong ); + std::vector::iterator iter = find( m_vpSongs.begin(), m_vpSongs.end(), pSong ); if( iter == m_vpSongs.end() ) row.SetOneSharedSelection( 0 ); else @@ -294,7 +294,7 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector &vpns ) +void ScreenOptionsEditCourse::ExportOptions( int iRow, const std::vector &vpns ) { FOREACH_ENUM( EditCourseRow, i ) { @@ -439,7 +439,7 @@ Steps *ScreenOptionsEditCourse::GetStepsForEntry( int iEntryIndex ) OptionRow &row = *m_pRows[iRow]; int index = row.GetOneSharedSelection(); Song *pSong = GetSongForEntry( iEntryIndex ); - vector vpSteps; + std::vector vpSteps; GetStepsForSong( pSong, vpSteps ); return vpSteps[index]; } diff --git a/src/ScreenOptionsEditCourse.h b/src/ScreenOptionsEditCourse.h index cd21e23fe4..98f5e0c43e 100644 --- a/src/ScreenOptionsEditCourse.h +++ b/src/ScreenOptionsEditCourse.h @@ -15,8 +15,8 @@ public: protected: private: - virtual void ImportOptions( int row, const vector &vpns ); - virtual void ExportOptions( int row, const vector &vpns ); + virtual void ImportOptions( int row, const std::vector &vpns ); + virtual void ExportOptions( int row, const std::vector &vpns ); virtual void GoToNextScreen(); virtual void GoToPrevScreen(); @@ -31,7 +31,7 @@ private: Song *GetSongForEntry( int iEntryIndex ); Steps *GetStepsForEntry( int iEntryIndex ); - vector m_vpSongs; + std::vector m_vpSongs; }; #endif diff --git a/src/ScreenOptionsEditProfile.cpp b/src/ScreenOptionsEditProfile.cpp index 178a28edc6..b6969ef8ec 100644 --- a/src/ScreenOptionsEditProfile.cpp +++ b/src/ScreenOptionsEditProfile.cpp @@ -27,7 +27,7 @@ void ScreenOptionsEditProfile::BeginScreen() { m_Original = *GAMESTATE->GetEditLocalProfile(); - vector vHands; + std::vector vHands; Profile *pProfile = PROFILEMAN->GetLocalProfile( GAMESTATE->m_sEditLocalProfileID ); ASSERT( pProfile != nullptr ); @@ -43,7 +43,7 @@ void ScreenOptionsEditProfile::BeginScreen() def.m_bExportOnChange = true; def.m_sName = "Character"; def.m_vsChoices.clear(); - vector vpCharacters; + std::vector vpCharacters; CHARMAN->GetCharacters( vpCharacters ); for (Character const *c : vpCharacters) def.m_vsChoices.push_back( c->GetDisplayName() ); @@ -61,7 +61,7 @@ ScreenOptionsEditProfile::~ScreenOptionsEditProfile() } -void ScreenOptionsEditProfile::ImportOptions( int iRow, const vector &vpns ) +void ScreenOptionsEditProfile::ImportOptions( int iRow, const std::vector &vpns ) { Profile *pProfile = PROFILEMAN->GetLocalProfile( GAMESTATE->m_sEditLocalProfileID ); ASSERT( pProfile != nullptr ); @@ -75,7 +75,7 @@ void ScreenOptionsEditProfile::ImportOptions( int iRow, const vector &vpns ) +void ScreenOptionsEditProfile::ExportOptions( int iRow, const std::vector &vpns ) { Profile *pProfile = PROFILEMAN->GetLocalProfile( GAMESTATE->m_sEditLocalProfileID ); ASSERT( pProfile != nullptr ); diff --git a/src/ScreenOptionsEditProfile.h b/src/ScreenOptionsEditProfile.h index 551a2960d4..8d49b19de7 100644 --- a/src/ScreenOptionsEditProfile.h +++ b/src/ScreenOptionsEditProfile.h @@ -14,8 +14,8 @@ public: protected: private: - virtual void ImportOptions( int row, const vector &vpns ); - virtual void ExportOptions( int row, const vector &vpns ); + virtual void ImportOptions( int row, const std::vector &vpns ); + virtual void ExportOptions( int row, const std::vector &vpns ); virtual void GoToNextScreen(); virtual void GoToPrevScreen(); diff --git a/src/ScreenOptionsExportPackage.cpp b/src/ScreenOptionsExportPackage.cpp index 202c66add6..f2c5747347 100644 --- a/src/ScreenOptionsExportPackage.cpp +++ b/src/ScreenOptionsExportPackage.cpp @@ -34,7 +34,7 @@ void ScreenOptionsExportPackage::BeginScreen() m_vsPackageTypes.push_back("Songs"); // announcers, characters, others? - vector OptionRowHandlers; + std::vector OptionRowHandlers; for (RString const &s : m_vsPackageTypes) { OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull(); @@ -80,12 +80,12 @@ void ScreenOptionsExportPackage::ProcessMenuStart( const InputEventPlus &input ) // todo: process menu back in SubGroup mode -void ScreenOptionsExportPackage::ImportOptions( int /* iRow */, const vector & /* vpns */ ) +void ScreenOptionsExportPackage::ImportOptions( int /* iRow */, const std::vector & /* vpns */ ) { } -void ScreenOptionsExportPackage::ExportOptions( int /* iRow */, const vector & /* vpns */ ) +void ScreenOptionsExportPackage::ExportOptions( int /* iRow */, const std::vector & /* vpns */ ) { } @@ -115,7 +115,7 @@ void ScreenOptionsExportPackageSubPage::BeginScreen() else if( *s_packageType == "NoteSkins" ) { // add noteskins - vector vs; + std::vector vs; GetDirListing( SpecialFiles::NOTESKINS_DIR + "*", vs, true, true ); for (RString const &s : vs) GetDirListing( s + "*", m_vsPossibleDirsToExport, true, true ); @@ -124,7 +124,7 @@ void ScreenOptionsExportPackageSubPage::BeginScreen() { // Add courses. Only support courses that are in a group folder. // Support for courses not in a group folder should be phased out. - vector vs; + std::vector vs; GetDirListing( SpecialFiles::COURSES_DIR + "*", vs, true, true ); StripCvsAndSvn( vs ); StripMacResourceForks( vs ); @@ -137,7 +137,7 @@ void ScreenOptionsExportPackageSubPage::BeginScreen() else if( *s_packageType == "Songs" ) { // Add song groups - vector asAllGroups; + std::vector asAllGroups; SONGMAN->GetSongGroupNames(asAllGroups); for (RString const &s : asAllGroups) { @@ -147,7 +147,7 @@ void ScreenOptionsExportPackageSubPage::BeginScreen() else if( *s_packageType == "SubGroup" ) { //ExportPackages::m_sFolder - vector vs; + std::vector vs; GetDirListing( SpecialFiles::SONGS_DIR + "/" + ExportPackages::m_sFolder + "/*", vs, true, true ); for (RString const &s : vs) { @@ -158,7 +158,7 @@ void ScreenOptionsExportPackageSubPage::BeginScreen() StripCvsAndSvn( m_vsPossibleDirsToExport ); StripMacResourceForks( m_vsPossibleDirsToExport ); - vector OptionRowHandlers; + std::vector OptionRowHandlers; for (RString const &s : m_vsPossibleDirsToExport) { OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull(); @@ -209,7 +209,7 @@ static bool ExportPackage( RString sPackageName, RString sDirToExport, RString & zip.Start(); zip.SetGlobalComment( sComment ); - vector vs; + std::vector vs; GetDirListingRecursive( sDirToExport, "*", vs ); SMPackageUtil::StripIgnoredSmzipFiles( vs ); LOG->Trace("Adding files..."); @@ -267,12 +267,12 @@ void ScreenOptionsExportPackageSubPage::ProcessMenuStart( const InputEventPlus & ScreenPrompt::Prompt( SM_None, ssprintf("Failed to export package: %s",sError.c_str()) ); } -void ScreenOptionsExportPackageSubPage::ImportOptions( int iRow, const vector &vpns ) +void ScreenOptionsExportPackageSubPage::ImportOptions( int iRow, const std::vector &vpns ) { } -void ScreenOptionsExportPackageSubPage::ExportOptions( int iRow, const vector &vpns ) +void ScreenOptionsExportPackageSubPage::ExportOptions( int iRow, const std::vector &vpns ) { } diff --git a/src/ScreenOptionsExportPackage.h b/src/ScreenOptionsExportPackage.h index 80e6c1059c..0fadaddcae 100644 --- a/src/ScreenOptionsExportPackage.h +++ b/src/ScreenOptionsExportPackage.h @@ -21,12 +21,12 @@ public: virtual void BeginScreen(); protected: - virtual void ImportOptions( int iRow, const vector &vpns ); - virtual void ExportOptions( int iRow, const vector &vpns ); + virtual void ImportOptions( int iRow, const std::vector &vpns ); + virtual void ExportOptions( int iRow, const std::vector &vpns ); virtual void ProcessMenuStart( const InputEventPlus &input ); - vector m_vsPackageTypes; + std::vector m_vsPackageTypes; }; class ScreenOptionsExportPackageSubPage : public ScreenOptions @@ -36,12 +36,12 @@ public: virtual void BeginScreen(); protected: - virtual void ImportOptions( int iRow, const vector &vpns ); - virtual void ExportOptions( int iRow, const vector &vpns ); + virtual void ImportOptions( int iRow, const std::vector &vpns ); + virtual void ExportOptions( int iRow, const std::vector &vpns ); virtual void ProcessMenuStart( const InputEventPlus &input ); - vector m_vsPossibleDirsToExport; + std::vector m_vsPossibleDirsToExport; }; #endif diff --git a/src/ScreenOptionsManageCourses.cpp b/src/ScreenOptionsManageCourses.cpp index 88068cf7e0..269477b12c 100644 --- a/src/ScreenOptionsManageCourses.cpp +++ b/src/ScreenOptionsManageCourses.cpp @@ -40,7 +40,7 @@ inline bool operator!=(StepsTypeAndDifficulty const &lhs, StepsTypeAndDifficulty static void SetNextCombination() { - vector v; + std::vector v; { for (StepsType const &st : CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue()) { @@ -50,7 +50,7 @@ static void SetNextCombination() } StepsTypeAndDifficulty curVal( GAMESTATE->m_stEdit, GAMESTATE->m_cdEdit ); - vector::const_iterator iter = find( v.begin(), v.end(), curVal ); + std::vector::const_iterator iter = find( v.begin(), v.end(), curVal ); if( iter == v.end() || ++iter == v.end() ) iter = v.begin(); @@ -76,7 +76,7 @@ void ScreenOptionsManageCourses::Init() void ScreenOptionsManageCourses::BeginScreen() { - vector vpStyles; + std::vector vpStyles; GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vpStyles ); const Style *pStyle = vpStyles[0]; GAMESTATE->SetCurrentStyle( pStyle, PLAYER_INVALID ); @@ -92,7 +92,7 @@ void ScreenOptionsManageCourses::BeginScreen() CourseID cidLast; cidLast.FromCourse( GAMESTATE->m_pCurCourse ); - vector vHands; + std::vector vHands; int iIndex = 0; @@ -148,7 +148,7 @@ void ScreenOptionsManageCourses::BeginScreen() if( GAMESTATE->m_pCurCourse ) { EditCourseUtil::UpdateAndSetTrail(); - vector::const_iterator iter = find( m_vpCourses.begin(), m_vpCourses.end(), GAMESTATE->m_pCurCourse ); + std::vector::const_iterator iter = find( m_vpCourses.begin(), m_vpCourses.end(), GAMESTATE->m_pCurCourse ); if( iter != m_vpCourses.end() ) { iIndex = iter - m_vpCourses.begin(); @@ -232,7 +232,7 @@ void ScreenOptionsManageCourses::ProcessMenuStart( const InputEventPlus & ) if( iCurRow == 0 ) // "create new" { - vector vpCourses; + std::vector vpCourses; EditCourseUtil::GetAllEditCourses( vpCourses ); if( vpCourses.size() >= (size_t)EditCourseUtil::MAX_PER_PROFILE ) { @@ -257,12 +257,12 @@ void ScreenOptionsManageCourses::ProcessMenuStart( const InputEventPlus & ) } } -void ScreenOptionsManageCourses::ImportOptions( int iRow, const vector &vpns ) +void ScreenOptionsManageCourses::ImportOptions( int iRow, const std::vector &vpns ) { } -void ScreenOptionsManageCourses::ExportOptions( int iRow, const vector &vpns ) +void ScreenOptionsManageCourses::ExportOptions( int iRow, const std::vector &vpns ) { } diff --git a/src/ScreenOptionsManageCourses.h b/src/ScreenOptionsManageCourses.h index 3db071997a..701f79d594 100644 --- a/src/ScreenOptionsManageCourses.h +++ b/src/ScreenOptionsManageCourses.h @@ -16,8 +16,8 @@ public: virtual bool MenuSelect( const InputEventPlus &input ); protected: - virtual void ImportOptions( int iRow, const vector &vpns ); - virtual void ExportOptions( int iRow, const vector &vpns ); + virtual void ImportOptions( int iRow, const std::vector &vpns ); + virtual void ExportOptions( int iRow, const std::vector &vpns ); virtual void AfterChangeRow( PlayerNumber pn ); virtual void ProcessMenuStart( const InputEventPlus &input ); @@ -26,7 +26,7 @@ private: Course *GetCourseWithFocus() const; RageSound m_soundDifficultyChanged; - vector m_vpCourses; + std::vector m_vpCourses; ThemeMetric EDIT_MODE; ThemeMetric CREATE_NEW_SCREEN; }; diff --git a/src/ScreenOptionsManageEditSteps.cpp b/src/ScreenOptionsManageEditSteps.cpp index cb8d7390dd..b384e5605c 100644 --- a/src/ScreenOptionsManageEditSteps.cpp +++ b/src/ScreenOptionsManageEditSteps.cpp @@ -64,7 +64,7 @@ void ScreenOptionsManageEditSteps::BeginScreen() GAMESTATE->m_pCurSong.Set(nullptr); GAMESTATE->m_pCurSteps[PLAYER_1].Set(nullptr); - vector vHands; + std::vector vHands; int iIndex = 0; @@ -107,7 +107,7 @@ void ScreenOptionsManageEditSteps::BeginScreen() // select the last chosen course if( GAMESTATE->m_pCurSteps[PLAYER_1] ) { - vector::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), GAMESTATE->m_pCurSteps[PLAYER_1] ); + std::vector::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), GAMESTATE->m_pCurSteps[PLAYER_1] ); if( iter != m_vpSteps.end() ) { iIndex = iter - m_vpSteps.begin(); @@ -249,7 +249,7 @@ void ScreenOptionsManageEditSteps::ProcessMenuStart( const InputEventPlus & ) if( iCurRow == 0 ) // "create new" { - vector v; + std::vector v; SONGMAN->GetStepsLoadedFromProfile( v, ProfileSlot_Machine ); if( v.size() >= size_t(MAX_EDIT_STEPS_PER_PROFILE) ) { @@ -280,12 +280,12 @@ void ScreenOptionsManageEditSteps::ProcessMenuStart( const InputEventPlus & ) } } -void ScreenOptionsManageEditSteps::ImportOptions( int iRow, const vector &vpns ) +void ScreenOptionsManageEditSteps::ImportOptions( int iRow, const std::vector &vpns ) { } -void ScreenOptionsManageEditSteps::ExportOptions( int iRow, const vector &vpns ) +void ScreenOptionsManageEditSteps::ExportOptions( int iRow, const std::vector &vpns ) { } diff --git a/src/ScreenOptionsManageEditSteps.h b/src/ScreenOptionsManageEditSteps.h index cb786e8ba4..af900f41b2 100644 --- a/src/ScreenOptionsManageEditSteps.h +++ b/src/ScreenOptionsManageEditSteps.h @@ -15,15 +15,15 @@ public: virtual void HandleScreenMessage( const ScreenMessage SM ); protected: - virtual void ImportOptions( int iRow, const vector &vpns ); - virtual void ExportOptions( int iRow, const vector &vpns ); + virtual void ImportOptions( int iRow, const std::vector &vpns ); + virtual void ExportOptions( int iRow, const std::vector &vpns ); virtual void AfterChangeRow( PlayerNumber pn ); virtual void ProcessMenuStart( const InputEventPlus &input ); Steps *GetStepsWithFocus() const; - vector m_vpSteps; + std::vector m_vpSteps; ThemeMetric CREATE_NEW_SCREEN; }; diff --git a/src/ScreenOptionsManageProfiles.cpp b/src/ScreenOptionsManageProfiles.cpp index 552c90b7c1..ae7d11a2d9 100644 --- a/src/ScreenOptionsManageProfiles.cpp +++ b/src/ScreenOptionsManageProfiles.cpp @@ -82,7 +82,7 @@ static bool ValidateLocalProfileName( const RString &sAnswer, RString &sErrorOut if( pProfile != nullptr && sAnswer == pProfile->m_sDisplayName ) return true; // unchanged - vector vsProfileNames; + std::vector vsProfileNames; PROFILEMAN->GetLocalProfileDisplayNames( vsProfileNames ); bool bAlreadyAProfileWithThisName = find( vsProfileNames.begin(), vsProfileNames.end(), sAnswer ) != vsProfileNames.end(); if( bAlreadyAProfileWithThisName ) @@ -108,7 +108,7 @@ void ScreenOptionsManageProfiles::BeginScreen() { // FIXME // int iIndex = 0; - vector OptionRowHandlers; + std::vector OptionRowHandlers; if( SHOW_CREATE_NEW ) { @@ -163,7 +163,7 @@ void ScreenOptionsManageProfiles::BeginScreen() // select the last chosen profile if( !sEditLocalProfileID.empty() ) { - vector::const_iterator iter = find( m_vsLocalProfileID.begin(), m_vsLocalProfileID.end(), sEditLocalProfileID ); + std::vector::const_iterator iter = find( m_vsLocalProfileID.begin(), m_vsLocalProfileID.end(), sEditLocalProfileID ); if( iter != m_vsLocalProfileID.end() ) { int iIndex = iter - m_vsLocalProfileID.begin(); @@ -254,7 +254,7 @@ void ScreenOptionsManageProfiles::HandleScreenMessage( const ScreenMessage SM ) { // Select the profile nearest to the one that was just deleted. int iIndex = -1; - vector::const_iterator iter = find( m_vsLocalProfileID.begin(), m_vsLocalProfileID.end(), GAMESTATE->m_sEditLocalProfileID.Get() ); + std::vector::const_iterator iter = find( m_vsLocalProfileID.begin(), m_vsLocalProfileID.end(), GAMESTATE->m_sEditLocalProfileID.Get() ); if( iter != m_vsLocalProfileID.end() ) iIndex = iter - m_vsLocalProfileID.begin(); CLAMP( iIndex, 0, m_vsLocalProfileID.size()-1 ); @@ -400,7 +400,7 @@ void ScreenOptionsManageProfiles::ProcessMenuStart( const InputEventPlus & ) if( SHOW_CREATE_NEW && iCurRow == 0 ) // "create new" { - vector vsUsedNames; + std::vector vsUsedNames; PROFILEMAN->GetLocalProfileDisplayNames( vsUsedNames ); RString sPotentialName; @@ -460,12 +460,12 @@ void ScreenOptionsManageProfiles::ProcessMenuStart( const InputEventPlus & ) } } -void ScreenOptionsManageProfiles::ImportOptions( int /* iRow */, const vector & /* vpns */ ) +void ScreenOptionsManageProfiles::ImportOptions( int /* iRow */, const std::vector & /* vpns */ ) { } -void ScreenOptionsManageProfiles::ExportOptions( int /* iRow */, const vector & /* vpns */ ) +void ScreenOptionsManageProfiles::ExportOptions( int /* iRow */, const std::vector & /* vpns */ ) { } diff --git a/src/ScreenOptionsManageProfiles.h b/src/ScreenOptionsManageProfiles.h index 5bd6f1b7e4..32aaf2fe5d 100644 --- a/src/ScreenOptionsManageProfiles.h +++ b/src/ScreenOptionsManageProfiles.h @@ -15,8 +15,8 @@ public: virtual void HandleScreenMessage( const ScreenMessage SM ); protected: - virtual void ImportOptions( int iRow, const vector &vpns ); - virtual void ExportOptions( int iRow, const vector &vpns ); + virtual void ImportOptions( int iRow, const std::vector &vpns ); + virtual void ExportOptions( int iRow, const std::vector &vpns ); virtual void AfterChangeRow( PlayerNumber pn ); virtual void ProcessMenuStart( const InputEventPlus &input ); @@ -24,7 +24,7 @@ protected: int GetLocalProfileIndexWithFocus() const; RString GetLocalProfileIDWithFocus() const; - vector m_vsLocalProfileID; + std::vector m_vsLocalProfileID; }; #endif diff --git a/src/ScreenOptionsMaster.cpp b/src/ScreenOptionsMaster.cpp index 9f6bd58e57..110d6ed816 100644 --- a/src/ScreenOptionsMaster.cpp +++ b/src/ScreenOptionsMaster.cpp @@ -26,7 +26,7 @@ REGISTER_SCREEN_CLASS( ScreenOptionsMaster ); void ScreenOptionsMaster::Init() { - vector asLineNames; + std::vector asLineNames; split( LINE_NAMES, ",", asLineNames ); if( asLineNames.empty() ) { @@ -49,7 +49,7 @@ void ScreenOptionsMaster::Init() // Call this after enabling players, if any. ScreenOptions::Init(); - vector OptionRowHandlers; + std::vector OptionRowHandlers; for( unsigned i = 0; i < asLineNames.size(); ++i ) { RString sLineName = asLineNames[i]; @@ -71,7 +71,7 @@ void ScreenOptionsMaster::Init() InitMenu( OptionRowHandlers ); } -void ScreenOptionsMaster::ImportOptions( int r, const vector &vpns ) +void ScreenOptionsMaster::ImportOptions( int r, const std::vector &vpns ) { for (PlayerNumber const &pn : vpns) { @@ -81,7 +81,7 @@ void ScreenOptionsMaster::ImportOptions( int r, const vector &vpns row.ImportOptions( vpns ); } -void ScreenOptionsMaster::ExportOptions( int r, const vector &vpns ) +void ScreenOptionsMaster::ExportOptions( int r, const std::vector &vpns ) { CHECKPOINT_M( ssprintf("%i/%i", r, int(m_pRows.size())) ); @@ -105,7 +105,7 @@ void ScreenOptionsMaster::HandleScreenMessage( const ScreenMessage SM ) CHECKPOINT_M("Starting the export handling."); - vector vpns; + std::vector vpns; FOREACH_OptionsPlayer( p ) vpns.push_back( p ); for( unsigned r=0; r &vpns ); - virtual void ExportOptions( int iRow, const vector &vpns ); + virtual void ImportOptions( int iRow, const std::vector &vpns ); + virtual void ExportOptions( int iRow, const std::vector &vpns ); }; #endif diff --git a/src/ScreenOptionsMasterPrefs.cpp b/src/ScreenOptionsMasterPrefs.cpp index 9e85b21465..f7118ecd32 100644 --- a/src/ScreenOptionsMasterPrefs.cpp +++ b/src/ScreenOptionsMasterPrefs.cpp @@ -28,7 +28,7 @@ static void GetPrefsDefaultModifiers( PlayerOptions &po, SongOptions &so ) static void SetPrefsDefaultModifiers( const PlayerOptions &po, const SongOptions &so ) { - vector as; + std::vector as; #define remove_empty_back() if(as.back() == "") { as.pop_back(); } as.push_back(po.GetString()); remove_empty_back(); @@ -160,9 +160,9 @@ static void MoveNop( int &iSel, bool bToSel, const ConfOption *pConfOption ) // TODO: Write GenerateValueList() function that can use ints and floats. -aj -static void GameChoices( vector &out ) +static void GameChoices( std::vector &out ) { - vector aGames; + std::vector aGames; GAMEMAN->GetEnabledGames( aGames ); for (Game const *g : aGames) { @@ -173,7 +173,7 @@ static void GameChoices( vector &out ) static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption ) { - vector choices; + std::vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) @@ -185,15 +185,15 @@ static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption ) if( !strcasecmp(choices[i], sCurGameName) ) sel = i; } else { - vector aGames; + std::vector aGames; GAMEMAN->GetEnabledGames( aGames ); PREFSMAN->SetCurrentGame(aGames[sel]->m_szName); } } -static void LanguageChoices( vector &out ) +static void LanguageChoices( std::vector &out ) { - vector vs; + std::vector vs; THEME->GetLanguages( vs ); SortRStringArray( vs, true ); @@ -209,7 +209,7 @@ static void LanguageChoices( vector &out ) static void Language( int &sel, bool ToSel, const ConfOption *pConfOption ) { - vector vs; + std::vector vs; THEME->GetLanguages( vs ); SortRStringArray( vs, true ); @@ -240,7 +240,7 @@ static void Language( int &sel, bool ToSel, const ConfOption *pConfOption ) } } -static void ThemeChoices( vector &out ) +static void ThemeChoices( std::vector &out ) { THEME->GetSelectableThemeNames( out ); for (RString &s : out) @@ -256,7 +256,7 @@ static void cache_display_specs() } } -static void DisplayResolutionChoices( vector &out ) +static void DisplayResolutionChoices( std::vector &out ) { cache_display_specs(); for (DisplaySpec const &iter : display_specs) @@ -271,10 +271,10 @@ static void DisplayResolutionChoices( vector &out ) static void RequestedTheme( int &sel, bool ToSel, const ConfOption *pConfOption ) { - vector choices; + std::vector choices; pConfOption->MakeOptionsList( choices ); - vector vsThemeNames; + std::vector vsThemeNames; THEME->GetSelectableThemeNames( vsThemeNames ); if( ToSel ) @@ -292,7 +292,7 @@ static void RequestedTheme( int &sel, bool ToSel, const ConfOption *pConfOption } static LocalizedString OFF ("ScreenOptionsMasterPrefs","Off"); -static void AnnouncerChoices( vector &out ) +static void AnnouncerChoices( std::vector &out ) { ANNOUNCER->GetAnnouncerNames( out ); out.insert( out.begin(), OFF ); @@ -300,7 +300,7 @@ static void AnnouncerChoices( vector &out ) static void Announcer( int &sel, bool ToSel, const ConfOption *pConfOption ) { - vector choices; + std::vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) @@ -318,14 +318,14 @@ static void Announcer( int &sel, bool ToSel, const ConfOption *pConfOption ) } } -static void DefaultNoteSkinChoices( vector &out ) +static void DefaultNoteSkinChoices( std::vector &out ) { NOTESKIN->GetNoteSkinNames( out ); } static void DefaultNoteSkin( int &sel, bool ToSel, const ConfOption *pConfOption ) { - vector choices; + std::vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) @@ -347,7 +347,7 @@ static void DefaultNoteSkin( int &sel, bool ToSel, const ConfOption *pConfOption } } -static void DefaultFailChoices(vector& out) +static void DefaultFailChoices(std::vector& out) { out.push_back("Immediate"); out.push_back("ImmediateContinue"); @@ -585,7 +585,7 @@ inline res_t operator-(res_t lhs, res_t const &rhs) static void DisplayResolutionM( int &sel, bool ToSel, const ConfOption *pConfOption ) { - static vector res_choices; + static std::vector res_choices; if( res_choices.empty() ) { @@ -733,7 +733,7 @@ static void CustomSongsMaxMegabytes(int& sel, bool to_sel, const ConfOption* con int mapping[]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 1000}; MoveMap(sel, conf_option, to_sel, mapping, ARRAYLEN(mapping)); } -static vector g_ConfOptions; +static std::vector g_ConfOptions; static void InitializeConfOptions() { if( !g_ConfOptions.empty() ) @@ -959,7 +959,7 @@ void ConfOption::UpdateAvailableOptions() } } -void ConfOption::MakeOptionsList( vector &out ) const +void ConfOption::MakeOptionsList( std::vector &out ) const { out = names; } diff --git a/src/ScreenOptionsMasterPrefs.h b/src/ScreenOptionsMasterPrefs.h index ab0c82298d..8654fe7318 100644 --- a/src/ScreenOptionsMasterPrefs.h +++ b/src/ScreenOptionsMasterPrefs.h @@ -41,7 +41,7 @@ struct ConfOption /* Return the list of available selections; Get() and Put() use indexes into * this array. UpdateAvailableOptions() should be called before using this. */ - void MakeOptionsList( vector &out ) const; + void MakeOptionsList( std::vector &out ) const; inline int Get() const { int sel; MoveData( sel, true, this ); return sel; } inline void Put( int sel ) const { MoveData( sel, false, this ); } @@ -63,7 +63,7 @@ struct ConfOption #undef PUSH ConfOption( const char *n, MoveData_t m, - void (*lst)( vector &out ) ) + void (*lst)( std::vector &out ) ) { name = n; MoveData = m; @@ -74,8 +74,8 @@ struct ConfOption // private: - vector names; - void (*MakeOptionsListCB)( vector &out ); + std::vector names; + void (*MakeOptionsListCB)( std::vector &out ); }; #endif diff --git a/src/ScreenOptionsMemoryCard.cpp b/src/ScreenOptionsMemoryCard.cpp index 5b03e0bf29..813861596e 100644 --- a/src/ScreenOptionsMemoryCard.cpp +++ b/src/ScreenOptionsMemoryCard.cpp @@ -25,9 +25,9 @@ void ScreenOptionsMemoryCard::Init() bool ScreenOptionsMemoryCard::UpdateCurrentUsbStorageDevices() { - vector aOldDevices = m_CurrentUsbStorageDevices; + std::vector aOldDevices = m_CurrentUsbStorageDevices; - const vector &aNewDevices = MEMCARDMAN->GetStorageDevices(); + const std::vector &aNewDevices = MEMCARDMAN->GetStorageDevices(); m_CurrentUsbStorageDevices.clear(); for( size_t i = 0; i < aNewDevices.size(); ++i ) @@ -46,11 +46,11 @@ static LocalizedString SIZE_UNKNOWN ("ScreenOptionsMemoryCard", "size ???" ); static LocalizedString VOLUME_SIZE ("ScreenOptionsMemoryCard", "%dMB" ); void ScreenOptionsMemoryCard::CreateMenu() { - vector vHands; + std::vector vHands; for (UsbStorageDevice const &iter : m_CurrentUsbStorageDevices) { - vector vs; + std::vector vs; if( iter.sVolumeLabel.empty() ) vs.push_back( NO_LABEL ); else @@ -123,7 +123,7 @@ void ScreenOptionsMemoryCard::HandleMessage( const Message &msg ) if( !m_Out.IsTransitioning() ) { /* Remember the old mountpoint. */ - const vector &v = m_CurrentUsbStorageDevices; + const std::vector &v = m_CurrentUsbStorageDevices; int iRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()]; RString sOldMountPoint; if( iRow < int(v.size()) ) @@ -147,12 +147,12 @@ void ScreenOptionsMemoryCard::HandleMessage( const Message &msg ) ScreenOptions::HandleMessage( msg ); } -void ScreenOptionsMemoryCard::ImportOptions( int iRow, const vector &vpns ) +void ScreenOptionsMemoryCard::ImportOptions( int iRow, const std::vector &vpns ) { } -void ScreenOptionsMemoryCard::ExportOptions( int iRow, const vector &vpns ) +void ScreenOptionsMemoryCard::ExportOptions( int iRow, const std::vector &vpns ) { OptionRow &row = *m_pRows[iRow]; if( row.GetRowType() == OptionRow::RowType_Exit ) @@ -161,7 +161,7 @@ void ScreenOptionsMemoryCard::ExportOptions( int iRow, const vectorGetMasterPlayerNumber(); if( m_iCurrentRow[pn] == iRow ) { - const vector &v = m_CurrentUsbStorageDevices; + const std::vector &v = m_CurrentUsbStorageDevices; if( iRow < int(v.size()) ) { const UsbStorageDevice &dev = v[iRow]; @@ -175,7 +175,7 @@ void ScreenOptionsMemoryCard::SelectRowWithMemoryCard( const RString &sOsMountPo if( sOsMountPoint.empty() ) return; - const vector &v = m_CurrentUsbStorageDevices; + const std::vector &v = m_CurrentUsbStorageDevices; for( unsigned i=0; iGetMasterPlayerNumber()]; - const vector &v = m_CurrentUsbStorageDevices; + const std::vector &v = m_CurrentUsbStorageDevices; if( iCurRow < int(v.size()) ) // a card { // Why is this statement in twice? Doubt it would change right after the if. -Wolfman2000 - const vector &vUSB = m_CurrentUsbStorageDevices; + const std::vector &vUSB = m_CurrentUsbStorageDevices; const UsbStorageDevice &dev = vUSB[iCurRow]; MEMCARDMAN->m_sEditorMemoryCardOsMountPoint.Set( dev.sOsMountDir ); diff --git a/src/ScreenOptionsMemoryCard.h b/src/ScreenOptionsMemoryCard.h index e9967ccef6..aec325a865 100644 --- a/src/ScreenOptionsMemoryCard.h +++ b/src/ScreenOptionsMemoryCard.h @@ -16,8 +16,8 @@ protected: virtual void AfterChangeRow( PlayerNumber pn ); private: - void ImportOptions( int iRow, const vector &vpns ); - void ExportOptions( int iRow, const vector &vpns ); + void ImportOptions( int iRow, const std::vector &vpns ); + void ExportOptions( int iRow, const std::vector &vpns ); void HandleMessage( const Message &msg ); @@ -27,7 +27,7 @@ private: void SelectRowWithMemoryCard( const RString &sOsMountPoint ); bool UpdateCurrentUsbStorageDevices(); - vector m_CurrentUsbStorageDevices; + std::vector m_CurrentUsbStorageDevices; BitmapText m_textOsMountDir; }; diff --git a/src/ScreenOptionsReviewWorkout.cpp b/src/ScreenOptionsReviewWorkout.cpp index 434373b593..bc185c145b 100644 --- a/src/ScreenOptionsReviewWorkout.cpp +++ b/src/ScreenOptionsReviewWorkout.cpp @@ -53,7 +53,7 @@ void ScreenOptionsCourseOverview::Init() void ScreenOptionsCourseOverview::BeginScreen() { - vector vHands; + std::vector vHands; FOREACH_ENUM( ReviewWorkoutRow, rowIndex ) { const MenuRowDef &mr = g_MenuRows[rowIndex]; @@ -74,12 +74,12 @@ ScreenOptionsCourseOverview::~ScreenOptionsCourseOverview() } -void ScreenOptionsCourseOverview::ImportOptions( int iRow, const vector &vpns ) +void ScreenOptionsCourseOverview::ImportOptions( int iRow, const std::vector &vpns ) { //OptionRow &row = *m_pRows[iRow]; } -void ScreenOptionsCourseOverview::ExportOptions( int iRow, const vector &vpns ) +void ScreenOptionsCourseOverview::ExportOptions( int iRow, const std::vector &vpns ) { OptionRow &row = *m_pRows[iRow]; int iIndex = row.GetOneSharedSelection( true ); diff --git a/src/ScreenOptionsReviewWorkout.h b/src/ScreenOptionsReviewWorkout.h index 47b8e960eb..534f8d7e76 100644 --- a/src/ScreenOptionsReviewWorkout.h +++ b/src/ScreenOptionsReviewWorkout.h @@ -13,8 +13,8 @@ public: protected: private: - virtual void ImportOptions( int row, const vector &vpns ); - virtual void ExportOptions( int row, const vector &vpns ); + virtual void ImportOptions( int row, const std::vector &vpns ); + virtual void ExportOptions( int row, const std::vector &vpns ); virtual void HandleScreenMessage( const ScreenMessage SM ); virtual void AfterChangeValueInRow( int iRow, PlayerNumber pn ); diff --git a/src/ScreenOptionsToggleSongs.cpp b/src/ScreenOptionsToggleSongs.cpp index 3fa8b81bb6..76e016f591 100644 --- a/src/ScreenOptionsToggleSongs.cpp +++ b/src/ScreenOptionsToggleSongs.cpp @@ -16,9 +16,9 @@ void ScreenOptionsToggleSongs::BeginScreen() { m_asGroups.clear(); - vector vHands; + std::vector vHands; - vector asAllGroups; + std::vector asAllGroups; SONGMAN->GetSongGroupNames(asAllGroups); for (RString const &sGroup : asAllGroups) { @@ -57,11 +57,11 @@ void ScreenOptionsToggleSongs::ProcessMenuStart( const InputEventPlus &input ) SCREENMAN->SetNewScreen("ScreenOptionsToggleSongsSubPage"); } -void ScreenOptionsToggleSongs::ImportOptions( int row, const vector &vpns ) +void ScreenOptionsToggleSongs::ImportOptions( int row, const std::vector &vpns ) { } -void ScreenOptionsToggleSongs::ExportOptions( int row, const vector &vpns ) +void ScreenOptionsToggleSongs::ExportOptions( int row, const std::vector &vpns ) { } @@ -72,9 +72,9 @@ void ScreenOptionsToggleSongsSubPage::BeginScreen() { m_apSongs.clear(); - vector vHands; + std::vector vHands; - const vector &apAllSongs = SONGMAN->GetSongs(ToggleSongs::m_sGroup); + const std::vector &apAllSongs = SONGMAN->GetSongs(ToggleSongs::m_sGroup); for (Song *pSong : apAllSongs) { if( UNLOCKMAN->SongIsLocked(pSong) & ~LOCKED_DISABLED ) @@ -100,7 +100,7 @@ void ScreenOptionsToggleSongsSubPage::BeginScreen() ScreenOptions::BeginScreen(); } -void ScreenOptionsToggleSongsSubPage::ImportOptions( int iRow, const vector &vpns ) +void ScreenOptionsToggleSongsSubPage::ImportOptions( int iRow, const std::vector &vpns ) { if( iRow >= (int)m_apSongs.size() ) // exit row return; @@ -111,7 +111,7 @@ void ScreenOptionsToggleSongsSubPage::ImportOptions( int iRow, const vector &vpns ) +void ScreenOptionsToggleSongsSubPage::ExportOptions( int iRow, const std::vector &vpns ) { if( iRow >= (int)m_apSongs.size() ) // exit row return; diff --git a/src/ScreenOptionsToggleSongs.h b/src/ScreenOptionsToggleSongs.h index 9642d60e28..7b68f87a90 100644 --- a/src/ScreenOptionsToggleSongs.h +++ b/src/ScreenOptionsToggleSongs.h @@ -16,11 +16,11 @@ public: virtual void BeginScreen(); private: - virtual void ImportOptions( int row, const vector &vpns ); - virtual void ExportOptions( int row, const vector &vpns ); + virtual void ImportOptions( int row, const std::vector &vpns ); + virtual void ExportOptions( int row, const std::vector &vpns ); virtual void ProcessMenuStart( const InputEventPlus &input ); - vector m_asGroups; + std::vector m_asGroups; }; class ScreenOptionsToggleSongsSubPage: public ScreenOptions @@ -29,10 +29,10 @@ public: virtual void BeginScreen(); private: - virtual void ImportOptions( int row, const vector &vpns ); - virtual void ExportOptions( int row, const vector &vpns ); + virtual void ImportOptions( int row, const std::vector &vpns ); + virtual void ExportOptions( int row, const std::vector &vpns ); - vector m_apSongs; + std::vector m_apSongs; }; #endif diff --git a/src/ScreenPlayerOptions.cpp b/src/ScreenPlayerOptions.cpp index 5a1c8efb83..2587fbacdc 100644 --- a/src/ScreenPlayerOptions.cpp +++ b/src/ScreenPlayerOptions.cpp @@ -85,7 +85,7 @@ bool ScreenPlayerOptions::Input( const InputEventPlus &input ) for( unsigned r=0; r v; + std::vector v; v.push_back( pn ); int iOldFocus = m_pRows[r]->GetChoiceInRowWithFocus( pn ); this->ImportOptions( r, v ); @@ -130,7 +130,7 @@ void ScreenPlayerOptions::UpdateDisqualified( int row, PlayerNumber pn ) // Find out if the current row when exported causes disqualification. // Exporting the row will fill GAMESTATE->m_PlayerOptions. PO_GROUP_CALL( GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions, ModsLevel_Preferred, Init ); - vector v; + std::vector v; v.push_back( pn ); ExportOptions( row, v ); bool bRowCausesDisqualified = GAMESTATE->CurrentOptionsDisqualifyPlayer( pn ); diff --git a/src/ScreenPlayerOptions.h b/src/ScreenPlayerOptions.h index b22a3345c5..6c3948a677 100644 --- a/src/ScreenPlayerOptions.h +++ b/src/ScreenPlayerOptions.h @@ -19,7 +19,7 @@ public: virtual void PushSelf( lua_State *L ); private: - vector m_bRowCausesDisqualified[NUM_PLAYERS]; + std::vector m_bRowCausesDisqualified[NUM_PLAYERS]; void UpdateDisqualified( int row, PlayerNumber pn ); bool m_bAcceptedChoices; diff --git a/src/ScreenRanking.cpp b/src/ScreenRanking.cpp index 67fb3cd3b6..a5ee6b349d 100644 --- a/src/ScreenRanking.cpp +++ b/src/ScreenRanking.cpp @@ -82,7 +82,7 @@ void ScreenRanking::Init() pts.colorIndex = i; pts.category = (RankingCategory)c; StepsType st = STEPS_TYPES_TO_SHOW.GetValue()[i]; - pts.aTypes.push_back( make_pair(Difficulty_Invalid, st) ); + pts.aTypes.push_back( std::make_pair(Difficulty_Invalid, st) ); m_vPagesToShow.push_back( pts ); } } @@ -100,7 +100,7 @@ void ScreenRanking::Init() this->AddChild( &m_textCourseTitle ); LOAD_ALL_COMMANDS( m_textCourseTitle ); - vector asCoursePaths; + std::vector asCoursePaths; split( COURSES_TO_SHOW, ",", asCoursePaths, true ); for( unsigned i=0; iGetCourseFromPath( asCoursePaths[c] ); if( pts.pCourse == nullptr ) continue; diff --git a/src/ScreenRanking.h b/src/ScreenRanking.h index 85fab7fdf8..4c18fc8ac8 100644 --- a/src/ScreenRanking.h +++ b/src/ScreenRanking.h @@ -9,7 +9,7 @@ class Course; class Trail; -typedef pair DifficultyAndStepsType; +typedef std::pair DifficultyAndStepsType; const int NUM_RANKING_LINES = 5; @@ -40,7 +40,7 @@ protected: } int colorIndex; - vector aTypes; + std::vector aTypes; // RankingPageType_Category RankingCategory category; @@ -54,7 +54,7 @@ protected: BitmapText m_textStepsType; // for category, course, all_steps - vector m_vPagesToShow; + std::vector m_vPagesToShow; unsigned m_iNextPageToShow; // Don't use the version in CommonMetrics because we may have multiple diff --git a/src/ScreenSaveSync.cpp b/src/ScreenSaveSync.cpp index d829a52f4b..d851aa3381 100644 --- a/src/ScreenSaveSync.cpp +++ b/src/ScreenSaveSync.cpp @@ -14,14 +14,14 @@ static RString GetPromptText() RString s; { - vector vs; + std::vector vs; AdjustSync::GetSyncChangeTextGlobal( vs ); if( !vs.empty() ) s += join( "\n", vs ) + "\n\n"; } { - vector vs; + std::vector vs; AdjustSync::GetSyncChangeTextSong( vs ); if( !vs.empty() ) { diff --git a/src/ScreenSelect.cpp b/src/ScreenSelect.cpp index 45e84dcb35..a4d748a5f0 100644 --- a/src/ScreenSelect.cpp +++ b/src/ScreenSelect.cpp @@ -76,7 +76,7 @@ void ScreenSelect::Init() // Each element in the list is a choice name. This level of indirection // makes it easier to add or remove items without having to change a // bunch of indices. - vector asChoiceNames; + std::vector asChoiceNames; split( CHOICE_NAMES, ",", asChoiceNames, true ); for( unsigned c=0; c m_aGameCommands; + std::vector m_aGameCommands; - vector m_asSubscribedMessages; + std::vector m_asSubscribedMessages; /** @brief Count up to the time between idle comment announcer sounds. */ RageTimer m_timerIdleComment; diff --git a/src/ScreenSelectCharacter.cpp b/src/ScreenSelectCharacter.cpp index 872bb4acdc..885651cc63 100644 --- a/src/ScreenSelectCharacter.cpp +++ b/src/ScreenSelectCharacter.cpp @@ -51,8 +51,8 @@ REGISTER_SCREEN_CLASS( ScreenSelectCharacter ); void ScreenSelectCharacter::Init() { ScreenWithMenuElements::Init(); - - vector apCharacters; + + std::vector apCharacters; CHARMAN->GetCharacters( apCharacters ); if( apCharacters.empty() ) { @@ -234,7 +234,7 @@ void ScreenSelectCharacter::AfterValueChange( PlayerNumber pn ) case CHOOSING_CPU_CHARACTER: case CHOOSING_HUMAN_CHARACTER: { - vector apCharacters; + std::vector apCharacters; CHARMAN->GetCharacters( apCharacters ); Character* pChar = apCharacters[ m_iSelectedCharacter[pnAffected] ]; m_sprCard[pnAffected].UnloadTexture(); @@ -304,7 +304,7 @@ void ScreenSelectCharacter::Move( PlayerNumber pn, int deltaValue ) case CHOOSING_CPU_CHARACTER: case CHOOSING_HUMAN_CHARACTER: { - vector apCharacters; + std::vector apCharacters; CHARMAN->GetCharacters( apCharacters ); m_iSelectedCharacter[pnAffected] += deltaValue; wrap( m_iSelectedCharacter[pnAffected], apCharacters.size() ); @@ -356,7 +356,7 @@ void ScreenSelectCharacter::MakeSelection( PlayerNumber pn ) { FOREACH_PlayerNumber( p ) { - vector apCharacters; + std::vector apCharacters; CHARMAN->GetCharacters( apCharacters ); Character* pChar = apCharacters[ m_iSelectedCharacter[p] ]; GAMESTATE->m_pCurCharacters[p] = pChar; diff --git a/src/ScreenSelectLanguage.cpp b/src/ScreenSelectLanguage.cpp index 118be9e206..ce210321a3 100644 --- a/src/ScreenSelectLanguage.cpp +++ b/src/ScreenSelectLanguage.cpp @@ -9,7 +9,7 @@ REGISTER_SCREEN_CLASS( ScreenSelectLanguage ); void ScreenSelectLanguage::Init() { // fill m_aGameCommands before calling Init() - vector vs; + std::vector vs; THEME->GetLanguages( vs ); SortRStringArray( vs, true ); diff --git a/src/ScreenSelectMaster.cpp b/src/ScreenSelectMaster.cpp index ea977ee58f..e4088ae6db 100644 --- a/src/ScreenSelectMaster.cpp +++ b/src/ScreenSelectMaster.cpp @@ -78,7 +78,7 @@ void ScreenSelectMaster::Init() m_TrackingRepeatingInput = GameButton_Invalid; - vector vpns; + std::vector vpns; GetActiveElementPlayerNumbers( vpns ); #define PLAYER_APPEND_NO_SPACE(p) (SHARED_SELECTION ? RString() : ssprintf("P%d",(p)+1)) @@ -103,7 +103,7 @@ void ScreenSelectMaster::Init() for (PlayerNumber const &p : vpns) m_vsprScroll[p].resize( m_aGameCommands.size() ); - vector positions; + std::vector positions; bool positions_set_by_lua= false; if(THEME->HasMetric(m_sName, "IconChoicePosFunction")) { @@ -174,7 +174,7 @@ void ScreenSelectMaster::Init() // init icon if( SHOW_ICON ) { - vector vs; + std::vector vs; vs.push_back( "Icon" ); if( PER_CHOICE_ICON_ELEMENT ) vs.push_back( "Choice" + mc.m_sName ); @@ -211,7 +211,7 @@ void ScreenSelectMaster::Init() { for (PlayerNumber const &p : vpns) { - vector vs; + std::vector vs; vs.push_back( "Scroll" ); if( PER_CHOICE_SCROLL_ELEMENT ) vs.push_back( "Choice" + mc.m_sName ); @@ -267,7 +267,7 @@ void ScreenSelectMaster::Init() FOREACH_MenuDir( dir ) { const RString order = OPTION_ORDER.GetValue( dir ); - vector parts; + std::vector parts; split( order, ",", parts, true ); for( unsigned part = 0; part < parts.size(); ++part ) @@ -369,7 +369,7 @@ void ScreenSelectMaster::HandleScreenMessage( const ScreenMessage SM ) { ScreenSelect::HandleScreenMessage( SM ); - vector vpns; + std::vector vpns; GetActiveElementPlayerNumbers( vpns ); if( SM == SM_PlayPostSwitchPage ) @@ -431,7 +431,7 @@ int ScreenSelectMaster::GetSelectionIndex( PlayerNumber pn ) void ScreenSelectMaster::UpdateSelectableChoices() { - vector vpns; + std::vector vpns; GetActiveElementPlayerNumbers( vpns ); int first_playable= -1; bool on_unplayable[NUM_PLAYERS]; @@ -504,11 +504,11 @@ bool ScreenSelectMaster::Move( PlayerNumber pn, MenuDir dir ) return false; int iSwitchToIndex = m_iChoice[pn]; - set seen; + std::set seen; do { - map::const_iterator iter = m_mapCurrentChoiceToNextChoice[dir].find( iSwitchToIndex ); + std::map::const_iterator iter = m_mapCurrentChoiceToNextChoice[dir].find( iSwitchToIndex ); if( iter != m_mapCurrentChoiceToNextChoice[dir].end() ) iSwitchToIndex = iter->second; @@ -673,7 +673,7 @@ bool ScreenSelectMaster::ChangePage( int iNewChoice ) m_sprMore[page]->PlayCommand( sIconAndExplanationCommand ); } - vector vpns; + std::vector vpns; GetActiveElementPlayerNumbers( vpns ); Message msg("PreSwitchPage"); @@ -722,7 +722,7 @@ bool ScreenSelectMaster::ChangeSelection( PlayerNumber pn, MenuDir dir, int iNew return ChangePage( iNewChoice ); } - vector vpns; + std::vector vpns; if( SHARED_SELECTION || page != PAGE_1 ) { /* Set the new m_iChoice even for disabled players, since a player might @@ -797,7 +797,7 @@ bool ScreenSelectMaster::ChangeSelection( PlayerNumber pn, MenuDir dir, int iNew if( SHOW_SCROLLER ) { ActorScroller &scroller = (SHARED_SELECTION || page != PAGE_1 ? m_Scroller[0] : m_Scroller[p]); - vector &vScroll = (SHARED_SELECTION || page != PAGE_1 ? m_vsprScroll[0] : m_vsprScroll[p]); + std::vector &vScroll = (SHARED_SELECTION || page != PAGE_1 ? m_vsprScroll[0] : m_vsprScroll[p]); if( WRAP_SCROLLER ) { @@ -885,7 +885,7 @@ float ScreenSelectMaster::DoMenuStart( PlayerNumber pn ) FOREACH_ENUM( Page, page ) { m_sprMore[page]->PlayCommand( "Off" ); - fSecs = max( fSecs, m_sprMore[page]->GetTweenTimeLeft() ); + fSecs = std::max( fSecs, m_sprMore[page]->GetTweenTimeLeft() ); } } if( SHOW_CURSOR ) @@ -893,7 +893,7 @@ float ScreenSelectMaster::DoMenuStart( PlayerNumber pn ) if(m_sprCursor[pn] != nullptr) { m_sprCursor[pn]->PlayCommand( "Choose" ); - fSecs = max( fSecs, m_sprCursor[pn]->GetTweenTimeLeft() ); + fSecs = std::max( fSecs, m_sprCursor[pn]->GetTweenTimeLeft() ); } } @@ -932,7 +932,7 @@ bool ScreenSelectMaster::MenuStart( const InputEventPlus &input ) if(SHOW_SCROLLER) { - vector &vScroll = SHARED_SELECTION ? m_vsprScroll[0] : m_vsprScroll[pn]; + std::vector &vScroll = SHARED_SELECTION ? m_vsprScroll[0] : m_vsprScroll[pn]; vScroll[m_iChoice[pn]]->PlayCommand( "InitialSelection" ); } @@ -977,12 +977,12 @@ bool ScreenSelectMaster::MenuStart( const InputEventPlus &input ) FOREACH_EnabledPlayer( p ) { ASSERT( !m_bChosen[p] ); - fSecs = max( fSecs, DoMenuStart(p) ); + fSecs = std::max( fSecs, DoMenuStart(p) ); } } else { - fSecs = max( fSecs, DoMenuStart(pn) ); + fSecs = std::max( fSecs, DoMenuStart(pn) ); // check to see if everyone has chosen FOREACH_HumanPlayer( p ) bAllDone &= m_bChosen[p]; @@ -1008,7 +1008,7 @@ bool ScreenSelectMaster::MenuStart( const InputEventPlus &input ) * eg. only use "addx", not "x". */ void ScreenSelectMaster::TweenOnScreen() { - vector vpns; + std::vector vpns; GetActiveElementPlayerNumbers( vpns ); if( SHOW_ICON ) @@ -1053,7 +1053,7 @@ void ScreenSelectMaster::TweenOffScreen() { ScreenSelect::TweenOffScreen(); - vector vpns; + std::vector vpns; GetActiveElementPlayerNumbers( vpns ); for( unsigned c=0; c SCROLLER_SUBDIVISIONS; ThemeMetric DEFAULT_CHOICE; - map m_mapCurrentChoiceToNextChoice[NUM_MenuDir]; + std::map m_mapCurrentChoiceToNextChoice[NUM_MenuDir]; virtual int GetSelectionIndex( PlayerNumber pn ); virtual void UpdateSelectableChoices(); @@ -98,10 +98,10 @@ protected: AutoActor m_sprExplanation[NUM_Page]; AutoActor m_sprMore[NUM_Page]; // icon is the shared, per-choice piece - vector m_vsprIcon; + std::vector m_vsprIcon; // preview is per-player, per-choice piece - vector m_vsprScroll[NUM_PLAYERS]; + std::vector m_vsprScroll[NUM_PLAYERS]; ActorScroller m_Scroller[NUM_PLAYERS]; diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index e8816c349d..5c2c6f9914 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -239,7 +239,7 @@ void ScreenSelectMusic::BeginScreen() { LuaHelpers::ReportScriptError("The Style has not been set. A theme must set the Style before loading ScreenSelectMusic."); // Instead of crashing, set the first compatible style. - vector vst; + std::vector vst; GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vst ); const Style *pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), vst[0] ); if(pStyle == nullptr) @@ -1057,7 +1057,7 @@ void ScreenSelectMusic::ChangeSteps( PlayerNumber pn, int dir ) return; } - vector vpns; + std::vector vpns; FOREACH_HumanPlayer( p ) { if( pn == p || GAMESTATE->DifficultiesLocked() ) @@ -1272,7 +1272,7 @@ bool ScreenSelectMusic::MenuStart( const InputEventPlus &input ) bool bIsRepeat = false; int i = 0; if( GAMESTATE->IsEventMode() ) - i = max( 0, int(STATSMAN->m_vPlayedStageStats.size())-5 ); + i = std::max( 0, int(STATSMAN->m_vPlayedStageStats.size())-5 ); for( ; i < (int)STATSMAN->m_vPlayedStageStats.size(); ++i ) if( STATSMAN->m_vPlayedStageStats[i].m_vpPlayedSongs.back() == m_MusicWheel.GetSelectedSong() ) bIsRepeat = true; @@ -1515,7 +1515,7 @@ bool ScreenSelectMusic::MenuStart( const InputEventPlus &input ) } StartTransitioningScreen( SM_None ); - float fTime = max( SHOW_OPTIONS_MESSAGE_SECONDS, this->GetTweenTimeLeft() ); + float fTime = std::max( SHOW_OPTIONS_MESSAGE_SECONDS, this->GetTweenTimeLeft() ); this->PostScreenMessage( SM_BeginFadingOut, fTime ); } else @@ -1564,7 +1564,7 @@ bool ScreenSelectMusic::MenuBack( const InputEventPlus & /* input */ ) return true; } -void ScreenSelectMusic::AfterStepsOrTrailChange( const vector &vpns ) +void ScreenSelectMusic::AfterStepsOrTrailChange( const std::vector &vpns ) { if(TWO_PART_CONFIRMS_ONLY && m_SelectionState == SelectionState_SelectingSteps) { @@ -1725,7 +1725,7 @@ void ScreenSelectMusic::AfterMusicChange() m_Banner.SetMovingFast( !!m_MusicWheel.IsMoving() ); - vector m_Artists, m_AltArtists; + std::vector m_Artists, m_AltArtists; if( SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_LastSong ) { @@ -1891,7 +1891,7 @@ void ScreenSelectMusic::AfterMusicChange() if(pStyle == nullptr) { lCourse->GetAllTrails(m_vpTrails); - vector::iterator tra= m_vpTrails.begin(); + std::vector::iterator tra= m_vpTrails.begin(); Game const* cur_game= GAMESTATE->GetCurrentGame(); int num_players= GAMESTATE->GetNumPlayersEnabled(); while(tra != m_vpTrails.end()) @@ -1978,7 +1978,7 @@ void ScreenSelectMusic::AfterMusicChange() g_StartedLoadingAt.Touch(); - vector vpns; + std::vector vpns; FOREACH_HumanPlayer( p ) vpns.push_back( p ); diff --git a/src/ScreenSelectMusic.h b/src/ScreenSelectMusic.h index 4e1112d926..d6dd64313b 100644 --- a/src/ScreenSelectMusic.h +++ b/src/ScreenSelectMusic.h @@ -61,15 +61,15 @@ protected: void UpdateSelectButton( PlayerNumber pn, bool bBeingPressed ); void ChangeSteps( PlayerNumber pn, int dir ); - void AfterStepsOrTrailChange( const vector &vpns ); + void AfterStepsOrTrailChange( const std::vector &vpns ); void SwitchToPreferredDifficulty(); void AfterMusicChange(); void CheckBackgroundRequests( bool bForce ); bool DetectCodes( const InputEventPlus &input ); - vector m_vpSteps; - vector m_vpTrails; + std::vector m_vpSteps; + std::vector m_vpTrails; int m_iSelection[NUM_PLAYERS]; RageTimer m_timerIdleComment; diff --git a/src/ScreenServiceAction.cpp b/src/ScreenServiceAction.cpp index de95df3974..adfbc82f6b 100644 --- a/src/ScreenServiceAction.cpp +++ b/src/ScreenServiceAction.cpp @@ -37,7 +37,7 @@ RString ClearMachineStats() static LocalizedString MACHINE_EDITS_CLEARED( "ScreenServiceAction", "%d edits cleared, %d errors." ); static RString ClearMachineEdits() { - vector vsEditFiles; + std::vector vsEditFiles; GetDirListing( PROFILEMAN->GetProfileDir(ProfileSlot_Machine)+EDIT_STEPS_SUBDIR+"*.edit", vsEditFiles, false, true ); GetDirListing( PROFILEMAN->GetProfileDir(ProfileSlot_Machine)+EDIT_COURSES_SUBDIR+"*.crs", vsEditFiles, false, true ); @@ -79,7 +79,7 @@ static RString ClearMemoryCardEdits() MEMCARDMAN->MountCard(pn); RString sDir = MEM_CARD_MOUNT_POINT[pn] + (RString)PREFSMAN->m_sMemoryCardProfileSubdir + "/"; - vector vsEditFiles; + std::vector vsEditFiles; GetDirListing( sDir+EDIT_STEPS_SUBDIR+"*.edit", vsEditFiles, false, true ); GetDirListing( sDir+EDIT_COURSES_SUBDIR+"*.crs", vsEditFiles, false, true ); int editCount = vsEditFiles.size(); @@ -169,7 +169,7 @@ static void CopyEdits( const RString &sFromProfileDir, const RString &sToProfile RString sFromDir = sFromProfileDir + EDIT_STEPS_SUBDIR; RString sToDir = sToProfileDir + EDIT_STEPS_SUBDIR; - vector vsFiles; + std::vector vsFiles; GetDirListing( sFromDir+"*.edit", vsFiles, false, false ); for (RString const &i : vsFiles) { @@ -197,7 +197,7 @@ static void CopyEdits( const RString &sFromProfileDir, const RString &sToProfile RString sFromDir = sFromProfileDir + EDIT_COURSES_SUBDIR; RString sToDir = sToProfileDir + EDIT_COURSES_SUBDIR; - vector vsFiles; + std::vector vsFiles; GetDirListing( sFromDir+"*.crs", vsFiles, false, false ); for (RString const &i : vsFiles) { @@ -230,7 +230,7 @@ static RString CopyEdits( const RString &sFromProfileDir, const RString &sToProf CopyEdits( sFromProfileDir, sToProfileDir, iNumSucceeded, iNumOverwritten, iNumIgnored, iNumErrored ); - vector vs; + std::vector vs; vs.push_back( sDisplayDir ); vs.push_back( ssprintf( COPIED.GetValue(), iNumSucceeded ) + ", " + ssprintf( OVERWRITTEN.GetValue(), iNumOverwritten ) ); if( iNumIgnored ) @@ -242,13 +242,13 @@ static RString CopyEdits( const RString &sFromProfileDir, const RString &sToProf static void SyncFiles( const RString &sFromDir, const RString &sToDir, const RString &sMask, int &iNumAdded, int &iNumDeleted, int &iNumOverwritten, int &iNumFailed ) { - vector vsFilesSource; + std::vector vsFilesSource; GetDirListing( sFromDir+sMask, vsFilesSource, false, false ); - vector vsFilesDest; + std::vector vsFilesDest; GetDirListing( sToDir+sMask, vsFilesDest, false, false ); - vector vsToDelete; + std::vector vsToDelete; GetAsNotInBs( vsFilesDest, vsFilesSource, vsToDelete ); for( unsigned i = 0; i < vsToDelete.size(); ++i ) @@ -305,7 +305,7 @@ static RString CopyEditsMachineToMemoryCard() RString sFromDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine); RString sToDir = MEM_CARD_MOUNT_POINT[pn] + (RString)PREFSMAN->m_sMemoryCardProfileSubdir + "/"; - vector vs; + std::vector vs; vs.push_back( ssprintf( COPIED_TO_CARD.GetValue(), pn+1 ) ); RString s = CopyEdits( sFromDir, sToDir, PREFSMAN->m_sMemoryCardProfileSubdir ); vs.push_back( s ); @@ -354,10 +354,10 @@ static RString CopyEditsMemoryCardToMachine() if( !MEMCARDMAN->IsMounted(pn) ) MEMCARDMAN->MountCard(pn); - vector vsSubDirs; + std::vector vsSubDirs; ProfileManager::GetMemoryCardProfileDirectoriesToTry( vsSubDirs ); - vector vs; + std::vector vs; vs.push_back( ssprintf( COPIED_FROM_CARD.GetValue(), pn+1 ) ); for (RString const &sSubDir : vsSubDirs) @@ -391,10 +391,10 @@ REGISTER_SCREEN_CLASS( ScreenServiceAction ); void ScreenServiceAction::BeginScreen() { RString sActions = THEME->GetMetric(m_sName,"Actions"); - vector vsActions; + std::vector vsActions; split( sActions, ",", vsActions ); - vector vsResults; + std::vector vsResults; for (RString const &s : vsActions) { RString (*pfn)() = nullptr; diff --git a/src/ScreenSongOptions.cpp b/src/ScreenSongOptions.cpp index 1c105c9b13..15a87b68ca 100644 --- a/src/ScreenSongOptions.cpp +++ b/src/ScreenSongOptions.cpp @@ -21,7 +21,7 @@ void ScreenSongOptions::Init() } } -void ScreenSongOptions::ExportOptions( int iRow, const vector &vpns ) +void ScreenSongOptions::ExportOptions( int iRow, const std::vector &vpns ) { PlayerNumber pn = GAMESTATE->GetMasterPlayerNumber(); PlayerState *pPS = GAMESTATE->m_pPlayerState[pn]; diff --git a/src/ScreenSongOptions.h b/src/ScreenSongOptions.h index e2b818d690..505ad771a0 100644 --- a/src/ScreenSongOptions.h +++ b/src/ScreenSongOptions.h @@ -9,7 +9,7 @@ public: virtual void Init(); private: - virtual void ExportOptions( int iRow, const vector &vpns ); + virtual void ExportOptions( int iRow, const std::vector &vpns ); }; #endif diff --git a/src/ScreenSyncOverlay.cpp b/src/ScreenSyncOverlay.cpp index eb0c7e3c27..80c977ff56 100644 --- a/src/ScreenSyncOverlay.cpp +++ b/src/ScreenSyncOverlay.cpp @@ -54,7 +54,7 @@ static LocalizedString STANDARD_DEVIATION( "ScreenSyncOverlay", "Standard deviat void ScreenSyncOverlay::UpdateText() { // Update Status - vector vs; + std::vector vs; PlayerController pc = GamePreferences::m_AutoPlay.Get(); switch( pc ) @@ -203,7 +203,7 @@ bool ScreenSyncOverlay::Input( const InputEventPlus &input ) TimingData &sTiming = GAMESTATE->m_pCurSong->m_SongTiming; BPMSegment * seg = sTiming.GetBPMSegmentAtBeat( GAMESTATE->m_Position.m_fSongBeat ); seg->SetBPS( seg->GetBPS() + fDelta ); - const vector& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps(); + const std::vector& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps(); for (Steps *s : vpSteps) { TimingData &pTiming = s->m_Timing; @@ -253,7 +253,7 @@ bool ScreenSyncOverlay::Input( const InputEventPlus &input ) if( GAMESTATE->m_pCurSong != nullptr ) { GAMESTATE->m_pCurSong->m_SongTiming.m_fBeat0OffsetInSeconds += fDelta; - const vector& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps(); + const std::vector& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps(); for (Steps *s : vpSteps) { // Empty means it inherits song timing, diff --git a/src/ScreenTestInput.cpp b/src/ScreenTestInput.cpp index 2b03a22976..52bf5926b3 100644 --- a/src/ScreenTestInput.cpp +++ b/src/ScreenTestInput.cpp @@ -36,9 +36,9 @@ class InputList: public BitmapText void Update( float fDeltaTime ) { // Update input texts - vector asInputs; + std::vector asInputs; - vector DeviceInputs; + std::vector DeviceInputs; INPUTFILTER->GetPressedButtons( DeviceInputs ); for (DeviceInput const &di : DeviceInputs) { diff --git a/src/ScreenTestSound.cpp b/src/ScreenTestSound.cpp index 1210b2ea58..6786092674 100644 --- a/src/ScreenTestSound.cpp +++ b/src/ScreenTestSound.cpp @@ -69,7 +69,7 @@ ScreenTestSound::~ScreenTestSound() for( int i = 0; i < nsounds; ++i ) { /* Delete copied sounds. */ - vector &snds = m_sSoundCopies[i]; + std::vector &snds = m_sSoundCopies[i]; for( unsigned j = 0; j < snds.size(); ++j ) delete snds[j]; } @@ -79,7 +79,7 @@ void ScreenTestSound::UpdateText(int n) { RString fn = Basename( s[n].s.GetLoadedFilePath() ); - vector &snds = m_sSoundCopies[n]; + std::vector &snds = m_sSoundCopies[n]; RString pos; for(unsigned p = 0; p < snds.size(); ++p) @@ -115,7 +115,7 @@ void ScreenTestSound::Update(float f) UpdateText(i); /* Delete copied sounds that have finished playing. */ - vector &snds = m_sSoundCopies[i]; + std::vector &snds = m_sSoundCopies[i]; for( unsigned j = 0; j < snds.size(); ++j ) { if( snds[j]->IsPlaying() ) @@ -157,7 +157,7 @@ bool ScreenTestSound::Input( const InputEventPlus &input ) for( int i = 0; i < nsounds; ++i ) { /* Stop copied sounds. */ - vector &snds = m_sSoundCopies[i]; + std::vector &snds = m_sSoundCopies[i]; for( unsigned j = 0; j < snds.size(); ++j ) snds[j]->Stop(); } diff --git a/src/ScreenTestSound.h b/src/ScreenTestSound.h index f6a96afc8a..b5725cae9a 100644 --- a/src/ScreenTestSound.h +++ b/src/ScreenTestSound.h @@ -24,7 +24,7 @@ public: BitmapText txt; }; Sound s[nsounds]; - vector m_sSoundCopies[nsounds]; + std::vector m_sSoundCopies[nsounds]; BitmapText HEEEEEEEEELP; int selected; diff --git a/src/ScreenTextEntry.cpp b/src/ScreenTextEntry.cpp index 40a2b535e9..360dbe0c06 100644 --- a/src/ScreenTextEntry.cpp +++ b/src/ScreenTextEntry.cpp @@ -267,7 +267,7 @@ bool ScreenTextEntry::Input( const InputEventPlus &input ) else if( c >= L' ' ) { // todo: handle caps lock -aj - TryAppendToAnswer( WStringToRString(wstring()+c) ); + TryAppendToAnswer( WStringToRString(std::wstring()+c) ); TextEnteredDirectly(); bHandled = true; @@ -280,7 +280,7 @@ bool ScreenTextEntry::Input( const InputEventPlus &input ) void ScreenTextEntry::TryAppendToAnswer( RString s ) { { - wstring sNewAnswer = m_sAnswer+RStringToWstring(s); + std::wstring sNewAnswer = m_sAnswer+RStringToWstring(s); if( (int)sNewAnswer.length() > g_iMaxInputLength ) { SCREENMAN->PlayInvalidSound(); @@ -294,7 +294,7 @@ void ScreenTextEntry::TryAppendToAnswer( RString s ) return; } - wstring sNewAnswer = m_sAnswer+RStringToWstring(s); + std::wstring sNewAnswer = m_sAnswer+RStringToWstring(s); m_sAnswer = sNewAnswer; m_sndType.Play(true); UpdateAnswerText(); diff --git a/src/ScreenTextEntry.h b/src/ScreenTextEntry.h index 801aff2718..b29c0add10 100644 --- a/src/ScreenTextEntry.h +++ b/src/ScreenTextEntry.h @@ -123,7 +123,7 @@ private: void UpdateAnswerText(); - wstring m_sAnswer; + std::wstring m_sAnswer; bool m_bShowAnswerCaret; // todo: allow Left/Right to change caret location -aj //int m_iCaretLocation; diff --git a/src/ScreenUnlockStatus.h b/src/ScreenUnlockStatus.h index 4a41aab64b..f9c940c4fa 100644 --- a/src/ScreenUnlockStatus.h +++ b/src/ScreenUnlockStatus.h @@ -15,11 +15,11 @@ public: protected: BitmapText PointsUntilNextUnlock; - vector Unlocks; - vector item; // scrolling text - vector ItemIcons; // icons for scrolling text + std::vector Unlocks; + std::vector item; // scrolling text + std::vector ItemIcons; // icons for scrolling text - vector LastUnlocks; // used for "last few" method + std::vector LastUnlocks; // used for "last few" method }; #endif diff --git a/src/ScreenWithMenuElements.cpp b/src/ScreenWithMenuElements.cpp index db3491720c..943a4d00d0 100644 --- a/src/ScreenWithMenuElements.cpp +++ b/src/ScreenWithMenuElements.cpp @@ -279,7 +279,7 @@ void ScreenWithMenuElements::StartTransitioningScreen( ScreenMessage smSendWhenD // Time the transition so that it finishes exactly when all actors have // finished tweening. float fSecondsUntilFinished = GetTweenTimeLeft(); - float fSecondsUntilBeginOff = max( fSecondsUntilFinished - m_Out.GetTweenTimeLeft(), 0 ); + float fSecondsUntilBeginOff = std::max( fSecondsUntilFinished - m_Out.GetTweenTimeLeft(), 0.0f ); m_Out.SetHibernate( fSecondsUntilBeginOff ); } } diff --git a/src/ScreenWithMenuElements.h b/src/ScreenWithMenuElements.h index 227b56629c..bb2edb6ede 100644 --- a/src/ScreenWithMenuElements.h +++ b/src/ScreenWithMenuElements.h @@ -46,7 +46,7 @@ protected: MemoryCardDisplay *m_MemoryCardDisplay[NUM_PLAYERS]; MenuTimer *m_MenuTimer; AutoActor m_sprOverlay; - vector m_vDecorations; + std::vector m_vDecorations; Transition m_In; Transition m_Out; diff --git a/src/Song.cpp b/src/Song.cpp index 21817b0a7d..5172058366 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -190,7 +190,7 @@ void Song::AddBackgroundChange( BackgroundLayer iLayer, BackgroundChange seg ) { // Delete old background change at this start beat, if any. auto &changes = GetBackgroundChanges(iLayer); - for (vector::iterator bgc = changes.begin(); bgc != changes.end(); ++bgc) + for (std::vector::iterator bgc = changes.begin(); bgc != changes.end(); ++bgc) { if( bgc->m_fStartBeat == seg.m_fStartBeat ) { @@ -271,7 +271,7 @@ const RString &Song::GetSongFilePath() const /* Hack: This should be a parameter to TidyUpData, but I don't want to pull in * into Song.h, which is heavily used. */ -static set BlacklistedImages; +static std::set BlacklistedImages; /* If PREFSMAN->m_bFastLoad is true, always load from cache if possible. * Don't read the contents of sDir if we can avoid it. That means we can't call @@ -295,7 +295,7 @@ bool Song::LoadFromSongDir(RString sDir, bool load_autosave, ProfileSlot from_pr // save group name if(from_profile == ProfileSlot_Invalid) { - vector sDirectoryParts; + std::vector sDirectoryParts; split( m_sSongDir, "/", sDirectoryParts, false ); ASSERT( sDirectoryParts.size() >= 4 ); /* e.g. "/Songs/Slow/Taps/" */ m_sGroupName = sDirectoryParts[sDirectoryParts.size()-3]; // second from last item @@ -356,7 +356,7 @@ bool Song::LoadFromSongDir(RString sDir, bool load_autosave, ProfileSlot from_pr { LOG->UserLog( "Song", sDir, "has no SSC, SM, SMA, DWI, BMS, or KSF files." ); - vector audios; + std::vector audios; FILEMAN->GetDirListingWithMultipleExtensions(sDir, ActorUtil::GetTypeExtensionList(FT_Sound), audios); bool has_music = !audios.empty(); @@ -367,7 +367,7 @@ bool Song::LoadFromSongDir(RString sDir, bool load_autosave, ProfileSlot from_pr return false; } // Make sure we have a future filename figured out. - vector folders; + std::vector folders; split(sDir, "/", folders); RString songName = folders[2] + ".ssc"; this->m_sSongFileName = sDir + songName; @@ -462,7 +462,7 @@ bool Song::ReloadFromSongDir( RString sDir ) FILEMAN->Remove(GetCacheFilePath()); RemoveAutoGenNotes(); - vector vOldSteps = m_vpSteps; + std::vector vOldSteps = m_vpSteps; Song copy; if( !copy.LoadFromSongDir( sDir ) ) @@ -473,8 +473,8 @@ bool Song::ReloadFromSongDir( RString sDir ) /* Go through the steps, first setting their Song pointer to this song * (instead of the copy used above), and constructing a map to let us * easily find the new steps. */ - map mNewSteps; - for( vector::const_iterator it = m_vpSteps.begin(); it != m_vpSteps.end(); ++it ) + std::map mNewSteps; + for( std::vector::const_iterator it = m_vpSteps.begin(); it != m_vpSteps.end(); ++it ) { (*it)->m_pSong = this; @@ -495,11 +495,11 @@ bool Song::ReloadFromSongDir( RString sDir ) * We have to go through these hoops because many places assume the Steps * pointers don't change - even though there are other ways they can change, * such as deleting a Steps via the editor. */ - for( vector::const_iterator itOld = vOldSteps.begin(); itOld != vOldSteps.end(); ++itOld ) + for( std::vector::const_iterator itOld = vOldSteps.begin(); itOld != vOldSteps.end(); ++itOld ) { StepsID id; id.FromSteps( *itOld ); - map::iterator itNew = mNewSteps.find( id ); + std::map::iterator itNew = mNewSteps.find( id ); if( itNew == mNewSteps.end() ) { // This stepchart didn't exist in the file we reverted from @@ -514,7 +514,7 @@ bool Song::ReloadFromSongDir( RString sDir ) } } // The leftovers in the map are steps that didn't exist before we reverted - for( map::const_iterator it = mNewSteps.begin(); it != mNewSteps.end(); ++it ) + for( std::map::const_iterator it = mNewSteps.begin(); it != mNewSteps.end(); ++it ) { Steps *NewSteps = new Steps(this); *NewSteps = *(it->second); @@ -523,7 +523,7 @@ bool Song::ReloadFromSongDir( RString sDir ) AddAutoGenNotes(); // Reload any images associated with the song. -Kyz - vector to_reload; + std::vector to_reload; to_reload.reserve(7); to_reload.push_back(m_sBannerFile); to_reload.push_back(m_sJacketFile); @@ -532,7 +532,7 @@ bool Song::ReloadFromSongDir( RString sDir ) to_reload.push_back(m_sBackgroundFile); to_reload.push_back(m_sCDTitleFile); to_reload.push_back(m_sPreviewVidFile); - for(vector::iterator file= to_reload.begin(); file != to_reload.end(); ++file) + for(std::vector::iterator file= to_reload.begin(); file != to_reload.end(); ++file) { RageTextureID id(*file); if(TEXTUREMAN->IsTextureRegistered(id)) @@ -551,7 +551,7 @@ void Song::LoadEditsFromSongDir(RString dir) { // Load any .edit files in the song folder. // Doing this BEFORE setting up AutoGen just in case. - vector vs; + std::vector vs; GetDirListing(dir + "*.edit", vs, false, false); // XXX: I'm sure there's a StepMania way of doing this, but familiar with this codebase I am not. for(unsigned int i = 0; i < vs.size(); ++i) @@ -649,10 +649,10 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ ) if(!from_cache) { - if (this->m_sArtist == "The Dancing Monkeys Project" && this->m_sMainTitle.find_first_of('-') != string::npos) + if (this->m_sArtist == "The Dancing Monkeys Project" && this->m_sMainTitle.find_first_of('-') != std::string::npos) { // Dancing Monkeys had a bug/feature where the artist was replaced. Restore it. - vector titleParts; + std::vector titleParts; split(this->m_sMainTitle, "-", titleParts); this->m_sArtist = titleParts.front(); Trim(this->m_sArtist); @@ -692,17 +692,17 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ ) // particular extension or type of extension. So fetch a list of all // files in the dir once, then split that list into the different things // we need. -Kyz - vector song_dir_listing; + std::vector song_dir_listing; FILEMAN->GetDirListing(m_sSongDir + "*", song_dir_listing, false, false); - vector music_list; - vector image_list; - vector movie_list; - vector lyric_list; - vector lyric_extensions(1, "lrc"); + std::vector music_list; + std::vector image_list; + std::vector movie_list; + std::vector lyric_list; + std::vector lyric_extensions(1, "lrc"); // Using a pair didn't work, so these two vectors have to be kept in // sync instead. -Kyz - vector*> lists_to_fill; - vector*> fill_exts; + std::vector*> lists_to_fill; + std::vector*> fill_exts; lists_to_fill.reserve(4); fill_exts.reserve(4); lists_to_fill.push_back(&music_list); @@ -718,7 +718,7 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ ) } lists_to_fill.push_back(&lyric_list); fill_exts.push_back(&lyric_extensions); - for(vector::iterator filename= song_dir_listing.begin(); + for(std::vector::iterator filename= song_dir_listing.begin(); filename != song_dir_listing.end(); ++filename) { bool matched_something= false; @@ -727,7 +727,7 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ ) { for(size_t tf= 0; tf < lists_to_fill.size(); ++ tf) { - for(vector::const_iterator ext= fill_exts[tf]->begin(); + for(std::vector::const_iterator ext= fill_exts[tf]->begin(); ext != fill_exts[tf]->end(); ++ext) { if(file_ext == *ext) @@ -878,7 +878,7 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ ) // which is the CDTitle. // For blank args to FindFirstFilenameContaining. -Kyz - vector empty_list; + std::vector empty_list; bool has_jacket= HasJacket(); bool has_cdimage= HasCDImage(); @@ -893,10 +893,10 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ ) //m_sBannerFile = ""; // find an image with "banner" in the file name - vector contains(1, "banner"); + std::vector contains(1, "banner"); /* Some people do things differently for the sake of being different. * Don't match eg. abnormal, numbness. */ - vector ends_with(1, " bn"); + std::vector ends_with(1, " bn"); m_bHasBanner= FindFirstFilenameContaining(image_list, m_sBannerFile, empty_list, contains, ends_with); } @@ -906,8 +906,8 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ ) //m_sBackgroundFile = ""; // find an image with "bg" or "background" in the file name - vector contains(1, "background"); - vector ends_with(1, "bg"); + std::vector contains(1, "background"); + std::vector ends_with(1, "bg"); m_bHasBackground= FindFirstFilenameContaining(image_list, m_sBackgroundFile, empty_list, contains, ends_with); } @@ -915,8 +915,8 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ ) if(!has_jacket) { // find an image with "jacket" or "albumart" in the filename. - vector starts_with(1, "jk_"); - vector contains; + std::vector starts_with(1, "jk_"); + std::vector contains; contains.reserve(2); contains.push_back("jacket"); contains.push_back("albumart"); @@ -928,7 +928,7 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ ) { // CD image, a la ddr 1st-3rd (not to be confused with CDTitles) // find an image with "-cd" at the end of the filename. - vector ends_with(1, "-cd"); + std::vector ends_with(1, "-cd"); has_cdimage= FindFirstFilenameContaining(image_list, m_sCDFile, empty_list, empty_list, ends_with); } @@ -936,7 +936,7 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ ) if(!has_disc) { // a rectangular graphic, not to be confused with CDImage above. - vector ends_with; + std::vector ends_with; ends_with.reserve(2); ends_with.push_back(" disc"); ends_with.push_back(" title"); @@ -947,7 +947,7 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ ) if(!has_cdtitle) { // find an image with "cdtitle" in the file name - vector contains(1, "cdtitle"); + std::vector contains(1, "cdtitle"); has_cdtitle= FindFirstFilenameContaining(image_list, m_sCDTitleFile, empty_list, contains, empty_list); } @@ -1168,9 +1168,9 @@ void Song::ReCalculateRadarValuesAndLastSecond(bool fromCache, bool duringCache) * don't force the first beat of the whole song to 0. */ if( tempNoteData.GetLastRow() != 0 ) { - localFirst = min(localFirst, + localFirst = std::min(localFirst, pSteps->GetTimingData()->GetElapsedTimeFromBeat(tempNoteData.GetFirstBeat())); - localLast = max(localLast, + localLast = std::max(localLast, pSteps->GetTimingData()->GetElapsedTimeFromBeat(tempNoteData.GetLastBeat())); } } @@ -1232,7 +1232,7 @@ void Song::Save(bool autosave) /* We've safely written our files and created backups. Rename non-SM and * non-DWI files to avoid confusion. */ - vector arrayOldFileNames; + std::vector arrayOldFileNames; GetDirListing( m_sSongDir + "*.bms", arrayOldFileNames ); GetDirListing( m_sSongDir + "*.pms", arrayOldFileNames ); GetDirListing( m_sSongDir + "*.ksf", arrayOldFileNames ); @@ -1261,7 +1261,7 @@ bool Song::SaveToSMFile() if( IsAFile(sPath) ) FileCopy( sPath, sPath + ".old" ); - vector vpStepsToSave; + std::vector vpStepsToSave; for (Steps *pSteps : m_vpSteps) { if( pSteps->IsAutogen() ) @@ -1298,7 +1298,7 @@ bool Song::SaveToSSCFile( RString sPath, bool bSavingCache, bool autosave ) if(!bSavingCache && !autosave && IsAFile(path)) FileCopy( path, path + ".old" ); - vector vpStepsToSave; + std::vector vpStepsToSave; for (Steps *pSteps : m_vpSteps) { if( pSteps->IsAutogen() ) @@ -1603,27 +1603,27 @@ bool Song::HasPreviewVid() const return m_sPreviewVidFile != "" && IsAFile(GetPreviewVidPath()); } -const vector &Song::GetBackgroundChanges( BackgroundLayer bl ) const +const std::vector &Song::GetBackgroundChanges( BackgroundLayer bl ) const { return *(m_BackgroundChanges[bl]); } -vector &Song::GetBackgroundChanges( BackgroundLayer bl ) +std::vector &Song::GetBackgroundChanges( BackgroundLayer bl ) { return *(m_BackgroundChanges[bl].Get()); } -const vector &Song::GetForegroundChanges() const +const std::vector &Song::GetForegroundChanges() const { return *m_ForegroundChanges; } -vector &Song::GetForegroundChanges() +std::vector &Song::GetForegroundChanges() { return *m_ForegroundChanges.Get(); } -vector Song::GetChangesToVectorString(const vector & changes) const +std::vector Song::GetChangesToVectorString(const std::vector & changes) const { - vector ret; + std::vector ret; for (BackgroundChange const &bgc : changes) { ret.push_back(bgc.ToString()); @@ -1631,17 +1631,17 @@ vector Song::GetChangesToVectorString(const vector & return ret; } -vector Song::GetBGChanges1ToVectorString() const +std::vector Song::GetBGChanges1ToVectorString() const { return this->GetChangesToVectorString(this->GetBackgroundChanges(BACKGROUND_LAYER_1)); } -vector Song::GetBGChanges2ToVectorString() const +std::vector Song::GetBGChanges2ToVectorString() const { return this->GetChangesToVectorString(this->GetBackgroundChanges(BACKGROUND_LAYER_2)); } -vector Song::GetFGChanges1ToVectorString() const +std::vector Song::GetFGChanges1ToVectorString() const { return this->GetChangesToVectorString(this->GetForegroundChanges()); } @@ -1650,7 +1650,7 @@ vector Song::GetFGChanges1ToVectorString() const RString Song::GetCacheFile(RString sType) { // We put the Predefined images into a map. - map< RString, RString > PreDefs; + std::map PreDefs; PreDefs["Banner"] = GetBannerPath(); PreDefs["Background"] = GetBackgroundPath(); PreDefs["CDTitle"] = GetCDTitlePath(); @@ -1663,10 +1663,10 @@ RString Song::GetCacheFile(RString sType) return PreDefs[sType.c_str()]; // Get all image files and put them into a vector. - vector song_dir_listing; + std::vector song_dir_listing; FILEMAN->GetDirListing(m_sSongDir + "*", song_dir_listing, false, false); - vector image_list; - vector fill_exts = ActorUtil::GetTypeExtensionList(FT_Bitmap); + std::vector image_list; + std::vector fill_exts = ActorUtil::GetTypeExtensionList(FT_Bitmap); for( RString Image : song_dir_listing ) { RString FileExt = GetExtension(Image); @@ -1679,7 +1679,7 @@ RString Song::GetCacheFile(RString sType) } // Create a map that contains all the filenames to search for. - map > PreSets; + std::map> PreSets; PreSets["Banner"][1] = "bn"; PreSets["Banner"][2] = "banner"; PreSets["Background"][1] = "bg"; @@ -1696,7 +1696,7 @@ RString Song::GetCacheFile(RString sType) { // We want to make it lower case. transform(Image.begin(), Image.end(), Image.begin(),::tolower); - for( pair< const int, RString> PreSet : PreSets[sType.c_str()] ) + for( std::pair PreSet : PreSets[sType.c_str()] ) { // Search for image using PreSets. size_t Found = Image.find(PreSet.second.c_str()); @@ -1739,9 +1739,9 @@ RString Song::GetFileHash() return m_sFileHash; } -vector Song::GetInstrumentTracksToVectorString() const +std::vector Song::GetInstrumentTracksToVectorString() const { - vector ret; + std::vector ret; FOREACH_ENUM(InstrumentTrack, it) { if (this->HasInstrumentTrack(it)) @@ -1765,7 +1765,7 @@ RString Song::GetSongAssetPath( RString sPath, const RString &sSongPath ) /* If there's no path in the file, the file is in the same directory as the * song. (This is the preferred configuration.) */ - if( sPath.find('/') == string::npos ) + if( sPath.find('/') == std::string::npos ) return sRelPath; // The song contains a path; treat it as relative to the top SM directory. @@ -1923,7 +1923,7 @@ void Song::DeleteSteps( const Steps* pSteps, bool bReAutoGen ) if( bReAutoGen ) RemoveAutoGenNotes(); - vector &vpSteps = m_vpStepsByType[pSteps->m_StepsType]; + std::vector &vpSteps = m_vpStepsByType[pSteps->m_StepsType]; for( int j=vpSteps.size()-1; j>=0; j-- ) { if( vpSteps[j] == pSteps ) @@ -1955,7 +1955,7 @@ bool Song::Matches(RString sGroup, RString sSong) const RString sDir = this->GetSongDir(); sDir.Replace("\\","/"); - vector bits; + std::vector bits; split( sDir, "/", bits ); ASSERT(bits.size() >= 2); // should always have at least two parts const RString &sLastBit = bits[bits.size()-1]; @@ -1971,11 +1971,11 @@ bool Song::Matches(RString sGroup, RString sSong) const /* If apInUse is set, it contains a list of steps which are in use elsewhere, * and should not be deleted. */ -void Song::FreeAllLoadedFromProfile( ProfileSlot slot, const set *setInUse ) +void Song::FreeAllLoadedFromProfile( ProfileSlot slot, const std::set *setInUse ) { /* DeleteSteps will remove and recreate autogen notes, which may reorder * m_vpSteps, so be careful not to skip over entries. */ - vector apToRemove; + std::vector apToRemove; for( int s=m_vpSteps.size()-1; s>=0; s-- ) { Steps* pSteps = m_vpSteps[s]; @@ -1992,7 +1992,7 @@ void Song::FreeAllLoadedFromProfile( ProfileSlot slot, const set *setInU this->DeleteSteps( apToRemove[i] ); } -void Song::GetStepsLoadedFromProfile( ProfileSlot slot, vector &vpStepsOut ) const +void Song::GetStepsLoadedFromProfile( ProfileSlot slot, std::vector &vpStepsOut ) const { for( unsigned s=0; s &v = p->GetAllSteps(); + const std::vector &v = p->GetAllSteps(); LuaHelpers::CreateTableFromArray( v, L ); return 1; } static int GetStepsByStepsType( T* p, lua_State *L ) { StepsType st = Enum::Check(L, 1); - const vector &v = p->GetStepsByStepsType( st ); + const std::vector &v = p->GetStepsByStepsType( st ); LuaHelpers::CreateTableFromArray( v, L ); return 1; } @@ -2328,7 +2328,7 @@ public: static int GetTimingData( T* p, lua_State *L ) { p->m_SongTiming.PushSelf(L); return 1; } static int GetBGChanges(T* p, lua_State* L) { - const vector& changes= p->GetBackgroundChanges(BACKGROUND_LAYER_1); + const std::vector& changes= p->GetBackgroundChanges(BACKGROUND_LAYER_1); lua_createtable(L, changes.size(), 0); for(size_t c= 0; c < changes.size(); ++c) { @@ -2428,7 +2428,7 @@ public: p->GetDisplayBpms(temp); float fMin = temp.GetMin(); float fMax = temp.GetMax(); - vector fBPMs; + std::vector fBPMs; fBPMs.push_back( fMin ); fBPMs.push_back( fMax ); LuaHelpers::CreateTableFromArray(fBPMs, L); diff --git a/src/Song.h b/src/Song.h index 92981e6f70..f7bf9ae876 100644 --- a/src/Song.h +++ b/src/Song.h @@ -259,10 +259,10 @@ public: RString m_sBackgroundFile; RString m_sCDTitleFile; RString m_sPreviewVidFile; - vector ImageDir; + std::vector ImageDir; AttackArray m_Attacks; - vector m_sAttackString; + std::vector m_sAttackString; static RString GetSongAssetPath( RString sPath, const RString &sSongPath ); RString GetMusicPath() const; @@ -319,7 +319,7 @@ public: void SetLastSecond(const float f); void SetSpecifiedLastSecond(const float f); - typedef vector VBackgroundChange; + typedef std::vector VBackgroundChange; private: /** @brief The first second that a note is hit. */ float firstSecond; @@ -340,23 +340,23 @@ private: * This must be sorted before gameplay. */ AutoPtrCopyOnWrite m_ForegroundChanges; - vector GetChangesToVectorString(const vector & changes) const; + std::vector GetChangesToVectorString(const std::vector & changes) const; public: - const vector &GetBackgroundChanges( BackgroundLayer bl ) const; - vector &GetBackgroundChanges( BackgroundLayer bl ); - const vector &GetForegroundChanges() const; - vector &GetForegroundChanges(); + const std::vector &GetBackgroundChanges( BackgroundLayer bl ) const; + std::vector &GetBackgroundChanges( BackgroundLayer bl ); + const std::vector &GetForegroundChanges() const; + std::vector &GetForegroundChanges(); - vector GetBGChanges1ToVectorString() const; - vector GetBGChanges2ToVectorString() const; - vector GetFGChanges1ToVectorString() const; + std::vector GetBGChanges1ToVectorString() const; + std::vector GetBGChanges2ToVectorString() const; + std::vector GetFGChanges1ToVectorString() const; - vector GetInstrumentTracksToVectorString() const; + std::vector GetInstrumentTracksToVectorString() const; /** * @brief The list of LyricSegments. * This must be sorted before gameplay. */ - vector m_LyricSegments; + std::vector m_LyricSegments; /* [splittiming] void AddBPMSegment( const BPMSegment &seg ) { m_Timing.AddBPMSegment( seg ); } @@ -416,8 +416,8 @@ public: bool HasStepsType( StepsType st ) const; bool HasStepsTypeAndDifficulty( StepsType st, Difficulty dc ) const; // TODO: Allow for a non const version. - const vector& GetAllSteps() const { return m_vpSteps; } - const vector& GetStepsByStepsType( StepsType st ) const { return m_vpStepsByType[st]; } + const std::vector& GetAllSteps() const { return m_vpSteps; } + const std::vector& GetStepsByStepsType( StepsType st ) const { return m_vpStepsByType[st]; } bool IsEasy( StepsType st ) const; bool IsTutorial() const; bool HasEdits( StepsType st ) const; @@ -439,9 +439,9 @@ public: void AddSteps( Steps* pSteps ); void DeleteSteps( const Steps* pSteps, bool bReAutoGen = true ); - void FreeAllLoadedFromProfile( ProfileSlot slot = ProfileSlot_Invalid, const set *setInUse = nullptr ); + void FreeAllLoadedFromProfile( ProfileSlot slot = ProfileSlot_Invalid, const std::set *setInUse = nullptr ); bool WasLoadedFromProfile() const { return m_LoadedFromProfile != ProfileSlot_Invalid; } - void GetStepsLoadedFromProfile( ProfileSlot slot, vector &vpStepsOut ) const; + void GetStepsLoadedFromProfile( ProfileSlot slot, std::vector &vpStepsOut ) const; int GetNumStepsLoadedFromProfile( ProfileSlot slot ) const; bool IsEditAlreadyLoaded( Steps* pSteps ) const; @@ -454,7 +454,7 @@ public: * If you change the index in here, you must change all NoteData too. * Any note that doesn't have a value in the range of this array * means "this note doesn't have a keysound". */ - vector m_vsKeysoundFile; + std::vector m_vsKeysoundFile; RString GetAttackString() const { @@ -467,11 +467,11 @@ public: private: bool m_loaded_from_autosave; /** @brief the Steps that belong to this Song. */ - vector m_vpSteps; + std::vector m_vpSteps; /** @brief the Steps of a particular StepsType that belong to this Song. */ - std::array, NUM_StepsType> m_vpStepsByType; + std::array, NUM_StepsType> m_vpStepsByType; /** @brief the Steps that are of unrecognized Styles. */ - vector m_UnknownStyleSteps; + std::vector m_UnknownStyleSteps; }; #endif diff --git a/src/SongCacheIndex.cpp b/src/SongCacheIndex.cpp index 1a8a0ef919..6caef32297 100644 --- a/src/SongCacheIndex.cpp +++ b/src/SongCacheIndex.cpp @@ -73,7 +73,7 @@ static void EmptyDir( RString dir ) { ASSERT(dir[dir.size()-1] == '/'); - vector asCacheFileNames; + std::vector asCacheFileNames; GetDirListing( dir, asCacheFileNames ); for( unsigned i=0; i ImageDir; + + std::vector ImageDir; split( CommonMetrics::IMAGES_TO_CACHE, ",", ImageDir ); for( unsigned c=0; c never_cache; + std::vector never_cache; split(PREFSMAN->m_NeverCacheList, ",", never_cache); - for(vector::iterator group= never_cache.begin(); + for(std::vector::iterator group= never_cache.begin(); group != never_cache.end(); ++group) { m_GroupsToNeverCache.insert(*group); @@ -240,9 +240,9 @@ static LocalizedString FOLDER_CONTAINS_MUSIC_FILES( "SongManager", "The folder \ void SongManager::SanityCheckGroupDir( RString sDir ) const { // Check to see if they put a song directly inside the group folder. - vector arrayFiles; + std::vector arrayFiles; GetDirListing( sDir + "/*", arrayFiles ); - const vector& audio_exts= ActorUtil::GetTypeExtensionList(FT_Sound); + const std::vector& audio_exts= ActorUtil::GetTypeExtensionList(FT_Sound); for (RString &fname : arrayFiles) { const RString ext= GetExtension(fname); @@ -268,7 +268,7 @@ void SongManager::AddGroup( RString sDir, RString sGroupDirName ) return; // the group is already added // Look for a group banner in this group folder - vector arrayGroupBanners; + std::vector arrayGroupBanners; GetDirListing( sDir+sGroupDirName+"/*.png", arrayGroupBanners ); GetDirListing( sDir+sGroupDirName+"/*.jpg", arrayGroupBanners ); GetDirListing( sDir+sGroupDirName+"/*.jpeg", arrayGroupBanners ); @@ -345,13 +345,13 @@ void SongManager::LoadSongDir( RString sDir, LoadingWindow *ld, bool onlyAdditio sDir += "/"; // Find all group directories in "Songs" folder - vector arrayGroupDirs; + std::vector arrayGroupDirs; GetDirListing( sDir+"*", arrayGroupDirs, true ); SortRStringArray( arrayGroupDirs ); StripCvsAndSvn( arrayGroupDirs ); StripMacResourceForks( arrayGroupDirs ); - vector< vector > arrayGroupSongDirs; + std::vector> arrayGroupSongDirs; int groupIndex, songCount, songIndex; groupIndex = 0; @@ -375,7 +375,7 @@ void SongManager::LoadSongDir( RString sDir, LoadingWindow *ld, bool onlyAdditio SanityCheckGroupDir(sDir+sGroupDirName); // Find all Song folders in this group directory - vector arraySongDirs; + std::vector arraySongDirs; GetDirListing( sDir+sGroupDirName + "/*", arraySongDirs, true, true ); StripCvsAndSvn( arraySongDirs ); StripMacResourceForks( arraySongDirs ); @@ -397,7 +397,7 @@ void SongManager::LoadSongDir( RString sDir, LoadingWindow *ld, bool onlyAdditio songIndex = 0; for (RString const &sGroupDirName : arrayGroupDirs) // foreach dir in /Songs/ { - vector &arraySongDirs = arrayGroupSongDirs[groupIndex++]; + std::vector &arraySongDirs = arrayGroupSongDirs[groupIndex++]; LOG->Trace("Attempting to load %i songs from \"%s\"", int(arraySongDirs.size()), (sDir+sGroupDirName).c_str() ); @@ -469,7 +469,7 @@ void SongManager::LoadSongDir( RString sDir, LoadingWindow *ld, bool onlyAdditio void SongManager::LoadGroupSymLinks(RString sDir, RString sGroupFolder) { // Find all symlink files in this folder - vector arraySymLinks; + std::vector arraySymLinks; GetDirListing( sDir+sGroupFolder+"/*.include", arraySymLinks, false ); SortRStringArray( arraySymLinks ); SongPointerVector& index_entry = m_mapSongGroupIndex[sGroupFolder]; @@ -486,7 +486,7 @@ void SongManager::LoadGroupSymLinks(RString sDir, RString sGroupFolder) } else { - const vector& vpSteps = pNewSong->GetAllSteps(); + const std::vector& vpSteps = pNewSong->GetAllSteps(); while( vpSteps.size() ) pNewSong->DeleteSteps( vpSteps[0] ); @@ -510,7 +510,7 @@ void SongManager::PreloadSongImages() * that we don't need to. */ RageTexturePreloader preload; - const vector &songs = GetAllSongs(); + const std::vector &songs = GetAllSongs(); for( unsigned i = 0; i < songs.size(); ++i ) { if( !songs[i]->HasBanner() ) @@ -520,7 +520,7 @@ void SongManager::PreloadSongImages() preload.Load( ID ); } - vector courses; + std::vector courses; GetAllCourses( courses, false ); for( unsigned i = 0; i < courses.size(); ++i ) { @@ -566,9 +566,9 @@ void SongManager::UnlistSong(Song *song) m_pDeletedSongs.push_back(song); // remove all occurences of the song in each of our song vectors - vector* songVectors[3] = { &m_pSongs, &m_pPopularSongs, &m_pShuffledSongs }; + std::vector* songVectors[3] = { &m_pSongs, &m_pPopularSongs, &m_pShuffledSongs }; for (int songVecIdx=0; songVecIdx<3; ++songVecIdx) { - vector& v = *songVectors[songVecIdx]; + std::vector& v = *songVectors[songVecIdx]; for (int i=0; i &AddTo ) const +void SongManager::GetSongGroupNames( std::vector &AddTo ) const { AddTo.insert(AddTo.end(), m_sSongGroupNames.begin(), m_sSongGroupNames.end() ); } @@ -684,7 +684,7 @@ RageColor SongManager::GetSongColor( const Song* pSong ) const * XXX: Ack. This means this function can only be called when we have * a style set up, which is too restrictive. How to handle this? */ //const StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; - const vector& vpSteps = pSong->GetAllSteps(); + const std::vector& vpSteps = pSong->GetAllSteps(); for( unsigned i=0; i::const_iterator iter = m_mapCourseGroupToInfo.find( sCourseGroup ); + std::map::const_iterator iter = m_mapCourseGroupToInfo.find( sCourseGroup ); if( iter == m_mapCourseGroupToInfo.end() ) { ASSERT_M( 0, ssprintf("requested banner for course group '%s' that doesn't exist",sCourseGroup.c_str()) ); @@ -721,7 +721,7 @@ RString SongManager::GetCourseGroupBannerPath( const RString &sCourseGroup ) con } } -void SongManager::GetCourseGroupNames( vector &AddTo ) const +void SongManager::GetCourseGroupNames( std::vector &AddTo ) const { for (std::pair const &iter : m_mapCourseGroupToInfo) AddTo.push_back( iter.first ); @@ -789,13 +789,13 @@ void SongManager::ResetGroupColors() COURSE_GROUP_COLOR .Load( "SongManager", COURSE_GROUP_COLOR_NAME, NUM_COURSE_GROUP_COLORS ); } -const vector &SongManager::GetSongs( const RString &sGroupName ) const +const std::vector &SongManager::GetSongs( const RString &sGroupName ) const { - static const vector vEmpty; + static const std::vector vEmpty; if( sGroupName == GROUP_ALL ) return m_pSongs; - map::const_iterator iter = m_mapSongGroupIndex.find( sGroupName ); + std::map::const_iterator iter = m_mapSongGroupIndex.find( sGroupName ); if ( iter != m_mapSongGroupIndex.end() ) return iter->second; FOREACH_EnabledPlayer(pn) @@ -812,7 +812,7 @@ const vector &SongManager::GetSongs( const RString &sGroupName ) const return vEmpty; } -void SongManager::GetPreferredSortSongs( vector &AddTo ) const +void SongManager::GetPreferredSortSongs( std::vector &AddTo ) const { if( m_vPreferredSongSort.empty() ) { @@ -835,7 +835,7 @@ RString SongManager::SongToPreferredSortSectionName( const Song *pSong ) const return RString(); } -void SongManager::GetPreferredSortCourses( CourseType ct, vector &AddTo, bool bIncludeAutogen ) const +void SongManager::GetPreferredSortCourses( CourseType ct, std::vector &AddTo, bool bIncludeAutogen ) const { if( m_vPreferredCourseSort.empty() ) { @@ -908,7 +908,7 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld, bool onlyAdditions ) RageTimer loading_window_last_update_time; loading_window_last_update_time.Touch(); - vector vsCourseGroupNames; + std::vector vsCourseGroupNames; // Find all group directories in Courses dir GetDirListing( SpecialFiles::COURSES_DIR + "*", vsCourseGroupNames, true, true ); StripCvsAndSvn( vsCourseGroupNames ); @@ -922,7 +922,7 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld, bool onlyAdditions ) for (RString const &sCourseGroup : vsCourseGroupNames) // for each dir in /Courses/ { // Find all CRS files in this group directory - vector vsCoursePaths; + std::vector vsCoursePaths; GetDirListing( sCourseGroup + "/*.crs", vsCoursePaths, false, true ); SortRStringArray( vsCoursePaths ); @@ -977,7 +977,7 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld, bool onlyAdditions ) void SongManager::InitAutogenCourses() { // Create group courses for Endless and Nonstop - vector saGroupNames; + std::vector saGroupNames; this->GetSongGroupNames( saGroupNames ); Course* pCourse; for( unsigned g=0; g apCourseSongs = GetAllSongs(); + std::vector apCourseSongs = GetAllSongs(); // Generate "All Songs" endless course. pCourse = new Course; @@ -1010,14 +1010,14 @@ void SongManager::InitAutogenCourses() /* We normally sort by translit artist. However, display artist is more * consistent. For example, transliterated Japanese names are alternately * spelled given- and family-name first, but display titles are more consistent. */ - vector apSongs = this->GetAllSongs(); + std::vector apSongs = this->GetAllSongs(); SongUtil::SortSongPointerArrayByDisplayArtist( apSongs ); RString sCurArtist = ""; RString sCurArtistTranslit = ""; int iCurArtistCount = 0; - vector aSongs; + std::vector aSongs; unsigned i = 0; do { RString sArtist = i >= apSongs.size()? RString(""): apSongs[i]->GetDisplayArtist(); @@ -1108,8 +1108,8 @@ void SongManager::FreeCourses() void SongManager::DeleteAutogenCourses() { - vector vNewCourses; - for( vector::iterator it = m_pCourses.begin(); it != m_pCourses.end(); ++it ) + std::vector vNewCourses; + for( std::vector::iterator it = m_pCourses.begin(); it != m_pCourses.end(); ++it ) { if( (*it)->m_bIsAutogen ) { @@ -1136,7 +1136,7 @@ void SongManager::AddCourse( Course *pCourse ) void SongManager::DeleteCourse( Course *pCourse ) { - vector::iterator iter = find( m_pCourses.begin(), m_pCourses.end(), pCourse ); + std::vector::iterator iter = find( m_pCourses.begin(), m_pCourses.end(), pCourse ); ASSERT( iter != m_pCourses.end() ); m_pCourses.erase( iter ); UpdatePopular(); @@ -1161,7 +1161,7 @@ void SongManager::Cleanup() { if (pSong) { - const vector& vpSteps = pSong->GetAllSteps(); + const std::vector& vpSteps = pSong->GetAllSteps(); for (Steps *pSteps : vpSteps) { pSteps->Compress(); @@ -1210,11 +1210,11 @@ void SongManager::SetPreferences() void SongManager::SaveEnabledSongsToPref() { - vector vsDisabledSongs; + std::vector vsDisabledSongs; // Intentionally drop disabled song entries for songs that aren't currently loaded. - const vector &apSongs = SONGMAN->GetAllSongs(); + const std::vector &apSongs = SONGMAN->GetAllSongs(); for (Song *pSong : apSongs) { SongID sid; @@ -1227,7 +1227,7 @@ void SongManager::SaveEnabledSongsToPref() void SongManager::LoadEnabledSongsFromPref() { - vector asDisabledSongs; + std::vector asDisabledSongs; split( g_sDisabledSongs, ";", asDisabledSongs, true ); for (RString const &s : asDisabledSongs) @@ -1240,9 +1240,9 @@ void SongManager::LoadEnabledSongsFromPref() } } -void SongManager::GetStepsLoadedFromProfile( vector &AddTo, ProfileSlot slot ) const +void SongManager::GetStepsLoadedFromProfile( std::vector &AddTo, ProfileSlot slot ) const { - const vector &vSongs = GetAllSongs(); + const std::vector &vSongs = GetAllSongs(); for (Song *song : vSongs) { song->GetStepsLoadedFromProfile( slot, AddTo ); @@ -1254,14 +1254,14 @@ void SongManager::DeleteSteps( Steps *pSteps ) pSteps->m_pSong->DeleteSteps( pSteps ); } -void SongManager::GetAllCourses( vector &AddTo, bool bIncludeAutogen ) const +void SongManager::GetAllCourses( std::vector &AddTo, bool bIncludeAutogen ) const { for( unsigned i=0; im_bIsAutogen ) AddTo.push_back( m_pCourses[i] ); } -void SongManager::GetCourses( CourseType ct, vector &AddTo, bool bIncludeAutogen ) const +void SongManager::GetCourses( CourseType ct, std::vector &AddTo, bool bIncludeAutogen ) const { for( unsigned i=0; iGetCourseType() == ct ) @@ -1269,7 +1269,7 @@ void SongManager::GetCourses( CourseType ct, vector &AddTo, bool bInclu AddTo.push_back( m_pCourses[i] ); } -void SongManager::GetCoursesInGroup( vector &AddTo, const RString &sCourseGroup, bool bIncludeAutogen ) const +void SongManager::GetCoursesInGroup( std::vector &AddTo, const RString &sCourseGroup, bool bIncludeAutogen ) const { for( unsigned i=0; im_sGroupName == sCourseGroup ) @@ -1299,8 +1299,8 @@ bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredG bool CompareNotesPointersForExtra(const Steps *n1, const Steps *n2) { // Equate CHALLENGE to HARD. - Difficulty d1 = min(n1->GetDifficulty(), Difficulty_Hard); - Difficulty d2 = min(n2->GetDifficulty(), Difficulty_Hard); + Difficulty d1 = std::min(n1->GetDifficulty(), Difficulty_Hard); + Difficulty d2 = std::min(n2->GetDifficulty(), Difficulty_Hard); if(d1 < d2) return true; if(d1 > d2) return false; @@ -1346,12 +1346,12 @@ void SongManager::GetExtraStageInfo( bool bExtra2, const Style *sd, Song*& pSong Song* pExtra2Song = nullptr; // a medium-hard Song and Steps. Use this for extra stage 2. Steps* pExtra2Notes = nullptr; - const vector &apSongs = GetSongs( sGroup ); + const std::vector &apSongs = GetSongs( sGroup ); for( unsigned s=0; s apSteps; + std::vector apSteps; SongUtil::GetSteps( pSong, apSteps, sd->m_StepsType ); for( unsigned n=0; n::const_iterator entry= m_SongsByDir.find(dir); + std::map::const_iterator entry= m_SongsByDir.find(dir); if(entry != m_SongsByDir.end()) { return entry->second; @@ -1493,7 +1493,7 @@ Course* SongManager::GetCourseFromName( RString sName ) const Song *SongManager::FindSong( RString sPath ) const { sPath.Replace( '\\', '/' ); - vector bits; + std::vector bits; split( sPath, "/", bits ); if( bits.size() == 1 ) @@ -1507,7 +1507,7 @@ Song *SongManager::FindSong( RString sPath ) const Song *SongManager::FindSong( RString sGroup, RString sSong ) const { // foreach song - const vector &vSongs = GetSongs( sGroup.empty()? GROUP_ALL:sGroup ); + const std::vector &vSongs = GetSongs( sGroup.empty()? GROUP_ALL:sGroup ); for (Song *s : vSongs) { if( s->Matches(sGroup, sSong) ) @@ -1520,7 +1520,7 @@ Song *SongManager::FindSong( RString sGroup, RString sSong ) const Course *SongManager::FindCourse( RString sPath ) const { sPath.Replace( '\\', '/' ); - vector bits; + std::vector bits; split( sPath, "/", bits ); if( bits.size() == 1 ) @@ -1545,7 +1545,7 @@ Course *SongManager::FindCourse( RString sGroup, RString sName ) const void SongManager::UpdatePopular() { // update players best - vector apBestSongs = m_pSongs; + std::vector apBestSongs = m_pSongs; for ( unsigned j=0; j < apBestSongs.size() ; ++j ) { bool bFiltered = false; @@ -1556,14 +1556,14 @@ void SongManager::UpdatePopular() continue; // Remove it. - swap( apBestSongs[j], apBestSongs.back() ); + std::swap( apBestSongs[j], apBestSongs.back() ); apBestSongs.erase( apBestSongs.end()-1 ); --j; } SongUtil::SortSongPointerArrayByTitle( apBestSongs ); - vector apBestCourses[NUM_CourseType]; + std::vector apBestCourses[NUM_CourseType]; FOREACH_ENUM( CourseType, ct ) { GetCourses( ct, apBestCourses[ct], PREFSMAN->m_bAutogenGroupCourses ); @@ -1575,7 +1575,7 @@ void SongManager::UpdatePopular() FOREACH_CourseType( ct ) { - vector &vpCourses = m_pPopularCourses[ct]; + std::vector &vpCourses = m_pPopularCourses[ct]; vpCourses = apBestCourses[ct]; CourseUtil::SortCoursePointerArrayByNumPlays( vpCourses, ProfileSlot_Machine, true ); } @@ -1598,14 +1598,14 @@ void SongManager::UpdatePreferredSort(RString sPreferredSongs, RString sPreferre { m_vPreferredSongSort.clear(); - vector asLines; + std::vector asLines; RString sFile = THEME->GetPathO( "SongManager", sPreferredSongs ); GetFileContents( sFile, asLines ); if( asLines.empty() ) return; PreferredSortSection section; - map mapSongToPri; + std::map mapSongToPri; for (RString sLine : asLines) { @@ -1632,7 +1632,7 @@ void SongManager::UpdatePreferredSort(RString sPreferredSongs, RString sPreferre if( DoesSongGroupExist(group) ) { // add all songs in group - const vector &vSongs = GetSongs( group ); + const std::vector &vSongs = GetSongs( group ); for (Song *song : vSongs) { if( UNLOCKMAN->SongIsLocked(song) & LOCKED_SELECTABLE ) @@ -1672,7 +1672,7 @@ void SongManager::UpdatePreferredSort(RString sPreferredSongs, RString sPreferre } } - for (vector::iterator v = m_vPreferredSongSort.begin(); v != m_vPreferredSongSort.end(); ++v) + for (std::vector::iterator v = m_vPreferredSongSort.begin(); v != m_vPreferredSongSort.end(); ++v) { for( int i=v->vpSongs.size()-1; i>=0; i-- ) { @@ -1702,12 +1702,12 @@ void SongManager::UpdatePreferredSort(RString sPreferredSongs, RString sPreferre { m_vPreferredCourseSort.clear(); - vector asLines; + std::vector asLines; RString sFile = THEME->GetPathO( "SongManager", sPreferredCourses ); if( !GetFileContents(sFile, asLines) ) return; - vector vpCourses; + std::vector vpCourses; for (RString sLine : asLines) { @@ -1739,7 +1739,7 @@ void SongManager::UpdatePreferredSort(RString sPreferredSongs, RString sPreferre if( MOVE_UNLOCKS_TO_BOTTOM_OF_PREFERRED_SORT.GetValue() ) { // move all unlock Courses to a group at the bottom - vector vpUnlockCourses; + std::vector vpUnlockCourses; for (UnlockEntry const &ue : UNLOCKMAN->m_UnlockEntries) { if( ue.m_Type == UnlockRewardType_Course ) @@ -1784,7 +1784,7 @@ void SongManager::UpdateRankingCourses() { /* Updating the ranking courses data is fairly expensive since it involves * comparing strings. Do so sparingly. */ - vector RankingCourses; + std::vector RankingCourses; split( THEME->GetMetric("ScreenRanking","CoursesToShow"),",", RankingCourses); for (Course *c : m_pCourses) @@ -1817,8 +1817,8 @@ void SongManager::LoadStepEditsFromProfileDir( const RString &sProfileDir, Profi int iNumEditsLoaded = GetNumEditsLoadedFromProfile( slot ); // Pass 1: Flat folder (old style) - vector vsFiles; - int size = min( (int) vsFiles.size(), MAX_EDIT_STEPS_PER_PROFILE - iNumEditsLoaded ); + std::vector vsFiles; + int size = std::min( (int) vsFiles.size(), MAX_EDIT_STEPS_PER_PROFILE - iNumEditsLoaded ); GetDirListing( sDir+"*.edit", vsFiles, false, true ); // XXX: If some edits are invalid and they're close to the edit limit, this may erroneously skip some edits, and won't warn. @@ -1844,19 +1844,19 @@ void SongManager::LoadStepEditsFromProfileDir( const RString &sProfileDir, Profi iNumEditsLoaded = GetNumEditsLoadedFromProfile( slot ); // Pass 2: Group and song folders with #SONG inferred from folder (optional new style) - vector vsGroups; + std::vector vsGroups; GetDirListing( sDir+"*", vsGroups, true, false ); // XXX: Same as above, edits may be skipped in error in some cases for( unsigned i=0; i vsSongs; + std::vector vsSongs; GetDirListing(sDir+sGroupDir+"*", vsSongs, true, false ); for( unsigned j=0; j vsEdits; + std::vector vsEdits; RString sSongDir = sGroupDir+vsSongs[j]+"/"; // XXX There doesn't appear to be a songdir const? Song *given = GetSongFromDir( "/Songs/"+sSongDir ); @@ -1865,7 +1865,7 @@ void SongManager::LoadStepEditsFromProfileDir( const RString &sProfileDir, Profi // which will interpret that as "we couldn't infer the song from the path", // which is what we want in that case anyway. GetDirListing(sDir+sSongDir+"/*.edit", vsEdits, false, true ); - size = min( (int) vsEdits.size(), MAX_EDIT_STEPS_PER_PROFILE - iNumEditsLoaded ); + size = std::min( (int) vsEdits.size(), MAX_EDIT_STEPS_PER_PROFILE - iNumEditsLoaded ); for( int k=0; k vsFiles; + std::vector vsFiles; GetDirListing( sDir+"*.crs", vsFiles, false, true ); int iNumEditsLoaded = GetNumEditsLoadedFromProfile( slot ); - int size = min( (int) vsFiles.size(), MAX_EDIT_COURSES_PER_PROFILE - iNumEditsLoaded ); + int size = std::min( (int) vsFiles.size(), MAX_EDIT_COURSES_PER_PROFILE - iNumEditsLoaded ); for( int i=0; i apSteps; + std::vector apSteps; SongUtil::GetSteps( pSong, apSteps ); for( unsigned i = 0; i < apSteps.size(); ++i ) @@ -1938,7 +1938,7 @@ void SongManager::AddSongToList(Song* new_song) void SongManager::FreeAllLoadedFromProfile( ProfileSlot slot ) { // Profile courses may refer to profile steps, so free profile courses first. - vector apToDelete; + std::vector apToDelete; for (Course *pCourse : m_pCourses) { if( pCourse->GetLoadedFromProfileSlot() == ProfileSlot_Invalid ) @@ -1952,7 +1952,7 @@ void SongManager::FreeAllLoadedFromProfile( ProfileSlot slot ) * UpdateShuffled repeatedly. */ for( unsigned i = 0; i < apToDelete.size(); ++i ) { - vector::iterator iter = find( m_pCourses.begin(), m_pCourses.end(), apToDelete[i] ); + std::vector::iterator iter = find( m_pCourses.begin(), m_pCourses.end(), apToDelete[i] ); ASSERT( iter != m_pCourses.end() ); m_pCourses.erase( iter ); delete apToDelete[i]; @@ -1964,7 +1964,7 @@ void SongManager::FreeAllLoadedFromProfile( ProfileSlot slot ) RefreshCourseGroupInfo(); // Free profile steps. - set setInUse; + std::set setInUse; if( STATSMAN ) STATSMAN->GetStepsInUse( setInUse ); for (Song *s : m_pSongs) @@ -1976,7 +1976,7 @@ int SongManager::GetNumStepsLoadedFromProfile() int iCount = 0; for (Song const *s : m_pSongs) { - vector vpAllSteps = s->GetAllSteps(); + std::vector vpAllSteps = s->GetAllSteps(); iCount += std::count_if(vpAllSteps.begin(), vpAllSteps.end(), [](Steps const *step) { return step->GetLoadedFromProfileSlot() != ProfileSlot_Invalid; @@ -2035,13 +2035,13 @@ public: } static int GetAllSongs( T* p, lua_State *L ) { - const vector &v = p->GetAllSongs(); + const std::vector &v = p->GetAllSongs(); LuaHelpers::CreateTableFromArray( v, L ); return 1; } static int GetAllCourses( T* p, lua_State *L ) { - vector v; + std::vector v; p->GetAllCourses( v, BArg(1) ); LuaHelpers::CreateTableFromArray( v, L ); return 1; @@ -2049,14 +2049,14 @@ public: static int GetPreferredSortSongs( T* p, lua_State *L ) { - vector v; + std::vector v; p->GetPreferredSortSongs(v); LuaHelpers::CreateTableFromArray( v, L ); return 1; } static int GetPreferredSortCourses( T* p, lua_State *L ) { - vector v; + std::vector v; CourseType ct = Enum::Check(L,1); p->GetPreferredSortCourses( ct, v, BArg(2) ); LuaHelpers::CreateTableFromArray( v, L ); @@ -2124,7 +2124,7 @@ public: static int GetSongGroupNames( T* p, lua_State *L ) { - vector v; + std::vector v; p->GetSongGroupNames( v ); LuaHelpers::CreateTableFromArray( v, L ); return 1; @@ -2132,14 +2132,14 @@ public: static int GetSongsInGroup( T* p, lua_State *L ) { - vector v = p->GetSongs(SArg(1)); + std::vector v = p->GetSongs(SArg(1)); LuaHelpers::CreateTableFromArray( v, L ); return 1; } static int GetCoursesInGroup( T* p, lua_State *L ) { - vector v; + std::vector v; p->GetCoursesInGroup(v,SArg(1),BArg(2)); LuaHelpers::CreateTableFromArray( v, L ); return 1; @@ -2149,7 +2149,7 @@ public: static int GetCourseGroupNames( T* p, lua_State *L ) { - vector v; + std::vector v; p->GetCourseGroupNames( v ); LuaHelpers::CreateTableFromArray( v, L ); return 1; @@ -2162,14 +2162,14 @@ public: static int GetPopularSongs( T* p, lua_State *L ) { - const vector &v = p->GetPopularSongs(); + const std::vector &v = p->GetPopularSongs(); LuaHelpers::CreateTableFromArray( v, L ); return 1; } static int GetPopularCourses( T* p, lua_State *L ) { CourseType ct = Enum::Check(L,1); - const vector &v = p->GetPopularCourses(ct); + const std::vector &v = p->GetPopularCourses(ct); LuaHelpers::CreateTableFromArray( v, L ); return 1; } diff --git a/src/SongManager.h b/src/SongManager.h index f9ac6fba4c..b32d239598 100644 --- a/src/SongManager.h +++ b/src/SongManager.h @@ -92,14 +92,14 @@ public: RString GetSongGroupBannerPath( RString sSongGroup ) const; //RString GetSongGroupBackgroundPath( RString sSongGroup ) const; - void GetSongGroupNames( vector &AddTo ) const; + void GetSongGroupNames( std::vector &AddTo ) const; bool DoesSongGroupExist( RString sSongGroup ) const; RageColor GetSongGroupColor( const RString &sSongGroupName ) const; RageColor GetSongColor( const Song* pSong ) const; RString GetCourseGroupBannerPath( const RString &sCourseGroup ) const; //RString GetCourseGroupBackgroundPath( const RString &sCourseGroup ) const; - void GetCourseGroupNames( vector &AddTo ) const; + void GetCourseGroupNames( std::vector &AddTo ) const; bool DoesCourseGroupExist( const RString &sCourseGroup ) const; RageColor GetCourseGroupColor( const RString &sCourseGroupName ) const; RageColor GetCourseColor( const Course* pCourse ) const; @@ -113,34 +113,34 @@ public: * @brief Retrieve all of the songs that belong to a particular group. * @param sGroupName the name of the group. * @return the songs that belong in the group. */ - const vector &GetSongs( const RString &sGroupName ) const; + const std::vector &GetSongs( const RString &sGroupName ) const; /** * @brief Retrieve all of the songs in the game. * @return all of the songs. */ - const vector &GetAllSongs() const { return GetSongs(GROUP_ALL); } + const std::vector &GetAllSongs() const { return GetSongs(GROUP_ALL); } /** * @brief Retrieve all of the popular songs. * * Popularity is determined specifically by the number of times * a song is chosen. * @return all of the popular songs. */ - const vector &GetPopularSongs() const { return m_pPopularSongs; } + const std::vector &GetPopularSongs() const { return m_pPopularSongs; } /** * @brief Retrieve all of the songs in a group that have at least one * valid step for the current gametype. * @param sGroupName the name of the group. * @return the songs within the group that have at least one valid Step. */ - const vector &GetSongsOfCurrentGame( const RString &sGroupName ) const; + const std::vector &GetSongsOfCurrentGame( const RString &sGroupName ) const; /** * @brief Retrieve all of the songs in the game that have at least one * valid step for the current gametype. * @return the songs within the game that have at least one valid Step. */ - const vector &GetAllSongsOfCurrentGame() const; + const std::vector &GetAllSongsOfCurrentGame() const; - void GetPreferredSortSongs( vector &AddTo ) const; + void GetPreferredSortSongs( std::vector &AddTo ) const; RString SongToPreferredSortSectionName( const Song *pSong ) const; - const vector &GetPopularCourses( CourseType ct ) const { return m_pPopularCourses[ct]; } + const std::vector &GetPopularCourses( CourseType ct ) const { return m_pPopularCourses[ct]; } Song *FindSong( RString sPath ) const; Song *FindSong( RString sGroup, RString sSong ) const; Course *FindCourse( RString sPath ) const; @@ -164,13 +164,13 @@ public: RString GetSongGroupByIndex(unsigned index) { return m_sSongGroupNames[index]; } int GetSongRank(Song* pSong); - void GetStepsLoadedFromProfile( vector &AddTo, ProfileSlot slot ) const; + void GetStepsLoadedFromProfile( std::vector &AddTo, ProfileSlot slot ) const; void DeleteSteps( Steps *pSteps ); // transfers ownership of pSteps - void GetAllCourses( vector &AddTo, bool bIncludeAutogen ) const; - void GetCourses( CourseType ct, vector &AddTo, bool bIncludeAutogen ) const; - void GetCoursesInGroup( vector &AddTo, const RString &sCourseGroup, bool bIncludeAutogen ) const; - void GetPreferredSortCourses( CourseType ct, vector &AddTo, bool bIncludeAutogen ) const; + void GetAllCourses( std::vector &AddTo, bool bIncludeAutogen ) const; + void GetCourses( CourseType ct, std::vector &AddTo, bool bIncludeAutogen ) const; + void GetCoursesInGroup( std::vector &AddTo, const RString &sCourseGroup, bool bIncludeAutogen ) const; + void GetPreferredSortCourses( CourseType ct, std::vector &AddTo, bool bIncludeAutogen ) const; void GetExtraStageInfo( bool bExtra2, const Style *s, Song*& pSongOut, Steps*& pStepsOut ); Song* GetSongFromDir( RString sDir ) const; @@ -204,41 +204,41 @@ protected: void AddSongToList(Song* new_song); /** @brief All of the songs that can be played. */ - vector m_pSongs; - map m_SongsByDir; - set m_GroupsToNeverCache; + std::vector m_pSongs; + std::map m_SongsByDir; + std::set m_GroupsToNeverCache; /** @brief Hold pointers to all the songs that have been deleted from disk but must at least be kept temporarily alive for smooth audio transitions. */ - vector m_pDeletedSongs; + std::vector m_pDeletedSongs; /** @brief The most popular songs ranked by number of plays. */ - vector m_pPopularSongs; - vector m_pShuffledSongs; // used by GetRandomSong + std::vector m_pPopularSongs; + std::vector m_pShuffledSongs; // used by GetRandomSong struct PreferredSortSection { RString sName; - vector vpSongs; + std::vector vpSongs; }; - vector m_vPreferredSongSort; - vector m_sSongGroupNames; - vector m_sSongGroupBannerPaths; // each song group may have a banner associated with it + std::vector m_vPreferredSongSort; + std::vector m_sSongGroupNames; + std::vector m_sSongGroupBannerPaths; // each song group may have a banner associated with it //vector m_sSongGroupBackgroundPaths; // each song group may have a background associated with it (very rarely) struct Comp { bool operator()(const RString& s, const RString &t) const { return CompareRStringsAsc(s,t); } }; - typedef vector SongPointerVector; - map m_mapSongGroupIndex; + typedef std::vector SongPointerVector; + std::map m_mapSongGroupIndex; - vector m_pCourses; - vector m_pPopularCourses[NUM_CourseType]; - vector m_pShuffledCourses; // used by GetRandomCourse + std::vector m_pCourses; + std::vector m_pPopularCourses[NUM_CourseType]; + std::vector m_pShuffledCourses; // used by GetRandomCourse struct CourseGroupInfo { RString m_sBannerPath; //RString m_sBackgroundPath; }; - map m_mapCourseGroupToInfo; - typedef vector CoursePointerVector; - vector m_vPreferredCourseSort; + std::map m_mapCourseGroupToInfo; + typedef std::vector CoursePointerVector; + std::vector m_vPreferredCourseSort; RageTexturePreloader m_TexturePreload; diff --git a/src/SongOptions.cpp b/src/SongOptions.cpp index f1ad29292c..5479055666 100644 --- a/src/SongOptions.cpp +++ b/src/SongOptions.cpp @@ -60,7 +60,7 @@ void SongOptions::Approach( const SongOptions& other, float fDeltaSeconds ) #undef DO_COPY } -static void AddPart( vector &AddTo, float level, RString name ) +static void AddPart( std::vector &AddTo, float level, RString name ) { if( level == 0 ) return; @@ -70,7 +70,7 @@ static void AddPart( vector &AddTo, float level, RString name ) AddTo.push_back( LevelStr + name ); } -void SongOptions::GetMods( vector &AddTo ) const +void SongOptions::GetMods( std::vector &AddTo ) const { if( m_fMusicRate != 1 ) { @@ -112,7 +112,7 @@ void SongOptions::GetMods( vector &AddTo ) const AddTo.push_back( "RandomBG" ); } -void SongOptions::GetLocalizedMods( vector &v ) const +void SongOptions::GetLocalizedMods( std::vector &v ) const { GetMods( v ); for (RString &s : v) @@ -123,14 +123,14 @@ void SongOptions::GetLocalizedMods( vector &v ) const RString SongOptions::GetString() const { - vector v; + std::vector v; GetMods( v ); return join( ", ", v ); } RString SongOptions::GetLocalizedString() const { - vector v; + std::vector v; GetLocalizedMods( v ); return join( ", ", v ); } @@ -141,7 +141,7 @@ RString SongOptions::GetLocalizedString() const void SongOptions::FromString( const RString &sMultipleMods ) { RString sTemp = sMultipleMods; - vector vs; + std::vector vs; split( sTemp, ",", vs, true ); RString sThrowAway; for (RString &s : vs) @@ -157,7 +157,7 @@ bool SongOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut ) Trim( sBit ); Regex mult("^([0-9]+(\\.[0-9]+)?)xmusic$"); - vector matches; + std::vector matches; if( mult.Compare(sBit, matches) ) { m_fMusicRate = StringToFloat( matches[0] ); @@ -166,7 +166,7 @@ bool SongOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut ) matches.clear(); - vector asParts; + std::vector asParts; split( sBit, " ", asParts, true ); bool on = true; if( asParts.size() > 1 ) diff --git a/src/SongOptions.h b/src/SongOptions.h index 34de874cb0..1e26952810 100644 --- a/src/SongOptions.h +++ b/src/SongOptions.h @@ -58,8 +58,8 @@ public: m_bSaveScore(true), m_bSaveReplay(false) {}; void Init(); void Approach( const SongOptions& other, float fDeltaSeconds ); - void GetMods( vector &AddTo ) const; - void GetLocalizedMods( vector &AddTo ) const; + void GetMods( std::vector &AddTo ) const; + void GetLocalizedMods( std::vector &AddTo ) const; RString GetString() const; RString GetLocalizedString() const; void FromString( const RString &sOptions ); diff --git a/src/SongUtil.cpp b/src/SongUtil.cpp index d715a733cd..06e4014992 100644 --- a/src/SongUtil.cpp +++ b/src/SongUtil.cpp @@ -95,8 +95,8 @@ bool SongCriteria::Matches( const Song *pSong ) const } void SongUtil::GetSteps( - const Song *pSong, - vector& arrayAddTo, + const Song *pSong, + std::vector& arrayAddTo, StepsType st, Difficulty dc, int iMeterLow, @@ -111,7 +111,7 @@ void SongUtil::GetSteps( if( !iMaxToGet ) return; - const vector &vpSteps = st == StepsType_Invalid ? pSong->GetAllSteps() : pSong->GetStepsByStepsType(st); + const std::vector &vpSteps = st == StepsType_Invalid ? pSong->GetAllSteps() : pSong->GetStepsByStepsType(st); for( unsigned i=0; i vpSteps; + std::vector vpSteps; GetSteps( pSong, vpSteps, st, dc, iMeterLow, iMeterHigh, sDescription, sCredit, bIncludeAutoGen, uHash, 1 ); // get max 1 if( vpSteps.empty() ) return nullptr; @@ -164,7 +164,7 @@ Steps* SongUtil::GetOneSteps( Steps* SongUtil::GetStepsByDifficulty( const Song *pSong, StepsType st, Difficulty dc, bool bIncludeAutoGen ) { - const vector& vpSteps = (st == StepsType_Invalid)? pSong->GetAllSteps() : pSong->GetStepsByStepsType(st); + const std::vector& vpSteps = (st == StepsType_Invalid)? pSong->GetAllSteps() : pSong->GetStepsByStepsType(st); for( unsigned i=0; i& vpSteps = (st == StepsType_Invalid)? pSong->GetAllSteps() : pSong->GetStepsByStepsType(st); + const std::vector& vpSteps = (st == StepsType_Invalid)? pSong->GetAllSteps() : pSong->GetStepsByStepsType(st); for( unsigned i=0; i vNotes; + std::vector vNotes; GetSteps( pSong, vNotes, st, Difficulty_Invalid, -1, -1, sDescription, "" ); if( vNotes.size() == 0 ) return nullptr; @@ -210,7 +210,7 @@ Steps* SongUtil::GetStepsByDescription( const Song *pSong, StepsType st, RString Steps* SongUtil::GetStepsByCredit( const Song *pSong, StepsType st, RString sCredit ) { - vector vNotes; + std::vector vNotes; GetSteps(pSong, vNotes, st, Difficulty_Invalid, -1, -1, "", sCredit ); if( vNotes.size() == 0 ) return nullptr; @@ -223,7 +223,7 @@ Steps* SongUtil::GetClosestNotes( const Song *pSong, StepsType st, Difficulty dc { ASSERT( dc != Difficulty_Invalid ); - const vector& vpSteps = (st == StepsType_Invalid)? pSong->GetAllSteps() : pSong->GetStepsByStepsType(st); + const std::vector& vpSteps = (st == StepsType_Invalid)? pSong->GetAllSteps() : pSong->GetStepsByStepsType(st); Steps *pClosest = nullptr; int iClosestDistance = 999; for( unsigned i=0; i vSteps; + std::vector vSteps; SongUtil::GetSteps( pSong, vSteps, st, dc ); /* Delete steps that are completely identical. This happened due to a @@ -299,7 +299,7 @@ static RString RemoveInitialWhitespace( RString s ) } /* This is called within TidyUpData, before autogen notes are added. */ -void SongUtil::DeleteDuplicateSteps( Song *pSong, vector &vSteps ) +void SongUtil::DeleteDuplicateSteps( Song *pSong, std::vector &vSteps ) { /* vSteps have the same StepsType and Difficulty. Delete them if they have the * same m_sDescription, m_sCredit, m_iMeter and SMNoteData. */ @@ -346,7 +346,7 @@ static LocalizedString SORT_OTHER ( "Sort", "Other" ); /* Just calculating GetNumTimesPlayed within the sort is pretty slow, so let's precompute * it. (This could be generalized with a template.) */ -static map g_mapSongSortVal; +static std::map g_mapSongSortVal; static bool CompareSongPointersBySortValueAscending( const Song *pSong1, const Song *pSong2 ) { @@ -398,7 +398,7 @@ static bool CompareSongPointersByTitle( const Song *pSong1, const Song *pSong2 ) return pSong1->GetSongFilePath().CompareNoCase(pSong2->GetSongFilePath()) < 0; } -void SongUtil::SortSongPointerArrayByTitle( vector &vpSongsInOut ) +void SongUtil::SortSongPointerArrayByTitle( std::vector &vpSongsInOut ) { sort( vpSongsInOut.begin(), vpSongsInOut.end(), CompareSongPointersByTitle ); } @@ -417,7 +417,7 @@ static bool CompareSongPointersByBPM( const Song *pSong1, const Song *pSong2 ) return CompareRStringsAsc( pSong1->GetSongFilePath(), pSong2->GetSongFilePath() ); } -void SongUtil::SortSongPointerArrayByBPM( vector &vpSongsInOut ) +void SongUtil::SortSongPointerArrayByBPM( std::vector &vpSongsInOut ) { sort( vpSongsInOut.begin(), vpSongsInOut.end(), CompareSongPointersByBPM ); } @@ -436,7 +436,7 @@ static bool CompareSongPointersByLength( const Song *pSong1, const Song *pSong2 return CompareRStringsAsc( pSong1->GetSongFilePath(), pSong2->GetSongFilePath() ); } -void SongUtil::SortSongPointerArrayByLength( vector &vpSongsInOut ) +void SongUtil::SortSongPointerArrayByLength( std::vector &vpSongsInOut ) { sort( vpSongsInOut.begin(), vpSongsInOut.end(), CompareSongPointersByLength ); } @@ -451,21 +451,21 @@ void AppendOctal( int n, int digits, RString &out ) } } -static bool CompDescending( const pair &a, const pair &b ) +static bool CompDescending( const std::pair &a, const std::pair &b ) { return a.second > b.second; } -static bool CompAscending( const pair &a, const pair &b ) +static bool CompAscending( const std::pair &a, const std::pair &b ) { return a.second < b.second; } -void SongUtil::SortSongPointerArrayByGrades( vector &vpSongsInOut, bool bDescending ) +void SongUtil::SortSongPointerArrayByGrades( std::vector &vpSongsInOut, bool bDescending ) { /* Optimize by pre-writing a string to compare, since doing * GetNumNotesWithGrade inside the sort is too slow. */ - typedef pair< Song *, RString > val; - vector vals; + typedef std::pair val; + std::vector vals; vals.reserve( vpSongsInOut.size() ); for( unsigned i = 0; i < vpSongsInOut.size(); ++i ) @@ -491,7 +491,7 @@ void SongUtil::SortSongPointerArrayByGrades( vector &vpSongsInOut, bool b } -void SongUtil::SortSongPointerArrayByArtist( vector &vpSongsInOut ) +void SongUtil::SortSongPointerArrayByArtist( std::vector &vpSongsInOut ) { for( unsigned i = 0; i < vpSongsInOut.size(); ++i ) g_mapSongSortVal[vpSongsInOut[i]] = MakeSortString( vpSongsInOut[i]->GetTranslitArtist() ); @@ -500,7 +500,7 @@ void SongUtil::SortSongPointerArrayByArtist( vector &vpSongsInOut ) /* This is for internal use, not display; sorting by Unicode codepoints isn't very * interesting for display. */ -void SongUtil::SortSongPointerArrayByDisplayArtist( vector &vpSongsInOut ) +void SongUtil::SortSongPointerArrayByDisplayArtist( std::vector &vpSongsInOut ) { for( unsigned i = 0; i < vpSongsInOut.size(); ++i ) g_mapSongSortVal[vpSongsInOut[i]] = MakeSortString( vpSongsInOut[i]->GetDisplayArtist() ); @@ -512,7 +512,7 @@ static int CompareSongPointersByGenre(const Song *pSong1, const Song *pSong2) return pSong1->m_sGenre < pSong2->m_sGenre; } -void SongUtil::SortSongPointerArrayByGenre( vector &vpSongsInOut ) +void SongUtil::SortSongPointerArrayByGenre( std::vector &vpSongsInOut ) { stable_sort( vpSongsInOut.begin(), vpSongsInOut.end(), CompareSongPointersByGenre ); } @@ -536,12 +536,12 @@ static int CompareSongPointersByGroupAndTitle( const Song *pSong1, const Song *p return CompareSongPointersByTitle( pSong1, pSong2 ); } -void SongUtil::SortSongPointerArrayByGroupAndTitle( vector &vpSongsInOut ) +void SongUtil::SortSongPointerArrayByGroupAndTitle( std::vector &vpSongsInOut ) { sort( vpSongsInOut.begin(), vpSongsInOut.end(), CompareSongPointersByGroupAndTitle ); } -void SongUtil::SortSongPointerArrayByNumPlays( vector &vpSongsInOut, ProfileSlot slot, bool bDescending ) +void SongUtil::SortSongPointerArrayByNumPlays( std::vector &vpSongsInOut, ProfileSlot slot, bool bDescending ) { if( !PROFILEMAN->IsPersistentProfile(slot) ) return; // nothing to do since we don't have data @@ -549,7 +549,7 @@ void SongUtil::SortSongPointerArrayByNumPlays( vector &vpSongsInOut, Prof SortSongPointerArrayByNumPlays( vpSongsInOut, pProfile, bDescending ); } -void SongUtil::SortSongPointerArrayByNumPlays( vector &vpSongsInOut, const Profile* pProfile, bool bDescending ) +void SongUtil::SortSongPointerArrayByNumPlays( std::vector &vpSongsInOut, const Profile* pProfile, bool bDescending ) { ASSERT( pProfile != nullptr ); for(unsigned i = 0; i < vpSongsInOut.size(); ++i) @@ -669,7 +669,7 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so } } -void SongUtil::SortSongPointerArrayBySectionName( vector &vpSongsInOut, SortOrder so ) +void SongUtil::SortSongPointerArrayBySectionName( std::vector &vpSongsInOut, SortOrder so ) { RString sOther = SORT_OTHER.GetValue(); for(unsigned i = 0; i < vpSongsInOut.size(); ++i) @@ -688,7 +688,7 @@ void SongUtil::SortSongPointerArrayBySectionName( vector &vpSongsInOut, S g_mapSongSortVal.clear(); } -void SongUtil::SortSongPointerArrayByStepsTypeAndMeter( vector &vpSongsInOut, StepsType st, Difficulty dc ) +void SongUtil::SortSongPointerArrayByStepsTypeAndMeter( std::vector &vpSongsInOut, StepsType st, Difficulty dc ) { g_mapSongSortVal.clear(); for(unsigned i = 0; i < vpSongsInOut.size(); ++i) @@ -713,7 +713,7 @@ void SongUtil::SortSongPointerArrayByStepsTypeAndMeter( vector &vpSongsIn stable_sort( vpSongsInOut.begin(), vpSongsInOut.end(), CompareSongPointersBySortValueAscending ); } -void SongUtil::SortByMostRecentlyPlayedForMachine( vector &vpSongsInOut ) +void SongUtil::SortByMostRecentlyPlayedForMachine( std::vector &vpSongsInOut ) { Profile *pProfile = PROFILEMAN->GetMachineProfile(); @@ -806,7 +806,7 @@ bool SongUtil::ValidateCurrentEditStepsDescription( const RString &sAnswer, RStr } // Steps name must be unique for this song. - vector v; + std::vector v; GetSteps( pSong, v, StepsType_Invalid, Difficulty_Edit ); for (Steps const *s : v) { @@ -928,9 +928,9 @@ bool SongUtil::ValidateCurrentStepsMusic(const RString &answer, RString &error) return valid; } -void SongUtil::GetAllSongGenres( vector &vsOut ) +void SongUtil::GetAllSongGenres( std::vector &vsOut ) { - set genres; + std::set genres; for (Song const *song : SONGMAN->GetAllSongs()) { if( !song->m_sGenre.empty() ) @@ -942,8 +942,8 @@ void SongUtil::GetAllSongGenres( vector &vsOut ) } } -void SongUtil::FilterSongs( const SongCriteria &sc, const vector &in, - vector &out, bool doCareAboutGame ) +void SongUtil::FilterSongs( const SongCriteria &sc, const std::vector &in, + std::vector &out, bool doCareAboutGame ) { out.reserve( in.size() ); for (Song *s : in) @@ -955,9 +955,9 @@ void SongUtil::FilterSongs( const SongCriteria &sc, const vector &in, } } -void SongUtil::GetPlayableStepsTypes( const Song *pSong, set &vOut ) +void SongUtil::GetPlayableStepsTypes( const Song *pSong, std::set &vOut ) { - vector vpPossibleStyles; + std::vector vpPossibleStyles; // If AutoSetStyle, or a Style hasn't been chosen, check StepsTypes for all Styles. if( CommonMetrics::AUTO_SET_STYLE || GAMESTATE->GetCurrentStyle(PLAYER_INVALID) == nullptr ) GAMEMAN->GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles ); @@ -984,20 +984,20 @@ void SongUtil::GetPlayableStepsTypes( const Song *pSong, set &vOut ) } } - set vStepsTypes; + std::set vStepsTypes; for (Style const *s : vpPossibleStyles) vStepsTypes.insert( s->m_StepsType ); /* filter out hidden StepsTypes, and remove steps that we don't have enough * stages left to play. */ // this being const may have caused some problems... -aj - const vector &vstToShow = CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue(); + const std::vector &vstToShow = CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue(); for (StepsType const &type : vStepsTypes) { bool bShowThisStepsType = find( vstToShow.begin(), vstToShow.end(), type ) != vstToShow.end(); int iNumPlayers = GAMESTATE->GetNumPlayersEnabled(); - iNumPlayers = max( iNumPlayers, 1 ); + iNumPlayers = std::max( iNumPlayers, 1 ); bool bEnoughStages = GAMESTATE->IsAnExtraStage() || GAMESTATE->GetSmallestNumStagesLeftForAnyHumanPlayer() >= @@ -1008,9 +1008,9 @@ void SongUtil::GetPlayableStepsTypes( const Song *pSong, set &vOut ) } } -void SongUtil::GetPlayableSteps( const Song *pSong, vector &vOut ) +void SongUtil::GetPlayableSteps( const Song *pSong, std::vector &vOut ) { - set vStepsType; + std::set vStepsType; GetPlayableStepsTypes( pSong, vStepsType ); for (StepsType const &type : vStepsType) @@ -1023,21 +1023,21 @@ void SongUtil::GetPlayableSteps( const Song *pSong, vector &vOut ) bool SongUtil::IsStepsTypePlayable( Song *pSong, StepsType st ) { - set vStepsType; + std::set vStepsType; GetPlayableStepsTypes( pSong, vStepsType ); return vStepsType.find( st ) != vStepsType.end(); } bool SongUtil::IsStepsPlayable( Song *pSong, Steps *pSteps ) { - vector vpSteps; + std::vector vpSteps; GetPlayableSteps( pSong, vpSteps ); return find( vpSteps.begin(), vpSteps.end(), pSteps ) != vpSteps.end(); } bool SongUtil::IsSongPlayable( Song *s ) { - const vector & steps = s->GetAllSteps(); + const std::vector & steps = s->GetAllSteps(); // I'm sure there is a foreach loop, but I don't return std::any_of(steps.begin(), steps.end(), [&](Steps *step) { return IsStepsPlayable(s, step); @@ -1076,7 +1076,7 @@ bool SongUtil::GetStepsTypeAndDifficultyFromSortOrder( SortOrder so, StepsType & case SORT_DOUBLE_HARD_METER: case SORT_DOUBLE_CHALLENGE_METER: stOut = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType; // in case we don't find any matches below - vector vpStyles; + std::vector vpStyles; GAMEMAN->GetStylesForGame(GAMESTATE->m_pCurGame,vpStyles); for (Style const *i : vpStyles) { @@ -1164,7 +1164,7 @@ namespace int GetPlayableSteps( lua_State *L ) { const Song *pSong = Luna::check( L, 1, true ); - vector vSteps; + std::vector vSteps; SongUtil::GetPlayableSteps(pSong,vSteps); LuaHelpers::CreateTableFromArray( vSteps, L ); return 1; diff --git a/src/SongUtil.h b/src/SongUtil.h index d45ecb853e..0d1b584b31 100644 --- a/src/SongUtil.h +++ b/src/SongUtil.h @@ -24,10 +24,10 @@ public: * If an empty string, don't bother using this for searching. */ RString m_sGroupName; bool m_bUseSongGenreAllowedList; - vector m_vsSongGenreAllowedList; + std::vector m_vsSongGenreAllowedList; enum Selectable { Selectable_Yes, Selectable_No, Selectable_DontCare } m_Selectable; bool m_bUseSongAllowedList; - vector m_vpSongAllowedList; + std::vector m_vpSongAllowedList; /** @brief How many songs does this take max? Don't use this if it's -1. */ int m_iMaxStagesForSong; // don't filter if -1 // float m_fMinBPM; // don't filter if -1 @@ -100,7 +100,7 @@ namespace SongUtil { void GetSteps( const Song *pSong, - vector& arrayAddTo, + std::vector& arrayAddTo, StepsType st = StepsType_Invalid, Difficulty dc = Difficulty_Invalid, int iMeterLow = -1, @@ -129,23 +129,23 @@ namespace SongUtil Steps* GetClosestNotes( const Song *pSong, StepsType st, Difficulty dc, bool bIgnoreLocked=false ); void AdjustDuplicateSteps( Song *pSong ); // part of TidyUpData - void DeleteDuplicateSteps( Song *pSong, vector &vSteps ); + void DeleteDuplicateSteps( Song *pSong, std::vector &vSteps ); RString MakeSortString( RString s ); - void SortSongPointerArrayByTitle( vector &vpSongsInOut ); - void SortSongPointerArrayByBPM( vector &vpSongsInOut ); - void SortSongPointerArrayByGrades( vector &vpSongsInOut, bool bDescending ); - void SortSongPointerArrayByArtist( vector &vpSongsInOut ); - void SortSongPointerArrayByDisplayArtist( vector &vpSongsInOut ); - void SortSongPointerArrayByGenre( vector &vpSongsInOut ); - void SortSongPointerArrayByGroupAndTitle( vector &vpSongsInOut ); - void SortSongPointerArrayByNumPlays( vector &vpSongsInOut, ProfileSlot slot, bool bDescending ); - void SortSongPointerArrayByNumPlays( vector &vpSongsInOut, const Profile* pProfile, bool bDescending ); - void SortSongPointerArrayByStepsTypeAndMeter( vector &vpSongsInOut, StepsType st, Difficulty dc ); + void SortSongPointerArrayByTitle( std::vector &vpSongsInOut ); + void SortSongPointerArrayByBPM( std::vector &vpSongsInOut ); + void SortSongPointerArrayByGrades( std::vector &vpSongsInOut, bool bDescending ); + void SortSongPointerArrayByArtist( std::vector &vpSongsInOut ); + void SortSongPointerArrayByDisplayArtist( std::vector &vpSongsInOut ); + void SortSongPointerArrayByGenre( std::vector &vpSongsInOut ); + void SortSongPointerArrayByGroupAndTitle( std::vector &vpSongsInOut ); + void SortSongPointerArrayByNumPlays( std::vector &vpSongsInOut, ProfileSlot slot, bool bDescending ); + void SortSongPointerArrayByNumPlays( std::vector &vpSongsInOut, const Profile* pProfile, bool bDescending ); + void SortSongPointerArrayByStepsTypeAndMeter( std::vector &vpSongsInOut, StepsType st, Difficulty dc ); RString GetSectionNameFromSongAndSort( const Song *pSong, SortOrder so ); - void SortSongPointerArrayBySectionName( vector &vpSongsInOut, SortOrder so ); - void SortByMostRecentlyPlayedForMachine( vector &vpSongsInOut ); - void SortSongPointerArrayByLength( vector &vpSongsInOut ); + void SortSongPointerArrayBySectionName( std::vector &vpSongsInOut, SortOrder so ); + void SortByMostRecentlyPlayedForMachine( std::vector &vpSongsInOut ); + void SortSongPointerArrayByLength( std::vector &vpSongsInOut ); int CompareSongPointersByGroup(const Song *pSong1, const Song *pSong2); @@ -167,18 +167,18 @@ namespace SongUtil bool ValidateCurrentSongPreview(const RString& answer, RString& error); bool ValidateCurrentStepsMusic(const RString &answer, RString &error); - void GetAllSongGenres( vector &vsOut ); + void GetAllSongGenres( std::vector &vsOut ); /** * @brief Filter the selection of songs to only match certain criteria. * @param sc the intended song criteria. * @param in the starting batch of songs. * @param out the resulting batch. * @param doCareAboutGame a flag to see if we should only get playable steps. */ - void FilterSongs( const SongCriteria &sc, const vector &in, vector &out, + void FilterSongs( const SongCriteria &sc, const std::vector &in, std::vector &out, bool doCareAboutGame = false ); - void GetPlayableStepsTypes( const Song *pSong, set &vOut ); - void GetPlayableSteps( const Song *pSong, vector &vOut ); + void GetPlayableStepsTypes( const Song *pSong, std::set &vOut ); + void GetPlayableSteps( const Song *pSong, std::vector &vOut ); bool IsStepsTypePlayable( Song *pSong, StepsType st ); bool IsStepsPlayable( Song *pSong, Steps *pSteps ); diff --git a/src/Sprite.cpp b/src/Sprite.cpp index 840e8a3c3d..e6997a0a28 100644 --- a/src/Sprite.cpp +++ b/src/Sprite.cpp @@ -198,7 +198,7 @@ void Sprite::LoadFromNode( const XNode* pNode ) // overwriting the states that LoadFromTexture created. // If the .sprite file doesn't define any states, leave // frames and delays created during LoadFromTexture(). - vector aStates; + std::vector aStates; const XNode *pFrames = pNode->GetChild( "Frames" ); if( pFrames != nullptr ) @@ -471,7 +471,7 @@ void Sprite::Update( float fDelta ) // If the texture is a movie, decode frames. if(!bSkipThisMovieUpdate && m_DecodeMovie) - m_pTexture->DecodeSeconds( max(0, fTimePassed) ); + m_pTexture->DecodeSeconds( std::max(0.0f, fTimePassed) ); // update scrolling if( m_fTexCoordVelocityX != 0 || m_fTexCoordVelocityY != 0 ) @@ -815,8 +815,8 @@ void Sprite::SetState( int iNewState ) if( iNewState != 0 && (iNewState < 0 || iNewState >= (int)m_States.size()) ) { // Don't warn about number of states in "_blank" or "_missing". - if( !m_pTexture || (m_pTexture->GetID().filename.find("_blank") == string::npos && - m_pTexture->GetID().filename.find("_missing") == string::npos) ) + if( !m_pTexture || (m_pTexture->GetID().filename.find("_blank") == std::string::npos && + m_pTexture->GetID().filename.find("_missing") == std::string::npos) ) { RString sError; if( m_pTexture ) @@ -986,7 +986,7 @@ void Sprite::ScaleToClipped( float fWidth, float fHeight ) if( bXDimNeedsToBeCropped ) // crop X { float fPercentageToCutOff = (this->GetZoomedWidth() - fWidth) / this->GetZoomedWidth(); - fPercentageToCutOff = max( fPercentageToCutOff-fScaleFudgePercent, 0 ); + fPercentageToCutOff = std::max( fPercentageToCutOff-fScaleFudgePercent, 0.0f ); float fPercentageToCutOffEachSide = fPercentageToCutOff / 2; // generate a rectangle with new texture coordinates @@ -1000,7 +1000,7 @@ void Sprite::ScaleToClipped( float fWidth, float fHeight ) else // crop Y { float fPercentageToCutOff = (this->GetZoomedHeight() - fHeight) / this->GetZoomedHeight(); - fPercentageToCutOff = max( fPercentageToCutOff-fScaleFudgePercent, 0 ); + fPercentageToCutOff = std::max( fPercentageToCutOff-fScaleFudgePercent, 0.0f ); float fPercentageToCutOffEachSide = fPercentageToCutOff / 2; // generate a rectangle with new texture coordinates @@ -1160,7 +1160,7 @@ public: for( int i=0; i<8; ++i ) { coords[i]= FArg(i+1); - if( isnan(coords[i]) ) + if( std::isnan(coords[i]) ) { coords[i]= 0.0f; } @@ -1199,7 +1199,7 @@ public: { luaL_error(L, "State properties must be in a table."); } - vector new_states; + std::vector new_states; size_t num_states= lua_objlen(L, 1); if(num_states == 0) { diff --git a/src/Sprite.h b/src/Sprite.h index a46e50b8ae..b04aff4cdd 100644 --- a/src/Sprite.h +++ b/src/Sprite.h @@ -59,7 +59,7 @@ public: { return m_animation_length_seconds; } virtual void RecalcAnimationLengthSeconds(); virtual void SetSecondsIntoAnimation( float fSeconds ); - void SetStateProperties(const vector& new_states) + void SetStateProperties(const std::vector& new_states) { m_States= new_states; RecalcAnimationLengthSeconds(); SetState(0); } RString GetTexturePath() const; @@ -109,7 +109,7 @@ private: RageTexture* m_pTexture; - vector m_States; + std::vector m_States; int m_iCurState; /** @brief The number of seconds that have elapsed since we switched to this frame. */ float m_fSecsIntoState; diff --git a/src/StageStats.cpp b/src/StageStats.cpp index adb7a1d4b7..eac4cb0bfe 100644 --- a/src/StageStats.cpp +++ b/src/StageStats.cpp @@ -143,7 +143,7 @@ static HighScore FillInHighScore( const PlayerStageStats &pss, const PlayerState hs.SetStageAward( pss.m_StageAward ); hs.SetPeakComboAward( pss.m_PeakComboAward ); - vector asModifiers; + std::vector asModifiers; { RString sPlayerOptions = ps.m_PlayerOptions.GetStage().GetString(); if( !sPlayerOptions.empty() ) @@ -288,7 +288,7 @@ void StageStats::FinalizeScores( bool bSummary ) pHSL = &pProfile->GetStepsHighScoreList( pSong, pSteps ); } - vector::const_iterator iter = find( pHSL->vHighScores.begin(), pHSL->vHighScores.end(), hs ); + std::vector::const_iterator iter = find( pHSL->vHighScores.begin(), pHSL->vHighScores.end(), hs ); if( iter == pHSL->vHighScores.end() ) m_player[p].m_iMachineHighScoreIndex = -1; else @@ -334,7 +334,7 @@ unsigned int StageStats::GetMinimumMissCombo() const { unsigned int iMin = INT_MAX; FOREACH_HumanPlayer( p ) - iMin = min( iMin, m_player[p].m_iCurMissCombo ); + iMin = std::min( iMin, m_player[p].m_iCurMissCombo ); return iMin; } diff --git a/src/StageStats.h b/src/StageStats.h index 8e73710123..1afc0f8f16 100644 --- a/src/StageStats.h +++ b/src/StageStats.h @@ -37,8 +37,8 @@ public: Stage m_Stage; int m_iStageIndex; PlayMode m_playMode; - vector m_vpPlayedSongs; - vector m_vpPossibleSongs; + std::vector m_vpPlayedSongs; + std::vector m_vpPossibleSongs; /** @brief Was an extra stage earned this goaround? */ EarnedExtraStage m_EarnedExtraStage; diff --git a/src/StatsManager.cpp b/src/StatsManager.cpp index c9316b6f9f..e960cd9c2c 100644 --- a/src/StatsManager.cpp +++ b/src/StatsManager.cpp @@ -52,7 +52,7 @@ void StatsManager::Reset() CalcAccumPlayedStageStats(); } -static StageStats AccumPlayedStageStats( const vector& vss ) +static StageStats AccumPlayedStageStats( const std::vector& vss ) { StageStats ssreturn; @@ -95,7 +95,7 @@ static StageStats AccumPlayedStageStats( const vector& vss ) void StatsManager::GetFinalEvalStageStats( StageStats& statsOut ) const { statsOut.Init(); - vector vssToCount; + std::vector vssToCount; for(size_t i= 0; i < m_vPlayedStageStats.size(); ++i) { vssToCount.push_back(m_vPlayedStageStats[i]); @@ -252,7 +252,7 @@ void StatsManager::CommitStatsToProfiles( const StageStats *pSS ) void StatsManager::SaveUploadFile( const StageStats *pSS ) { // Save recent scores - unique_ptr xml( new XNode("Stats") ); + std::unique_ptr xml( new XNode("Stats") ); xml->AppendChild( "MachineGuid", PROFILEMAN->GetMachineProfile()->m_sGuid ); XNode *recent = nullptr; @@ -331,7 +331,7 @@ void StatsManager::SavePadmissScore( const StageStats *pSS, PlayerNumber pn ) stepdata->AppendChild( "StepArtist", steps->GetCredit() ); stepdata->AppendChild( "StepsType", steps->m_StepsTypeStr ); RageFileObjMem f; - vector stepv; + std::vector stepv; stepv.push_back(steps); NotesWriterSM::Write( f, *song, stepv ); stepdata->AppendChild( "StepData", f.GetString() ); @@ -492,7 +492,7 @@ void StatsManager::UnjoinPlayer( PlayerNumber pn ) } } -void StatsManager::GetStepsInUse( set &apInUseOut ) const +void StatsManager::GetStepsInUse( std::set &apInUseOut ) const { for( int i = 0; i < (int) m_vPlayedStageStats.size(); ++i ) { @@ -557,7 +557,7 @@ public: { Grade g = NUM_Grade; FOREACH_EnabledPlayer( pn ) - g = min( g, STATSMAN->m_CurStageStats.m_player[pn].GetGrade() ); + g = std::min( g, STATSMAN->m_CurStageStats.m_player[pn].GetGrade() ); lua_pushnumber( L, g ); return 1; } @@ -566,7 +566,7 @@ public: { Grade g = Grade_Tier01; FOREACH_EnabledPlayer( pn ) - g = max( g, STATSMAN->m_CurStageStats.m_player[pn].GetGrade() ); + g = std::max( g, STATSMAN->m_CurStageStats.m_player[pn].GetGrade() ); lua_pushnumber( L, g ); return 1; } @@ -583,7 +583,7 @@ public: [&](StageStats const &ss) { return ss.m_player[p].m_bFailed; })) continue; - top_grade = min( top_grade, stats.m_player[p].GetGrade() ); + top_grade = std::min( top_grade, stats.m_player[p].GetGrade() ); } Enum::Push( L, top_grade ); diff --git a/src/StatsManager.h b/src/StatsManager.h index 2c9fd7468e..fa57ad7904 100644 --- a/src/StatsManager.h +++ b/src/StatsManager.h @@ -17,7 +17,7 @@ public: * * This is not necessarily passed stage stats if this is an Extra Stage. */ StageStats m_CurStageStats; - vector m_vPlayedStageStats; + std::vector m_vPlayedStageStats; // Only the latest 3 normal songs + passed extra stages. void GetFinalEvalStageStats( StageStats& statsOut ) const; @@ -30,7 +30,7 @@ public: static void CommitStatsToProfiles( const StageStats *pSS ); void UnjoinPlayer( PlayerNumber pn ); - void GetStepsInUse( set &apInUseOut ) const; + void GetStepsInUse( std::set &apInUseOut ) const; // Lua void PushSelf( lua_State *L ); diff --git a/src/StdString.h b/src/StdString.h index f1237f33b2..d0beb30128 100644 --- a/src/StdString.h +++ b/src/StdString.h @@ -51,7 +51,7 @@ // - Jim Cline // - Jeff Kohn // - Todd Heckel -// - Ullrich Pollähne +// - Ullrich Pollähne // - Joe Vitaterna // - Joe Woodbury // - Aaron (no last name) @@ -538,7 +538,7 @@ public: { // Range check the count. - nCount = max(0, min(nCount, static_cast(this->size()))); + nCount = std::max(0, std::min(nCount, static_cast(this->size()))); return this->substr(0, static_cast(nCount)); } @@ -581,7 +581,7 @@ public: { // Range check the count. - nCount = max(0, min(nCount, static_cast(this->size()))); + nCount = std::max(0, std::min(nCount, static_cast(this->size()))); return this->substr(this->size()-static_cast(nCount)); } diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 5163870bab..2b5bcd1e87 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -622,7 +622,7 @@ RageDisplay *CreateDisplay() VIDEO_TROUBLESHOOTING_URL "\n\n"+ ssprintf(ERROR_VIDEO_DRIVER.GetValue(), GetVideoDriverName().c_str())+"\n\n"; - vector asRenderers; + std::vector asRenderers; split( PREFSMAN->m_sVideoRenderers, ",", asRenderers, true ); if( asRenderers.empty() ) @@ -769,7 +769,7 @@ void StepMania::InitializeCurrentGame( const Game* g ) static void MountTreeOfZips( const RString &dir ) { - vector dirs; + std::vector dirs; dirs.push_back( dir ); while( dirs.size() ) @@ -780,7 +780,7 @@ static void MountTreeOfZips( const RString &dir ) if( !IsADirectory(path) ) continue; - vector zips; + std::vector zips; GetDirListing( path + "/*.zip", zips, false, true ); GetDirListing( path + "/*.smzip", zips, false, true ); @@ -801,7 +801,7 @@ static void MountFolders(const RString &type, const RString &realPathList, const { if (!realPathList.empty()) { - vector dirs; + std::vector dirs; split(realPathList, ",", dirs, true); for (const auto& dir : dirs) FILEMAN->Mount(type, dir, mountPoint); @@ -1349,7 +1349,7 @@ void HandleInputEvents(float fDeltaTime) if( SCREENMAN->GetTopScreen()->IsFirstUpdate() ) return; - vector ieArray; + std::vector ieArray; INPUTFILTER->GetInputEvents( ieArray ); // If we don't have focus, discard input. diff --git a/src/Steps.cpp b/src/Steps.cpp index 38129a57c7..05781b1bf0 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -321,10 +321,10 @@ void Steps::CalculateRadarValues( float fMusicLengthSeconds ) GAMESTATE->SetProcessedTimingData(this->GetTimingData()); if( tempNoteData.IsComposite() ) { - vector vParts; + std::vector vParts; NoteDataUtil::SplitCompositeNoteData( tempNoteData, vParts ); - for( size_t pn = 0; pn < min(vParts.size(), size_t(NUM_PLAYERS)); ++pn ) + for( size_t pn = 0; pn < std::min(vParts.size(), size_t(NUM_PLAYERS)); ++pn ) NoteDataUtil::CalculateRadarValues( vParts[pn], fMusicLengthSeconds, m_CachedRadarValues[pn] ); } else if (GAMEMAN->GetStepsTypeInfo(this->m_StepsType).m_StepsTypeCategory == StepsTypeCategory_Couple) @@ -346,7 +346,7 @@ void Steps::CalculateRadarValues( float fMusicLengthSeconds ) else { NoteDataUtil::CalculateRadarValues( tempNoteData, fMusicLengthSeconds, m_CachedRadarValues[0] ); - fill_n( m_CachedRadarValues + 1, NUM_PLAYERS-1, m_CachedRadarValues[0] ); + std::fill_n( m_CachedRadarValues + 1, NUM_PLAYERS-1, m_CachedRadarValues[0] ); } GAMESTATE->SetProcessedTimingData(nullptr); } @@ -499,7 +499,7 @@ void Steps::DeAutogen( bool bCopyNoteData ) m_sChartStyle = Real()->m_sChartStyle; m_Difficulty = Real()->m_Difficulty; m_iMeter = Real()->m_iMeter; - copy( Real()->m_CachedRadarValues, Real()->m_CachedRadarValues + NUM_PLAYERS, m_CachedRadarValues ); + std::copy( Real()->m_CachedRadarValues, Real()->m_CachedRadarValues + NUM_PLAYERS, m_CachedRadarValues ); m_sCredit = Real()->m_sCredit; parent = nullptr; @@ -624,7 +624,7 @@ void Steps::SetMusicFile(const RString& file) void Steps::SetCachedRadarValues( const RadarValues v[NUM_PLAYERS] ) { DeAutogen(); - copy( v, v + NUM_PLAYERS, m_CachedRadarValues ); + std::copy( v, v + NUM_PLAYERS, m_CachedRadarValues ); m_bAreCachedRadarValuesJustLoaded = true; } @@ -764,7 +764,7 @@ public: p->GetDisplayBpms(temp); float fMin = temp.GetMin(); float fMax = temp.GetMax(); - vector fBPMs; + std::vector fBPMs; fBPMs.push_back( fMin ); fBPMs.push_back( fMax ); LuaHelpers::CreateTableFromArray(fBPMs, L); diff --git a/src/Steps.h b/src/Steps.h index c2143b8f3a..9ebc881a2b 100644 --- a/src/Steps.h +++ b/src/Steps.h @@ -108,7 +108,7 @@ public: /** @brief The list of attacks. */ AttackArray m_Attacks; /** @brief The stringified list of attacks. */ - vector m_sAttackString; + std::vector m_sAttackString; RString GetChartName() const { return parent ? Real()->GetChartName() : this->chartName; } void SetChartName(const RString name) { this->chartName = name; } diff --git a/src/StepsDisplay.cpp b/src/StepsDisplay.cpp index 9e3da422d1..ebfd36fc50 100644 --- a/src/StepsDisplay.cpp +++ b/src/StepsDisplay.cpp @@ -226,9 +226,9 @@ void StepsDisplay::SetInternal( const SetParams ¶ms ) char off = '0'; RString sNewText; - int iNumOn = min( (int)m_iMaxTicks, params.iMeter ); + int iNumOn = std::min( (int) m_iMaxTicks, params.iMeter ); sNewText.insert( sNewText.end(), iNumOn, on ); - int iNumOff = max( 0, m_iNumTicks-iNumOn ); + int iNumOff = std::max( 0, m_iNumTicks-iNumOn ); sNewText.insert( sNewText.end(), iNumOff, off ); m_textTicks.SetText( sNewText ); m_textTicks.HandleMessage( msg ); diff --git a/src/StepsUtil.cpp b/src/StepsUtil.cpp index eb80ff7cec..e2c9762da5 100644 --- a/src/StepsUtil.cpp +++ b/src/StepsUtil.cpp @@ -38,10 +38,10 @@ bool StepsCriteria::Matches( const Song *pSong, const Steps *pSteps ) const return true; } -void StepsUtil::GetAllMatching( const SongCriteria &soc, const StepsCriteria &stc, vector &out ) +void StepsUtil::GetAllMatching( const SongCriteria &soc, const StepsCriteria &stc, std::vector &out ) { const RString &sGroupName = soc.m_sGroupName.empty()? GROUP_ALL:soc.m_sGroupName; - const vector &songs = SONGMAN->GetSongs( sGroupName ); + const std::vector &songs = SONGMAN->GetSongs( sGroupName ); for (Song *so : songs) { @@ -51,9 +51,9 @@ void StepsUtil::GetAllMatching( const SongCriteria &soc, const StepsCriteria &st } } -void StepsUtil::GetAllMatching( Song *pSong, const StepsCriteria &stc, vector &out ) +void StepsUtil::GetAllMatching( Song *pSong, const StepsCriteria &stc, std::vector &out ) { - const vector &vSteps = ( stc.m_st == StepsType_Invalid ? pSong->GetAllSteps() : + const std::vector &vSteps = ( stc.m_st == StepsType_Invalid ? pSong->GetAllSteps() : pSong->GetStepsByStepsType(stc.m_st) ); for (Steps *st : vSteps) @@ -61,9 +61,9 @@ void StepsUtil::GetAllMatching( Song *pSong, const StepsCriteria &stc, vector &out ) +void StepsUtil::GetAllMatchingEndless( Song *pSong, const StepsCriteria &stc, std::vector &out ) { - const vector &vSteps = ( stc.m_st == StepsType_Invalid ? pSong->GetAllSteps() : + const std::vector &vSteps = ( stc.m_st == StepsType_Invalid ? pSong->GetAllSteps() : pSong->GetStepsByStepsType( stc.m_st ) ); int previousSize = out.size(); int successful = false; @@ -79,7 +79,7 @@ void StepsUtil::GetAllMatchingEndless( Song *pSong, const StepsCriteria &stc, ve Difficulty difficulty = ( *( vSteps.begin() ) )->GetDifficulty(); Difficulty previousDifficulty = difficulty; int lowestDifficultyIndex = 0; - vector difficulties; + std::vector difficulties; for (auto st = vSteps.begin(); st != vSteps.end(); ++st) { previousDifficulty = difficulty; @@ -100,7 +100,7 @@ void StepsUtil::GetAllMatchingEndless( Song *pSong, const StepsCriteria &stc, ve bool StepsUtil::HasMatching( const SongCriteria &soc, const StepsCriteria &stc ) { const RString &sGroupName = soc.m_sGroupName.empty()? GROUP_ALL:soc.m_sGroupName; - const vector &songs = SONGMAN->GetSongs( sGroupName ); + const std::vector &songs = SONGMAN->GetSongs( sGroupName ); return std::any_of(songs.begin(), songs.end(), [&](Song const *so) { return soc.Matches(so) && HasMatching(so, stc); @@ -109,14 +109,14 @@ bool StepsUtil::HasMatching( const SongCriteria &soc, const StepsCriteria &stc ) bool StepsUtil::HasMatching( const Song *pSong, const StepsCriteria &stc ) { - const vector &vSteps = stc.m_st == StepsType_Invalid? pSong->GetAllSteps():pSong->GetStepsByStepsType( stc.m_st ); + const std::vector &vSteps = stc.m_st == StepsType_Invalid? pSong->GetAllSteps():pSong->GetStepsByStepsType( stc.m_st ); return std::any_of(vSteps.begin(), vSteps.end(), [&](Steps const *st) { return stc.Matches(pSong, st); }); } // Sorting stuff -map steps_sort_val; +std::map steps_sort_val; static bool CompareStepsPointersBySortValueAscending(const Steps *pSteps1, const Steps *pSteps2) { @@ -128,7 +128,7 @@ static bool CompareStepsPointersBySortValueDescending(const Steps *pSteps1, cons return steps_sort_val[pSteps1] > steps_sort_val[pSteps2]; } -void StepsUtil::SortStepsPointerArrayByNumPlays( vector &vStepsPointers, ProfileSlot slot, bool bDescending ) +void StepsUtil::SortStepsPointerArrayByNumPlays( std::vector &vStepsPointers, ProfileSlot slot, bool bDescending ) { if( !PROFILEMAN->IsPersistentProfile(slot) ) return; // nothing to do since we don't have data @@ -136,17 +136,17 @@ void StepsUtil::SortStepsPointerArrayByNumPlays( vector &vStepsPointers, SortStepsPointerArrayByNumPlays( vStepsPointers, pProfile, bDescending ); } -void StepsUtil::SortStepsPointerArrayByNumPlays( vector &vStepsPointers, const Profile* pProfile, bool bDecending ) +void StepsUtil::SortStepsPointerArrayByNumPlays( std::vector &vStepsPointers, const Profile* pProfile, bool bDecending ) { // ugly... - vector vpSongs = SONGMAN->GetAllSongs(); - vector vpAllSteps; - map mapStepsToSong; + std::vector vpSongs = SONGMAN->GetAllSongs(); + std::vector vpAllSteps; + std::map mapStepsToSong; { for( unsigned i=0; i vpSteps = pSong->GetAllSteps(); + std::vector vpSteps = pSong->GetAllSteps(); for( unsigned j=0; jGetDifficulty() < pSteps2->GetDifficulty(); } -void StepsUtil::SortNotesArrayByDifficulty( vector &arraySteps ) +void StepsUtil::SortNotesArrayByDifficulty( std::vector &arraySteps ) { /* Sort in reverse order of priority. Sort by description first, to get * a predictable order for songs with no radar values (edits). */ @@ -209,7 +209,7 @@ bool StepsUtil::CompareStepsPointersByTypeAndDifficulty(const Steps *pStep1, con return pStep1->GetDifficulty() < pStep2->GetDifficulty(); } -void StepsUtil::SortStepsByTypeAndDifficulty( vector &arraySongPointers ) +void StepsUtil::SortStepsByTypeAndDifficulty( std::vector &arraySongPointers ) { sort( arraySongPointers.begin(), arraySongPointers.end(), CompareStepsPointersByTypeAndDifficulty ); } @@ -219,12 +219,12 @@ bool StepsUtil::CompareStepsPointersByDescription(const Steps *pStep1, const Ste return pStep1->GetDescription().CompareNoCase( pStep2->GetDescription() ) < 0; } -void StepsUtil::SortStepsByDescription( vector &arraySongPointers ) +void StepsUtil::SortStepsByDescription( std::vector &arraySongPointers ) { sort( arraySongPointers.begin(), arraySongPointers.end(), CompareStepsPointersByDescription ); } -void StepsUtil::RemoveLockedSteps( const Song *pSong, vector &vpSteps ) +void StepsUtil::RemoveLockedSteps( const Song *pSong, std::vector &vpSteps ) { for( int i=vpSteps.size()-1; i>=0; i-- ) { diff --git a/src/StepsUtil.h b/src/StepsUtil.h index 2cba43ff6b..b02e4831ce 100644 --- a/src/StepsUtil.h +++ b/src/StepsUtil.h @@ -117,21 +117,21 @@ namespace StepsUtil * @param stc the StepsCriteria to look for. * @param out the SongsAndSteps that match. */ - void GetAllMatching( const SongCriteria &soc, const StepsCriteria &stc, vector &out); // look up in SONGMAN + void GetAllMatching( const SongCriteria &soc, const StepsCriteria &stc, std::vector &out); // look up in SONGMAN /** * @brief Retrieve all of the Steps that match the criteria. * @param pSong the Song we're checking in. * @param stc the StepsCriteria to look for. * @param out the SongsAndSteps that match. */ - void GetAllMatching( Song *pSong, const StepsCriteria &stc, vector &out ); + void GetAllMatching( Song *pSong, const StepsCriteria &stc, std::vector &out ); /** * @brief Retrieve all of the Steps that match the criteria, for Endless mode only. * @param pSong the Song we're checking in. * @param stc the StepsCriteria to look for. * @param out the SongsAndSteps that match. */ - void GetAllMatchingEndless( Song *pSong, const StepsCriteria &stc, vector &out ); + void GetAllMatchingEndless( Song *pSong, const StepsCriteria &stc, std::vector &out ); /** * @brief Is there a Step * that matches the criteria? @@ -150,15 +150,15 @@ namespace StepsUtil bool CompareNotesPointersByRadarValues(const Steps* pSteps1, const Steps* pSteps2); bool CompareNotesPointersByMeter(const Steps *pSteps1, const Steps* pSteps2); bool CompareNotesPointersByDifficulty(const Steps *pSteps1, const Steps *pSteps2); - void SortNotesArrayByDifficulty( vector &vpStepsInOut ); + void SortNotesArrayByDifficulty( std::vector &vpStepsInOut ); bool CompareStepsPointersByTypeAndDifficulty(const Steps *pStep1, const Steps *pStep2); - void SortStepsByTypeAndDifficulty( vector &vpStepsInOut ); - void SortStepsPointerArrayByNumPlays( vector &vpStepsInOut, ProfileSlot slot, bool bDescending ); - void SortStepsPointerArrayByNumPlays( vector &vpStepsInOut, const Profile* pProfile, bool bDescending ); + void SortStepsByTypeAndDifficulty( std::vector &vpStepsInOut ); + void SortStepsPointerArrayByNumPlays( std::vector &vpStepsInOut, ProfileSlot slot, bool bDescending ); + void SortStepsPointerArrayByNumPlays( std::vector &vpStepsInOut, const Profile* pProfile, bool bDescending ); bool CompareStepsPointersByDescription(const Steps *pStep1, const Steps *pStep2); - void SortStepsByDescription( vector &vpStepsInOut ); - void RemoveLockedSteps( const Song *pSong, vector &vpStepsInOut ); -}; + void SortStepsByDescription( std::vector &vpStepsInOut ); + void RemoveLockedSteps( const Song *pSong, std::vector &vpStepsInOut ); +} class StepsID { diff --git a/src/StreamDisplay.cpp b/src/StreamDisplay.cpp index d6ddba882e..60df39f459 100644 --- a/src/StreamDisplay.cpp +++ b/src/StreamDisplay.cpp @@ -141,12 +141,12 @@ void StreamDisplay::SetPercent( float fPercent ) float fLifeMultiplier = THEME->GetMetricF("LifeMeterBar","LifeMultiplier"); #endif DEBUG_ASSERT( fPercent >= 0.0f && fPercent <= 1.0f * fLifeMultiplier ); - if( isnan(fPercent) ) + if( std::isnan(fPercent) ) { DEBUG_ASSERT_M( 0, "fPercent is NaN" ); fPercent = 1; } - if( !isfinite(fPercent) ) + if( !std::isfinite(fPercent) ) { DEBUG_ASSERT_M( 0, "fPercent is infinite" ); fPercent = 1; diff --git a/src/StreamDisplay.h b/src/StreamDisplay.h index bd44e88e63..cc7390175c 100644 --- a/src/StreamDisplay.h +++ b/src/StreamDisplay.h @@ -32,7 +32,7 @@ public: float GetPercent() { return m_fPercent; } private: - vector m_vpSprPill[NUM_StreamType]; + std::vector m_vpSprPill[NUM_StreamType]; LuaExpressionTransform m_transformPill; // params: self,offsetFromCenter,itemIndex,numItems ThemeMetric VELOCITY_MULTIPLIER; diff --git a/src/Style.cpp b/src/Style.cpp index 3d5e4acc4f..d8718dc76e 100644 --- a/src/Style.cpp +++ b/src/Style.cpp @@ -47,7 +47,7 @@ void Style::GetTransformedNoteDataForStyle( PlayerNumber pn, const NoteData& ori noteDataOut.LoadTransformed( original, m_iColsPerPlayer, iNewToOriginalTrack ); } -void Style::StyleInputToGameInput( int iCol, PlayerNumber pn, vector& ret ) const +void Style::StyleInputToGameInput( int iCol, PlayerNumber pn, std::vector& ret ) const { ASSERT_M( pn < NUM_PLAYERS && iCol < MAX_COLS_PER_PLAYER, ssprintf("P%i C%i", pn, iCol) ); @@ -109,8 +109,8 @@ void Style::GetMinAndMaxColX( PlayerNumber pn, float& fMixXOut, float& fMaxXOut fMaxXOut = FLT_MIN; for( int i=0; i GI; + std::vector GI; StyleInputToGameInput( iCol, PLAYER_1, GI ); return INPUTMAPPER->GetInputScheme()->GetGameButtonName(GI[0].button); } diff --git a/src/Style.h b/src/Style.h index 187450820f..f8a90a0e81 100644 --- a/src/Style.h +++ b/src/Style.h @@ -80,7 +80,7 @@ public: * This is primarily for Couple and Routine styles. */ bool m_bLockDifficulties; - void StyleInputToGameInput( int iCol, PlayerNumber pn, vector& ret ) const; + void StyleInputToGameInput( int iCol, PlayerNumber pn, std::vector& ret ) const; /** * @brief Retrieve the column based on the game input. * @param GameI the game input. diff --git a/src/SubscriptionManager.h b/src/SubscriptionManager.h index 67e7778356..94a923fab0 100644 --- a/src/SubscriptionManager.h +++ b/src/SubscriptionManager.h @@ -18,23 +18,23 @@ public: // collection ourself on first use. SubscriptionHandler itself is // a POD type, so a static SubscriptionHandler will always have // m_pSubscribers == nullptr (before any static constructors are called). - set* m_pSubscribers; + std::set* m_pSubscribers; // Use this to access m_pSubscribers, so you don't have to worry about // it being nullptr. - set &Get() + std::set &Get() { if( m_pSubscribers == nullptr ) - m_pSubscribers = new set; + m_pSubscribers = new std::set; return *m_pSubscribers; } void Subscribe( T* p ) { if( m_pSubscribers == nullptr ) - m_pSubscribers = new set; + m_pSubscribers = new std::set; #ifdef DEBUG - typename set::iterator iter = m_pSubscribers->find( p ); + typename std::set::iterator iter = m_pSubscribers->find( p ); ASSERT_M( iter == m_pSubscribers->end(), "already subscribed" ); #endif m_pSubscribers->insert( p ); @@ -42,7 +42,7 @@ public: void Unsubscribe( T* p ) { - typename set::iterator iter = m_pSubscribers->find( p ); + typename std::set::iterator iter = m_pSubscribers->find( p ); ASSERT( iter != m_pSubscribers->end() ); m_pSubscribers->erase( iter ); } diff --git a/src/Texture Font Generator/Texture Font GeneratorDlg.cpp b/src/Texture Font Generator/Texture Font GeneratorDlg.cpp index 183355ee76..e0b4d756cc 100644 --- a/src/Texture Font Generator/Texture Font GeneratorDlg.cpp +++ b/src/Texture Font Generator/Texture Font GeneratorDlg.cpp @@ -7,8 +7,6 @@ #include #include #include -using namespace std; - #include static TextureFont *g_pTextureFont = NULL; @@ -710,7 +708,7 @@ void CTextureFontGeneratorDlg::UpdateCloseUp() int CALLBACK CTextureFontGeneratorDlg::EnumFontFamiliesCallback( const LOGFONTA *pLogicalFontData, const TEXTMETRICA *pPhysicalFontData, DWORD FontType, LPARAM lParam ) { CTextureFontGeneratorDlg *pThis = (CTextureFontGeneratorDlg *) lParam; - set *pSet = (set *) lParam; + std::set *pSet = (std::set *) lParam; pSet->insert( pLogicalFontData->lfFaceName ); return 1; } @@ -732,9 +730,9 @@ BOOL CTextureFontGeneratorDlg::OnInitDialog() memset( &font, 0, sizeof(font) ); font.lfCharSet = DEFAULT_CHARSET; CPaintDC dc(this); - set setFamilies; + std::set setFamilies; EnumFontFamiliesEx( dc.GetSafeHdc(), &font, EnumFontFamiliesCallback, (LPARAM) &setFamilies, 0 ); - for( set::const_iterator it = setFamilies.begin(); it != setFamilies.end(); ++it ) + for( std::set::const_iterator it = setFamilies.begin(); it != setFamilies.end(); ++it ) m_FamilyList.AddString( *it ); m_FamilyList.SetCurSel( 0 ); } @@ -872,9 +870,9 @@ BOOL CTextureFontGeneratorDlg::OnMouseWheel( UINT nFlags, short zDelta, CPoint p int i = atoi( sText ); i += zDelta / WHEEL_DELTA; if( pFocus == &m_Padding ) - i = max( i, 0 ); + i = std::max( i, 0 ); else if( pFocus == &m_FontSize ) - i = max( i, 1 ); + i = std::max( i, 1 ); sText.Format( "%i", i ); pFocusedEdit->SetWindowText( sText ); @@ -1028,7 +1026,7 @@ void CTextureFontGeneratorDlg::OnFileSave() /* { - vector asOldFiles; + std::vector asOldFiles; WIN32_FIND_DATA fd; CString sPath = szFile; diff --git a/src/Texture Font Generator/Texture Font GeneratorDlg.h b/src/Texture Font Generator/Texture Font GeneratorDlg.h index 37af168df6..a1899b6448 100644 --- a/src/Texture Font Generator/Texture Font GeneratorDlg.h +++ b/src/Texture Font Generator/Texture Font GeneratorDlg.h @@ -42,7 +42,7 @@ protected: void UpdateCloseUp(); public: - vector m_PagesToGenerate; + std::vector m_PagesToGenerate; afx_msg void OnCbnSelchangeShownPage(); afx_msg void OnCbnSelchangeFamilyList(); diff --git a/src/Texture Font Generator/TextureFont.cpp b/src/Texture Font Generator/TextureFont.cpp index 8b00a3c403..9574259fb0 100644 --- a/src/Texture Font Generator/TextureFont.cpp +++ b/src/Texture Font Generator/TextureFont.cpp @@ -25,7 +25,7 @@ void TextureFont::FormatFontPages() for( unsigned i = 0; i < m_apPages.size(); ++i ) delete m_apPages[i]; m_apPages.clear(); - for( map::iterator i = m_Characters.begin(); i != m_Characters.end(); ++i ) + for( std::map::iterator i = m_Characters.begin(); i != m_Characters.end(); ++i ) { if( i->second == NULL ) continue; @@ -247,16 +247,16 @@ void TextureFont::FormatCharacter( wchar_t c, HDC hDC ) if( realbounds.left != realbounds.right && realbounds.top != realbounds.bottom ) { - m_BoundingRect.top = min( m_BoundingRect.top, (LONG) realbounds.top ); - m_BoundingRect.left = min( m_BoundingRect.left, (LONG) realbounds.left ); - m_BoundingRect.right = max( m_BoundingRect.right, (LONG) realbounds.right ); - m_BoundingRect.bottom = max( m_BoundingRect.bottom, (LONG) realbounds.bottom ); + m_BoundingRect.top = std::min( m_BoundingRect.top, (LONG) realbounds.top ); + m_BoundingRect.left = std::min( m_BoundingRect.left, (LONG) realbounds.left ); + m_BoundingRect.right = std::max( m_BoundingRect.right, (LONG) realbounds.right ); + m_BoundingRect.bottom = std::max( m_BoundingRect.bottom, (LONG) realbounds.bottom ); if( m_BoundingRect.left == m_BoundingRect.right && m_BoundingRect.top == m_BoundingRect.bottom ) m_BoundingRect = realbounds; } - m_iCharLeftOverlap = max( m_iCharLeftOverlap, -int(abc.abcA) ); - m_iCharRightOverlap = max( m_iCharRightOverlap, int(abc.abcC) - int(abc.abcB) ); + m_iCharLeftOverlap = std::max( m_iCharLeftOverlap, -int(abc.abcA) ); + m_iCharRightOverlap = std::max( m_iCharRightOverlap, int(abc.abcC) - int(abc.abcB) ); // const SolidBrush solidBrush(Color(128, 255, 0, 255)); // Pen pen(&solidBrush, 1); @@ -439,7 +439,7 @@ void TextureFont::Save( CString sBasePath, CString sBitmapAppendBeforeExtension, /* export character widths. "numbers" page has fixed with for all number characters. */ - vector viCharWidth; + std::vector viCharWidth; int iMaxNumberCharWidth = 0; for( unsigned j = 0; j < desc.chars.size(); ++j ) { @@ -451,7 +451,7 @@ void TextureFont::Save( CString sBasePath, CString sBitmapAppendBeforeExtension, viCharWidth.push_back( iCharWidth ); if( IsNumberChar( c ) ) - iMaxNumberCharWidth = max( iMaxNumberCharWidth, iCharWidth ); + iMaxNumberCharWidth = std::max( iMaxNumberCharWidth, iCharWidth ); } for( unsigned j = 0; j < desc.chars.size(); ++j ) { diff --git a/src/Texture Font Generator/TextureFont.h b/src/Texture Font Generator/TextureFont.h index 1b5c28d0a1..e02c9a3564 100644 --- a/src/Texture Font Generator/TextureFont.h +++ b/src/Texture Font Generator/TextureFont.h @@ -3,12 +3,11 @@ #include #include -using namespace std; struct FontPageDescription { CString name; - vector chars; + std::vector chars; }; struct FontPage @@ -34,12 +33,12 @@ public: TextureFont(); ~TextureFont(); - vector m_PagesToGenerate; + std::vector m_PagesToGenerate; void FormatFontPage( int iPage, HDC hDC ); void FormatFontPages(); void Save( CString sPath, CString sBitmapAppendBeforeExtension, bool bSaveMetrics, bool bSaveBitmaps, bool bExportStrokeTemplates ); - map m_Characters; + std::map m_Characters; /* Font generation properties: */ bool m_bBold; /* whether font is bold */ @@ -55,7 +54,7 @@ public: RECT m_BoundingRect; - vector m_apPages; + std::vector m_apPages; CString m_sError, m_sWarnings; @@ -63,9 +62,9 @@ private: int GetTopPadding() const; /* Bounds of each character, according to MeasureCharacterRanges. */ - map m_RealBounds; + std::map m_RealBounds; - map m_ABC; + std::map m_ABC; void FormatCharacter( wchar_t c, HDC hDC ); }; diff --git a/src/Texture Font Generator/Utils.cpp b/src/Texture Font Generator/Utils.cpp index 8cbc9b0795..9ee2a6c1be 100644 --- a/src/Texture Font Generator/Utils.cpp +++ b/src/Texture Font Generator/Utils.cpp @@ -82,10 +82,10 @@ void GetBounds( const Surface *pSurf, RECT *out ) if( (pixel & 0xFFFFFF) == 0 ) continue; /* black */ - FirstCol = min(FirstCol, col); - LastCol = max(LastCol, col); - FirstRow = min(FirstRow, row); - LastRow = max(LastRow, row); + FirstCol = std::min(FirstCol, col); + LastCol = std::max(LastCol, col); + FirstRow = std::min(FirstRow, row); + LastRow = std::max(LastRow, row); } p += pSurf->iPitch; } diff --git a/src/Texture Font Generator/stdafx.h b/src/Texture Font Generator/stdafx.h index 088ce07b2d..9209a76e86 100644 --- a/src/Texture Font Generator/stdafx.h +++ b/src/Texture Font Generator/stdafx.h @@ -10,7 +10,6 @@ #define NOMINMAX #include -using namespace std; // Modify the following defines if you have to target a platform prior to the ones specified below. // Refer to MSDN for the latest info on corresponding values for different platforms. diff --git a/src/ThemeManager.cpp b/src/ThemeManager.cpp index 0ae222ff55..813e046fc5 100644 --- a/src/ThemeManager.cpp +++ b/src/ThemeManager.cpp @@ -48,7 +48,7 @@ struct Theme RString sThemeName; }; // When looking for a metric or an element, search these from head to tail. -static deque g_vThemes; +static std::deque g_vThemes; class LoadedThemeData { public: @@ -117,7 +117,7 @@ void ThemeManager::Unsubscribe( IThemeMetric *p ) // We spend a lot of time doing redundant theme path lookups. Cache results. -static map g_ThemePathCache[NUM_ElementCategory]; +static std::map g_ThemePathCache[NUM_ElementCategory]; void ThemeManager::ClearThemePathCache() { for( int i = 0; i < NUM_ElementCategory; ++i ) @@ -128,7 +128,7 @@ static void FileNameToMetricsGroupAndElement( const RString &sFileName, RString { // split into class name and file name RString::size_type iIndexOfFirstSpace = sFileName.find(" "); - if( iIndexOfFirstSpace == string::npos ) // no space + if( iIndexOfFirstSpace == std::string::npos ) // no space { sMetricsGroupOut = ""; sElementOut = sFileName; @@ -166,7 +166,7 @@ ThemeManager::ThemeManager() m_sCurThemeName = ""; m_bPseudoLocalize = false; - vector arrayThemeNames; + std::vector arrayThemeNames; GetThemeNames( arrayThemeNames ); } @@ -179,14 +179,14 @@ ThemeManager::~ThemeManager() LUA->UnsetGlobal( "THEME" ); } -void ThemeManager::GetThemeNames( vector& AddTo ) +void ThemeManager::GetThemeNames( std::vector& AddTo ) { GetDirListing( SpecialFiles::THEMES_DIR + "*", AddTo, true ); StripCvsAndSvn( AddTo ); StripMacResourceForks( AddTo ); } -void ThemeManager::GetSelectableThemeNames( vector& AddTo ) +void ThemeManager::GetSelectableThemeNames( std::vector& AddTo ) { GetThemeNames( AddTo ); for( int i=AddTo.size()-1; i>=0; i-- ) @@ -200,14 +200,14 @@ void ThemeManager::GetSelectableThemeNames( vector& AddTo ) int ThemeManager::GetNumSelectableThemes() { - vector vs; + std::vector vs; GetSelectableThemeNames( vs ); return vs.size(); } bool ThemeManager::DoesThemeExist( const RString &sThemeName ) { - vector asThemeNames; + std::vector asThemeNames; GetThemeNames( asThemeNames ); for( unsigned i=0; i& AddTo ) +void ThemeManager::GetLanguages( std::vector& AddTo ) { AddTo.clear(); @@ -266,13 +266,13 @@ void ThemeManager::GetLanguages( vector& AddTo ) // remove dupes sort( AddTo.begin(), AddTo.end() ); - vector::iterator it = unique( AddTo.begin(), AddTo.end(), EqualsNoCase ); + std::vector::iterator it = unique( AddTo.begin(), AddTo.end(), EqualsNoCase ); AddTo.erase(it, AddTo.end()); } bool ThemeManager::DoesLanguageExist( const RString &sLanguage ) { - vector asLanguages; + std::vector asLanguages; GetLanguages( asLanguages ); for( unsigned i=0; i vs; + std::vector vs; GetOptionalLanguageIniPaths(vs,sThemeName,sLanguage); for (RString const &s : vs) iniStrings.ReadFile( s ); @@ -362,7 +362,7 @@ void ThemeManager::LoadThemeMetrics( const RString &sThemeName_, const RString & * in "foo::bar=1+1=2", "baz" is always "1+1=2". Neither foo nor bar may * be empty, but baz may be. */ Regex re( "^([^=]+)::([^=]+)=(.*)$" ); - vector sBits; + std::vector sBits; if( !re.Compare( sMetric, sBits ) ) RageException::Throw( "Invalid argument \"--metric=%s\".", sMetric.c_str() ); @@ -405,7 +405,7 @@ void ThemeManager::SwitchThemeAndLanguage( const RString &sThemeName_, const RSt sThemeName = to_try; if(!IsThemeSelectable(sThemeName)) { - vector theme_names; + std::vector theme_names; GetSelectableThemeNames(theme_names); ASSERT_M(!theme_names.empty(), "No themes found, unable to start stepmania."); to_try= theme_names[0]; @@ -495,7 +495,7 @@ void ThemeManager::RunLuaScripts( const RString &sMask, bool bUseThemeDir ) /* TODO: verify whether this final check is necessary. */ const RString sCurThemeName = m_sCurThemeName; - deque::const_iterator iter = g_vThemes.end(); + std::deque::const_iterator iter = g_vThemes.end(); do { --iter; @@ -507,10 +507,10 @@ void ThemeManager::RunLuaScripts( const RString &sMask, bool bUseThemeDir ) m_sCurThemeName = iter->sThemeName; const RString &sScriptDir = bUseThemeDir ? GetThemeDirFromName( m_sCurThemeName ) : "/"; - vector asElementPaths; + std::vector asElementPaths; // get files from directories - vector asElementChildPaths; - vector arrayScriptDirs; + std::vector asElementChildPaths; + std::vector arrayScriptDirs; GetDirListing( sScriptDir + "Scripts/*", arrayScriptDirs, true ); SortRStringArray( arrayScriptDirs ); StripCvsAndSvn( arrayScriptDirs ); @@ -594,11 +594,11 @@ struct CompareLanguageTag * files with the current language tag to the top, so choosing "ignore" from * the multiple-match dialog will cause it to default to the first entry, so * it'll still use a preferred language match if there were any. */ -void ThemeManager::FilterFileLanguages( vector &asPaths ) +void ThemeManager::FilterFileLanguages( std::vector &asPaths ) { if( asPaths.size() <= 1 ) return; - vector::iterator it = + std::vector::iterator it = partition( asPaths.begin(), asPaths.end(), CompareLanguageTag(m_sCurLanguage) ); int iDist = distance( asPaths.begin(), it ); @@ -625,7 +625,7 @@ bool ThemeManager::GetPathInfoToRaw( PathInfo &out, const RString &sThemeName_, const RString sThemeDir = GetThemeDirFromName( sThemeName ); const RString &sCategory = ElementCategoryToString(category); - vector asElementPaths; + std::vector asElementPaths; // If sFileName already has an extension, we're looking for a specific file bool bLookingForSpecificFile = sElement.find_last_of('.') != sElement.npos; @@ -636,7 +636,7 @@ bool ThemeManager::GetPathInfoToRaw( PathInfo &out, const RString &sThemeName_, } else // look for all files starting with sFileName that have types we can use { - vector asPaths; + std::vector asPaths; GetDirListing( sThemeDir + sCategory + "/" + MetricsGroupAndElementToFileName(sMetricsGroup,sElement) + "*", asPaths, false, true ); @@ -809,9 +809,9 @@ bool ThemeManager::GetPathInfo( PathInfo &out, ElementCategory category, const R RString sFileName = MetricsGroupAndElementToFileName( sMetricsGroup, sElement ); - map &Cache = g_ThemePathCache[category]; + std::map &Cache = g_ThemePathCache[category]; { - map::const_iterator i; + std::map::const_iterator i; i = Cache.find( sFileName ); if( i != Cache.end() ) @@ -1142,7 +1142,7 @@ void ThemeManager::EvaluateString( RString &sText ) RString ThemeManager::GetNextTheme() { - vector as; + std::vector as; GetThemeNames( as ); unsigned i; for( i=0; i as; + std::vector as; GetSelectableThemeNames( as ); unsigned i; for( i=0; i& asLanguagesOut ) +void ThemeManager::GetLanguagesForTheme( const RString &sThemeName, std::vector& asLanguagesOut ) { RString sLanguageDir = GetThemeDirFromName(sThemeName) + SpecialFiles::LANGUAGES_SUBDIR; - vector as; + std::vector as; GetDirListing( sLanguageDir + "*.ini", as ); for (RString const &s : as) @@ -1192,13 +1192,13 @@ RString ThemeManager::GetLanguageIniPath( const RString &sThemeName, const RStri return GetThemeDirFromName(sThemeName) + SpecialFiles::LANGUAGES_SUBDIR + sLanguage + ".ini"; } -void ThemeManager::GetOptionalLanguageIniPaths( vector &vsPathsOut, const RString &sThemeName, const RString &sLanguage ) +void ThemeManager::GetOptionalLanguageIniPaths( std::vector &vsPathsOut, const RString &sThemeName, const RString &sLanguage ) { // optional ini names look like: "en PackageName.ini" GetDirListing( GetThemeDirFromName(sThemeName) + SpecialFiles::LANGUAGES_SUBDIR + sLanguage + " *.ini", vsPathsOut, false, true ); } -void ThemeManager::GetOptionNames( vector& AddTo ) +void ThemeManager::GetOptionNames( std::vector& AddTo ) { const XNode *cur = g_pLoadedThemeData->iniStrings.GetChild( "OptionNames" ); if( cur ) @@ -1288,7 +1288,7 @@ RString ThemeManager::GetString( const RString &sMetricsGroup, const RString &sV return s; } -void ThemeManager::GetMetricsThatBeginWith( const RString &sMetricsGroup_, const RString &sValueName, set &vsValueNamesOut ) +void ThemeManager::GetMetricsThatBeginWith( const RString &sMetricsGroup_, const RString &sValueName, std::set &vsValueNamesOut ) { RString sMetricsGroup( sMetricsGroup_ ); while( !sMetricsGroup.empty() ) @@ -1382,7 +1382,7 @@ public: { // pushes a table of theme folders from GetSelectableThemeNames() //lua_pushnumber(L, p->GetNumSelectableThemes() ); - vector sThemes; + std::vector sThemes; p->GetSelectableThemeNames(sThemes); LuaHelpers::CreateTableFromArray( sThemes, L ); return 1; diff --git a/src/ThemeManager.h b/src/ThemeManager.h index 03e326037e..fd0ef16902 100644 --- a/src/ThemeManager.h +++ b/src/ThemeManager.h @@ -32,15 +32,15 @@ public: ThemeManager(); ~ThemeManager(); - void GetThemeNames( vector& AddTo ); - void GetSelectableThemeNames( vector& AddTo ); + void GetThemeNames( std::vector& AddTo ); + void GetSelectableThemeNames( std::vector& AddTo ); int GetNumSelectableThemes(); bool DoesThemeExist( const RString &sThemeName ); bool IsThemeSelectable(RString const& name); bool IsThemeNameValid(RString const& name); RString GetThemeDisplayName( const RString &sThemeName ); RString GetThemeAuthor( const RString &sThemeName ); - void GetLanguages( vector& AddTo ); + void GetLanguages( std::vector& AddTo ); bool DoesLanguageExist( const RString &sLanguage ); void SwitchThemeAndLanguage( const RString &sThemeName, const RString &sLanguage, bool bPseudoLocalize, bool bForceThemeReload = false ); void UpdateLuaGlobals(); @@ -53,7 +53,7 @@ public: void ReloadMetrics(); void ReloadSubscribers(); void ClearSubscribers(); - void GetOptionNames( vector& AddTo ); + void GetOptionNames( std::vector& AddTo ); static void EvaluateString( RString &sText ); @@ -91,9 +91,9 @@ public: bool HasString( const RString &sMetricsGroup, const RString &sValueName ); RString GetString( const RString &sMetricsGroup, const RString &sValueName ); void GetString( const RString &sMetricsGroup, const RString &sValueName, RString &valueOut ) { valueOut = GetString( sMetricsGroup, sValueName ); } - void FilterFileLanguages( vector &asElementPaths ); + void FilterFileLanguages( std::vector &asElementPaths ); - void GetMetricsThatBeginWith( const RString &sMetricsGroup, const RString &sValueName, set &vsValueNamesOut ); + void GetMetricsThatBeginWith( const RString &sMetricsGroup, const RString &sValueName, std::set &vsValueNamesOut ); RString GetMetricsGroupFallback( const RString &sMetricsGroup ); @@ -119,9 +119,9 @@ protected: static RString GetThemeDirFromName( const RString &sThemeName ); RString GetElementDir( const RString &sThemeName ); static RString GetMetricsIniPath( const RString &sThemeName ); - static void GetLanguagesForTheme( const RString &sThemeName, vector& asLanguagesOut ); + static void GetLanguagesForTheme( const RString &sThemeName, std::vector& asLanguagesOut ); static RString GetLanguageIniPath( const RString &sThemeName, const RString &sLanguage ); - void GetOptionalLanguageIniPaths( vector &vsPathsOut, const RString &sThemeName, const RString &sLanguage ); + void GetOptionalLanguageIniPaths( std::vector &vsPathsOut, const RString &sThemeName, const RString &sLanguage ); RString GetDefaultLanguage(); RString m_sCurThemeName; diff --git a/src/ThemeMetric.h b/src/ThemeMetric.h index 83115ac926..ea4193a4dc 100644 --- a/src/ThemeMetric.h +++ b/src/ThemeMetric.h @@ -185,7 +185,7 @@ template class ThemeMetric1D : public IThemeMetric { typedef ThemeMetric ThemeMetricT; - vector m_metric; + std::vector m_metric; public: ThemeMetric1D( const RString& sGroup, MetricName1D pfn, size_t N ) @@ -224,8 +224,8 @@ template class ThemeMetric2D : public IThemeMetric { typedef ThemeMetric ThemeMetricT; - typedef vector ThemeMetricTVector; - vector m_metric; + typedef std::vector ThemeMetricTVector; + std::vector m_metric; public: ThemeMetric2D( const RString& sGroup = "", MetricName2D pfn = nullptr, size_t N = 0, size_t M = 0 ) @@ -266,14 +266,14 @@ template class ThemeMetricMap : public IThemeMetric { typedef ThemeMetric ThemeMetricT; - map m_metric; + std::map m_metric; public: - ThemeMetricMap( const RString& sGroup = "", MetricNameMap pfn = nullptr, const vector vsValueNames = vector() ) + ThemeMetricMap( const RString& sGroup = "", MetricNameMap pfn = nullptr, const std::vector vsValueNames = std::vector() ) { Load( sGroup, pfn, vsValueNames ); } - void Load( const RString& sGroup, MetricNameMap pfn, const vector vsValueNames ) + void Load( const RString& sGroup, MetricNameMap pfn, const std::vector vsValueNames ) { m_metric.clear(); for (RString const &s : vsValueNames) @@ -283,19 +283,19 @@ public: { // HACK: GCC (3.4) takes this and pretty much nothing else. // I don't know why. - for( typename map >::iterator m = m_metric.begin(); m != m_metric.end(); ++m ) + for( typename std::map >::iterator m = m_metric.begin(); m != m_metric.end(); ++m ) m->second.Read(); } void Clear() { - for( typename map >::iterator m = m_metric.begin(); m != m_metric.end(); ++m ) + for( typename std::map >::iterator m = m_metric.begin(); m != m_metric.end(); ++m ) m->second.Clear(); } const T& GetValue( RString s ) const { // HACK: GCC (3.4) takes this and pretty much nothing else. // I don't know why. - typename map >::const_iterator iter = m_metric.find(s); + typename std::map >::const_iterator iter = m_metric.find(s); ASSERT( iter != m_metric.end() ); return iter->second.GetValue(); } diff --git a/src/TimingData.cpp b/src/TimingData.cpp index 46b26d0ec1..a19a2af935 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -8,7 +8,7 @@ #include "NoteTypes.h" #include -static void EraseSegment(vector &vSegs, int index, TimingSegment *cur); +static void EraseSegment(std::vector &vSegs, int index, TimingSegment *cur); static const int INVALID_INDEX = -1; TimingSegment* GetSegmentAtRow( int iNoteRow, TimingSegmentType tst ); @@ -27,7 +27,7 @@ void TimingData::Copy( const TimingData& cpy ) FOREACH_TimingSegmentType( tst ) { - const vector &vpSegs = cpy.m_avpTimingSegments[tst]; + const std::vector &vpSegs = cpy.m_avpTimingSegments[tst]; for( unsigned i = 0; i < vpSegs.size(); ++i ) AddSegment( vpSegs[i] ); @@ -39,7 +39,7 @@ void TimingData::Clear() /* Delete all pointers owned by this TimingData. */ FOREACH_TimingSegmentType( tst ) { - vector &vSegs = m_avpTimingSegments[tst]; + std::vector &vSegs = m_avpTimingSegments[tst]; for( unsigned i = 0; i < vSegs.size(); ++i ) { SAFE_DELETE( vSegs[i] ); @@ -51,7 +51,7 @@ void TimingData::Clear() bool TimingData::IsSafeFullTiming() { - static vector needed_segments; + static std::vector needed_segments; if(needed_segments.empty()) { needed_segments.push_back(SEGMENT_BPM); @@ -84,10 +84,10 @@ void TimingData::PrepareLookup() // thing. So release the lookups. -Kyz ReleaseLookup(); const unsigned int segments_per_lookup= 16; - const vector& bpms= m_avpTimingSegments[SEGMENT_BPM]; - const vector& warps= m_avpTimingSegments[SEGMENT_WARP]; - const vector& stops= m_avpTimingSegments[SEGMENT_STOP]; - const vector& delays= m_avpTimingSegments[SEGMENT_DELAY]; + const std::vector& bpms= m_avpTimingSegments[SEGMENT_BPM]; + const std::vector& warps= m_avpTimingSegments[SEGMENT_WARP]; + const std::vector& stops= m_avpTimingSegments[SEGMENT_STOP]; + const std::vector& delays= m_avpTimingSegments[SEGMENT_DELAY]; unsigned int total_segments= bpms.size() + warps.size() + stops.size() + delays.size(); unsigned int lookup_entries= total_segments / segments_per_lookup; @@ -134,7 +134,7 @@ void TimingData::ReleaseLookup() #undef CLEAR_LOOKUP } -RString SegInfoStr(const vector& segs, unsigned int index, const RString& name) +RString SegInfoStr(const std::vector& segs, unsigned int index, const RString& name) { if(index < segs.size()) { @@ -145,10 +145,10 @@ RString SegInfoStr(const vector& segs, unsigned int index, const void TimingData::DumpOneTable(const beat_start_lookup_t& lookup, const RString& name) { - const vector& bpms= m_avpTimingSegments[SEGMENT_BPM]; - const vector& warps= m_avpTimingSegments[SEGMENT_WARP]; - const vector& stops= m_avpTimingSegments[SEGMENT_STOP]; - const vector& delays= m_avpTimingSegments[SEGMENT_DELAY]; + const std::vector& bpms= m_avpTimingSegments[SEGMENT_BPM]; + const std::vector& warps= m_avpTimingSegments[SEGMENT_WARP]; + const std::vector& stops= m_avpTimingSegments[SEGMENT_STOP]; + const std::vector& delays= m_avpTimingSegments[SEGMENT_DELAY]; LOG->Trace("%s lookup table:", name.c_str()); for(size_t lit= 0; lit < lookup.size(); ++lit) { @@ -238,7 +238,7 @@ void TimingData::CopyRange(int start_row, int end_row, { if(seg_type == copy_type || copy_type == TimingSegmentType_Invalid) { - const vector& segs= GetTimingSegments(seg_type); + const std::vector& segs= GetTimingSegments(seg_type); for(size_t i= 0; i < segs.size(); ++i) { if(segs[i]->GetRow() >= start_row && segs[i]->GetRow() <= end_row) @@ -262,9 +262,9 @@ void TimingData::ShiftRange(int start_row, int end_row, { if(seg_type == shift_type || shift_type == TimingSegmentType_Invalid) { - vector& segs= GetTimingSegments(seg_type); - int first_row= min(start_row, start_row + shift_amount); - int last_row= max(end_row, end_row + shift_amount); + std::vector& segs= GetTimingSegments(seg_type); + int first_row= std::min(start_row, start_row + shift_amount); + int last_row= std::max(end_row, end_row + shift_amount); int first_affected= GetSegmentIndexAtRow(seg_type, first_row); int last_affected= GetSegmentIndexAtRow(seg_type, last_row); if(first_affected == INVALID_INDEX) @@ -280,7 +280,7 @@ void TimingData::ShiftRange(int start_row, int end_row, int seg_row= segs[i]->GetRow(); if(seg_row > 0 && seg_row >= start_row && seg_row <= end_row) { - int dest_row= max(seg_row + shift_amount, 0); + int dest_row= std::max(seg_row + shift_amount, 0); segs[i]->SetRow(dest_row); } } @@ -327,7 +327,7 @@ void TimingData::ClearRange(int start_row, int end_row, TimingSegmentType clear_ { if(seg_type == clear_type || clear_type == TimingSegmentType_Invalid) { - vector& segs= GetTimingSegments(seg_type); + std::vector& segs= GetTimingSegments(seg_type); int first_affected= GetSegmentIndexAtRow(seg_type, start_row); int last_affected= GetSegmentIndexAtRow(seg_type, end_row); if(first_affected == INVALID_INDEX) @@ -351,19 +351,19 @@ void TimingData::GetActualBPM( float &fMinBPMOut, float &fMaxBPMOut, float highe { fMinBPMOut = FLT_MAX; fMaxBPMOut = 0; - const vector &bpms = GetTimingSegments(SEGMENT_BPM); + const std::vector &bpms = GetTimingSegments(SEGMENT_BPM); for (unsigned i = 0; i < bpms.size(); i++) { const float fBPM = ToBPM(bpms[i])->GetBPM(); - fMaxBPMOut = clamp(max( fBPM, fMaxBPMOut ), 0, highest); - fMinBPMOut = min( fBPM, fMinBPMOut ); + fMaxBPMOut = clamp(std::max( fBPM, fMaxBPMOut ), 0.0f, highest); + fMinBPMOut = std::min( fBPM, fMinBPMOut ); } } float TimingData::GetNextSegmentBeatAtRow(TimingSegmentType tst, int row) const { - const vector segs = GetTimingSegments(tst); + const std::vector segs = GetTimingSegments(tst); for (unsigned i = 0; i < segs.size(); i++ ) { if( segs[i]->GetRow() <= row ) @@ -378,7 +378,7 @@ float TimingData::GetNextSegmentBeatAtRow(TimingSegmentType tst, int row) const float TimingData::GetPreviousSegmentBeatAtRow(TimingSegmentType tst, int row) const { float backup = -1; - const vector segs = GetTimingSegments(tst); + const std::vector segs = GetTimingSegments(tst); for (unsigned i = 0; i < segs.size(); i++ ) { if( segs[i]->GetRow() >= row ) @@ -392,7 +392,7 @@ float TimingData::GetPreviousSegmentBeatAtRow(TimingSegmentType tst, int row) co int TimingData::GetSegmentIndexAtRow(TimingSegmentType tst, int iRow ) const { - const vector &vSegs = GetTimingSegments(tst); + const std::vector &vSegs = GetTimingSegments(tst); if( vSegs.empty() ) return INVALID_INDEX; @@ -432,7 +432,7 @@ struct ts_less void TimingData::MultiplyBPMInBeatRange( int iStartIndex, int iEndIndex, float fFactor ) { // Change all other BPM segments in this range. - vector &bpms = m_avpTimingSegments[SEGMENT_BPM]; + std::vector &bpms = m_avpTimingSegments[SEGMENT_BPM]; for( unsigned i=0; i &warps = GetTimingSegments(SEGMENT_WARP); + const std::vector &warps = GetTimingSegments(SEGMENT_WARP); if( warps.empty() ) return false; @@ -501,7 +501,7 @@ bool TimingData::IsWarpAtRow( int iNoteRow ) const bool TimingData::IsFakeAtRow( int iNoteRow ) const { - const vector &fakes = GetTimingSegments(SEGMENT_FAKE); + const std::vector &fakes = GetTimingSegments(SEGMENT_FAKE); if( fakes.empty() ) return false; @@ -545,7 +545,7 @@ static const TimingSegment* DummySegments[NUM_TimingSegmentType] = const TimingSegment* TimingData::GetSegmentAtRow( int iNoteRow, TimingSegmentType tst ) const { - const vector &vSegments = GetTimingSegments(tst); + const std::vector &vSegments = GetTimingSegments(tst); if( vSegments.empty() ) return DummySegments[tst]; @@ -579,7 +579,7 @@ TimingSegment* TimingData::GetSegmentAtRow( int iNoteRow, TimingSegmentType tst return const_cast( static_cast(this)->GetSegmentAtRow(iNoteRow, tst) ); } -static void EraseSegment( vector &vSegs, int index, TimingSegment *cur ) +static void EraseSegment( std::vector &vSegs, int index, TimingSegment *cur ) { #ifdef WITH_LOGGING_TIMING_DATA LOG->Trace( "EraseSegment(%d, %p)", index, cur ); @@ -600,7 +600,7 @@ void TimingData::AddSegment( const TimingSegment *seg ) #endif TimingSegmentType tst = seg->GetType(); - vector &vSegs = m_avpTimingSegments[tst]; + std::vector &vSegs = m_avpTimingSegments[tst]; // OPTIMIZATION: if this is our first segment, push and return. if( vSegs.empty() ) @@ -734,7 +734,7 @@ void TimingData::AddSegment( const TimingSegment *seg ) else { // copy and insert a new segment - vector::iterator it; + std::vector::iterator it; it = upper_bound( vSegs.begin(), vSegs.end(), cpy, ts_less() ); vSegs.insert( it, cpy ); } @@ -742,7 +742,7 @@ void TimingData::AddSegment( const TimingSegment *seg ) bool TimingData::DoesLabelExist( const RString& sLabel ) const { - const vector &labels = GetTimingSegments(SEGMENT_LABEL); + const std::vector &labels = GetTimingSegments(SEGMENT_LABEL); for (unsigned i = 0; i < labels.size(); i++) { if (ToLabel(labels[i])->GetLabel() == sLabel) @@ -771,8 +771,8 @@ enum void FindEvent(int& event_row, int& event_type, TimingData::GetBeatStarts& start, float beat, bool find_marker, - const vector& bpms, const vector& warps, - const vector& stops, const vector& delays) + const std::vector& bpms, const std::vector& warps, + const std::vector& stops, const std::vector& delays) { if(start.is_warping && BeatToNoteRow(start.warp_destination) < event_row) { @@ -810,10 +810,10 @@ void FindEvent(int& event_row, int& event_type, void TimingData::GetBeatInternal(GetBeatStarts& start, GetBeatArgs& args, unsigned int max_segment) const { - const vector& bpms= m_avpTimingSegments[SEGMENT_BPM]; - const vector& warps= m_avpTimingSegments[SEGMENT_WARP]; - const vector& stops= m_avpTimingSegments[SEGMENT_STOP]; - const vector& delays= m_avpTimingSegments[SEGMENT_DELAY]; + const std::vector& bpms= m_avpTimingSegments[SEGMENT_BPM]; + const std::vector& warps= m_avpTimingSegments[SEGMENT_WARP]; + const std::vector& stops= m_avpTimingSegments[SEGMENT_STOP]; + const std::vector& delays= m_avpTimingSegments[SEGMENT_DELAY]; unsigned int curr_segment= start.bpm+start.warp+start.stop+start.delay; float bps= GetBPMAtRow(start.last_row) / 60.0f; @@ -927,10 +927,10 @@ void TimingData::GetBeatAndBPSFromElapsedTimeNoOffset(GetBeatArgs& args) const float TimingData::GetElapsedTimeInternal(GetBeatStarts& start, float beat, unsigned int max_segment) const { - const vector& bpms= m_avpTimingSegments[SEGMENT_BPM]; - const vector& warps= m_avpTimingSegments[SEGMENT_WARP]; - const vector& stops= m_avpTimingSegments[SEGMENT_STOP]; - const vector& delays= m_avpTimingSegments[SEGMENT_DELAY]; + const std::vector& bpms= m_avpTimingSegments[SEGMENT_BPM]; + const std::vector& warps= m_avpTimingSegments[SEGMENT_WARP]; + const std::vector& stops= m_avpTimingSegments[SEGMENT_STOP]; + const std::vector& delays= m_avpTimingSegments[SEGMENT_DELAY]; unsigned int curr_segment= start.bpm+start.warp+start.stop+start.delay; float bps= GetBPMAtRow(start.last_row) / 60.0f; @@ -1014,7 +1014,7 @@ float TimingData::GetDisplayedBeat( float fBeat ) const { float fOutBeat = 0; unsigned i; - const vector &scrolls = m_avpTimingSegments[SEGMENT_SCROLL]; + const std::vector &scrolls = m_avpTimingSegments[SEGMENT_SCROLL]; for( i=0; iGetBeat() > fBeat ) @@ -1043,7 +1043,7 @@ void TimingData::ScaleRegion( float fScale, int iStartIndex, int iEndIndex, bool { int iNewEndIndex = iStartIndex + newLength; float fEndBPMBeforeScaling = GetBPMAtRow(iNewEndIndex); - vector &bpms = m_avpTimingSegments[SEGMENT_BPM]; + std::vector &bpms = m_avpTimingSegments[SEGMENT_BPM]; // adjust BPM changes "between" iStartIndex and iNewEndIndex for ( unsigned i = 0; i < bpms.size(); i++ ) @@ -1069,7 +1069,7 @@ void TimingData::InsertRows( int iStartRow, int iRowsToAdd ) { FOREACH_TimingSegmentType( tst ) { - vector &segs = m_avpTimingSegments[tst]; + std::vector &segs = m_avpTimingSegments[tst]; for (unsigned j = 0; j < segs.size(); j++) { TimingSegment *seg = segs[j]; @@ -1083,7 +1083,7 @@ void TimingData::InsertRows( int iStartRow, int iRowsToAdd ) { /* If we're shifting up at the beginning, we just shifted up the first * BPMSegment. That segment must always begin at 0. */ - vector &bpms = m_avpTimingSegments[SEGMENT_BPM]; + std::vector &bpms = m_avpTimingSegments[SEGMENT_BPM]; ASSERT_M( bpms.size() > 0, "There must be at least one BPM Segment in the chart!" ); bpms[0]->SetRow(0); } @@ -1107,7 +1107,7 @@ void TimingData::DeleteRows( int iStartRow, int iRowsToDelete ) } // Now delete and shift up - vector &segs = m_avpTimingSegments[tst]; + std::vector &segs = m_avpTimingSegments[tst]; for (unsigned j = 0; j < segs.size(); j++) { TimingSegment *seg = segs[j]; @@ -1142,7 +1142,7 @@ float TimingData::GetDisplayedSpeedPercent( float fSongBeat, float fMusicSeconds return 1.0f; } - const vector &speeds = GetTimingSegments(SEGMENT_SPEED); + const std::vector &speeds = GetTimingSegments(SEGMENT_SPEED); if( speeds.size() == 0 ) { #ifdef DEBUG @@ -1244,26 +1244,26 @@ void TimingData::TidyUpData(bool allowEmpty) void TimingData::SortSegments( TimingSegmentType tst ) { - vector &vSegments = m_avpTimingSegments[tst]; + std::vector &vSegments = m_avpTimingSegments[tst]; sort( vSegments.begin(), vSegments.end() ); } bool TimingData::HasSpeedChanges() const { - const vector &speeds = GetTimingSegments(SEGMENT_SPEED); + const std::vector &speeds = GetTimingSegments(SEGMENT_SPEED); return (speeds.size()>1 || ToSpeed(speeds[0])->GetRatio() != 1); } bool TimingData::HasScrollChanges() const { - const vector &scrolls = GetTimingSegments(SEGMENT_SCROLL); + const std::vector &scrolls = GetTimingSegments(SEGMENT_SCROLL); return (scrolls.size()>1 || ToScroll(scrolls[0])->GetRatio() != 1); } void TimingData::NoteRowToMeasureAndBeat( int iNoteRow, int &iMeasureIndexOut, int &iBeatIndexOut, int &iRowsRemainder ) const { iMeasureIndexOut = 0; - const vector &tSigs = GetTimingSegments(SEGMENT_TIME_SIG); + const std::vector &tSigs = GetTimingSegments(SEGMENT_TIME_SIG); for (unsigned i = 0; i < tSigs.size(); i++) { TimeSignatureSegment *curSig = ToTimeSignature(tSigs[i]); @@ -1294,10 +1294,10 @@ void TimingData::NoteRowToMeasureAndBeat( int iNoteRow, int &iMeasureIndexOut, i FAIL_M("Failed to get measure and beat for note row"); } -vector TimingData::ToVectorString(TimingSegmentType tst, int dec) const +std::vector TimingData::ToVectorString(TimingSegmentType tst, int dec) const { - const vector segs = GetTimingSegments(tst); - vector ret; + const std::vector segs = GetTimingSegments(tst); + std::vector ret; for (unsigned i = 0; i < segs.size(); i++) { @@ -1316,7 +1316,7 @@ vector TimingData::ToVectorString(TimingSegmentType tst, int dec) const void TimingSegmentSetToLuaTable(TimingData* td, TimingSegmentType tst, lua_State *L); void TimingSegmentSetToLuaTable(TimingData* td, TimingSegmentType tst, lua_State *L) { - const vector segs= td->GetTimingSegments(tst); + const std::vector segs= td->GetTimingSegments(tst); lua_createtable(L, segs.size(), 0); if(tst == SEGMENT_LABEL) { @@ -1334,7 +1334,7 @@ void TimingSegmentSetToLuaTable(TimingData* td, TimingSegmentType tst, lua_State { for(size_t i= 0; i < segs.size(); ++i) { - vector values= segs[i]->GetValues(); + std::vector values= segs[i]->GetValues(); lua_createtable(L, values.size()+1, 0); lua_pushnumber(L, segs[i]->GetBeat()); lua_rawseti(L, -2, 1); @@ -1387,8 +1387,8 @@ public: #undef GET_FUNCTION static int GetBPMs( T* p, lua_State *L ) { - vector vBPMs; - const vector &bpms = p->GetTimingSegments(SEGMENT_BPM); + std::vector vBPMs; + const std::vector &bpms = p->GetTimingSegments(SEGMENT_BPM); for (unsigned i = 0; i < bpms.size(); i++) vBPMs.push_back( ToBPM(bpms[i])->GetBPM() ); @@ -1401,7 +1401,7 @@ public: // certainly there's a better way to do it than this? -aj float fMinBPM, fMaxBPM; p->GetActualBPM( fMinBPM, fMaxBPM ); - vector fBPMs; + std::vector fBPMs; fBPMs.push_back( fMinBPM ); fBPMs.push_back( fMaxBPM ); LuaHelpers::CreateTableFromArray(fBPMs, L); diff --git a/src/TimingData.h b/src/TimingData.h index db22b1bd6b..f27a0c1ab7 100644 --- a/src/TimingData.h +++ b/src/TimingData.h @@ -111,7 +111,7 @@ public: }; // map can't be used for the lookup table because its find or *_bound // functions would return the wrong entry. - // In a map with three entries, [-1]= 3, [6]= 1, [8]= 2, + // In a std::map with three entries, [-1]= 3, [6]= 1, [8]= 2, // lower_bound(0) and upper_bound(0) both returned the entry at [6]= 1. // So the lookup table is a vector of entries and FindEntryInLookup does a // binary search. @@ -122,7 +122,7 @@ public: GetBeatStarts second; lookup_item_t(float f, GetBeatStarts& s) :first(f), second(s) {} }; - typedef vector beat_start_lookup_t; + typedef std::vector beat_start_lookup_t; beat_start_lookup_t m_beat_start_lookup; beat_start_lookup_t m_time_start_lookup; @@ -395,8 +395,8 @@ public: { FOREACH_ENUM( TimingSegmentType, tst ) { - const vector &us = m_avpTimingSegments[tst]; - const vector &them = other.m_avpTimingSegments[tst]; + const std::vector &us = m_avpTimingSegments[tst]; + const std::vector &them = other.m_avpTimingSegments[tst]; // optimization: check vector sizes before contents if( us.size() != them.size() ) @@ -431,11 +431,11 @@ public: void SortSegments( TimingSegmentType tst ); - const vector &GetTimingSegments( TimingSegmentType tst ) const + const std::vector &GetTimingSegments( TimingSegmentType tst ) const { return const_cast(this)->GetTimingSegments(tst); } - vector &GetTimingSegments( TimingSegmentType tst ) + std::vector &GetTimingSegments( TimingSegmentType tst ) { return m_avpTimingSegments[tst]; } @@ -461,13 +461,13 @@ public: float m_fBeat0OffsetInSeconds; // XXX: this breaks encapsulation. get rid of it ASAP - vector ToVectorString(TimingSegmentType tst, int dec = 6) const; + std::vector ToVectorString(TimingSegmentType tst, int dec = 6) const; protected: // don't call this directly; use the derived-type overloads. void AddSegment( const TimingSegment *seg ); // All of the following vectors must be sorted before gameplay. - std::array, NUM_TimingSegmentType> m_avpTimingSegments; + std::array, NUM_TimingSegmentType> m_avpTimingSegments; }; #undef COMPARE diff --git a/src/TimingSegments.cpp b/src/TimingSegments.cpp index 696ab32157..a9f3c5aab5 100644 --- a/src/TimingSegments.cpp +++ b/src/TimingSegments.cpp @@ -170,9 +170,9 @@ RString ComboSegment::ToString(int dec) const return ssprintf(str.c_str(), GetBeat(), GetCombo(), GetMissCombo()); } -vector ComboSegment::GetValues() const +std::vector ComboSegment::GetValues() const { - vector ret; + std::vector ret; ret.push_back(GetCombo()); ret.push_back(GetMissCombo()); return ret; @@ -197,9 +197,9 @@ RString TimeSignatureSegment::ToString(int dec) const return ssprintf(str.c_str(), GetBeat(), GetNum(), GetDen()); } -vector TimeSignatureSegment::GetValues() const +std::vector TimeSignatureSegment::GetValues() const { - vector ret; + std::vector ret; ret.push_back(GetNum()); ret.push_back(GetDen()); return ret; @@ -214,9 +214,9 @@ RString SpeedSegment::ToString(int dec) const GetDelay(), static_cast(GetUnit())); } -vector SpeedSegment::GetValues() const +std::vector SpeedSegment::GetValues() const { - vector ret; + std::vector ret; ret.push_back(GetRatio()); ret.push_back(GetDelay()); ret.push_back(GetUnit()); diff --git a/src/TimingSegments.h b/src/TimingSegments.h index 454bd05d29..24459775a1 100644 --- a/src/TimingSegments.h +++ b/src/TimingSegments.h @@ -83,9 +83,9 @@ struct TimingSegment return std::to_string(GetBeat()); } - virtual vector GetValues() const + virtual std::vector GetValues() const { - return vector(0); + return std::vector(0); } bool operator<( const TimingSegment &other ) const @@ -153,7 +153,7 @@ struct FakeSegment : public TimingSegment void Scale( int start, int length, int newLength ); RString ToString( int dec ) const; - vector GetValues() const { return vector(1, GetLength()); } + std::vector GetValues() const { return std::vector(1, GetLength()); } bool operator==( const FakeSegment &other ) const { @@ -211,7 +211,7 @@ struct WarpSegment : public TimingSegment void Scale( int start, int length, int newLength ); RString ToString( int dec ) const; - vector GetValues() const { return vector(1, GetLength()); } + std::vector GetValues() const { return std::vector(1, GetLength()); } bool operator==( const WarpSegment &other ) const { @@ -266,7 +266,7 @@ struct TickcountSegment : public TimingSegment void SetTicks( int iTicks ) { m_iTicksPerBeat = iTicks; } RString ToString( int dec ) const; - vector GetValues() const { return vector(1, GetTicks() * 1.f); } + std::vector GetValues() const { return std::vector(1, GetTicks() * 1.f); } bool operator==( const TickcountSegment &other ) const { @@ -318,7 +318,7 @@ struct ComboSegment : public TimingSegment void SetMissCombo( int iCombo ) { m_iMissCombo = iCombo; } RString ToString( int dec ) const; - vector GetValues() const; + std::vector GetValues() const; bool operator==( const ComboSegment &other ) const { @@ -419,7 +419,7 @@ struct BPMSegment : public TimingSegment void SetBPM( float fBPM ) { m_fBPS = fBPM / 60.0f; } RString ToString( int dec ) const; - vector GetValues() const { return vector(1, GetBPM()); } + std::vector GetValues() const { return std::vector(1, GetBPM()); } bool operator==( const BPMSegment &other ) const { @@ -476,7 +476,7 @@ struct TimeSignatureSegment : public TimingSegment void Set( int num, int den ) { m_iNumerator = num; m_iDenominator = den; } RString ToString( int dec ) const; - vector GetValues() const; + std::vector GetValues() const; /** * @brief Retrieve the number of note rows per measure within the TimeSignatureSegment. @@ -558,7 +558,7 @@ struct SpeedSegment : public TimingSegment void Scale( int start, int length, int newLength ); RString ToString( int dec ) const; - vector GetValues() const; + std::vector GetValues() const; bool operator==( const SpeedSegment &other ) const { @@ -618,7 +618,7 @@ struct ScrollSegment : public TimingSegment void SetRatio( float fRatio ) { m_fRatio = fRatio; } RString ToString( int dec ) const; - vector GetValues() const { return vector(1, GetRatio()); } + std::vector GetValues() const { return std::vector(1, GetRatio()); } bool operator==( const ScrollSegment &other ) const { @@ -663,7 +663,7 @@ struct StopSegment : public TimingSegment void SetPause( float fSeconds ) { m_fSeconds = fSeconds; } RString ToString( int dec ) const; - vector GetValues() const { return vector(1, GetPause()); } + std::vector GetValues() const { return std::vector(1, GetPause()); } bool operator==( const StopSegment &other ) const { @@ -707,7 +707,7 @@ struct DelaySegment : public TimingSegment void SetPause( float fSeconds ) { m_fSeconds = fSeconds; } RString ToString( int dec ) const; - vector GetValues() const { return vector(1, GetPause()); } + std::vector GetValues() const { return std::vector(1, GetPause()); } bool operator==( const DelaySegment &other ) const { diff --git a/src/TitleSubstitution.h b/src/TitleSubstitution.h index b7b09ecb4d..2b9176d04b 100644 --- a/src/TitleSubstitution.h +++ b/src/TitleSubstitution.h @@ -34,7 +34,7 @@ struct TitleTrans; /** @brief Automatic translation for Song titles. */ class TitleSubst { - vector ttab; + std::vector ttab; void AddTrans(const TitleTrans &tr); public: diff --git a/src/Trail.cpp b/src/Trail.cpp index 3d03fc86c6..9b5e1c899e 100644 --- a/src/Trail.cpp +++ b/src/Trail.cpp @@ -230,7 +230,7 @@ public: } static int GetArtists( T* p, lua_State *L ) { - vector asArtists, asAltArtists; + std::vector asArtists, asAltArtists; for (TrailEntry const &e : p->m_vEntries) { if( e.bSecret ) @@ -260,7 +260,7 @@ public: static int GetTrailEntry( T* p, lua_State *L ) { TrailEntry &te = p->m_vEntries[IArg(1)]; te.PushSelf(L); return 1; } static int GetTrailEntries( T* p, lua_State *L ) { - vector v; + std::vector v; for( unsigned i = 0; i < p->m_vEntries.size(); ++i ) { v.push_back(&p->m_vEntries[i]); diff --git a/src/Trail.h b/src/Trail.h index 5366727148..d5c0b9c8aa 100644 --- a/src/Trail.h +++ b/src/Trail.h @@ -59,7 +59,7 @@ public: StepsType m_StepsType; CourseType m_CourseType; CourseDifficulty m_CourseDifficulty; - vector m_vEntries; + std::vector m_vEntries; int m_iSpecifiedMeter; // == -1 if no meter specified mutable bool m_bRadarValuesCached; mutable RadarValues m_CachedRadarValues; diff --git a/src/UnlockManager.cpp b/src/UnlockManager.cpp index 3a37c17dd3..f78767af3d 100644 --- a/src/UnlockManager.cpp +++ b/src/UnlockManager.cpp @@ -359,7 +359,7 @@ bool UnlockEntry::IsValid() const UnlockEntryStatus UnlockEntry::GetUnlockEntryStatus() const { - set &ids = PROFILEMAN->GetMachineProfile()->m_UnlockedEntryIDs; + std::set &ids = PROFILEMAN->GetMachineProfile()->m_UnlockedEntryIDs; if(!m_sEntryID.empty() && ids.find(m_sEntryID) != ids.end() ) return UnlockEntryStatus_Unlocked; @@ -379,7 +379,7 @@ UnlockEntryStatus UnlockEntry::GetUnlockEntryStatus() const if( m_bRequirePassHardSteps && m_Song.IsValid() ) { Song *pSong = m_Song.ToSong(); - vector vp; + std::vector vp; SongUtil::GetSteps( pSong, vp, @@ -394,7 +394,7 @@ UnlockEntryStatus UnlockEntry::GetUnlockEntryStatus() const if (m_bRequirePassChallengeSteps && m_Song.IsValid()) { Song *pSong = m_Song.ToSong(); - vector vp; + std::vector vp; SongUtil::GetSteps(pSong, vp, StepsType_Invalid, @@ -478,7 +478,7 @@ void UnlockManager::Load() { LOG->Trace( "UnlockManager::Load()" ); - vector asUnlockNames; + std::vector asUnlockNames; split( UNLOCK_NAMES, ",", asUnlockNames ); Lua *L = LUA->Get(); @@ -677,7 +677,7 @@ float UnlockManager::PointsUntilNextUnlock( UnlockRequirement t ) const float fSmallestPoints = FLT_MAX; // or an arbitrarily large value for( unsigned a=0; a fScores[t] ) - fSmallestPoints = min( fSmallestPoints, m_UnlockEntries[a].m_fRequirement[t] ); + fSmallestPoints = std::min( fSmallestPoints, m_UnlockEntries[a].m_fRequirement[t] ); if( fSmallestPoints == FLT_MAX ) return 0; // no match found @@ -752,16 +752,16 @@ bool UnlockManager::AnyUnlocksToCelebrate() const return GetUnlockEntryIndexToCelebrate() != -1; } -void UnlockManager::GetUnlocksByType( UnlockRewardType t, vector &apEntries ) +void UnlockManager::GetUnlocksByType( UnlockRewardType t, std::vector &apEntries ) { for (UnlockEntry &entry : m_UnlockEntries) if( entry.IsValid() && entry.m_Type == t ) apEntries.push_back( &entry ); } -void UnlockManager::GetSongsUnlockedByEntryID( vector &apSongsOut, RString sUnlockEntryID ) +void UnlockManager::GetSongsUnlockedByEntryID( std::vector &apSongsOut, RString sUnlockEntryID ) { - vector apEntries; + std::vector apEntries; GetUnlocksByType( UnlockRewardType_Song, apEntries ); for (UnlockEntry const *ue : apEntries) @@ -769,9 +769,9 @@ void UnlockManager::GetSongsUnlockedByEntryID( vector &apSongsOut, RStri apSongsOut.push_back( ue->m_Song.ToSong() ); } -void UnlockManager::GetStepsUnlockedByEntryID( vector &apSongsOut, vector &apDifficultyOut, RString sUnlockEntryID ) +void UnlockManager::GetStepsUnlockedByEntryID( std::vector &apSongsOut, std::vector &apDifficultyOut, RString sUnlockEntryID ) { - vector apEntries; + std::vector apEntries; GetUnlocksByType( UnlockRewardType_Steps, apEntries ); for (UnlockEntry const *entry : apEntries) @@ -814,8 +814,8 @@ public: Song *pSong = p->m_Song.ToSong(); if (pSong) { - const vector& allSteps = pSong->GetAllSteps(); - vector toRet; + const std::vector& allSteps = pSong->GetAllSteps(); + std::vector toRet; for (Steps *step : allSteps) { if (step->GetDifficulty() == p->m_dc) @@ -835,7 +835,7 @@ public: Song *pSong = p->m_Song.ToSong(); if (pSong) { - const vector& allStepsType = pSong->GetStepsByStepsType(p->m_StepsType); + const std::vector& allStepsType = pSong->GetStepsByStepsType(p->m_StepsType); for (Steps *step : allStepsType) { if (step->GetDifficulty() == p->m_dc) @@ -947,7 +947,7 @@ public: static int GetUnlockEntry( T* p, lua_State *L ) { unsigned iIndex = IArg(1); if( iIndex >= p->m_UnlockEntries.size() ) return 0; p->m_UnlockEntries[iIndex].PushSelf(L); return 1; } static int GetSongsUnlockedByEntryID( T* p, lua_State *L ) { - vector apSongs; + std::vector apSongs; UNLOCKMAN->GetSongsUnlockedByEntryID( apSongs, SArg(1) ); LuaHelpers::CreateTableFromArray( apSongs, L ); return 1; @@ -956,8 +956,8 @@ public: static int GetStepsUnlockedByEntryID( T* p, lua_State *L ) { // Return the Song each Steps are associated with, too. - vector apSongs; - vector apDifficulty; + std::vector apSongs; + std::vector apDifficulty; UNLOCKMAN->GetStepsUnlockedByEntryID( apSongs, apDifficulty, SArg(1) ); LuaHelpers::CreateTableFromArray( apSongs, L ); LuaHelpers::CreateTableFromArray( apDifficulty, L ); diff --git a/src/UnlockManager.h b/src/UnlockManager.h index 184216b160..e607b30278 100644 --- a/src/UnlockManager.h +++ b/src/UnlockManager.h @@ -157,11 +157,11 @@ public: RString FindEntryID( const RString &sName ) const; // All locked songs are stored here - vector m_UnlockEntries; + std::vector m_UnlockEntries; - void GetUnlocksByType( UnlockRewardType t, vector &apEntries ); - void GetSongsUnlockedByEntryID( vector &apSongsOut, RString sEntryID ); - void GetStepsUnlockedByEntryID( vector &apSongsOut, vector &apStepsOut, RString sEntryID ); + void GetUnlocksByType( UnlockRewardType t, std::vector &apEntries ); + void GetSongsUnlockedByEntryID( std::vector &apSongsOut, RString sEntryID ); + void GetStepsUnlockedByEntryID( std::vector &apSongsOut, std::vector &apStepsOut, RString sEntryID ); const UnlockEntry *FindSong( const Song *pSong ) const; const UnlockEntry *FindSteps( const Song *pSong, const Steps *pSteps ) const; @@ -175,8 +175,8 @@ public: private: // read unlocks void Load(); - - set m_RouletteCodes; // "codes" which are available in roulette and which unlock if rouletted + + std::set m_RouletteCodes; // "codes" which are available in roulette and which unlock if rouletted }; extern UnlockManager* UNLOCKMAN; // global and accessible from anywhere in program diff --git a/src/WheelBase.cpp b/src/WheelBase.cpp index 4c4dc1d00d..5836d62dea 100644 --- a/src/WheelBase.cpp +++ b/src/WheelBase.cpp @@ -170,7 +170,7 @@ void WheelBase::Update( float fDeltaTime ) if( m_Moving ) { m_TimeBeforeMovingBegins -= fDeltaTime; - m_TimeBeforeMovingBegins = max(m_TimeBeforeMovingBegins, 0); + m_TimeBeforeMovingBegins = std::max(m_TimeBeforeMovingBegins, 0.0f); } // update wheel state @@ -185,7 +185,7 @@ void WheelBase::Update( float fDeltaTime ) float fTime = fDeltaTime; while( fTime > 0 ) { - float t = min( fTime, 0.1f ); + float t = std::min( fTime, 0.1f ); fTime -= t; m_fPositionOffsetFromSelection = clamp( m_fPositionOffsetFromSelection, -0.3f, +0.3f ); @@ -436,8 +436,8 @@ void WheelBase::ChangeMusic( int iDist ) void WheelBase::RebuildWheelItems( int iDist ) { - const vector &data = m_CurWheelItemData; - vector &items = m_WheelBaseItems; + const std::vector &data = m_CurWheelItemData; + std::vector &items = m_WheelBaseItems; // rewind to first index that will be displayed; int iFirstVisibleIndex = m_iSelection; diff --git a/src/WheelBase.h b/src/WheelBase.h index e984ee2d30..6650069ab8 100644 --- a/src/WheelBase.h +++ b/src/WheelBase.h @@ -86,8 +86,8 @@ protected: ScrollBar m_ScrollBar; AutoActor m_sprHighlight; - vector m_CurWheelItemData; - vector m_WheelBaseItems; + std::vector m_CurWheelItemData; + std::vector m_WheelBaseItems; WheelItemBaseData* m_LastSelection; bool m_bEmpty; diff --git a/src/WheelNotifyIcon.cpp b/src/WheelNotifyIcon.cpp index eda452a441..7be0ece7e7 100644 --- a/src/WheelNotifyIcon.cpp +++ b/src/WheelNotifyIcon.cpp @@ -58,7 +58,8 @@ void WheelNotifyIcon::SetFlags( Flags flags ) m_vIconsToShow.push_back( empty ); } - m_vIconsToShow.resize( min(m_vIconsToShow.size(), static_cast(NUM_ICONS_TO_SHOW)) ); + const unsigned int newSize = std::min(m_vIconsToShow.size(), static_cast(NUM_ICONS_TO_SHOW)); + m_vIconsToShow.resize(newSize); // Broadcast Set message so items can react. (futures) -aj //Message msg("Set"); diff --git a/src/WheelNotifyIcon.h b/src/WheelNotifyIcon.h index 6060ad6ce1..69f77a4a2b 100644 --- a/src/WheelNotifyIcon.h +++ b/src/WheelNotifyIcon.h @@ -37,7 +37,7 @@ protected: }; /** @brief the list of Icons to show. */ - vector m_vIconsToShow; + std::vector m_vIconsToShow; }; #endif diff --git a/src/WorkoutGraph.cpp b/src/WorkoutGraph.cpp index e1ee230fcf..0d53d85206 100644 --- a/src/WorkoutGraph.cpp +++ b/src/WorkoutGraph.cpp @@ -60,7 +60,7 @@ void WorkoutGraph::SetInternal( int iMinSongsPlayed ) if( pTrail == nullptr ) return; - vector viMeters; + std::vector viMeters; for (TrailEntry const &e : pTrail->m_vEntries) { ASSERT( e.pSteps != nullptr ); @@ -78,7 +78,7 @@ void WorkoutGraph::SetInternal( int iMinSongsPlayed ) float fTotalHeight = SCALE( iBlocksHigh, 1.0f, 10.0f, 50.0f, fMaxHeight ); CLAMP( fTotalHeight, 50, fMaxHeight ); - float fBlockSize = min( fTotalWidth / iBlocksWide, fTotalHeight / iBlocksHigh ); + float fBlockSize = std::min( fTotalWidth / iBlocksWide, fTotalHeight / iBlocksHigh ); m_sprEmpty.SetVertAlign( align_bottom ); m_sprEmpty.SetCustomImageRect( RectF(0,0,(float)iBlocksWide,(float)iBlocksHigh) ); diff --git a/src/WorkoutGraph.h b/src/WorkoutGraph.h index bc193ad3ea..62d92f7890 100644 --- a/src/WorkoutGraph.h +++ b/src/WorkoutGraph.h @@ -27,7 +27,7 @@ protected: void HighlightSong( int iSongIndex ); Sprite m_sprEmpty; - vector m_vpBars; + std::vector m_vpBars; int m_iSongsChoppedOffAtBeginning; }; diff --git a/src/XmlFile.cpp b/src/XmlFile.cpp index 2179abaa77..72d505e297 100644 --- a/src/XmlFile.cpp +++ b/src/XmlFile.cpp @@ -98,7 +98,7 @@ XNodeValue *XNode::GetAttr( const RString &attrname ) XNode *XNode::GetChild( const RString &sName ) { - multimap::iterator by_name= m_children_by_name.lower_bound(sName); + std::multimap::iterator by_name= m_children_by_name.lower_bound(sName); if(by_name != m_children_by_name.end() && sName == by_name->second->GetName()) { @@ -121,7 +121,7 @@ bool XNode::PushChildValue( lua_State *L, const RString &sName ) const const XNode *XNode::GetChild( const RString &sName ) const { - multimap::const_iterator by_name= m_children_by_name.lower_bound(sName); + std::multimap::const_iterator by_name= m_children_by_name.lower_bound(sName); if(by_name != m_children_by_name.end() && sName == by_name->second->GetName()) { @@ -153,7 +153,7 @@ bool XNode::RemoveChild(XNode *node, bool bDelete) void XNode::RemoveChildFromByName(XNode* node) { - multimap::iterator by_name= m_children_by_name.lower_bound(node->m_sName); + std::multimap::iterator by_name= m_children_by_name.lower_bound(node->m_sName); if(by_name != m_children_by_name.end() && node->GetName() == by_name->second->GetName()) { @@ -192,7 +192,7 @@ bool XNode::RemoveAttr( const RString &sName ) XNodeValue *XNode::AppendAttrFrom( const RString &sName, XNodeValue *pValue, bool bOverwrite ) { DEBUG_ASSERT( sName.size() ); - pair ret = m_attrs.insert( make_pair(sName, (XNodeValue *) nullptr) ); + std::pair ret = m_attrs.insert( make_pair(sName, (XNodeValue *) nullptr) ); if( !ret.second ) // already existed { if( bOverwrite ) @@ -214,7 +214,7 @@ XNodeValue *XNode::AppendAttrFrom( const RString &sName, XNodeValue *pValue, boo XNodeValue *XNode::AppendAttr( const RString &sName ) { DEBUG_ASSERT( sName.size() ); - pair ret = m_attrs.insert( make_pair(sName, (XNodeValue *) nullptr) ); + std::pair ret = m_attrs.insert( make_pair(sName, (XNodeValue *) nullptr) ); if( ret.second ) ret.first->second = new XNodeStringValue; return ret.first->second; // already existed diff --git a/src/XmlFile.h b/src/XmlFile.h index bce2b4a50e..8da1319bb3 100644 --- a/src/XmlFile.h +++ b/src/XmlFile.h @@ -52,9 +52,9 @@ public: void SetValueFromStack( lua_State *L ); }; -typedef map XAttrs; +typedef std::map XAttrs; class XNode; -typedef vector XNodes; +typedef std::vector XNodes; /** @brief Loop through each node. */ #define FOREACH_Attr( pNode, Var ) \ for( XAttrs::iterator Var = (pNode)->m_attrs.begin(); \ @@ -84,7 +84,7 @@ class XNode { private: XNodes m_childs; // child nodes - multimap m_children_by_name; + std::multimap m_children_by_name; public: RString m_sName; diff --git a/src/XmlFileUtil.cpp b/src/XmlFileUtil.cpp index 776d9b9088..bcce97210e 100644 --- a/src/XmlFileUtil.cpp +++ b/src/XmlFileUtil.cpp @@ -49,8 +49,8 @@ static const char chXMLTagPre = '/'; static const char chXMLExclamation = '!'; static const char chXMLDash = '-'; -static map g_mapEntitiesToChars; -static map g_mapCharsToEntities; +static std::map g_mapEntitiesToChars; +static std::map g_mapCharsToEntities; static void InitEntities() { @@ -131,7 +131,7 @@ RString::size_type LoadAttributes( XNode *pNode, const RString &xml, RString &sE // error if( sErrorOut.empty() ) sErrorOut = ssprintf( "<%s> attribute has error ", pNode->GetName().c_str() ); - return string::npos; + return std::string::npos; } // XML Attr Name @@ -175,7 +175,7 @@ RString::size_type LoadAttributes( XNode *pNode, const RString &xml, RString &sE // error if( sErrorOut.empty() ) sErrorOut = ssprintf( "<%s> attribute text: couldn't find matching quote", sName.c_str() ); - return string::npos; + return std::string::npos; } RString sValue; @@ -190,7 +190,7 @@ RString::size_type LoadAttributes( XNode *pNode, const RString &xml, RString &sE } // not well-formed tag - return string::npos; + return std::string::npos; } // @@ -208,8 +208,8 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr // < iOffset = xml.find( chXMLTagOpen, iOffset ); - if( iOffset == string::npos ) - return string::npos; + if( iOffset == std::string::npos ) + return std::string::npos; // ", iOffset ); - if( iEnd == string::npos ) + if( iEnd == std::string::npos ) { if( sErrorOut.empty() ) sErrorOut = "Unterminated comment"; - return string::npos; + return std::string::npos; } // Skip -->. @@ -246,8 +246,8 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr // Generate XML Attribute List iOffset = LoadAttributes( pNode, xml, sErrorOut, iOffset ); - if( iOffset == string::npos ) - return string::npos; + if( iOffset == std::string::npos ) + return std::string::npos; // alone tag or or // current pointer: ^ ^ ^ @@ -267,7 +267,7 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr sErrorOut = "Element must be closed."; // ill-formed tag - return string::npos; + return std::string::npos; } // well-formed tag @@ -289,12 +289,12 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr // Text Value ++iOffset; RString::size_type iEnd = xml.find( chXMLTagOpen, iOffset ); - if( iEnd == string::npos ) + if( iEnd == std::string::npos ) { if( sErrorOut.empty() ) sErrorOut = ssprintf( "%s must be closed with ", pNode->GetName().c_str(), pNode->GetName().c_str() ); // error cos not exist CloseTag - return string::npos; + return std::string::npos; } RString sValue; @@ -312,7 +312,7 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr XNode *node = new XNode; iOffset = LoadInternal( node, xml, sErrorOut, iOffset ); - if( iOffset == string::npos ) + if( iOffset == std::string::npos ) { delete node; return iOffset; @@ -340,12 +340,12 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr continue; RString::size_type iEnd = xml.find_first_of( " >", iOffset ); - if( iEnd == string::npos ) + if( iEnd == std::string::npos ) { if( sErrorOut.empty() ) sErrorOut = ssprintf( "it must be closed with ", pNode->GetName().c_str() ); // error - return string::npos; + return std::string::npos; } RString closename; @@ -362,7 +362,7 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr // not welformed open/close if( sErrorOut.empty() ) sErrorOut = ssprintf( "'<%s> ... ' is not well-formed.", pNode->GetName().c_str(), closename.c_str() ); - return string::npos; + return std::string::npos; } } else // Alone child Tag Loaded @@ -371,12 +371,12 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr { // Text Value RString::size_type iEnd = xml.find( chXMLTagOpen, iOffset ); - if( iEnd == string::npos ) + if( iEnd == std::string::npos ) { // error cos not exist CloseTag if( sErrorOut.empty() ) sErrorOut = ssprintf( "it must be closed with ", pNode->GetName().c_str() ); - return string::npos; + return std::string::npos; } RString sValue; @@ -601,7 +601,7 @@ void XmlFileUtil::AnnotateXNodeTree( XNode *pNode, const RString &sFile ) { RString sDir = Dirname( sFile ); - vector queue; + std::vector queue; queue.push_back( pNode ); while( !queue.empty() ) { @@ -623,7 +623,7 @@ void XmlFileUtil::AnnotateXNodeTree( XNode *pNode, const RString &sFile ) void XmlFileUtil::CompileXNodeTree( XNode *pNode, const RString &sFile ) { - vector aToCompile; + std::vector aToCompile; aToCompile.push_back( pNode ); Lua *L = LUA->Get(); @@ -660,8 +660,8 @@ namespace } // Iterate over the table, pulling out attributes and tables to process. - vector NodeNamesToAdd; - vector NodesToAdd; + std::vector NodeNamesToAdd; + std::vector NodesToAdd; /* Add array elements first, in array order, so iterating over the XNode * keeps the array in order. */ @@ -776,7 +776,7 @@ void XmlFileUtil::MergeIniUnder( XNode *pFrom, XNode *pTo ) { /* Batch up nodes to move, and do them all at once, to deal sanely * with the possibility of duplicate child names. */ - vector aToMove; + std::vector aToMove; // Iterate over each section in pFrom. XNodes::iterator it = pFrom->GetChildrenBegin(); diff --git a/src/XmlToLua.cpp b/src/XmlToLua.cpp index b53af0ffa7..fe9ba107bf 100644 --- a/src/XmlToLua.cpp +++ b/src/XmlToLua.cpp @@ -41,9 +41,9 @@ RString unique_name(RString const& type) void convert_xmls_in_dir(RString const& dirname) { - vector listing; + std::vector listing; FILEMAN->GetDirListing(dirname, listing, false, true); - for(vector::iterator curr_file= listing.begin(); + for(std::vector::iterator curr_file= listing.begin(); curr_file != listing.end(); ++curr_file) { switch(ActorUtil::GetFileType(*curr_file)) @@ -83,7 +83,7 @@ RString maybe_conv_pos(RString pos, RString (*conv_func)(float p)) size_t after_slash_or_zero(RString const& s) { size_t ret= s.rfind('/'); - if(ret != string::npos) + if(ret != std::string::npos) { return ret+1; } @@ -96,10 +96,10 @@ RString add_extension_to_relative_path_from_found_file( size_t rel_last_slash= after_slash_or_zero(relative_path); size_t found_last_slash= after_slash_or_zero(found_file); return relative_path.Left(rel_last_slash) + - found_file.substr(found_last_slash, string::npos); + found_file.substr(found_last_slash, std::string::npos); } -bool verify_arg_count(RString cmd, vector& args, size_t req) +bool verify_arg_count(RString cmd, std::vector& args, size_t req) { if(args.size() < req) { @@ -109,15 +109,15 @@ bool verify_arg_count(RString cmd, vector& args, size_t req) return true; } -typedef void (*arg_converter_t)(vector& args); +typedef void (*arg_converter_t)(std::vector& args); -map arg_converters; -map tween_counters; -set fields_that_are_strings; -map chunks_to_replace; +std::map arg_converters; +std::map tween_counters; +std::set fields_that_are_strings; +std::map chunks_to_replace; #define COMMON_ARG_VERIFY(count) if(!verify_arg_count(args[0], args, count)) return; -void x_conv(vector& args) +void x_conv(std::vector& args) { COMMON_ARG_VERIFY(2); float pos; @@ -126,7 +126,7 @@ void x_conv(vector& args) args[1]= convert_xpos(pos); } } -void y_conv(vector& args) +void y_conv(std::vector& args) { COMMON_ARG_VERIFY(2); float pos; @@ -135,16 +135,16 @@ void y_conv(vector& args) args[1]= convert_ypos(pos); } } -void string_arg_conv(vector& args) +void string_arg_conv(std::vector& args) { COMMON_ARG_VERIFY(2); args[1]= "\"" + args[1] + "\""; } -void lower_string_conv(vector& args) +void lower_string_conv(std::vector& args) { args[0].MakeLower(); } -void hidden_conv(vector& args) +void hidden_conv(std::vector& args) { COMMON_ARG_VERIFY(2); args[0]= "visible"; @@ -157,7 +157,7 @@ void hidden_conv(vector& args) args[1]= "true"; } } -void diffuse_conv(vector& args) +void diffuse_conv(std::vector& args) { COMMON_ARG_VERIFY(2); RString retarg; @@ -176,7 +176,7 @@ void diffuse_conv(vector& args) // Prototype for a function that is created by a macro in another translation unit and has no visible prototype, don't do this unless you have a good reason. const RString& BlendModeToString(BlendMode); const RString& CullModeToString(CullMode); -void blend_conv(vector& args) +void blend_conv(std::vector& args) { COMMON_ARG_VERIFY(2); for(int i= 0; i < NUM_BlendMode; ++i) @@ -190,7 +190,7 @@ void blend_conv(vector& args) } } } -void cull_conv(vector& args) +void cull_conv(std::vector& args) { COMMON_ARG_VERIFY(2); for(int i= 0; i < NUM_CullMode; ++i) @@ -246,7 +246,7 @@ void init_parser_helpers() void convert_lua_chunk(RString& chunk_text) { - for(map::iterator chunk= chunks_to_replace.begin(); + for(std::map::iterator chunk= chunks_to_replace.begin(); chunk != chunks_to_replace.end(); ++chunk) { chunk_text.Replace(chunk->first, chunk->second); @@ -257,8 +257,8 @@ void convert_lua_chunk(RString& chunk_text) // So condition_set_t::iterator->first is the lua to execute for the // condition, and condition_set_t::iterator->second is the name of the // condition. -typedef map condition_set_t; -typedef map field_cont_t; +typedef std::map condition_set_t; +typedef std::map field_cont_t; struct frame_t { int frame; @@ -272,8 +272,8 @@ struct actor_template_t field_cont_t fields; RString condition; RString name; - vector frames; - vector children; + std::vector frames; + std::vector children; RString x; RString y; void make_space_for_frame(int id); @@ -305,19 +305,19 @@ void actor_template_t::store_cmd(RString const& cmd_name, RString const& full_cm fields[cmd_name]= cmd_text; return; } - vector cmds; + std::vector cmds; split(full_cmd, ";", cmds, true); size_t queue_size= 0; // If someone has a simfile that uses a playcommand that pushes tween // states onto the queue, queue size counting will have to be made much // more complex to prevent that from causing an overflow. - for(vector::iterator cmd= cmds.begin(); cmd != cmds.end(); ++cmd) + for(std::vector::iterator cmd= cmds.begin(); cmd != cmds.end(); ++cmd) { - vector args; + std::vector args; split(*cmd, ",", args, true); if(!args.empty()) { - for(vector::iterator arg= args.begin(); arg != args.end(); ++arg) + for(std::vector::iterator arg= args.begin(); arg != args.end(); ++arg) { size_t first_nonspace= 0; size_t last_nonspace= arg->size(); @@ -331,12 +331,12 @@ void actor_template_t::store_cmd(RString const& cmd_name, RString const& full_cm } *arg= arg->substr(first_nonspace, last_nonspace - first_nonspace); } - map::iterator conv= arg_converters.find(args[0]); + std::map::iterator conv= arg_converters.find(args[0]); if(conv != arg_converters.end()) { conv->second(args); } - map::iterator counter= tween_counters.find(args[0]); + std::map::iterator counter= tween_counters.find(args[0]); if(counter != tween_counters.end()) { queue_size+= counter->second; @@ -353,15 +353,15 @@ void actor_template_t::store_cmd(RString const& cmd_name, RString const& full_cm size_t states_per= (queue_size / num_to_make) + 1; size_t states_in_curr= 0; RString this_name= cmd_name; - vector curr_cmd; - for(vector::iterator cmd= cmds.begin(); cmd != cmds.end(); ++cmd) + std::vector curr_cmd; + for(std::vector::iterator cmd= cmds.begin(); cmd != cmds.end(); ++cmd) { curr_cmd.push_back(*cmd); - vector args; + std::vector args; split(*cmd, ",", args, true); if(!args.empty()) { - map::iterator counter= tween_counters.find(args[0]); + std::map::iterator counter= tween_counters.find(args[0]); if(counter != tween_counters.end()) { states_in_curr+= counter->second; @@ -547,11 +547,11 @@ void actor_template_t::load_node(XNode const& node, RString const& dirname, cond } else { - vector files_in_dir; + std::vector files_in_dir; FILEMAN->GetDirListing(sfname + "*", files_in_dir, false, true); int handled_level= 0; RString found_file= ""; - for(vector::iterator file= files_in_dir.begin(); + for(std::vector::iterator file= files_in_dir.begin(); file != files_in_dir.end() && handled_level < 2; ++file) { RString extension= GetExtension(*file); @@ -684,7 +684,7 @@ void actor_template_t::output_to_file(RageFile* file, RString const& indent) { file->Write(subindent + "Frames= {\n"); RString frameindent= subindent + " "; - for(vector::iterator frame= frames.begin(); + for(std::vector::iterator frame= frames.begin(); frame != frames.end(); ++frame) { file->Write(frameindent + "{Frame= " + std::to_string(frame->frame) + @@ -695,7 +695,7 @@ void actor_template_t::output_to_file(RageFile* file, RString const& indent) for(field_cont_t::iterator field= fields.begin(); field != fields.end(); ++field) { - set::iterator is_string= fields_that_are_strings.find(field->first); + std::set::iterator is_string= fields_that_are_strings.find(field->first); if(is_string != fields_that_are_strings.end()) { file->Write(subindent + field->first + "= \"" + field->second + "\",\n"); @@ -705,7 +705,7 @@ void actor_template_t::output_to_file(RageFile* file, RString const& indent) file->Write(subindent + field->first + "= " + field->second + ",\n"); } } - for(vector::iterator child= children.begin(); + for(std::vector::iterator child= children.begin(); child != children.end(); ++child) { child->output_to_file(file, subindent); @@ -767,7 +767,7 @@ int LuaFunc_convert_xml_bgs(lua_State* L); int LuaFunc_convert_xml_bgs(lua_State* L) { RString dir= SArg(1); - vector xml_list; + std::vector xml_list; convert_xmls_in_dir(dir + "/"); return 0; } diff --git a/src/arch/ArchHooks/ArchHooks_Win32.cpp b/src/arch/ArchHooks/ArchHooks_Win32.cpp index 7d31c6b4fa..dfc9738a7f 100644 --- a/src/arch/ArchHooks/ArchHooks_Win32.cpp +++ b/src/arch/ArchHooks/ArchHooks_Win32.cpp @@ -105,7 +105,7 @@ bool ArchHooks_Win32::CheckForMultipleInstances(int argc, char* argv[]) SetForegroundWindow( hWnd ); // Send the command line to the existing window. - vector vsArgs; + std::vector vsArgs; for( int i=0; i asParts; + std::vector asParts; split( sDirOfExecutable, "/", asParts ); CHECKPOINT_M( ssprintf( "... %i asParts", asParts.size()) ); ASSERT_M( asParts.size() > 1, ssprintf("Strange sDirOfExecutable: %s", sDirOfExecutable.c_str()) ); diff --git a/src/arch/Dialog/Dialog.cpp b/src/arch/Dialog/Dialog.cpp index 58b996e266..b14daaa848 100644 --- a/src/arch/Dialog/Dialog.cpp +++ b/src/arch/Dialog/Dialog.cpp @@ -15,7 +15,7 @@ static Preference g_sIgnoredDialogs( "IgnoredDialogs", "" ); DialogDriver *MakeDialogDriver() { RString sDrivers = "win32,cocoa,null"; - vector asDriversToTry; + std::vector asDriversToTry; split( sDrivers, ",", asDriversToTry, true ); ASSERT( asDriversToTry.size() != 0 ); @@ -83,7 +83,7 @@ void Dialog::Shutdown() static bool MessageIsIgnored( RString sID ) { #if !defined(SMPACKAGE) - vector asList; + std::vector asList; split( g_sIgnoredDialogs, ",", asList ); for( unsigned i = 0; i < asList.size(); ++i ) if( !sID.CompareNoCase(asList[i]) ) @@ -109,7 +109,7 @@ void Dialog::IgnoreMessage( RString sID ) if( MessageIsIgnored(sID) ) return; - vector asList; + std::vector asList; split( g_sIgnoredDialogs, ",", asList ); asList.push_back( sID ); g_sIgnoredDialogs.Set( join(",",asList) ); diff --git a/src/arch/Dialog/DialogDriver.cpp b/src/arch/Dialog/DialogDriver.cpp index e4fdd11866..95e8295a71 100644 --- a/src/arch/Dialog/DialogDriver.cpp +++ b/src/arch/Dialog/DialogDriver.cpp @@ -3,11 +3,11 @@ #include "RageLog.h" -map *RegisterDialogDriver::g_pRegistrees; +std::map *RegisterDialogDriver::g_pRegistrees; RegisterDialogDriver::RegisterDialogDriver( const istring &sName, CreateDialogDriverFn pfn ) { if( g_pRegistrees == nullptr ) - g_pRegistrees = new map; + g_pRegistrees = new std::map; ASSERT( g_pRegistrees->find(sName) == g_pRegistrees->end() ); (*g_pRegistrees)[sName] = pfn; @@ -18,14 +18,14 @@ REGISTER_DIALOG_DRIVER_CLASS( Null ); DialogDriver *DialogDriver::Create() { RString sDrivers = "win32,macosx,null"; - vector asDriversToTry; + std::vector asDriversToTry; split( sDrivers, ",", asDriversToTry, true ); ASSERT( asDriversToTry.size() != 0 ); for (RString const &Driver : asDriversToTry) { - map::const_iterator iter = RegisterDialogDriver::g_pRegistrees->find( istring(Driver) ); + std::map::const_iterator iter = RegisterDialogDriver::g_pRegistrees->find( istring(Driver) ); if( iter == RegisterDialogDriver::g_pRegistrees->end() ) continue; diff --git a/src/arch/Dialog/DialogDriver.h b/src/arch/Dialog/DialogDriver.h index 5e377328ba..ee35b0da58 100644 --- a/src/arch/Dialog/DialogDriver.h +++ b/src/arch/Dialog/DialogDriver.h @@ -25,7 +25,7 @@ class DialogDriver_Null : public DialogDriver { }; typedef DialogDriver *(*CreateDialogDriverFn)(); struct RegisterDialogDriver { - static map *g_pRegistrees; + static std::map *g_pRegistrees; RegisterDialogDriver( const istring &sName, CreateDialogDriverFn pfn ); }; #define REGISTER_DIALOG_DRIVER_CLASS( name ) \ diff --git a/src/arch/Dialog/DialogDriver_MacOSX.cpp b/src/arch/Dialog/DialogDriver_MacOSX.cpp index 96b346b258..84edf36b81 100644 --- a/src/arch/Dialog/DialogDriver_MacOSX.cpp +++ b/src/arch/Dialog/DialogDriver_MacOSX.cpp @@ -28,7 +28,7 @@ static CFOptionFlags ShowAlert( CFOptionFlags flags, const RString& sMessage, CF // Flush all input that's accumulated while the dialog box was up. if( INPUTFILTER ) { - vector dummy; + std::vector dummy; INPUTFILTER->Reset(); INPUTFILTER->GetInputEvents( dummy ); } diff --git a/src/arch/InputHandler/InputHandler.cpp b/src/arch/InputHandler/InputHandler.cpp index e715a59928..98ba623f4b 100644 --- a/src/arch/InputHandler/InputHandler.cpp +++ b/src/arch/InputHandler/InputHandler.cpp @@ -133,7 +133,7 @@ RString InputHandler::GetDeviceSpecificInputString( const DeviceInput &di ) wchar_t c = DeviceButtonToChar( di.button, false ); if( c && c != L' ' ) // Don't show "Key " for space. - return InputDeviceToString( di.device ) + " " + Capitalize( WStringToRString(wstring()+c) ); + return InputDeviceToString( di.device ) + " " + Capitalize( WStringToRString(std::wstring()+c) ); } RString s = DeviceButtonToString( di.button ); @@ -162,7 +162,7 @@ RString InputHandler::GetLocalizedInputString( const DeviceInput &di ) default: wchar_t c = DeviceButtonToChar( di.button, false ); if( c && c != L' ' ) // Don't show "Key " for space. - return Capitalize( WStringToRString(wstring()+c) ); + return Capitalize( WStringToRString(std::wstring()+c) ); return DeviceButtonToString( di.button ); } @@ -171,10 +171,10 @@ RString InputHandler::GetLocalizedInputString( const DeviceInput &di ) DriverList InputHandler::m_pDriverList; static LocalizedString INPUT_HANDLERS_EMPTY( "Arch", "Input Handlers cannot be empty." ); -void InputHandler::Create( const RString &drivers_, vector &Add ) +void InputHandler::Create( const RString &drivers_, std::vector &Add ) { const RString drivers = drivers_.empty()? RString(DEFAULT_INPUT_DRIVER_LIST):drivers_; - vector DriversToTry; + std::vector DriversToTry; split( drivers, ",", DriversToTry, true ); if( DriversToTry.empty() ) diff --git a/src/arch/InputHandler/InputHandler.h b/src/arch/InputHandler/InputHandler.h index 2afaa75066..3ea5270ad5 100644 --- a/src/arch/InputHandler/InputHandler.h +++ b/src/arch/InputHandler/InputHandler.h @@ -22,14 +22,14 @@ class InputHandler: public RageDriver { public: - static void Create( const RString &sDrivers, vector &apAdd ); + static void Create( const RString &sDrivers, std::vector &apAdd ); static DriverList m_pDriverList; InputHandler(): m_LastUpdate(), m_iInputsSinceUpdate(0) {} virtual ~InputHandler() { } virtual void Update() { } virtual bool DevicesChanged() { return false; } - virtual void GetDevicesAndDescriptions( vector& vDevicesOut ) = 0; + virtual void GetDevicesAndDescriptions( std::vector& vDevicesOut ) = 0; // Override to return a pretty string that's specific to the controller type. virtual RString GetDeviceSpecificInputString( const DeviceInput &di ); diff --git a/src/arch/InputHandler/InputHandler_DirectInput.cpp b/src/arch/InputHandler/InputHandler_DirectInput.cpp index deb9a9a8be..349c626a89 100644 --- a/src/arch/InputHandler/InputHandler_DirectInput.cpp +++ b/src/arch/InputHandler/InputHandler_DirectInput.cpp @@ -32,8 +32,8 @@ REGISTER_INPUT_HANDLER_CLASS2( DirectInput, DInput ); -static vector Devices; -static vector XDevices; +static std::vector Devices; +static std::vector XDevices; // Number of joysticks found: static int g_iNumJoysticks; @@ -505,8 +505,8 @@ void InputHandler_DInput::UpdatePolled( DIDevice &device, const RageTimer &tm ) if( neg != DeviceButton_Invalid ) { float l = SCALE( int(val), 0.0f, 100.0f, 0.0f, 1.0f ); - ButtonPressed( DeviceInput(dev, neg, max(-l,0), tm) ); - ButtonPressed( DeviceInput(dev, pos, max(+l,0), tm) ); + ButtonPressed( DeviceInput(dev, neg, std::max(-l, 0.0f), tm) ); + ButtonPressed( DeviceInput(dev, pos, std::max(+l, 0.0f), tm) ); } break; @@ -752,8 +752,8 @@ void InputHandler_DInput::UpdateBuffered( DIDevice &device, const RageTimer &tm } else { - ButtonPressed( DeviceInput(dev, up, max(-l,0), tm) ); - ButtonPressed( DeviceInput(dev, down, max(+l,0), tm) ); + ButtonPressed( DeviceInput(dev, up, std::max(-l, 0.0f), tm) ); + ButtonPressed( DeviceInput(dev, down, std::max(+l, 0.0f), tm) ); } } break; @@ -777,8 +777,6 @@ const short XINPUT_GAMEPAD_THUMB_MAX = MAXSHORT; void InputHandler_DInput::UpdateXInput( XIDevice &device, const RageTimer &tm ) { - using std::max; - XINPUT_STATE state; ZeroMemory(&state, sizeof(XINPUT_STATE)); if (XInputGetState(device.m_dwXInputSlot, &state) == ERROR_SUCCESS) @@ -791,10 +789,10 @@ void InputHandler_DInput::UpdateXInput( XIDevice &device, const RageTimer &tm ) lx = SCALE(state.Gamepad.sThumbLX + 0.f, XINPUT_GAMEPAD_THUMB_MIN + 0.f, XINPUT_GAMEPAD_THUMB_MAX + 0.f, -1.0f, 1.0f); ly = SCALE(state.Gamepad.sThumbLY + 0.f, XINPUT_GAMEPAD_THUMB_MIN + 0.f, XINPUT_GAMEPAD_THUMB_MAX + 0.f, -1.0f, 1.0f); } - ButtonPressed(DeviceInput(device.dev, JOY_LEFT, max(-lx, 0.f), tm)); - ButtonPressed(DeviceInput(device.dev, JOY_RIGHT, max(+lx, 0.f), tm)); - ButtonPressed(DeviceInput(device.dev, JOY_UP, max(+ly, 0.f), tm)); - ButtonPressed(DeviceInput(device.dev, JOY_DOWN, max(-ly, 0.f), tm)); + ButtonPressed(DeviceInput(device.dev, JOY_LEFT, std::max(-lx, 0.f), tm)); + ButtonPressed(DeviceInput(device.dev, JOY_RIGHT, std::max(+lx, 0.f), tm)); + ButtonPressed(DeviceInput(device.dev, JOY_UP, std::max(+ly, 0.f), tm)); + ButtonPressed(DeviceInput(device.dev, JOY_DOWN, std::max(-ly, 0.f), tm)); float rx = 0.f; float ry = 0.f; @@ -803,10 +801,10 @@ void InputHandler_DInput::UpdateXInput( XIDevice &device, const RageTimer &tm ) rx = SCALE(state.Gamepad.sThumbRX + 0.f, XINPUT_GAMEPAD_THUMB_MIN + 0.f, XINPUT_GAMEPAD_THUMB_MAX + 0.f, -1.0f, 1.0f); ry = SCALE(state.Gamepad.sThumbRY + 0.f, XINPUT_GAMEPAD_THUMB_MIN + 0.f, XINPUT_GAMEPAD_THUMB_MAX + 0.f, -1.0f, 1.0f); } - ButtonPressed(DeviceInput(device.dev, JOY_LEFT_2, max(-rx, 0.f), tm)); - ButtonPressed(DeviceInput(device.dev, JOY_RIGHT_2, max(+rx, 0.f), tm)); - ButtonPressed(DeviceInput(device.dev, JOY_UP_2, max(+ry, 0.f), tm)); - ButtonPressed(DeviceInput(device.dev, JOY_DOWN_2, max(-ry, 0.f), tm)); + ButtonPressed(DeviceInput(device.dev, JOY_LEFT_2, std::max(-rx, 0.f), tm)); + ButtonPressed(DeviceInput(device.dev, JOY_RIGHT_2, std::max(+rx, 0.f), tm)); + ButtonPressed(DeviceInput(device.dev, JOY_UP_2, std::max(+ry, 0.f), tm)); + ButtonPressed(DeviceInput(device.dev, JOY_DOWN_2, std::max(-ry, 0.f), tm)); // map buttons ButtonPressed(DeviceInput(device.dev, JOY_BUTTON_1, !!(state.Gamepad.wButtons & XINPUT_GAMEPAD_A), tm)); @@ -944,7 +942,7 @@ void InputHandler_DInput::InputThreadMain() // Enable priority boosting. SetThreadPriorityBoost( GetCurrentThread(), FALSE ); - vector BufferedDevices; + std::vector BufferedDevices; HANDLE Handle = CreateEvent( nullptr, FALSE, FALSE, nullptr ); for( unsigned i = 0; i < Devices.size(); ++i ) { @@ -1002,7 +1000,7 @@ void InputHandler_DInput::InputThreadMain() CloseHandle(Handle); } -void InputHandler_DInput::GetDevicesAndDescriptions( vector& vDevicesOut ) +void InputHandler_DInput::GetDevicesAndDescriptions( std::vector& vDevicesOut ) { for( unsigned i=0; i < XDevices.size(); ++i ) vDevicesOut.push_back( InputDeviceInfo(XDevices[i].dev, XDevices[i].m_sName ) ); diff --git a/src/arch/InputHandler/InputHandler_DirectInput.h b/src/arch/InputHandler/InputHandler_DirectInput.h index 64fc7bfc8a..2d0cc6a480 100644 --- a/src/arch/InputHandler/InputHandler_DirectInput.h +++ b/src/arch/InputHandler/InputHandler_DirectInput.h @@ -11,7 +11,7 @@ class InputHandler_DInput: public InputHandler public: InputHandler_DInput(); ~InputHandler_DInput(); - void GetDevicesAndDescriptions( vector& vDevicesOut ); + void GetDevicesAndDescriptions( std::vector& vDevicesOut ); wchar_t DeviceButtonToChar( DeviceButton button, bool bUseCurrentKeyModifiers ); void Update(); bool DevicesChanged(); diff --git a/src/arch/InputHandler/InputHandler_DirectInputHelper.h b/src/arch/InputHandler/InputHandler_DirectInputHelper.h index 655aadd4a8..79c4b3a8ae 100644 --- a/src/arch/InputHandler/InputHandler_DirectInputHelper.h +++ b/src/arch/InputHandler/InputHandler_DirectInputHelper.h @@ -44,7 +44,7 @@ struct DIDevice bool buffered; int buttons, axes, hats; - vector Inputs; + std::vector Inputs; InputDevice dev; DIDevice(); diff --git a/src/arch/InputHandler/InputHandler_Linux_Event.cpp b/src/arch/InputHandler/InputHandler_Linux_Event.cpp index a3a8a34668..20a18a3e25 100644 --- a/src/arch/InputHandler/InputHandler_Linux_Event.cpp +++ b/src/arch/InputHandler/InputHandler_Linux_Event.cpp @@ -67,7 +67,7 @@ struct EventDevice DeviceButton aiAbsMappingLow[ABS_MAX]; }; -static vector g_apEventDevices; +static std::vector g_apEventDevices; static bool BitIsSet( const uint8_t *pArray, uint32_t iBit ) { @@ -153,7 +153,7 @@ bool EventDevice::Open( RString sFile, InputDevice dev ) LOG->Warn( "ioctl(EV_MAX): %s", strerror(errno) ); { - vector setEventTypes; + std::vector setEventTypes; if( BitIsSet(iEventTypes, EV_SYN) ) setEventTypes.push_back( "syn" ); if( BitIsSet(iEventTypes, EV_KEY) ) setEventTypes.push_back( "key" ); @@ -347,7 +347,7 @@ void InputHandler_Linux_Event::InputThread() continue; FD_SET( iFD, &fdset ); - iMaxFD = max( iMaxFD, iFD ); + iMaxFD = std::max( iMaxFD, iFD ); } if( iMaxFD == -1 ) @@ -414,8 +414,8 @@ void InputHandler_Linux_Event::InputThread() } else { - ButtonPressed( DeviceInput(g_apEventDevices[i]->m_Dev, neg, max(-l,0), now) ); - ButtonPressed( DeviceInput(g_apEventDevices[i]->m_Dev, pos, max(+l,0), now) ); + ButtonPressed( DeviceInput(g_apEventDevices[i]->m_Dev, neg, std::max(-l, 0.0f), now) ); + ButtonPressed( DeviceInput(g_apEventDevices[i]->m_Dev, pos, std::max(+l, 0.0f), now) ); } break; } @@ -428,7 +428,7 @@ void InputHandler_Linux_Event::InputThread() InputHandler::UpdateTimer(); } -void InputHandler_Linux_Event::GetDevicesAndDescriptions( vector& vDevicesOut ) +void InputHandler_Linux_Event::GetDevicesAndDescriptions( std::vector& vDevicesOut ) { for( unsigned i = 0; i < g_apEventDevices.size(); ++i ) { diff --git a/src/arch/InputHandler/InputHandler_Linux_Event.h b/src/arch/InputHandler/InputHandler_Linux_Event.h index d14aa881bb..1028a5af2e 100644 --- a/src/arch/InputHandler/InputHandler_Linux_Event.h +++ b/src/arch/InputHandler/InputHandler_Linux_Event.h @@ -14,7 +14,7 @@ public: ~InputHandler_Linux_Event(); bool TryDevice(RString devfile); bool DevicesChanged() { return m_bDevicesChanged; } - void GetDevicesAndDescriptions( vector& vDevicesOut ); + void GetDevicesAndDescriptions( std::vector& vDevicesOut ); private: void StartThread(); diff --git a/src/arch/InputHandler/InputHandler_Linux_Joystick.cpp b/src/arch/InputHandler/InputHandler_Linux_Joystick.cpp index 38728d11dc..0c276d9b0c 100644 --- a/src/arch/InputHandler/InputHandler_Linux_Joystick.cpp +++ b/src/arch/InputHandler/InputHandler_Linux_Joystick.cpp @@ -119,7 +119,7 @@ void InputHandler_Linux_Joystick::InputThread() continue; FD_SET(fds[i], &fdset); - max_fd = max(max_fd, fds[i]); + max_fd = std::max(max_fd, fds[i]); } if(max_fd == -1) @@ -174,8 +174,8 @@ void InputHandler_Linux_Joystick::InputThread() DeviceButton neg = enum_add2(JOY_LEFT, 2*event.number); DeviceButton pos = enum_add2(JOY_RIGHT, 2*event.number); float l = SCALE( int(event.value), 0.0f, 32767, 0.0f, 1.0f ); - ButtonPressed( DeviceInput(id, neg, max(-l,0), now) ); - ButtonPressed( DeviceInput(id, pos, max(+l,0), now) ); + ButtonPressed( DeviceInput(id, neg, std::max(-l, 0.0f), now) ); + ButtonPressed( DeviceInput(id, pos, std::max(+l, 0.0f), now) ); break; } @@ -193,7 +193,7 @@ void InputHandler_Linux_Joystick::InputThread() InputHandler::UpdateTimer(); } -void InputHandler_Linux_Joystick::GetDevicesAndDescriptions( vector& vDevicesOut ) +void InputHandler_Linux_Joystick::GetDevicesAndDescriptions( std::vector& vDevicesOut ) { // HACK: If IH_Linux_Joystick is constructed before IH_Linux_Event, our thread won't be started // as part of the constructor. This isn't called until all InputHandlers have been constructed, diff --git a/src/arch/InputHandler/InputHandler_Linux_Joystick.h b/src/arch/InputHandler/InputHandler_Linux_Joystick.h index cae39f47ec..db0da7ff1d 100644 --- a/src/arch/InputHandler/InputHandler_Linux_Joystick.h +++ b/src/arch/InputHandler/InputHandler_Linux_Joystick.h @@ -13,7 +13,7 @@ public: ~InputHandler_Linux_Joystick(); bool TryDevice(RString dev); bool DevicesChanged() { return m_bDevicesChanged; } - void GetDevicesAndDescriptions( vector& vDevicesOut ); + void GetDevicesAndDescriptions( std::vector& vDevicesOut ); private: void StartThread(); diff --git a/src/arch/InputHandler/InputHandler_Linux_PIUIO.cpp b/src/arch/InputHandler/InputHandler_Linux_PIUIO.cpp index 2a82553f1f..c6ae2129a5 100644 --- a/src/arch/InputHandler/InputHandler_Linux_PIUIO.cpp +++ b/src/arch/InputHandler/InputHandler_Linux_PIUIO.cpp @@ -132,7 +132,7 @@ void InputHandler_Linux_PIUIO::InputThread() InputHandler::UpdateTimer(); } -void InputHandler_Linux_PIUIO::GetDevicesAndDescriptions( vector& vDevicesOut ) +void InputHandler_Linux_PIUIO::GetDevicesAndDescriptions( std::vector& vDevicesOut ) { vDevicesOut.push_back( InputDeviceInfo(InputDevice(DEVICE_PIUIO), "PIUIO") ); } diff --git a/src/arch/InputHandler/InputHandler_Linux_PIUIO.h b/src/arch/InputHandler/InputHandler_Linux_PIUIO.h index 7cdf2154be..ac82ca6710 100644 --- a/src/arch/InputHandler/InputHandler_Linux_PIUIO.h +++ b/src/arch/InputHandler/InputHandler_Linux_PIUIO.h @@ -10,7 +10,7 @@ class InputHandler_Linux_PIUIO: public InputHandler public: InputHandler_Linux_PIUIO(); ~InputHandler_Linux_PIUIO(); - void GetDevicesAndDescriptions( vector& vDevicesOut ); + void GetDevicesAndDescriptions( std::vector& vDevicesOut ); private: static int InputThread_Start( void *p ); diff --git a/src/arch/InputHandler/InputHandler_MacOSX_HID.h b/src/arch/InputHandler/InputHandler_MacOSX_HID.h index faed18da17..d9c305c3f8 100644 --- a/src/arch/InputHandler/InputHandler_MacOSX_HID.h +++ b/src/arch/InputHandler/InputHandler_MacOSX_HID.h @@ -12,12 +12,12 @@ class HIDDevice; class InputHandler_MacOSX_HID : public InputHandler { private: - vector m_vDevices; + std::vector m_vDevices; RageThread m_InputThread; RageSemaphore m_Sem; CFRunLoopRef m_LoopRef; CFRunLoopSourceRef m_SourceRef; - vector m_vIters; // We don't really care about these but they need to stick around + std::vector m_vIters; // We don't really care about these but they need to stick around IONotificationPortRef m_NotifyPort; RageMutex m_ChangeLock; bool m_bChanged; @@ -33,7 +33,7 @@ public: ~InputHandler_MacOSX_HID(); bool DevicesChanged() { LockMut( m_ChangeLock ); return m_bChanged; } - void GetDevicesAndDescriptions( vector& vDevicesOut ); + void GetDevicesAndDescriptions( std::vector& vDevicesOut ); RString GetDeviceSpecificInputString( const DeviceInput &di ); wchar_t DeviceButtonToChar( DeviceButton button, bool bUseCurrentKeyModifiers ); static void QueueCallback( void *target, int result, void *refcon, void *sender ); diff --git a/src/arch/InputHandler/InputHandler_MacOSX_HID.mm b/src/arch/InputHandler/InputHandler_MacOSX_HID.mm index be296162cd..cf8f01693b 100644 --- a/src/arch/InputHandler/InputHandler_MacOSX_HID.mm +++ b/src/arch/InputHandler/InputHandler_MacOSX_HID.mm @@ -24,7 +24,7 @@ void InputHandler_MacOSX_HID::QueueCallback( void *target, int result, void *ref IOHIDEventStruct event; AbsoluteTime zeroTime = { 0, 0 }; HIDDevice *dev = static_cast(refcon); - vector vPresses; + std::vector vPresses; while( (result = CALL(queue, getNextEvent, &event, zeroTime, 0)) == kIOReturnSuccess ) { @@ -271,7 +271,7 @@ InputHandler_MacOSX_HID::InputHandler_MacOSX_HID() : m_Sem( "Input thread starte } } -void InputHandler_MacOSX_HID::GetDevicesAndDescriptions( vector& vDevices ) +void InputHandler_MacOSX_HID::GetDevicesAndDescriptions( std::vector& vDevices ) { for (HIDDevice *i : m_vDevices) i->GetDevicesAndDescriptions( vDevices ); diff --git a/src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp b/src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp index 7c14708f97..ab56429dc6 100644 --- a/src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp +++ b/src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp @@ -13,7 +13,7 @@ InputHandler_MonkeyKeyboard::~InputHandler_MonkeyKeyboard() { } -void InputHandler_MonkeyKeyboard::GetDevicesAndDescriptions( vector& vDevicesOut ) +void InputHandler_MonkeyKeyboard::GetDevicesAndDescriptions( std::vector& vDevicesOut ) { vDevicesOut.push_back( InputDeviceInfo(DEVICE_KEYBOARD, "MonkeyKeyboard") ); } diff --git a/src/arch/InputHandler/InputHandler_MonkeyKeyboard.h b/src/arch/InputHandler/InputHandler_MonkeyKeyboard.h index 6a478d830e..44f0d1061f 100644 --- a/src/arch/InputHandler/InputHandler_MonkeyKeyboard.h +++ b/src/arch/InputHandler/InputHandler_MonkeyKeyboard.h @@ -11,7 +11,7 @@ public: void Update(); InputHandler_MonkeyKeyboard(); ~InputHandler_MonkeyKeyboard(); - void GetDevicesAndDescriptions( vector& vDevicesOut ); + void GetDevicesAndDescriptions( std::vector& vDevicesOut ); private: RageTimer m_timerPressButton; diff --git a/src/arch/InputHandler/InputHandler_NSEvent.hpp b/src/arch/InputHandler/InputHandler_NSEvent.hpp index 98db29e04a..177e292d7a 100644 --- a/src/arch/InputHandler/InputHandler_NSEvent.hpp +++ b/src/arch/InputHandler/InputHandler_NSEvent.hpp @@ -18,7 +18,7 @@ public: InputHandler_NSEvent(); ~InputHandler_NSEvent(); - void GetDevicesAndDescriptions( vector& vDevicesOut ); + void GetDevicesAndDescriptions( std::vector& vDevicesOut ); }; #endif /* InputHandler_NSEvent_hpp */ diff --git a/src/arch/InputHandler/InputHandler_NSEvent.mm b/src/arch/InputHandler/InputHandler_NSEvent.mm index 1560d22fb7..bc21cb96db 100644 --- a/src/arch/InputHandler/InputHandler_NSEvent.mm +++ b/src/arch/InputHandler/InputHandler_NSEvent.mm @@ -193,7 +193,7 @@ InputHandler_NSEvent::~InputHandler_NSEvent() { } -void InputHandler_NSEvent::GetDevicesAndDescriptions( vector& vDevicesOut ) +void InputHandler_NSEvent::GetDevicesAndDescriptions( std::vector& vDevicesOut ) { vDevicesOut.push_back(InputDeviceInfo(DEVICE_KEYBOARD, "NSEventKeyboard")); } diff --git a/src/arch/InputHandler/InputHandler_SextetStream.cpp b/src/arch/InputHandler/InputHandler_SextetStream.cpp index c91ac4e69e..71845020e2 100644 --- a/src/arch/InputHandler/InputHandler_SextetStream.cpp +++ b/src/arch/InputHandler/InputHandler_SextetStream.cpp @@ -9,8 +9,6 @@ #include #include -using namespace std; - // In so many words, ceil(n/6). #define NUMBER_OF_SEXTETS_FOR_BIT_COUNT(n) (((n) + 5) / 6) @@ -180,7 +178,7 @@ class InputHandler_SextetStream::Impl } } - void GetDevicesAndDescriptions(vector& vDevicesOut) + void GetDevicesAndDescriptions(std::vector& vDevicesOut) { vDevicesOut.push_back(InputDeviceInfo(FIRST_DEVICE, "SextetStream")); } @@ -292,7 +290,7 @@ class InputHandler_SextetStream::Impl } }; -void InputHandler_SextetStream::GetDevicesAndDescriptions(vector& vDevicesOut) +void InputHandler_SextetStream::GetDevicesAndDescriptions(std::vector& vDevicesOut) { if(_impl != nullptr) { _impl->GetDevicesAndDescriptions(vDevicesOut); diff --git a/src/arch/InputHandler/InputHandler_SextetStream.h b/src/arch/InputHandler/InputHandler_SextetStream.h index b0b3748fde..b2f221c9ad 100644 --- a/src/arch/InputHandler/InputHandler_SextetStream.h +++ b/src/arch/InputHandler/InputHandler_SextetStream.h @@ -9,7 +9,7 @@ class InputHandler_SextetStream: public InputHandler public: InputHandler_SextetStream(); ~InputHandler_SextetStream(); - void GetDevicesAndDescriptions(vector& vDevicesOut); + void GetDevicesAndDescriptions(std::vector& vDevicesOut); public: class Impl; diff --git a/src/arch/InputHandler/InputHandler_Win32_MIDI.cpp b/src/arch/InputHandler/InputHandler_Win32_MIDI.cpp index 75578a50d4..0d0ecc5388 100644 --- a/src/arch/InputHandler/InputHandler_Win32_MIDI.cpp +++ b/src/arch/InputHandler/InputHandler_Win32_MIDI.cpp @@ -67,7 +67,7 @@ InputHandler_Win32_MIDI::~InputHandler_Win32_MIDI() } } -void InputHandler_Win32_MIDI::GetDevicesAndDescriptions( vector& vDevicesOut ) +void InputHandler_Win32_MIDI::GetDevicesAndDescriptions( std::vector& vDevicesOut ) { if( m_bFoundDevice ) { diff --git a/src/arch/InputHandler/InputHandler_Win32_MIDI.h b/src/arch/InputHandler/InputHandler_Win32_MIDI.h index 8f6abef9ae..46c6871f6f 100644 --- a/src/arch/InputHandler/InputHandler_Win32_MIDI.h +++ b/src/arch/InputHandler/InputHandler_Win32_MIDI.h @@ -10,7 +10,7 @@ public: InputHandler_Win32_MIDI(); ~InputHandler_Win32_MIDI(); - void GetDevicesAndDescriptions( vector& vDevicesOut ); + void GetDevicesAndDescriptions( std::vector& vDevicesOut ); void SetDev( DeviceInput key ) { ButtonPressed( key ); } diff --git a/src/arch/InputHandler/InputHandler_Win32_Para.cpp b/src/arch/InputHandler/InputHandler_Win32_Para.cpp index fbf7af2b5f..122c2e6d6b 100644 --- a/src/arch/InputHandler/InputHandler_Win32_Para.cpp +++ b/src/arch/InputHandler/InputHandler_Win32_Para.cpp @@ -39,7 +39,7 @@ InputHandler_Win32_Para::InputHandler_Win32_Para() SAFE_DELETE( dev ); } -void InputHandler_Win32_Para::GetDevicesAndDescriptions(vector& vDevicesOut ) +void InputHandler_Win32_Para::GetDevicesAndDescriptions(std::vector& vDevicesOut ) { // The device appears as a HID joystick } diff --git a/src/arch/InputHandler/InputHandler_Win32_Para.h b/src/arch/InputHandler/InputHandler_Win32_Para.h index 19d7195074..f91144ab0f 100644 --- a/src/arch/InputHandler/InputHandler_Win32_Para.h +++ b/src/arch/InputHandler/InputHandler_Win32_Para.h @@ -9,7 +9,7 @@ class InputHandler_Win32_Para: public InputHandler { public: InputHandler_Win32_Para(); - void GetDevicesAndDescriptions( vector& vDevicesOut ); + void GetDevicesAndDescriptions( std::vector& vDevicesOut ); }; #endif diff --git a/src/arch/InputHandler/InputHandler_Win32_Pump.cpp b/src/arch/InputHandler/InputHandler_Win32_Pump.cpp index e2ab6a4249..3cea7851b1 100644 --- a/src/arch/InputHandler/InputHandler_Win32_Pump.cpp +++ b/src/arch/InputHandler/InputHandler_Win32_Pump.cpp @@ -100,7 +100,7 @@ RString InputHandler_Win32_Pump::GetDeviceSpecificInputString( const DeviceInput return InputHandler::GetDeviceSpecificInputString( di ); } -void InputHandler_Win32_Pump::GetDevicesAndDescriptions( vector& vDevicesOut ) +void InputHandler_Win32_Pump::GetDevicesAndDescriptions( std::vector& vDevicesOut ) { for(int i = 0; i < NUM_PUMPS; ++i) { @@ -125,7 +125,7 @@ void InputHandler_Win32_Pump::InputThreadMain() /* Enable priority boosting. */ SetThreadPriorityBoost( GetCurrentThread(), FALSE ); - vector apSources; + std::vector apSources; for( int i = 0; i < NUM_PUMPS; ++i ) { if( m_pDevice[i].m_IO.IsOpen() ) diff --git a/src/arch/InputHandler/InputHandler_Win32_Pump.h b/src/arch/InputHandler/InputHandler_Win32_Pump.h index a04c93f00d..739530c047 100644 --- a/src/arch/InputHandler/InputHandler_Win32_Pump.h +++ b/src/arch/InputHandler/InputHandler_Win32_Pump.h @@ -12,7 +12,7 @@ public: InputHandler_Win32_Pump(); ~InputHandler_Win32_Pump(); RString GetDeviceSpecificInputString( const DeviceInput &di ); - void GetDevicesAndDescriptions( vector& vDevicesOut ); + void GetDevicesAndDescriptions( std::vector& vDevicesOut ); private: USBDevice *m_pDevice; diff --git a/src/arch/InputHandler/InputHandler_Win32_RTIO.cpp b/src/arch/InputHandler/InputHandler_Win32_RTIO.cpp index 1918a6373b..c085acd0ea 100644 --- a/src/arch/InputHandler/InputHandler_Win32_RTIO.cpp +++ b/src/arch/InputHandler/InputHandler_Win32_RTIO.cpp @@ -54,7 +54,7 @@ InputHandler_Win32_RTIO::~InputHandler_Win32_RTIO() rtio_.Disconnect(); } -void InputHandler_Win32_RTIO::GetDevicesAndDescriptions(vector& vDevicesOut) +void InputHandler_Win32_RTIO::GetDevicesAndDescriptions(std::vector& vDevicesOut) { // We use a joystick device so we can get automatic input mapping vDevicesOut.push_back(InputDeviceInfo(InputDevice(DEVICE_JOY1), "Raw Thrills I/O")); @@ -404,7 +404,7 @@ void InputHandler_Win32_RTIO::HandleCounterAck(const std::string &msg) if (ack_num == 0 && counter_state_ == COUNTER_STATE_RECV_2) { counter_state_ = COUNTER_STATE_SEND_1; - counter_cycles_pending_ = max(counter_cycles_pending_ - 1, 0); + counter_cycles_pending_ = std::max(counter_cycles_pending_ - 1, 0); return; } @@ -658,8 +658,8 @@ int SerialDevice::Read(char *buffer, int buffer_size) ResetOverlapped(&read_overlapped_); - DWORD read_size = min(stat.cbInQue, (DWORD)read_buffer_size_); - read_size = min(read_size, (DWORD)buffer_size); + DWORD read_size = std::min(stat.cbInQue, (DWORD)read_buffer_size_); + read_size = std::min(read_size, (DWORD)buffer_size); DWORD bytes_transferred; if (!ReadFile(com_handle_, buffer, read_size, &bytes_transferred, &read_overlapped_)) { @@ -682,7 +682,7 @@ int SerialDevice::Read(char *buffer, int buffer_size) int SerialDevice::Write(const char *buffer, int buffer_size) { DWORD bytes_transferred; - DWORD write_size = min((DWORD)buffer_size, (DWORD)write_buffer_size_); + DWORD write_size = std::min((DWORD) buffer_size, (DWORD) write_buffer_size_); ResetOverlapped(&write_overlapped_); diff --git a/src/arch/InputHandler/InputHandler_Win32_RTIO.h b/src/arch/InputHandler/InputHandler_Win32_RTIO.h index 814997766a..d146108a60 100644 --- a/src/arch/InputHandler/InputHandler_Win32_RTIO.h +++ b/src/arch/InputHandler/InputHandler_Win32_RTIO.h @@ -83,7 +83,7 @@ class InputHandler_Win32_RTIO : public InputHandler public: InputHandler_Win32_RTIO(); ~InputHandler_Win32_RTIO(); - void GetDevicesAndDescriptions(vector& vDevicesOut); + void GetDevicesAndDescriptions(std::vector& vDevicesOut); RString GetDeviceSpecificInputString(const DeviceInput &di); static int InputThread_Start(void *this_ptr); diff --git a/src/arch/InputHandler/InputHandler_Win32_ddrio.cpp b/src/arch/InputHandler/InputHandler_Win32_ddrio.cpp index 0ee6ce4c1a..18dc61eede 100644 --- a/src/arch/InputHandler/InputHandler_Win32_ddrio.cpp +++ b/src/arch/InputHandler/InputHandler_Win32_ddrio.cpp @@ -247,7 +247,7 @@ RString InputHandler_Win32_ddrio::GetDeviceSpecificInputString( const DeviceInpu return InputHandler::GetDeviceSpecificInputString(di); } -void InputHandler_Win32_ddrio::GetDevicesAndDescriptions( vector& vDevicesOut ) +void InputHandler_Win32_ddrio::GetDevicesAndDescriptions( std::vector& vDevicesOut ) { // We use a joystick device so we can get automatic input mapping vDevicesOut.push_back(InputDeviceInfo(InputDevice(DDRIO_DEVICEID), "ddrio")); diff --git a/src/arch/InputHandler/InputHandler_Win32_ddrio.h b/src/arch/InputHandler/InputHandler_Win32_ddrio.h index f1c2ef4b01..df8b27a7a5 100644 --- a/src/arch/InputHandler/InputHandler_Win32_ddrio.h +++ b/src/arch/InputHandler/InputHandler_Win32_ddrio.h @@ -66,7 +66,7 @@ public: ~InputHandler_Win32_ddrio(); RString GetDeviceSpecificInputString( const DeviceInput &di ); - void GetDevicesAndDescriptions( vector& vDevicesOut ); + void GetDevicesAndDescriptions( std::vector& vDevicesOut ); private: RageThread InputThread; diff --git a/src/arch/InputHandler/InputHandler_X11.cpp b/src/arch/InputHandler/InputHandler_X11.cpp index ceeefa717a..aad05097b7 100644 --- a/src/arch/InputHandler/InputHandler_X11.cpp +++ b/src/arch/InputHandler/InputHandler_X11.cpp @@ -247,7 +247,7 @@ void InputHandler_X11::Update() } -void InputHandler_X11::GetDevicesAndDescriptions( vector& vDevicesOut ) +void InputHandler_X11::GetDevicesAndDescriptions( std::vector& vDevicesOut ) { if( Dpy && Win ) { diff --git a/src/arch/InputHandler/InputHandler_X11.h b/src/arch/InputHandler/InputHandler_X11.h index 49905546e4..dc6e25af76 100644 --- a/src/arch/InputHandler/InputHandler_X11.h +++ b/src/arch/InputHandler/InputHandler_X11.h @@ -11,7 +11,7 @@ public: InputHandler_X11(); ~InputHandler_X11(); void Update(); - void GetDevicesAndDescriptions( vector& vDevicesOut ); + void GetDevicesAndDescriptions( std::vector& vDevicesOut ); private: // timestamp is unsigned long to match X11 Time type void RegisterKeyEvent( unsigned long timestamp, bool keyDown, DeviceButton button ); diff --git a/src/arch/InputHandler/LinuxInputManager.h b/src/arch/InputHandler/LinuxInputManager.h index 4213845f63..c773b3f372 100644 --- a/src/arch/InputHandler/LinuxInputManager.h +++ b/src/arch/InputHandler/LinuxInputManager.h @@ -2,7 +2,6 @@ #define LINUX_INPUT_MANAGER 1 #include -using namespace std; #include "global.h" class InputHandler_Linux_Joystick; @@ -21,11 +20,11 @@ public: private: bool m_bEventEnabled; InputHandler_Linux_Event* m_EventDriver; - vector m_vsPendingEventDevices; + std::vector m_vsPendingEventDevices; bool m_bJoystickEnabled; InputHandler_Linux_Joystick* m_JoystickDriver; - vector m_vsPendingJoystickDevices; + std::vector m_vsPendingJoystickDevices; }; extern LinuxInputManager* LINUXINPUT; // global and accessible from anywhere in our program diff --git a/src/arch/Lights/LightsDriver.cpp b/src/arch/Lights/LightsDriver.cpp index c0235f2692..beed29e4da 100644 --- a/src/arch/Lights/LightsDriver.cpp +++ b/src/arch/Lights/LightsDriver.cpp @@ -10,11 +10,11 @@ DriverList LightsDriver::m_pDriverList; -void LightsDriver::Create( const RString &sDrivers, vector &Add ) +void LightsDriver::Create( const RString &sDrivers, std::vector &Add ) { LOG->Trace( "Initializing lights drivers: %s", sDrivers.c_str() ); - vector asDriversToTry; + std::vector asDriversToTry; split( sDrivers, ",", asDriversToTry, true ); for (RString const &Driver : asDriversToTry) diff --git a/src/arch/Lights/LightsDriver.h b/src/arch/Lights/LightsDriver.h index 69989e02d6..84c3503324 100644 --- a/src/arch/Lights/LightsDriver.h +++ b/src/arch/Lights/LightsDriver.h @@ -9,7 +9,7 @@ struct LightsState; class LightsDriver: public RageDriver { public: - static void Create( const RString &sDriver, vector &apAdd ); + static void Create( const RString &sDriver, std::vector &apAdd ); static DriverList m_pDriverList; LightsDriver() {}; diff --git a/src/arch/Lights/LightsDriver_SextetStream.cpp b/src/arch/Lights/LightsDriver_SextetStream.cpp index e1be922fd4..5be1fd9883 100644 --- a/src/arch/Lights/LightsDriver_SextetStream.cpp +++ b/src/arch/Lights/LightsDriver_SextetStream.cpp @@ -7,9 +7,6 @@ #include -using namespace std; - - // Private members/methods are kept out of the header using an opaque pointer `_impl`. // Google "pimpl idiom" for an explanation of what's going on and why it is (or might be) useful. diff --git a/src/arch/LoadingWindow/LoadingWindow.cpp b/src/arch/LoadingWindow/LoadingWindow.cpp index 6265d27657..87438ae95b 100644 --- a/src/arch/LoadingWindow/LoadingWindow.cpp +++ b/src/arch/LoadingWindow/LoadingWindow.cpp @@ -13,7 +13,7 @@ LoadingWindow *LoadingWindow::Create() #endif // Don't load nullptr by default. const RString drivers = "win32,macosx,gtk"; - vector DriversToTry; + std::vector DriversToTry; split( drivers, ",", DriversToTry, true ); ASSERT( DriversToTry.size() != 0 ); diff --git a/src/arch/LoadingWindow/LoadingWindow_MacOSX.mm b/src/arch/LoadingWindow/LoadingWindow_MacOSX.mm index ec735f5c62..35c25cdaea 100644 --- a/src/arch/LoadingWindow/LoadingWindow_MacOSX.mm +++ b/src/arch/LoadingWindow/LoadingWindow_MacOSX.mm @@ -134,7 +134,7 @@ void LoadingWindow_MacOSX::SetSplash( const RageSurface *pSplash ) { RageFile f; RString data; - vector vs; + std::vector vs; // Try to load a custom splash from the current theme, first. GetDirListing( THEME->GetPathG( "Common", "splash"), vs, false, true ); diff --git a/src/arch/LoadingWindow/LoadingWindow_Win32.cpp b/src/arch/LoadingWindow/LoadingWindow_Win32.cpp index aac16e3225..f74aa99627 100644 --- a/src/arch/LoadingWindow/LoadingWindow_Win32.cpp +++ b/src/arch/LoadingWindow/LoadingWindow_Win32.cpp @@ -87,7 +87,7 @@ INT_PTR CALLBACK LoadingWindow_Win32::WndProc( HWND hWnd, UINT msg, WPARAM wPara { case WM_INITDIALOG: { - vector vs; + std::vector vs; GetDirListing( "Data/splash*.png", vs, false, true ); if( !vs.empty() ) g_hBitmap = LoadWin32Surface( vs[0], hWnd ); @@ -176,7 +176,7 @@ void LoadingWindow_Win32::Paint() void LoadingWindow_Win32::SetText( RString sText ) { - vector asMessageLines; + std::vector asMessageLines; split( sText, "\n", asMessageLines, false ); while( asMessageLines.size() < 3 ) asMessageLines.push_back( "" ); diff --git a/src/arch/MemoryCard/MemoryCardDriver.cpp b/src/arch/MemoryCard/MemoryCardDriver.cpp index 48167473a2..b2d28d6283 100644 --- a/src/arch/MemoryCard/MemoryCardDriver.cpp +++ b/src/arch/MemoryCard/MemoryCardDriver.cpp @@ -59,18 +59,18 @@ bool MemoryCardDriver::NeedUpdate( bool bMount ) return USBStorageDevicesChanged(); } -bool MemoryCardDriver::DoOneUpdate( bool bMount, vector& vStorageDevicesOut ) +bool MemoryCardDriver::DoOneUpdate( bool bMount, std::vector& vStorageDevicesOut ) { if( !NeedUpdate(bMount) ) return false; - vector vOld = m_vDevicesLastSeen; // copy + std::vector vOld = m_vDevicesLastSeen; // copy GetUSBStorageDevices( vStorageDevicesOut ); // log connects for (UsbStorageDevice &newd : vStorageDevicesOut) { - vector::iterator iter = find( vOld.begin(), vOld.end(), newd ); + std::vector::iterator iter = find( vOld.begin(), vOld.end(), newd ); if( iter == vOld.end() ) // didn't find LOG->Trace( "New device connected: %s", newd.sDevice.c_str() ); } @@ -85,7 +85,7 @@ bool MemoryCardDriver::DoOneUpdate( bool bMount, vector& vStor /* If this device was just connected (it wasn't here last time), set it to * CHECKING and return it, to let the main thread know about the device before * we start checking. */ - vector::iterator iter = find( vOld.begin(), vOld.end(), d ); + std::vector::iterator iter = find( vOld.begin(), vOld.end(), d ); if( iter == vOld.end() ) // didn't find { LOG->Trace( "New device entering CHECKING: %s", d.sDevice.c_str() ); diff --git a/src/arch/MemoryCard/MemoryCardDriver.h b/src/arch/MemoryCard/MemoryCardDriver.h index c3f3b383d1..b7e3800848 100644 --- a/src/arch/MemoryCard/MemoryCardDriver.h +++ b/src/arch/MemoryCard/MemoryCardDriver.h @@ -87,19 +87,19 @@ public: /* Poll for memory card changes. If anything has changed, fill in vStorageDevicesOut * and return true. */ - bool DoOneUpdate( bool bMount, vector& vStorageDevicesOut ); + bool DoOneUpdate( bool bMount, std::vector& vStorageDevicesOut ); protected: /* This may be called before GetUSBStorageDevices; return false if the results of * GetUSBStorageDevices have not changed. (This is an optimization.) */ virtual bool USBStorageDevicesChanged() { return true; } - virtual void GetUSBStorageDevices( vector& /* vDevicesOut */ ) { } + virtual void GetUSBStorageDevices( std::vector& /* vDevicesOut */ ) { } /* Test the device. On failure, call pDevice->SetError() appropriately, and return false. */ virtual bool TestWrite( UsbStorageDevice* ) { return true; } private: - vector m_vDevicesLastSeen; + std::vector m_vDevicesLastSeen; bool NeedUpdate( bool bMount ); }; diff --git a/src/arch/MemoryCard/MemoryCardDriverThreaded_Folder.cpp b/src/arch/MemoryCard/MemoryCardDriverThreaded_Folder.cpp index 98d10d3f79..9e2693dd9d 100644 --- a/src/arch/MemoryCard/MemoryCardDriverThreaded_Folder.cpp +++ b/src/arch/MemoryCard/MemoryCardDriverThreaded_Folder.cpp @@ -74,7 +74,7 @@ bool MemoryCardDriverThreaded_Folder::USBStorageDevicesChanged() return GetActivePlayerMask() != m_LastDevices; } -void MemoryCardDriverThreaded_Folder::GetUSBStorageDevices( vector& vDevicesOut ) +void MemoryCardDriverThreaded_Folder::GetUSBStorageDevices( std::vector& vDevicesOut ) { LOG->Trace( "GetUSBStorageDevices" ); diff --git a/src/arch/MemoryCard/MemoryCardDriverThreaded_Folder.h b/src/arch/MemoryCard/MemoryCardDriverThreaded_Folder.h index e07630390d..f495269954 100644 --- a/src/arch/MemoryCard/MemoryCardDriverThreaded_Folder.h +++ b/src/arch/MemoryCard/MemoryCardDriverThreaded_Folder.h @@ -13,7 +13,7 @@ public: virtual void Unmount( UsbStorageDevice* pDevice ); protected: - void GetUSBStorageDevices( vector& vDevicesOut ); + void GetUSBStorageDevices( std::vector& vDevicesOut ); bool USBStorageDevicesChanged(); bool TestWrite( UsbStorageDevice* pDevice ); bool FolderExists(RString path); diff --git a/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp b/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp index ddee48fbe7..332a1b45dc 100644 --- a/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp +++ b/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp @@ -80,7 +80,7 @@ static bool ReadFile( const RString &sPath, RString &sBuf ) return true; } -static void GetFileList( const RString &sPath, vector &out ) +static void GetFileList( const RString &sPath, std::vector &out ) { out.clear(); @@ -101,8 +101,8 @@ bool MemoryCardDriverThreaded_Linux::USBStorageDevicesChanged() /* If a device is removed and reinserted, the inode of the /sys/block entry * will change. */ RString sDevicePath = "/sys/block/"; - - vector asDevices; + + std::vector asDevices; GetFileList( sDevicePath, asDevices ); for( unsigned i = 0; i < asDevices.size(); ++i ) @@ -121,14 +121,14 @@ bool MemoryCardDriverThreaded_Linux::USBStorageDevicesChanged() return bChanged; } -void MemoryCardDriverThreaded_Linux::GetUSBStorageDevices( vector& vDevicesOut ) +void MemoryCardDriverThreaded_Linux::GetUSBStorageDevices( std::vector& vDevicesOut ) { LOG->Trace( "GetUSBStorageDevices" ); vDevicesOut.clear(); { - vector asDevices; + std::vector asDevices; RString sBlockDevicePath = "/sys/block/"; GetFileList( sBlockDevicePath, asDevices ); @@ -232,7 +232,7 @@ void MemoryCardDriverThreaded_Linux::GetUSBStorageDevices( vector asBits; + std::vector asBits; split( szLink, "/", asBits ); RString sHostPort = asBits[asBits.size()-1]; @@ -240,7 +240,7 @@ void MemoryCardDriverThreaded_Linux::GetUSBStorageDevices( vector& vDevicesOut ); + void GetUSBStorageDevices( std::vector& vDevicesOut ); bool USBStorageDevicesChanged(); bool TestWrite( UsbStorageDevice* pDevice ); diff --git a/src/arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.cpp b/src/arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.cpp index 0431afe3ed..5ed135a823 100644 --- a/src/arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.cpp +++ b/src/arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.cpp @@ -73,7 +73,7 @@ void MemoryCardDriverThreaded_MacOSX::Unmount( UsbStorageDevice *pDevice ) const RString& base = Basename( pDevice->sOsMountDir ); memset( &pb, 0, sizeof(pb) ); - name[0] = min( base.length(), size_t(255) ); + name[0] = std::min( base.length(), size_t(255) ); strncpy( (char *)&name[1], base, name[0] ); pb.volumeParam.ioNamePtr = name; pb.volumeParam.ioVolIndex = -1; // Use ioNamePtr to find the volume. @@ -133,7 +133,7 @@ static RString GetStringProperty( io_registry_entry_t entry, CFStringRef key ) return ret; } -void MemoryCardDriverThreaded_MacOSX::GetUSBStorageDevices( vector& vDevicesOut ) +void MemoryCardDriverThreaded_MacOSX::GetUSBStorageDevices( std::vector& vDevicesOut ) { LockMut( m_ChangedLock ); // First, get all device paths diff --git a/src/arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.h b/src/arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.h index 96672f375c..9b52a2d563 100644 --- a/src/arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.h +++ b/src/arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.h @@ -14,7 +14,7 @@ public: protected: bool USBStorageDevicesChanged(); - void GetUSBStorageDevices( vector& vStorageDevicesOut ); + void GetUSBStorageDevices( std::vector& vStorageDevicesOut ); bool TestWrite( UsbStorageDevice *pDevice ); private: diff --git a/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp b/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp index 8d580af0b6..208a53d10d 100644 --- a/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp +++ b/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp @@ -93,7 +93,7 @@ static bool IsFloppyDrive( const RString &sDrive ) return false; } -void MemoryCardDriverThreaded_Windows::GetUSBStorageDevices( vector& vDevicesOut ) +void MemoryCardDriverThreaded_Windows::GetUSBStorageDevices( std::vector& vDevicesOut ) { LOG->Trace( "MemoryCardDriverThreaded_Windows::GetUSBStorageDevices" ); diff --git a/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.h b/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.h index 389dd07b8e..da27edb08d 100644 --- a/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.h +++ b/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.h @@ -14,7 +14,7 @@ public: virtual void Unmount( UsbStorageDevice* pDevice ); private: - void GetUSBStorageDevices( vector& vDevicesOut ); + void GetUSBStorageDevices( std::vector& vDevicesOut ); bool USBStorageDevicesChanged(); bool TestWrite( UsbStorageDevice* pDevice ); diff --git a/src/arch/MemoryCard/MemoryCardDriver_Null.h b/src/arch/MemoryCard/MemoryCardDriver_Null.h index b804d7055f..641ddf756a 100644 --- a/src/arch/MemoryCard/MemoryCardDriver_Null.h +++ b/src/arch/MemoryCard/MemoryCardDriver_Null.h @@ -8,7 +8,7 @@ class MemoryCardDriver_Null : public MemoryCardDriver public: MemoryCardDriver_Null() {} virtual bool USBStorageDevicesChanged() { return false; } - virtual void GetUSBStorageDevices( vector& vDevicesOut ) { } + virtual void GetUSBStorageDevices( std::vector& vDevicesOut ) { } virtual bool Mount( UsbStorageDevice* pDevice ) { return false; } virtual void Unmount( UsbStorageDevice* pDevice ) {} virtual void Flush( UsbStorageDevice* pDevice ) {} diff --git a/src/arch/MovieTexture/MovieTexture.cpp b/src/arch/MovieTexture/MovieTexture.cpp index 1f54e3928e..6b6810e086 100644 --- a/src/arch/MovieTexture/MovieTexture.cpp +++ b/src/arch/MovieTexture/MovieTexture.cpp @@ -85,8 +85,8 @@ RageMovieTexture *RageMovieTexture::Create( RageTextureID ID ) RString sDrivers = g_sMovieDrivers; if( sDrivers.empty() ) sDrivers = DEFAULT_MOVIE_DRIVER_LIST; - - vector DriversToTry; + + std::vector DriversToTry; split( sDrivers, ",", DriversToTry, true ); if( DriversToTry.empty() ) diff --git a/src/arch/MovieTexture/MovieTexture_DShow.cpp b/src/arch/MovieTexture/MovieTexture_DShow.cpp index 3a7accfc4f..6356b3d9f9 100644 --- a/src/arch/MovieTexture/MovieTexture_DShow.cpp +++ b/src/arch/MovieTexture/MovieTexture_DShow.cpp @@ -387,7 +387,7 @@ RString MovieTexture_DShow::Create() pCTR->SetRenderTarget(this); /* Cap the max texture size to the hardware max. */ - actualID.iMaxSize = min( actualID.iMaxSize, DISPLAY->GetMaxTextureSize() ); + actualID.iMaxSize = std::min( actualID.iMaxSize, DISPLAY->GetMaxTextureSize() ); // The graph is built, now get the set the output video width and height. // The source and image width will always be the same since we can't scale the video @@ -395,8 +395,8 @@ RString MovieTexture_DShow::Create() m_iSourceHeight = pCTR->GetVidHeight(); /* image size cannot exceed max size */ - m_iImageWidth = min( m_iSourceWidth, actualID.iMaxSize ); - m_iImageHeight = min( m_iSourceHeight, actualID.iMaxSize ); + m_iImageWidth = std::min( m_iSourceWidth, actualID.iMaxSize ); + m_iImageHeight = std::min( m_iSourceHeight, actualID.iMaxSize ); /* Texture dimensions need to be a power of two; jump to the next. */ m_iTextureWidth = power_of_two(m_iImageWidth); diff --git a/src/arch/MovieTexture/MovieTexture_Generic.cpp b/src/arch/MovieTexture/MovieTexture_Generic.cpp index 0d30f7be78..dfa48c3510 100644 --- a/src/arch/MovieTexture/MovieTexture_Generic.cpp +++ b/src/arch/MovieTexture/MovieTexture_Generic.cpp @@ -117,9 +117,9 @@ public: m_PixFmt = pixfmt; m_iSourceWidth = iWidth; m_iSourceHeight = iHeight; -/* int iMaxSize = min( GetID().iMaxSize, DISPLAY->GetMaxTextureSize() ); - m_iImageWidth = min( m_iSourceWidth, iMaxSize ); - m_iImageHeight = min( m_iSourceHeight, iMaxSize ); +/* int iMaxSize = std::min( GetID().iMaxSize, DISPLAY->GetMaxTextureSize() ); + m_iImageWidth = std::min( m_iSourceWidth, iMaxSize ); + m_iImageHeight = std::min( m_iSourceHeight, iMaxSize ); m_iTextureWidth = power_of_two( m_iImageWidth ); m_iTextureHeight = power_of_two( m_iImageHeight ); */ diff --git a/src/arch/RageDriver.cpp b/src/arch/RageDriver.cpp index d996e23553..4cd6ccf5e3 100644 --- a/src/arch/RageDriver.cpp +++ b/src/arch/RageDriver.cpp @@ -4,7 +4,7 @@ void DriverList::Add( const istring &sName, CreateRageDriverFn pfn ) { if( m_pRegistrees == nullptr ) - m_pRegistrees = new map; + m_pRegistrees = new std::map; ASSERT( m_pRegistrees->find(sName) == m_pRegistrees->end() ); (*m_pRegistrees)[sName] = pfn; @@ -15,7 +15,7 @@ RageDriver *DriverList::Create( const RString &sDriverName ) if( m_pRegistrees == nullptr ) return nullptr; - map::const_iterator iter = m_pRegistrees->find( istring(sDriverName) ); + std::map::const_iterator iter = m_pRegistrees->find( istring(sDriverName) ); if( iter == m_pRegistrees->end() ) return nullptr; return (iter->second)(); diff --git a/src/arch/RageDriver.h b/src/arch/RageDriver.h index fa2f3a32ad..2f0d2e26ba 100644 --- a/src/arch/RageDriver.h +++ b/src/arch/RageDriver.h @@ -16,7 +16,7 @@ struct DriverList { void Add( const istring &sName, CreateRageDriverFn pfn ); RageDriver *Create( const RString &sDriverName ); - map *m_pRegistrees; + std::map *m_pRegistrees; }; struct RegisterRageDriver diff --git a/src/arch/Sound/ALSA9Helpers.cpp b/src/arch/Sound/ALSA9Helpers.cpp index 3a390b5908..2519c54b78 100644 --- a/src/arch/Sound/ALSA9Helpers.cpp +++ b/src/arch/Sound/ALSA9Helpers.cpp @@ -274,7 +274,7 @@ int Alsa9Buf::GetNumFramesToFill() { /* Make sure we can write ahead at least two chunks. Otherwise, we'll only * fill one chunk ahead, and underrun. */ - int ActualWriteahead = max( writeahead, chunksize*2 ); + int ActualWriteahead = std::max( writeahead, chunksize*2 ); snd_pcm_sframes_t avail_frames = dsnd_pcm_avail_update(pcm); @@ -308,7 +308,7 @@ int Alsa9Buf::GetNumFramesToFill() } /* Number of frames that have data: */ - const snd_pcm_sframes_t filled_frames = max( 0l, total_frames - avail_frames ); + const snd_pcm_sframes_t filled_frames = std::max( 0l, total_frames - avail_frames ); /* Number of frames that don't have data, that are within the writeahead: */ snd_pcm_sframes_t unfilled_frames = clamp( ActualWriteahead - filled_frames, 0l, (snd_pcm_sframes_t)ActualWriteahead ); diff --git a/src/arch/Sound/DSoundHelpers.cpp b/src/arch/Sound/DSoundHelpers.cpp index 22be7b291c..3c69af8c21 100644 --- a/src/arch/Sound/DSoundHelpers.cpp +++ b/src/arch/Sound/DSoundHelpers.cpp @@ -185,7 +185,7 @@ RString DSoundBuf::Init( DSound &ds, DSoundBuf::hw hardware, /* The size of the actual DSound buffer. This can be large; we generally * won't fill it completely. */ m_iBufferSize = 1024*64; - m_iBufferSize = max( m_iBufferSize, m_iWriteAhead ); + m_iBufferSize = std::max( m_iBufferSize, m_iWriteAhead ); WAVEFORMATEX waveformat; memset( &waveformat, 0, sizeof(waveformat) ); @@ -250,7 +250,7 @@ RString DSoundBuf::Init( DSound &ds, DSoundBuf::hw hardware, { LOG->Warn( "bcaps.dwBufferBytes (%i) != m_iBufferSize(%i); adjusting", bcaps.dwBufferBytes, m_iBufferSize ); m_iBufferSize = bcaps.dwBufferBytes; - m_iWriteAhead = min( m_iWriteAhead, m_iBufferSize ); + m_iWriteAhead = std::min( m_iWriteAhead, m_iBufferSize ); } if( !(bcaps.dwFlags & DSBCAPS_CTRLVOLUME) ) @@ -287,7 +287,7 @@ void DSoundBuf::SetVolume( float fVolume ) float iVolumeLog2 = log10f(fVolume) / log10f(2); /* vol log 2 */ /* Volume is a multiplier; SetVolume wants attenuation in hundredths of a decibel. */ - const int iNewVolume = max( int(1000 * iVolumeLog2), DSBVOLUME_MIN ); + const int iNewVolume = std::max( int(1000 * iVolumeLog2), DSBVOLUME_MIN ); if( m_iVolume == iNewVolume ) return; @@ -488,11 +488,11 @@ bool DSoundBuf::get_output_buf( char **pBuffer, unsigned *pBufferSize, int iChun wrap( bytes_played, m_iBufferSize ); m_iBufferBytesFilled -= bytes_played; - m_iBufferBytesFilled = max( 0, m_iBufferBytesFilled ); + m_iBufferBytesFilled = std::max( 0, m_iBufferBytesFilled ); if( m_iExtraWriteahead ) { - int used = min( m_iExtraWriteahead, bytes_played ); + int used = std::min( m_iExtraWriteahead, bytes_played ); RString s = ssprintf("used %i of %i (%i..%i)", used, m_iExtraWriteahead, iCursorStart, iCursorEnd ); s += "; last: "; for( int i = 0; i < 4; ++i ) @@ -591,7 +591,7 @@ int64_t DSoundBuf::GetPosition() const /* Failsafe: never return a value smaller than we've already returned. * This can happen once in a while in underrun conditions. */ - iRet = max( m_iLastPosition, iRet ); + iRet = std::max( m_iLastPosition, iRet ); m_iLastPosition = iRet; return iRet; diff --git a/src/arch/Sound/RageSoundDriver.cpp b/src/arch/Sound/RageSoundDriver.cpp index 8507345e14..fe0b3f44f2 100644 --- a/src/arch/Sound/RageSoundDriver.cpp +++ b/src/arch/Sound/RageSoundDriver.cpp @@ -10,7 +10,7 @@ DriverList RageSoundDriver::m_pDriverList; RageSoundDriver *RageSoundDriver::Create( const RString& drivers ) { - vector drivers_to_try; + std::vector drivers_to_try; if(drivers.empty()) { split(DEFAULT_SOUND_DRIVER_LIST, ",", drivers_to_try); diff --git a/src/arch/Sound/RageSoundDriver_Generic_Software.cpp b/src/arch/Sound/RageSoundDriver_Generic_Software.cpp index 4604b1df80..1f31dac8b9 100644 --- a/src/arch/Sound/RageSoundDriver_Generic_Software.cpp +++ b/src/arch/Sound/RageSoundDriver_Generic_Software.cpp @@ -120,13 +120,13 @@ RageSoundMixBuffer &RageSoundDriver::MixIntoBuffer( int iFrames, int64_t iFrameN continue; // more data /* We've used up p[0]. Try p[1]. */ - swap( p[0], p[1] ); - swap( pSize[0], pSize[1] ); + std::swap( p[0], p[1] ); + std::swap( pSize[0], pSize[1] ); continue; } /* Note that, until we call advance_read_pointer, we can safely write to p[0]. */ - const int frames_to_read = min( iFramesLeft, p[0]->m_FramesInBuffer ); + const int frames_to_read = std::min( iFramesLeft, p[0]->m_FramesInBuffer ); mix.SetWriteOffset( iGotFrames*channels ); mix.write( p[0]->m_BufferNext, frames_to_read * channels ); @@ -467,7 +467,7 @@ RageSoundDriver::~RageSoundDriver() LOG->Flush(); LOG->Info( "Mixing %f ahead in %i Mix() calls", - float(g_iTotalAhead) / max( g_iTotalAheadCount, 1 ), g_iTotalAheadCount ); + float(g_iTotalAhead) / std::max( g_iTotalAheadCount, 1 ), g_iTotalAheadCount ); } } @@ -525,7 +525,7 @@ int64_t RageSoundDriver::ClampHardwareFrame( int64_t iHardwareFrame ) const } } - m_iMaxHardwareFrame = iHardwareFrame = max( iHardwareFrame, m_iMaxHardwareFrame ); + m_iMaxHardwareFrame = iHardwareFrame = std::max( iHardwareFrame, m_iMaxHardwareFrame ); //return iHardwareFrame; m_iVMaxHardwareFrame += diff; return m_iVMaxHardwareFrame; diff --git a/src/arch/Sound/RageSoundDriver_JACK.cpp b/src/arch/Sound/RageSoundDriver_JACK.cpp index 5a68402fbe..af5565f4e9 100644 --- a/src/arch/Sound/RageSoundDriver_JACK.cpp +++ b/src/arch/Sound/RageSoundDriver_JACK.cpp @@ -109,7 +109,7 @@ out_close: RString RageSoundDriver_JACK::ConnectPorts() { - vector portNames; + std::vector portNames; split(PREFSMAN->m_iSoundDevice.Get(), ",", portNames, true); const char *port_out_l = nullptr, *port_out_r = nullptr; diff --git a/src/arch/Sound/RageSoundDriver_WDMKS.cpp b/src/arch/Sound/RageSoundDriver_WDMKS.cpp index b84e4c1c84..fbb37bf42b 100644 --- a/src/arch/Sound/RageSoundDriver_WDMKS.cpp +++ b/src/arch/Sound/RageSoundDriver_WDMKS.cpp @@ -58,7 +58,7 @@ struct WinWdmPin HANDLE m_hHandle; WinWdmFilter *m_pParentFilter; int m_iPinId; - vector m_dataRangesItem; + std::vector m_dataRangesItem; }; enum DeviceSampleFormat @@ -115,7 +115,7 @@ struct WinWdmFilter void Release(); HANDLE m_hHandle; - vector m_apPins; + std::vector m_apPins; RString m_sFilterName; RString m_sFriendlyName; int m_iUsageCount; @@ -189,7 +189,7 @@ static bool WdmGetPropertySimple( HANDLE hHandle, const GUID *pGuidPropertySet, void *pValue, unsigned long iValueSize, void *pInstance, unsigned long iInstanceSize, RString &sError ) { unsigned long iPropertySize = sizeof(KSPROPERTY) + iInstanceSize; - vector buf; + std::vector buf; buf.resize( iPropertySize ); KSPROPERTY *ksProperty = (KSPROPERTY*) &buf[0]; @@ -209,7 +209,7 @@ static bool WdmSetPropertySimple( void *pValue, unsigned long iValueSize, void *instance, unsigned long iInstanceSize, RString &sError ) { - vector buf; + std::vector buf; unsigned long iPropertySize = sizeof(KSPROPERTY) + iInstanceSize; buf.resize( iPropertySize ); KSPROPERTY *ksProperty = (KSPROPERTY *) &buf[0]; @@ -638,12 +638,12 @@ WinWdmPin *WinWdmFilter::InstantiateRenderPin( const WAVEFORMATEX *wfex, RString } template -void MoveToBeginning( vector &v, const U &item ) +void MoveToBeginning( std::vector &v, const U &item ) { - vector::iterator it = find( v.begin(), v.end(), item ); + std::vector::iterator it = find( v.begin(), v.end(), item ); if( it == v.end() ) return; - vector::iterator next = it; + std::vector::iterator next = it; ++next; copy_backward( v.begin(), it, next ); *v.begin() = item; @@ -695,7 +695,7 @@ WinWdmPin *WinWdmFilter::InstantiateRenderPin( * more channels, since some drivers won't send audio to rear speakers in stereo modes. Sort * the preferred channel count first. */ - vector aChannels; + std::vector aChannels; aChannels.push_back( 8 ); aChannels.push_back( 6 ); aChannels.push_back( 4 ); @@ -704,7 +704,7 @@ WinWdmPin *WinWdmFilter::InstantiateRenderPin( MoveToBeginning( aChannels, iPreferredOutputChannels ); /* Try all sample formats. Try PreferredOutputSampleFormat first. */ - vector SampleFormats; + std::vector SampleFormats; SampleFormats.push_back( DeviceSampleFormat_Int16 ); SampleFormats.push_back( DeviceSampleFormat_Int24 ); SampleFormats.push_back( DeviceSampleFormat_Int32 ); @@ -719,7 +719,7 @@ WinWdmPin *WinWdmFilter::InstantiateRenderPin( * Try all samplerates listed in the device's DATARANGES. Sort iSampleRate first, * then 48k, then 44.1k, then higher sample rates first. */ - vector aSampleRates; + std::vector aSampleRates; { for (WinWdmPin *pPin : m_apPins) { @@ -746,7 +746,7 @@ WinWdmPin *WinWdmFilter::InstantiateRenderPin( } /* Try WAVE_FORMAT_EXTENSIBLE, then WAVE_FORMAT_PCM. */ - vector aTryPCM; + std::vector aTryPCM; aTryPCM.push_back( false ); aTryPCM.push_back( true ); @@ -811,7 +811,7 @@ static bool GetDevicePath( HANDLE hHandle, SP_DEVICE_INTERFACE_DATA *pInterfaceD } /* Build a list of available filters. */ -static bool BuildFilterList( vector &aFilters, RString &sError ) +static bool BuildFilterList( std::vector &aFilters, RString &sError ) { const GUID *pCategoryGuid = (GUID*) &KSCATEGORY_RENDER; @@ -989,7 +989,7 @@ bool WinWdmStream::Open( WinWdmFilter *pFilter, if( m_iFramesPerChunk == 0 ) { m_iFramesPerChunk = 512 / m_iWriteAheadChunks; - m_iFramesPerChunk = max( m_iFramesPerChunk, iFrameSize ); // iFrameSize may be 0 + m_iFramesPerChunk = std::max( m_iFramesPerChunk, iFrameSize ); // iFrameSize may be 0 } LOG->Info( "KS: chunk size: %i; allocator framing: %i (%ims)", m_iFramesPerChunk, iFrameSize, (iFrameSize * 1000) / m_iSampleRate ); @@ -1276,7 +1276,7 @@ RString RageSoundDriver_WDMKS::Init() if( !PaWinWdm_Initialize(sError) ) return sError; - vector apFilters; + std::vector apFilters; if( !BuildFilterList(apFilters, sError) ) return "Error building filter list: " + sError; if( apFilters.empty() ) diff --git a/src/arch/Threads/Threads_Win32.cpp b/src/arch/Threads/Threads_Win32.cpp index e74bb5a74f..4d6dbedcc4 100644 --- a/src/arch/Threads/Threads_Win32.cpp +++ b/src/arch/Threads/Threads_Win32.cpp @@ -359,7 +359,7 @@ bool EventImpl_Win32::Wait( RageTimer *pTimeout ) if( pTimeout != nullptr ) { float fSecondsInFuture = -pTimeout->Ago(); - iMilliseconds = (unsigned) max( 0, int( fSecondsInFuture * 1000 ) ); + iMilliseconds = (unsigned) std::max( 0, int( fSecondsInFuture * 1000 ) ); } // Unlock the mutex and wait for a signal. diff --git a/src/archutils/Darwin/HIDDevice.h b/src/archutils/Darwin/HIDDevice.h index 52d4c1de95..4d67bd0632 100644 --- a/src/archutils/Darwin/HIDDevice.h +++ b/src/archutils/Darwin/HIDDevice.h @@ -116,7 +116,7 @@ public: * presses may be generated by a single element. The value of the element is * passed to determine if this is a push or a release. The time is provided * as an optimization. */ - virtual void GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const = 0; + virtual void GetButtonPresses( std::vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const = 0; /* Returns the number of IDs assigned starting from startID. This is not * meaningful for devices like keyboards that all share the same InputDevice @@ -127,7 +127,7 @@ public: virtual int AssignIDs( InputDevice startID ) { return 0; } //Add a device and a description for each logical device. - virtual void GetDevicesAndDescriptions( vector& vDevices ) const = 0; + virtual void GetDevicesAndDescriptions( std::vector& vDevices ) const = 0; }; #endif diff --git a/src/archutils/Darwin/JoystickDevice.cpp b/src/archutils/Darwin/JoystickDevice.cpp index ecdbf2ea4a..a52d6aa045 100644 --- a/src/archutils/Darwin/JoystickDevice.cpp +++ b/src/archutils/Darwin/JoystickDevice.cpp @@ -2,8 +2,6 @@ #include "JoystickDevice.h" #include "RageLog.h" -using std::unordered_map; - Joystick::Joystick() : id( InputDevice_Invalid ), x_axis( 0 ), y_axis( 0 ), z_axis( 0 ), x_rot( 0 ), y_rot( 0 ), z_rot( 0 ), hat( 0 ), @@ -134,7 +132,7 @@ void JoystickDevice::Open() ADD( x_rot ); ADD( y_rot ); ADD( z_rot ); ADD( hat ); #undef ADD - for( unordered_map::const_iterator j = js.mapping.begin(); j != js.mapping.end(); ++j ) + for( std::unordered_map::const_iterator j = js.mapping.begin(); j != js.mapping.end(); ++j ) AddElementToQueue( j->first ); } } @@ -152,7 +150,7 @@ bool JoystickDevice::InitDevice( int vid, int pid ) return ret == kIOReturnSuccess; } -void JoystickDevice::GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const +void JoystickDevice::GetButtonPresses( std::vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const { for (Joystick const &js : m_vSticks) { @@ -160,48 +158,48 @@ void JoystickDevice::GetButtonPresses( vector& vPresses, IOHIDEleme { float level = SCALE( value, js.x_min, js.x_max, -1.0f, 1.0f ); - vPresses.push_back( DeviceInput(js.id, JOY_LEFT, max(-level, 0.0f), now) ); - vPresses.push_back( DeviceInput(js.id, JOY_RIGHT, max(level, 0.0f), now) ); + vPresses.push_back( DeviceInput(js.id, JOY_LEFT, std::max(-level, 0.0f), now) ); + vPresses.push_back( DeviceInput(js.id, JOY_RIGHT, std::max(level, 0.0f), now) ); break; } else if( js.y_axis == cookie ) { float level = SCALE( value, js.y_min, js.y_max, -1.0f, 1.0f ); - vPresses.push_back( DeviceInput(js.id, JOY_UP, max(-level, 0.0f), now) ); - vPresses.push_back( DeviceInput(js.id, JOY_DOWN, max(level, 0.0f), now) ); + vPresses.push_back( DeviceInput(js.id, JOY_UP, std::max(-level, 0.0f), now) ); + vPresses.push_back( DeviceInput(js.id, JOY_DOWN, std::max(level, 0.0f), now) ); break; } else if( js.z_axis == cookie ) { float level = SCALE( value, js.z_min, js.z_max, -1.0f, 1.0f ); - vPresses.push_back( DeviceInput(js.id, JOY_Z_UP, max(-level, 0.0f), now) ); - vPresses.push_back( DeviceInput(js.id, JOY_Z_DOWN, max(level, 0.0f), now) ); + vPresses.push_back( DeviceInput(js.id, JOY_Z_UP, std::max(-level, 0.0f), now) ); + vPresses.push_back( DeviceInput(js.id, JOY_Z_DOWN, std::max(level, 0.0f), now) ); break; } else if( js.x_rot == cookie ) { float level = SCALE( value, js.rx_min, js.rx_max, -1.0f, 1.0f ); - vPresses.push_back( DeviceInput(js.id, JOY_ROT_LEFT, max(-level, 0.0f), now) ); - vPresses.push_back( DeviceInput(js.id, JOY_ROT_RIGHT, max(level, 0.0f), now) ); + vPresses.push_back( DeviceInput(js.id, JOY_ROT_LEFT, std::max(-level, 0.0f), now) ); + vPresses.push_back( DeviceInput(js.id, JOY_ROT_RIGHT, std::max(level, 0.0f), now) ); break; } else if( js.y_rot == cookie ) { float level = SCALE( value, js.ry_min, js.ry_max, -1.0f, 1.0f ); - vPresses.push_back( DeviceInput(js.id, JOY_ROT_UP, max(-level, 0.0f), now) ); - vPresses.push_back( DeviceInput(js.id, JOY_ROT_DOWN, max(level, 0.0f), now) ); + vPresses.push_back( DeviceInput(js.id, JOY_ROT_UP, std::max(-level, 0.0f), now) ); + vPresses.push_back( DeviceInput(js.id, JOY_ROT_DOWN, std::max(level, 0.0f), now) ); break; } else if( js.z_rot == cookie ) { float level = SCALE( value, js.rz_min, js.rz_max, -1.0f, 1.0f ); - vPresses.push_back( DeviceInput(js.id, JOY_ROT_Z_UP, max(-level, 0.0f), now) ); - vPresses.push_back( DeviceInput(js.id, JOY_ROT_Z_DOWN, max(level, 0.0f), now) ); + vPresses.push_back( DeviceInput(js.id, JOY_ROT_Z_UP, std::max(-level, 0.0f), now) ); + vPresses.push_back( DeviceInput(js.id, JOY_ROT_Z_DOWN, std::max(level, 0.0f), now) ); break; } else if( js.hat == cookie ) @@ -231,7 +229,7 @@ void JoystickDevice::GetButtonPresses( vector& vPresses, IOHIDEleme else { // hash_map::operator[] is not const - unordered_map::const_iterator iter; + std::unordered_map::const_iterator iter; iter = js.mapping.find( cookie ); if( iter != js.mapping.end() ) @@ -260,7 +258,7 @@ int JoystickDevice::AssignIDs( InputDevice startID ) return m_vSticks.size(); } -void JoystickDevice::GetDevicesAndDescriptions( vector& vDevices ) const +void JoystickDevice::GetDevicesAndDescriptions( std::vector& vDevices ) const { for (auto &i : m_vSticks) vDevices.push_back( InputDeviceInfo(i.id,GetDescription()) ); diff --git a/src/archutils/Darwin/JoystickDevice.h b/src/archutils/Darwin/JoystickDevice.h index ba59f2feb4..2c0f43f5ed 100644 --- a/src/archutils/Darwin/JoystickDevice.h +++ b/src/archutils/Darwin/JoystickDevice.h @@ -23,7 +23,7 @@ struct Joystick class JoystickDevice : public HIDDevice { private: - vector m_vSticks; + std::vector m_vSticks; protected: bool AddLogicalDevice( int usagePage, int usage ); @@ -32,9 +32,9 @@ protected: bool InitDevice( int vid, int pid ); public: - void GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const; + void GetButtonPresses( std::vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const; int AssignIDs( InputDevice startID ); - void GetDevicesAndDescriptions( vector& vDevices ) const; + void GetDevicesAndDescriptions( std::vector& vDevices ) const; }; #endif diff --git a/src/archutils/Darwin/KeyboardDevice.cpp b/src/archutils/Darwin/KeyboardDevice.cpp index 46e8663e17..bfc79097d1 100644 --- a/src/archutils/Darwin/KeyboardDevice.cpp +++ b/src/archutils/Darwin/KeyboardDevice.cpp @@ -162,16 +162,16 @@ void KeyboardDevice::AddElement( int usagePage, int usage, IOHIDElementCookie co void KeyboardDevice::Open() { - for( unordered_map::const_iterator i = m_Mapping.begin(); i != m_Mapping.end(); ++i ) + for( std::unordered_map::const_iterator i = m_Mapping.begin(); i != m_Mapping.end(); ++i ) { //LOG->Trace( "Adding %s to queue, cookie %p", DeviceButtonToString(i->second).c_str(), i->first ); AddElementToQueue( i->first ); } } -void KeyboardDevice::GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const +void KeyboardDevice::GetButtonPresses( std::vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const { - unordered_map::const_iterator iter = m_Mapping.find( cookie ); + std::unordered_map::const_iterator iter = m_Mapping.find( cookie ); if( iter != m_Mapping.end() ) { @@ -180,7 +180,7 @@ void KeyboardDevice::GetButtonPresses( vector& vPresses, IOHIDEleme } } -void KeyboardDevice::GetDevicesAndDescriptions( vector& vDevices ) const +void KeyboardDevice::GetDevicesAndDescriptions( std::vector& vDevices ) const { if( vDevices.size() && vDevices[0].id == DEVICE_KEYBOARD ) return; diff --git a/src/archutils/Darwin/KeyboardDevice.h b/src/archutils/Darwin/KeyboardDevice.h index 9c126efaf1..7406f0fe87 100644 --- a/src/archutils/Darwin/KeyboardDevice.h +++ b/src/archutils/Darwin/KeyboardDevice.h @@ -14,8 +14,8 @@ protected: void Open(); public: - void GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const; - void GetDevicesAndDescriptions( vector& vDevices ) const; + void GetButtonPresses( std::vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const; + void GetDevicesAndDescriptions( std::vector& vDevices ) const; static bool DeviceButtonToMacVirtualKey( DeviceButton button, UInt8 &iMacVKOut ); }; diff --git a/src/archutils/Darwin/MouseDevice.cpp b/src/archutils/Darwin/MouseDevice.cpp index bc6aebad27..5857568603 100644 --- a/src/archutils/Darwin/MouseDevice.cpp +++ b/src/archutils/Darwin/MouseDevice.cpp @@ -1,8 +1,6 @@ #include "global.h" #include "MouseDevice.h" -using std::unordered_map; - Mouse::Mouse() : id( InputDevice_Invalid ), x_axis( 0 ), y_axis( 0 ), z_axis( 0 ), x_min( 0 ), x_max( 0 ), y_min( 0 ), @@ -94,11 +92,11 @@ void MouseDevice::Open() #define ADD(x) if( m.x ) AddElementToQueue( m.x ) ADD( x_axis ); ADD( y_axis ); ADD( z_axis ); #undef ADD - for( unordered_map::const_iterator i = m_Mapping.begin(); i != m_Mapping.end(); ++i ) + for( std::unordered_map::const_iterator i = m_Mapping.begin(); i != m_Mapping.end(); ++i ) AddElementToQueue( i->first ); } -void MouseDevice::GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const +void MouseDevice::GetButtonPresses( std::vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const { // todo: add mouse axis stuff -aj const Mouse& m = m_Mouse; @@ -119,18 +117,18 @@ void MouseDevice::GetButtonPresses( vector& vPresses, IOHIDElementC else if( m.z_axis == cookie ) { float level = SCALE( value, m.z_min, m.z_max, -1.0f, 1.0f ); - INPUTFILTER->ButtonPressed( DeviceInput(DEVICE_MOUSE, MOUSE_WHEELUP, max(-level,0), now) ); - INPUTFILTER->ButtonPressed( DeviceInput(DEVICE_MOUSE, MOUSE_WHEELDOWN, max(+level,0), now) ); + INPUTFILTER->ButtonPressed( DeviceInput(DEVICE_MOUSE, MOUSE_WHEELUP, std::max(-level, 0.0f), now) ); + INPUTFILTER->ButtonPressed( DeviceInput(DEVICE_MOUSE, MOUSE_WHEELDOWN, std::max(+level, 0.0f), now) ); } else { - unordered_map::const_iterator iter = m_Mapping.find( cookie ); + std::unordered_map::const_iterator iter = m_Mapping.find( cookie ); if( iter != m_Mapping.end() ) vPresses.push_back( DeviceInput(DEVICE_MOUSE, iter->second, value, now) ); } } -void MouseDevice::GetDevicesAndDescriptions( vector& vDevices ) const +void MouseDevice::GetDevicesAndDescriptions( std::vector& vDevices ) const { vDevices.push_back( InputDeviceInfo(DEVICE_MOUSE, "Mouse") ); } diff --git a/src/archutils/Darwin/MouseDevice.h b/src/archutils/Darwin/MouseDevice.h index 255db6b19f..0303629cf2 100644 --- a/src/archutils/Darwin/MouseDevice.h +++ b/src/archutils/Darwin/MouseDevice.h @@ -30,8 +30,8 @@ protected: Mouse GetMouse(){ return m_Mouse; } public: - void GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const; - void GetDevicesAndDescriptions( vector& vDevices ) const; + void GetButtonPresses( std::vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const; + void GetDevicesAndDescriptions( std::vector& vDevices ) const; }; #endif diff --git a/src/archutils/Darwin/PumpDevice.cpp b/src/archutils/Darwin/PumpDevice.cpp index f7044659c8..d43bf57e05 100644 --- a/src/archutils/Darwin/PumpDevice.cpp +++ b/src/archutils/Darwin/PumpDevice.cpp @@ -11,7 +11,7 @@ void PumpDevice::Open() AddElementToQueue( IOHIDElementCookie(8) ); } -void PumpDevice::GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const +void PumpDevice::GetButtonPresses( std::vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const { DeviceButton db1 = DeviceButton_Invalid; DeviceButton db2 = DeviceButton_Invalid; @@ -58,7 +58,7 @@ int PumpDevice::AssignIDs( InputDevice startID ) return 1; } -void PumpDevice::GetDevicesAndDescriptions( vector& vDevices ) const +void PumpDevice::GetDevicesAndDescriptions( std::vector& vDevices ) const { vDevices.push_back( InputDeviceInfo(m_Id, "Pump USB") ); } diff --git a/src/archutils/Darwin/PumpDevice.h b/src/archutils/Darwin/PumpDevice.h index 1f8ee03a34..1f0451200c 100644 --- a/src/archutils/Darwin/PumpDevice.h +++ b/src/archutils/Darwin/PumpDevice.h @@ -16,9 +16,9 @@ protected: bool InitDevice( int vid, int pid ) { return vid == 0x0d2f && pid == 0x0001; } public: - void GetButtonPresses( vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const; + void GetButtonPresses( std::vector& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const; int AssignIDs( InputDevice startID ); - void GetDevicesAndDescriptions( vector& vDevices ) const; + void GetDevicesAndDescriptions( std::vector& vDevices ) const; }; #endif diff --git a/src/archutils/Unix/AssertionHandler.cpp b/src/archutils/Unix/AssertionHandler.cpp index 92a34c0bcc..0045fe1e5f 100644 --- a/src/archutils/Unix/AssertionHandler.cpp +++ b/src/archutils/Unix/AssertionHandler.cpp @@ -72,7 +72,7 @@ void UnexpectedExceptionHandler() void InstallExceptionHandler() { - set_terminate( UnexpectedExceptionHandler ); + std::set_terminate( UnexpectedExceptionHandler ); } /* diff --git a/src/archutils/Unix/Backtrace.cpp b/src/archutils/Unix/Backtrace.cpp index db8ac06046..3ff9c472e9 100644 --- a/src/archutils/Unix/Backtrace.cpp +++ b/src/archutils/Unix/Backtrace.cpp @@ -500,7 +500,7 @@ static bool PointsToValidCall( vm_address_t start, const void *ptr ) /* We're reading buf backwards, between buf[-7] and buf[-1]. Find out how * far we can read. */ - const int len = min( intptr_t(ptr)-start, 7U ); + const int len = std::min(intptr_t(ptr) - start, 7); // Permissible CALL sequences that we care about: // diff --git a/src/archutils/Unix/CrashHandler.cpp b/src/archutils/Unix/CrashHandler.cpp index 3d33c14b2b..f16cc501f4 100644 --- a/src/archutils/Unix/CrashHandler.cpp +++ b/src/archutils/Unix/CrashHandler.cpp @@ -371,7 +371,7 @@ void CrashHandler::ForceDeadlock( RString reason, uint64_t iID ) strncpy( crash.m_ThreadName[0], RageThread::GetCurrentThreadName(), sizeof(crash.m_ThreadName[0])-1 ); - strncpy( crash.reason, reason, min(sizeof(crash.reason) - 1, reason.length()) ); + strncpy( crash.reason, reason, std::min(sizeof(crash.reason) - 1, reason.length()) ); crash.reason[ sizeof(crash.reason)-1 ] = 0; RunCrashHandler( &crash ); diff --git a/src/archutils/Unix/CrashHandlerChild.cpp b/src/archutils/Unix/CrashHandlerChild.cpp index 0ed38bb30c..38c6d65d21 100644 --- a/src/archutils/Unix/CrashHandlerChild.cpp +++ b/src/archutils/Unix/CrashHandlerChild.cpp @@ -134,7 +134,7 @@ static void child_process() if( !child_read(3, temp, size) ) return; - vector Checkpoints; + std::vector Checkpoints; split(temp, "$$", Checkpoints); delete [] temp; diff --git a/src/archutils/Unix/SignalHandler.cpp b/src/archutils/Unix/SignalHandler.cpp index 5ec0ee8ea6..1e4a6d320a 100644 --- a/src/archutils/Unix/SignalHandler.cpp +++ b/src/archutils/Unix/SignalHandler.cpp @@ -31,8 +31,8 @@ extern "C" int sigaltstack(const stack_t * __restrict, stack_t * __restrict); static int find_stack_direction2( char *p ) NOINLINE; static int find_stack_direction() NOINLINE; -static vector handlers; -unique_ptr saved_sigs; +static std::vector handlers; +std::unique_ptr saved_sigs; static int signals[] = { diff --git a/src/archutils/Unix/SignalHandler.h b/src/archutils/Unix/SignalHandler.h index ff903cc0df..3af0f4c4d9 100644 --- a/src/archutils/Unix/SignalHandler.h +++ b/src/archutils/Unix/SignalHandler.h @@ -6,7 +6,7 @@ class SaveSignals { - vector old_handlers; + std::vector old_handlers; public: SaveSignals(); /* save signals */ diff --git a/src/archutils/Win32/CrashHandlerChild.cpp b/src/archutils/Win32/CrashHandlerChild.cpp index 9d4463c41d..53ff1bd6c0 100644 --- a/src/archutils/Win32/CrashHandlerChild.cpp +++ b/src/archutils/Win32/CrashHandlerChild.cpp @@ -446,8 +446,8 @@ struct CompleteCrashData RString m_sInfo; RString m_sAdditionalLog; RString m_sCrashedThread; - vector m_asRecent; - vector m_asCheckpoints; + std::vector m_asRecent; + std::vector m_asCheckpoints; }; static void MakeCrashReport( const CompleteCrashData &Data, RString &sOut ) @@ -455,7 +455,7 @@ static void MakeCrashReport( const CompleteCrashData &Data, RString &sOut ) sOut += ssprintf( "%s crash report (build %s, %s @ %s)\n" "--------------------------------------\n\n", - (string(PRODUCT_FAMILY) + product_version).c_str(), ::sm_version_git_hash, version_date, version_time ); + (std::string(PRODUCT_FAMILY) + product_version).c_str(), ::sm_version_git_hash, version_date, version_time ); sOut += ssprintf( "Crash reason: %s\n", Data.m_CrashInfo.m_CrashReason ); sOut += ssprintf( "\n" ); diff --git a/src/archutils/Win32/CrashHandlerNetworking.cpp b/src/archutils/Win32/CrashHandlerNetworking.cpp index e5621b8b72..39ae513b16 100644 --- a/src/archutils/Win32/CrashHandlerNetworking.cpp +++ b/src/archutils/Win32/CrashHandlerNetworking.cpp @@ -582,7 +582,7 @@ NetworkPostData::~NetworkPostData() } /** @brief Create a MIME multipart data block from the given set of fields. */ -void NetworkPostData::CreateMimeData( const map &mapNameToData, RString &sOut, RString &sMimeBoundaryOut ) +void NetworkPostData::CreateMimeData( const std::map &mapNameToData, RString &sOut, RString &sMimeBoundaryOut ) { // Find a non-conflicting mime boundary. while(1) @@ -667,7 +667,7 @@ void NetworkPostData::HttpThread() // Parse the results. int iStart = 0, iSize = -1; - map mapHeaders; + std::map mapHeaders; while( 1 ) { split( sResult, "\n", iStart, iSize, false ); diff --git a/src/archutils/Win32/CrashHandlerNetworking.h b/src/archutils/Win32/CrashHandlerNetworking.h index e6cd158cfa..c379263c67 100644 --- a/src/archutils/Win32/CrashHandlerNetworking.h +++ b/src/archutils/Win32/CrashHandlerNetworking.h @@ -30,7 +30,7 @@ public: RString GetResult() const { return m_sResult; } private: - static void CreateMimeData( const map &mapNameToData, RString &sOut, RString &sMimeBoundaryOut ); + static void CreateMimeData( const std::map &mapNameToData, RString &sOut, RString &sMimeBoundaryOut ); void SetProgress( float fProgress ); RageThread m_Thread; @@ -42,7 +42,7 @@ private: float m_fProgress; // When the thread exists, it owns the rest of the data, regardless of m_Mutex. - map m_Data; + std::map m_Data; bool m_bFinished; RString m_sHost; diff --git a/src/archutils/Win32/DebugInfoHunt.cpp b/src/archutils/Win32/DebugInfoHunt.cpp index afb0e62b20..f8b15219a7 100644 --- a/src/archutils/Win32/DebugInfoHunt.cpp +++ b/src/archutils/Win32/DebugInfoHunt.cpp @@ -89,13 +89,13 @@ static void GetDriveDebugInfo9x() * DMACurrentlyUsed 0 or 1 * DeviceDesc "GENERIC IDE DISK TYPE01" */ - vector Drives; + std::vector Drives; if( !RegistryAccess::GetRegSubKeys( "HKEY_LOCAL_MACHINE\\Enum\\ESDI", Drives ) ) return; for( unsigned drive = 0; drive < Drives.size(); ++drive ) { - vector IDs; + std::vector IDs; if( !RegistryAccess::GetRegSubKeys( Drives[drive], IDs ) ) continue; @@ -128,7 +128,7 @@ static void GetDriveDebugInfoNT() * Identifier "WDC WD1200JB-75CRA0" * Type "DiskPeripheral" */ - vector Ports; + std::vector Ports; if( !RegistryAccess::GetRegSubKeys( "HKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\Scsi", Ports ) ) return; @@ -140,19 +140,19 @@ static void GetDriveDebugInfoNT() RString Driver; RegistryAccess::GetRegValue( Ports[i], "Driver", Driver ); - vector Busses; + std::vector Busses; if( !RegistryAccess::GetRegSubKeys( Ports[i], Busses, "Scsi Bus .*" ) ) continue; for( unsigned bus = 0; bus < Busses.size(); ++bus ) { - vector TargetIDs; + std::vector TargetIDs; if( !RegistryAccess::GetRegSubKeys( Busses[bus], TargetIDs, "Target Id .*" ) ) continue; for( unsigned tid = 0; tid < TargetIDs.size(); ++tid ) { - vector LUIDs; + std::vector LUIDs; if( !RegistryAccess::GetRegSubKeys( TargetIDs[tid], LUIDs, "Logical Unit Id .*" ) ) continue; diff --git a/src/archutils/Win32/ErrorStrings.cpp b/src/archutils/Win32/ErrorStrings.cpp index 4c79144b81..a995fab256 100644 --- a/src/archutils/Win32/ErrorStrings.cpp +++ b/src/archutils/Win32/ErrorStrings.cpp @@ -25,7 +25,7 @@ RString werr_ssprintf( int err, const char *fmt, ... ) return s += ssprintf( " (%s)", text.c_str() ); } -RString ConvertWstringToCodepage( wstring s, int iCodePage ) +RString ConvertWstringToCodepage( std::wstring s, int iCodePage ) { if( s.empty() ) return RString(); @@ -48,17 +48,17 @@ RString ConvertUTF8ToACP( const RString &s ) return ConvertWstringToCodepage( RStringToWstring(s), CP_ACP ); } -wstring ConvertCodepageToWString( RString s, int iCodePage ) +std::wstring ConvertCodepageToWString( RString s, int iCodePage ) { if( s.empty() ) - return wstring(); + return std::wstring(); int iBytes = MultiByteToWideChar( iCodePage, 0, s.data(), s.size(), nullptr, 0 ); ASSERT_M( iBytes > 0, werr_ssprintf( GetLastError(), "MultiByteToWideChar" ).c_str() ); wchar_t *pTemp = new wchar_t[iBytes]; MultiByteToWideChar( iCodePage, 0, s.data(), s.size(), pTemp, iBytes ); - wstring sRet( pTemp, iBytes ); + std::wstring sRet( pTemp, iBytes ); delete [] pTemp; return sRet; diff --git a/src/archutils/Win32/ErrorStrings.h b/src/archutils/Win32/ErrorStrings.h index 123a24520c..f7f191f53f 100644 --- a/src/archutils/Win32/ErrorStrings.h +++ b/src/archutils/Win32/ErrorStrings.h @@ -2,9 +2,9 @@ #define ERROR_STRINGS_H RString werr_ssprintf( int err, const char *fmt, ... ); -RString ConvertWstringToCodepage( wstring s, int iCodePage ); +RString ConvertWstringToCodepage( std::wstring s, int iCodePage ); RString ConvertUTF8ToACP( const RString &s ); -wstring ConvertCodepageToWString( RString s, int iCodePage ); +std::wstring ConvertCodepageToWString( RString s, int iCodePage ); RString ConvertACPToUTF8( const RString &s ); #endif diff --git a/src/archutils/Win32/GraphicsWindow.cpp b/src/archutils/Win32/GraphicsWindow.cpp index 147dccf2c8..401aa6ed3c 100644 --- a/src/archutils/Win32/GraphicsWindow.cpp +++ b/src/archutils/Win32/GraphicsWindow.cpp @@ -70,10 +70,10 @@ static LRESULT CALLBACK GraphicsWindow_WndProc( HWND hWnd, UINT msg, WPARAM wPar if( !g_bHasFocus ) { RString sName = GetNewWindow(); - static set sLostFocusTo; + static std::set sLostFocusTo; sLostFocusTo.insert( sName ); RString sStr; - for( set::const_iterator it = sLostFocusTo.begin(); it != sLostFocusTo.end(); ++it ) + for( std::set::const_iterator it = sLostFocusTo.begin(); it != sLostFocusTo.end(); ++it ) sStr += (sStr.size()?", ":"") + *it; LOG->MapLog( "LOST_FOCUS", "Lost focus to: %s", sStr.c_str() ); @@ -432,7 +432,7 @@ void GraphicsWindow::Initialize( bool bD3D ) AppInstance inst; do { - const wstring wsClassName = RStringToWstring( g_sClassName ); + const std::wstring wsClassName = RStringToWstring( g_sClassName ); WNDCLASSW WindowClassW = { CS_OWNDC | CS_BYTEALIGNCLIENT, diff --git a/src/archutils/Win32/RegistryAccess.cpp b/src/archutils/Win32/RegistryAccess.cpp index 1f6f6f8c25..16320833d8 100644 --- a/src/archutils/Win32/RegistryAccess.cpp +++ b/src/archutils/Win32/RegistryAccess.cpp @@ -112,7 +112,7 @@ bool RegistryAccess::GetRegValue( const RString &sKey, const RString &sName, boo return b; } -bool RegistryAccess::GetRegSubKeys( const RString &sKey, vector &lst, const RString ®ex, bool bReturnPathToo ) +bool RegistryAccess::GetRegSubKeys( const RString &sKey, std::vector &lst, const RString ®ex, bool bReturnPathToo ) { HKEY hKey = OpenRegKey( sKey, READ ); if( hKey == nullptr ) @@ -196,7 +196,7 @@ bool RegistryAccess::CreateKey( const RString &sKey ) RString sSubkey; HKEY hType; if( !GetRegKeyType(sKey, sSubkey, hType) ) - return nullptr; + return false; HKEY hKey; DWORD dwDisposition = 0; diff --git a/src/archutils/Win32/RegistryAccess.h b/src/archutils/Win32/RegistryAccess.h index 74f263b14e..273161da14 100644 --- a/src/archutils/Win32/RegistryAccess.h +++ b/src/archutils/Win32/RegistryAccess.h @@ -9,7 +9,7 @@ namespace RegistryAccess bool GetRegValue( const RString &sKey, const RString &sName, int &val, bool bWarnOnError = true ); bool GetRegValue( const RString &sKey, const RString &sName, bool &val ); - bool GetRegSubKeys( const RString &sKey, vector &asList, const RString &sRegex = ".*", bool bReturnPathToo = true ); + bool GetRegSubKeys( const RString &sKey, std::vector &asList, const RString &sRegex = ".*", bool bReturnPathToo = true ); bool SetRegValue( const RString &sKey, const RString &sName, const RString &val ); bool SetRegValue( const RString &sKey, const RString &sName, int val ); diff --git a/src/archutils/Win32/USB.cpp b/src/archutils/Win32/USB.cpp index ecd5f48ecb..71c104a072 100644 --- a/src/archutils/Win32/USB.cpp +++ b/src/archutils/Win32/USB.cpp @@ -189,7 +189,7 @@ int WindowsFileIO::read( void *p ) return finish_read(p); } -int WindowsFileIO::read_several(const vector &sources, void *p, int &actual, float timeout) +int WindowsFileIO::read_several(const std::vector &sources, void *p, int &actual, float timeout) { HANDLE *Handles = new HANDLE[sources.size()]; for( unsigned i = 0; i < sources.size(); ++i ) diff --git a/src/archutils/Win32/USB.h b/src/archutils/Win32/USB.h index 8e63a7f637..85f71aa430 100644 --- a/src/archutils/Win32/USB.h +++ b/src/archutils/Win32/USB.h @@ -17,7 +17,7 @@ public: /* Nonblocking read. size must always be the same. Returns the number of bytes * read, or 0. */ int read( void *p ); - static int read_several( const vector &sources, void *p, int &actual, float timeout ); + static int read_several( const std::vector &sources, void *p, int &actual, float timeout ); private: void queue_read(); diff --git a/src/archutils/Win32/VideoDriverInfo.cpp b/src/archutils/Win32/VideoDriverInfo.cpp index 8a94dbee83..0e944ec455 100644 --- a/src/archutils/Win32/VideoDriverInfo.cpp +++ b/src/archutils/Win32/VideoDriverInfo.cpp @@ -68,7 +68,7 @@ bool GetVideoDriverInfo( int iCardno, VideoDriverInfo &info ) const bool bIsWin9x = version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS; static bool bInitialized=false; - static vector lst; + static std::vector lst; if( !bInitialized ) { bInitialized = true; diff --git a/src/global.h b/src/global.h index a90bcf5eda..3fd49c2af1 100644 --- a/src/global.h +++ b/src/global.h @@ -46,8 +46,6 @@ #define unlikely(x) (x) #endif -using namespace std; - #ifdef ASSERT #undef ASSERT #endif diff --git a/src/smpackage/EditInsallations.cpp b/src/smpackage/EditInsallations.cpp index aecf455420..942f0c5df2 100644 --- a/src/smpackage/EditInsallations.cpp +++ b/src/smpackage/EditInsallations.cpp @@ -59,9 +59,9 @@ BOOL EditInsallations::OnInitDialog() CDialog::OnInitDialog(); // TODO: Add extra initialization here - DialogUtil::LocalizeDialogAndContents( *this ); + DialogUtil::LocalizeDialogAndContents( *this ); - vector vs; + std::vector vs; SMPackageUtil::GetGameInstallDirs( vs ); for( unsigned i=0; i vs; + std::vector vs; for( int i=0; i asInstallDirs; + std::vector asInstallDirs; SMPackageUtil::GetGameInstallDirs( asInstallDirs ); FILEMAN->Remount( "/", asInstallDirs[0] ); diff --git a/src/smpackage/LanguagesDlg.cpp b/src/smpackage/LanguagesDlg.cpp index e0a3cd9491..11520ad36a 100644 --- a/src/smpackage/LanguagesDlg.cpp +++ b/src/smpackage/LanguagesDlg.cpp @@ -49,10 +49,10 @@ BOOL LanguagesDlg::OnInitDialog() DialogUtil::LocalizeDialogAndContents( *this ); - vector vs; + std::vector vs; GetDirListing( SpecialFiles::THEMES_DIR+"*", vs, true ); StripCvsAndSvn( vs ); - for (vector::const_iterator s = vs.begin(); s != vs.end(); ++s) + for (std::vector::const_iterator s = vs.begin(); s != vs.end(); ++s) m_listThemes.AddString( *s ); if( !vs.empty() ) m_listThemes.SetSel( 0 ); @@ -97,9 +97,9 @@ void LanguagesDlg::OnSelchangeListThemes() { RString sLanguagesDir = SpecialFiles::THEMES_DIR + sTheme + "/" + SpecialFiles::LANGUAGES_SUBDIR; - vector vs; + std::vector vs; GetDirListing( sLanguagesDir+"*.ini", vs, false ); - for (vector::const_iterator s = vs.begin(); s != vs.end(); ++s) + for (std::vector::const_iterator s = vs.begin(); s != vs.end(); ++s) { RString sIsoCode = GetFileNameWithoutExtension(*s); RString sLanguage = SMPackageUtil::GetLanguageDisplayString(sIsoCode); @@ -274,7 +274,7 @@ void LanguagesDlg::OnBnClickedButtonExport() ini2.ReadFile( sLanguageFile ); int iNumExpored = 0; - vector vs; + std::vector vs; vs.push_back( "Section" ); vs.push_back( "ID" ); vs.push_back( "Base Language Value" ); @@ -301,7 +301,7 @@ void LanguagesDlg::OnBnClickedButtonExport() bool bAlreadyTranslated = !tl.sCurrentLanguage.empty(); if( !bAlreadyTranslated || bExportAlreadyTranslated ) { - vector vs; + std::vector vs; vs.push_back( tl.sSection ); vs.push_back( tl.sID ); vs.push_back( tl.sBaseLanguage ); @@ -388,7 +388,7 @@ void LanguagesDlg::OnBnClickedButtonImport() int iNumModified = 0; int iNumUnchanged = 0; int iNumIgnored = 0; - for (vector::const_iterator line = csv.m_vvs.begin(); line != csv.m_vvs.end(); ++line) + for (std::vector::const_iterator line = csv.m_vvs.begin(); line != csv.m_vvs.end(); ++line) { int iLineIndex = line - csv.m_vvs.begin(); @@ -444,13 +444,13 @@ void LanguagesDlg::OnBnClickedButtonImport() OnSelchangeListThemes(); } -void GetAllMatches( const RString &sRegex, const RString &sString, vector &asOut ) +void GetAllMatches( const RString &sRegex, const RString &sString, std::vector &asOut ) { Regex re( sRegex + "(.*)$"); RString sMatch( sString ); while(1) { - vector asMatches; + std::vector asMatches; if( !re.Compare(sMatch, asMatches) ) break; asOut.push_back( asMatches[0] ); @@ -458,10 +458,10 @@ void GetAllMatches( const RString &sRegex, const RString &sString, vector &asList, RageFile &file ) +void DumpList( const std::vector &asList, RageFile &file ) { RString sLine; - for (vector::const_iterator s = asList.begin(); s != asList.end(); ++s) + for (std::vector::const_iterator s = asList.begin(); s != asList.end(); ++s) { if( sLine.size() + s->size() > 100 ) { @@ -519,10 +519,10 @@ void LanguagesDlg::OnBnClickedCheckLanguage() * languages with substantially different word order rules than English. */ { RString sRegex = "(&[A-Za-z]+;|%{[A-Za-z]+}|%[+-]?[0-9]*.?[0-9]*[sidf]|%)"; - vector asMatchesBase; + std::vector asMatchesBase; GetAllMatches( sRegex, sBaseLanguage, asMatchesBase ); - vector asMatches; + std::vector asMatches; GetAllMatches( sRegex, sCurrentLanguage, asMatches ); if( asMatchesBase.size() != asMatches.size() || @@ -538,10 +538,10 @@ void LanguagesDlg::OnBnClickedCheckLanguage() * of the above. */ { RString sRegex = "(\"|::|\\n)"; - vector asMatchesBase; + std::vector asMatchesBase; GetAllMatches( sRegex, sBaseLanguage, asMatchesBase ); - vector asMatches; + std::vector asMatches; GetAllMatches( sRegex, sCurrentLanguage, asMatches ); if( asMatchesBase.size() != asMatches.size() || @@ -598,7 +598,7 @@ void LanguagesDlg::OnBnClickedCheckLanguage() { FOREACH_CONST_Child( &ini2, key ) { - vector asList; + std::vector asList; const RString &sSection = key->m_sName; FOREACH_CONST_Attr( key, value ) { @@ -620,7 +620,7 @@ void LanguagesDlg::OnBnClickedCheckLanguage() { FOREACH_CONST_Child( &ini1, key ) { - vector asList; + std::vector asList; const RString &sSection = key->m_sName; FOREACH_CONST_Attr( key, value ) { diff --git a/src/smpackage/SMPackageInstallDlg.cpp b/src/smpackage/SMPackageInstallDlg.cpp index 9161ad9102..707cf057bb 100644 --- a/src/smpackage/SMPackageInstallDlg.cpp +++ b/src/smpackage/SMPackageInstallDlg.cpp @@ -70,7 +70,7 @@ static bool CompareStringNoCase( const RString &s1, const RString &s2 ) return s1.CompareNoCase( s2 ) < 0; } -void GetSmzipFilesToExtract( RageFileDriver &zip, vector &vsOut ) +void GetSmzipFilesToExtract( RageFileDriver &zip, std::vector &vsOut ) { GetDirListingRecursive( &zip, "/", "*", vsOut ); SMPackageUtil::StripIgnoredSmzipFiles( vsOut ); @@ -119,7 +119,7 @@ BOOL CSMPackageInstallDlg::OnInitDialog() // Set the text of the second Edit box // { - vector vs; + std::vector vs; GetSmzipFilesToExtract( zip, vs ); CEdit* pEdit2 = (CEdit*)GetDlgItem(IDC_EDIT_MESSAGE2); RString sText = "\t" + join( "\r\n\t", vs ); @@ -183,7 +183,7 @@ static bool CheckPackages( RageFileDriverZip &fileDriver ) int cnt = 0; ini.GetValue( "Packages", "NumPackages", cnt ); - vector vsDirectories; + std::vector vsDirectories; for( int i = 0; i < cnt; ++i ) { RString path; @@ -305,7 +305,7 @@ void CSMPackageInstallDlg::OnOK() // Unzip the SMzip package into the installation folder - vector vs; + std::vector vs; GetSmzipFilesToExtract( zip, vs ); for( unsigned i=0; i asInstallDirs; + std::vector asInstallDirs; SMPackageUtil::GetGameInstallDirs( asInstallDirs ); for( unsigned i=0; i& asInstallDirsToWrite ) +void SMPackageUtil::WriteGameInstallDirs( const std::vector& asInstallDirsToWrite ) { RegistryAccess::CreateKey( INSTALLATIONS_KEY ); @@ -28,7 +28,7 @@ void SMPackageUtil::WriteGameInstallDirs( const vector& asInstallDirsTo } } -void SMPackageUtil::GetGameInstallDirs( vector& asInstallDirsOut ) +void SMPackageUtil::GetGameInstallDirs( std::vector& asInstallDirsOut ) { asInstallDirsOut.clear(); @@ -55,7 +55,7 @@ void SMPackageUtil::GetGameInstallDirs( vector& asInstallDirsOut ) void SMPackageUtil::AddGameInstallDir( const RString &sNewInstallDir ) { - vector asInstallDirs; + std::vector asInstallDirs; GetGameInstallDirs( asInstallDirs ); bool bAlreadyInList = false; @@ -77,7 +77,7 @@ void SMPackageUtil::AddGameInstallDir( const RString &sNewInstallDir ) void SMPackageUtil::SetDefaultInstallDir( int iInstallDirIndex ) { // move the specified index to the top of the list - vector asInstallDirs; + std::vector asInstallDirs; GetGameInstallDirs( asInstallDirs ); ASSERT( iInstallDirIndex >= 0 && iInstallDirIndex < (int)asInstallDirs.size() ); RString sDefaultInstallDir = asInstallDirs[iInstallDirIndex]; @@ -88,7 +88,7 @@ void SMPackageUtil::SetDefaultInstallDir( int iInstallDirIndex ) void SMPackageUtil::SetDefaultInstallDir( const RString &sInstallDir ) { - vector asInstallDirs; + std::vector asInstallDirs; GetGameInstallDirs( asInstallDirs ); for( unsigned i=0; i Parts; + std::vector Parts; split( path, "\\", Parts ); unsigned NumParts = 2; @@ -148,7 +148,7 @@ bool SMPackageUtil::IsValidPackageDirectory( const RString &path ) { /* Make sure the path contains only second-level directories, and doesn't * contain any ".", "..", "...", etc. dirs. */ - vector Parts; + std::vector Parts; split( path, "\\", Parts, true ); if( Parts.size() == 0 ) return false; @@ -215,7 +215,7 @@ RString SMPackageUtil::GetLanguageCodeFromDisplayString( const RString &sDisplay return s; } -void SMPackageUtil::StripIgnoredSmzipFiles( vector &vsFilesInOut ) +void SMPackageUtil::StripIgnoredSmzipFiles( std::vector &vsFilesInOut ) { for( int i=vsFilesInOut.size()-1; i>=0; i-- ) { @@ -226,7 +226,7 @@ void SMPackageUtil::StripIgnoredSmzipFiles( vector &vsFilesInOut ) bEraseThis |= EndsWith( sFile, ".old" ); bEraseThis |= EndsWith( sFile, "Thumbs.db" ); bEraseThis |= EndsWith( sFile, ".DS_Store" ); - bEraseThis |= (sFile.find("CVS") != string::npos); + bEraseThis |= (sFile.find("CVS") != std::string::npos); if( bEraseThis ) vsFilesInOut.erase( vsFilesInOut.begin()+i ); diff --git a/src/smpackage/SmpackageExportDlg.cpp b/src/smpackage/SmpackageExportDlg.cpp index 1d3f152687..2a51394945 100644 --- a/src/smpackage/SmpackageExportDlg.cpp +++ b/src/smpackage/SmpackageExportDlg.cpp @@ -2,7 +2,7 @@ #define CO_EXIST_WITH_MFC #include "global.h" -#include "stdafx.h" +#include "StdAfx.h" #include "smpackage.h" #include "SmpackageExportDlg.h" #include "RageUtil.h" @@ -22,8 +22,7 @@ #include #include #include -#include ".\smpackageexportdlg.h" -using namespace std; +#include ".\SmpackageExportDlg.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -99,7 +98,7 @@ RString ReplaceInvalidFileNameChars( RString sOldFileName ) } static LocalizedString ERROR_ADDING_FILE ( "SmpackageExportDlg", "Error adding file '%s'." ); -static bool ExportPackage( const RString &sPackageName, const RString &sSourceInstallDir, const vector& asDirectoriesToExport, const RString &sComment ) +static bool ExportPackage( const RString &sPackageName, const RString &sSourceInstallDir, const std::vector& asDirectoriesToExport, const RString &sComment ) { CZipArchive zip; @@ -123,7 +122,7 @@ static bool ExportPackage( const RString &sPackageName, const RString &sSourceIn /* Find files to add to zip. */ - vector asFilePaths; + std::vector asFilePaths; { RageFileDriverDirect fileDriver( sSourceInstallDir ); @@ -146,7 +145,7 @@ static bool ExportPackage( const RString &sPackageName, const RString &sSourceIn IniFile ini; ini.SetValue( "SMZIP", "Version", 1 ); - set Directories; + std::set Directories; for( unsigned i=0; i::const_iterator it; + std::set::const_iterator it; int num = 0; for( it = Directories.begin(); it != Directories.end(); ++it ) ini.SetValue( "Packages", ssprintf("%i", num++), *it ); @@ -235,7 +234,7 @@ static LocalizedString NO_ITEMS_ARE_CHECKED ( "CSmpackageExportDlg", "No items a static LocalizedString SUCCESSFULLY_EXPORTED( "CSmpackageExportDlg", "Successfully exported package '%s' to your Desktop." ); void CSmpackageExportDlg::OnButtonExportAsOne() { - vector asPaths; + std::vector asPaths; GetCheckedPaths( asPaths ); if( asPaths.size() == 0 ) @@ -271,7 +270,7 @@ static LocalizedString THE_FOLLOWING_PACKAGES_WERE_EXPORTED ("CSmpackageExportDl static LocalizedString THE_FOLLOWING_PACKAGES_FAILED ("CSmpackageExportDlg","The following packages failed to export:"); void CSmpackageExportDlg::OnButtonExportAsIndividual() { - vector asPaths; + std::vector asPaths; GetCheckedPaths( asPaths ); if( asPaths.size() == 0 ) @@ -285,8 +284,8 @@ void CSmpackageExportDlg::OnButtonExportAsIndividual() if( !MakeComment(sComment) ) return; // cancelled - vector asExportedPackages; - vector asFailedPackages; + std::vector asExportedPackages; + std::vector asFailedPackages; for( unsigned i=0; i asPathsToExport; + std::vector asPathsToExport; asPathsToExport.push_back( sPath ); if( ExportPackage( sPackageName, GetCurrentInstallDir(), asPathsToExport, sComment ) ) @@ -360,7 +359,7 @@ void CSmpackageExportDlg::GetCheckedTreeItems( CArray& aChe aCheckedItemsOut.Add( aItems[i] ); } -void CSmpackageExportDlg::GetCheckedPaths( vector& aPathsOut ) +void CSmpackageExportDlg::GetCheckedPaths( std::vector& aPathsOut ) { CArray aItems; @@ -400,7 +399,7 @@ void CSmpackageExportDlg::RefreshInstallationList() { m_comboDir.ResetContent(); - vector asInstallDirs; + std::vector asInstallDirs; SMPackageUtil::GetGameInstallDirs( asInstallDirs ); for( unsigned i=0; i as1; + std::vector as1; HTREEITEM item1 = m_tree.InsertItem( "Announcers" ); fileDriver.GetDirListing( "Announcers/*", as1, true, false ); for( unsigned i=0; i as1; + std::vector as1; HTREEITEM item1 = m_tree.InsertItem( "Characters" ); fileDriver.GetDirListing( "Characters/*", as1, true, false ); for( unsigned i=0; i as1; + std::vector as1; HTREEITEM item1 = m_tree.InsertItem( "Themes" ); fileDriver.GetDirListing( "Themes/*", as1, true, false ); for( unsigned i=0; i as1; + std::vector as1; HTREEITEM item1 = m_tree.InsertItem( "BGAnimations" ); fileDriver.GetDirListing( "BGAnimations/*", as1, true, false ); for( unsigned i=0; i as1; + std::vector as1; HTREEITEM item1 = m_tree.InsertItem( "RandomMovies" ); fileDriver.GetDirListing( "RandomMovies/*.ogv", as1, false, false ); fileDriver.GetDirListing( "RandomMovies/*.avi", as1, false, false ); @@ -481,7 +480,7 @@ void CSmpackageExportDlg::RefreshTree() // Add visualizations { - vector as1; + std::vector as1; HTREEITEM item1 = m_tree.InsertItem( "Visualizations" ); fileDriver.GetDirListing( "Visualizations/*.ogv", as1, false, false ); fileDriver.GetDirListing( "Visualizations/*.avi", as1, false, false ); @@ -493,7 +492,7 @@ void CSmpackageExportDlg::RefreshTree() // Add courses { - vector as1; + std::vector as1; HTREEITEM item1 = m_tree.InsertItem( "Courses" ); fileDriver.GetDirListing( "Courses/*.crs", as1, false, false ); for( unsigned i=0; i as1; + std::vector as1; HTREEITEM item1 = m_tree.InsertItem( "NoteSkins" ); fileDriver.GetDirListing( "NoteSkins/*", as1, true, false ); for( unsigned i=0; i as2; + std::vector as2; HTREEITEM item2 = m_tree.InsertItem( as1[i], item1 ); fileDriver.GetDirListing( "NoteSkins/" + as1[i] + "/*", as2, true, false ); for( unsigned j=0; j as1; + std::vector as1; HTREEITEM item1 = m_tree.InsertItem( "Songs" ); fileDriver.GetDirListing( "Songs/*", as1, true, false ); for( unsigned i=0; i as2; + std::vector as2; HTREEITEM item2 = m_tree.InsertItem( as1[i], item1 ); fileDriver.GetDirListing( "Songs/" + as1[i] + "/*", as2, true, false ); for( unsigned j=0; j& aItemsOut ); void GetCheckedTreeItems( CArray& aCheckedItemsOut ); - void GetCheckedPaths( vector& aCheckedItemsOut ); + void GetCheckedPaths( std::vector& aCheckedItemsOut ); bool MakeComment( RString &comment ); RString GetCurrentInstallDir(); diff --git a/src/smpackage/StdAfx.h b/src/smpackage/StdAfx.h index 6cc9991dd6..e53c008812 100644 --- a/src/smpackage/StdAfx.h +++ b/src/smpackage/StdAfx.h @@ -33,7 +33,6 @@ #endif #include -using namespace std; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. diff --git a/src/smpackage/ZipArchive/stl/zippie/CmdLine.cpp b/src/smpackage/ZipArchive/stl/zippie/CmdLine.cpp index e8b9384070..a93cb88430 100644 --- a/src/smpackage/ZipArchive/stl/zippie/CmdLine.cpp +++ b/src/smpackage/ZipArchive/stl/zippie/CmdLine.cpp @@ -79,7 +79,7 @@ int CCmdLine::SplitLine(int argc, char **argv) cmd.m_strings.push_back(arg); // add the CCmdParam to 'this' - pair res = insert(CCmdLine::value_type(curParam, cmd)); + std::pair res = insert(CCmdLine::value_type(curParam, cmd)); } else diff --git a/src/smpackage/ZipArchive/stl/zippie/CmdLine.h b/src/smpackage/ZipArchive/stl/zippie/CmdLine.h index e4632a6a74..ea689cc44d 100644 --- a/src/smpackage/ZipArchive/stl/zippie/CmdLine.h +++ b/src/smpackage/ZipArchive/stl/zippie/CmdLine.h @@ -138,16 +138,15 @@ #include #include #include -using namespace std ; // handy little container for our argument vector struct CCmdParam { - vector m_strings; + std::vector m_strings; }; // this class is actually a map of strings to vectors -typedef map _CCmdLine; +typedef std::map _CCmdLine; // the command line parser class class CCmdLine : public _CCmdLine diff --git a/src/smpackage/ZipArchive/stl/zippie/zippie.cpp b/src/smpackage/ZipArchive/stl/zippie/zippie.cpp index c8ef86bbda..0068dc3cea 100644 --- a/src/smpackage/ZipArchive/stl/zippie/zippie.cpp +++ b/src/smpackage/ZipArchive/stl/zippie/zippie.cpp @@ -123,10 +123,10 @@ protected: }; -typedef list FILELIST; -typedef list::iterator FILELISTIT; -typedef list FILELISTADD; -typedef list::iterator FILELISTADDIT; +typedef std::list FILELIST; +typedef std::list::iterator FILELISTIT; +typedef std::list FILELISTADD; +typedef std::list::iterator FILELISTADDIT; struct AddDirectoryInfo { diff --git a/src/smpackage/smpackageUtil.h b/src/smpackage/smpackageUtil.h index d34b51685d..c62a8bf26a 100644 --- a/src/smpackage/smpackageUtil.h +++ b/src/smpackage/smpackageUtil.h @@ -5,8 +5,8 @@ struct LanguageInfo; namespace SMPackageUtil { - void WriteGameInstallDirs( const vector& asInstallDirsToWrite ); - void GetGameInstallDirs( vector& asInstallDirsOut ); + void WriteGameInstallDirs( const std::vector& asInstallDirsToWrite ); + void GetGameInstallDirs( std::vector& asInstallDirsOut ); void AddGameInstallDir( const RString &sNewInstallDir ); void SetDefaultInstallDir( int iInstallDirIndex ); void SetDefaultInstallDir( const RString &sInstallDir ); @@ -23,7 +23,7 @@ namespace SMPackageUtil RString GetLanguageDisplayString( const RString &sIsoCode ); RString GetLanguageCodeFromDisplayString( const RString &sDisplayString ); - void StripIgnoredSmzipFiles( vector &vsFilesInOut ); + void StripIgnoredSmzipFiles( std::vector &vsFilesInOut ); bool GetFileContentsOsAbsolute( const RString &sAbsoluteOsFile, RString &sOut ); diff --git a/src/tests/test_audio_readers.cpp b/src/tests/test_audio_readers.cpp index b17735b773..42f52c6869 100644 --- a/src/tests/test_audio_readers.cpp +++ b/src/tests/test_audio_readers.cpp @@ -174,8 +174,8 @@ bool test_read( RageSoundReader *snd, float *expected_data, int frames ) if( bMatches ) return true; - dump( expected_data, min(100, samples) ); - dump( buf, min(100, samples) ); + dump( expected_data, std::min(100, samples) ); + dump( buf, std::min(100, samples) ); return false; } @@ -360,7 +360,7 @@ bool RunTests( RageSoundReader *snd, const TestFile &tf ) if( bFailed ) { LOG->Trace("Got data:"); - dump( InitialData, min( 16, 2*InitialDataSize ) ); + dump( InitialData, std::min( 16, 2*InitialDataSize ) ); } const int LaterOffsetFrames = one_second_frames/2; /* half second */ diff --git a/src/tests/test_file_errors.cpp b/src/tests/test_file_errors.cpp index 1a437037d8..fd3265a87b 100644 --- a/src/tests/test_file_errors.cpp +++ b/src/tests/test_file_errors.cpp @@ -81,7 +81,7 @@ public: void Rewind() { pos = 0; } int Seek( int offset ) { - pos = min( offset, (int) g_TestFile.size() ); + pos = std::min( offset, (int) g_TestFile.size() ); return pos; } RageFileObj *Copy() const; @@ -134,7 +134,7 @@ RageFileObjTest::RageFileObjTest( const RString &path_ ) int RageFileObjTest::ReadInternal( void *buf, size_t bytes ) { - bytes = min( bytes, g_TestFile.size()-pos ); + bytes = std::min( bytes, g_TestFile.size()-pos ); if( g_BytesUntilError != -1 ) { @@ -145,7 +145,7 @@ int RageFileObjTest::ReadInternal( void *buf, size_t bytes ) return -1; } - g_BytesUntilError -= min( g_BytesUntilError, (int) bytes ); + g_BytesUntilError -= std::min( g_BytesUntilError, (int) bytes ); } memcpy( buf, g_TestFile.data()+pos, bytes ); @@ -164,7 +164,7 @@ int RageFileObjTest::WriteInternal( const void *buf, size_t bytes ) return -1; } - g_BytesUntilError -= min( g_BytesUntilError, (int) bytes ); + g_BytesUntilError -= std::min( g_BytesUntilError, (int) bytes ); } return bytes; diff --git a/src/tests/test_vector.cpp b/src/tests/test_vector.cpp index 41635e429f..21a8ce8392 100644 --- a/src/tests/test_vector.cpp +++ b/src/tests/test_vector.cpp @@ -14,8 +14,6 @@ #endif #define SCALE(x, l1, h1, l2, h2) (((x) - (l1)) * ((h2) - (l2)) / ((h1) - (l1)) + (l2)) -using namespace std; - // This requires that allocated memory be 16 byte aligned. Apple's new // (and malloc) ensures this but most others only ensure that the // memory is type size aligned. Hack in posix_memalign. We could also @@ -40,7 +38,7 @@ static void ScalarWrite( float *pDestBuf, const float *pSrcBuf, size_t iSize ) static void ScalarRead( int16_t *pDestBuf, const int32_t *pSrcBuf, unsigned iSize ) { for( unsigned iPos = 0; iPos < iSize; ++iPos ) - pDestBuf[iPos] = max( -32768, min(pSrcBuf[iPos]/256, 32767) ); + pDestBuf[iPos] = std::max( -32768, std::min(pSrcBuf[iPos]/256, 32767) ); } #endif