s/CArray<x,y>/vector<x>/g

This commit is contained in:
Glenn Maynard
2003-01-03 05:56:28 +00:00
parent fdc69927d9
commit 55e92e771d
46 changed files with 121 additions and 124 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ public:
virtual float TweenTime() const; virtual float TweenTime() const;
protected: protected:
CArray<Actor*,Actor*> m_SubActors; vector<Actor*> m_SubActors;
}; };
#endif #endif
+1 -1
View File
@@ -42,7 +42,7 @@ public:
void LosingFocus(); void LosingFocus();
protected: protected:
CArray<BGAnimationLayer*,BGAnimationLayer*> m_Layers; vector<BGAnimationLayer*> m_Layers;
float m_fFadeSeconds; float m_fFadeSeconds;
}; };
+1 -1
View File
@@ -39,7 +39,7 @@ int CompareBGSegments(const BGSegment &seg1, const BGSegment &seg2)
return seg1.m_fStartBeat < seg2.m_fStartBeat; return seg1.m_fStartBeat < seg2.m_fStartBeat;
} }
void SortBGSegmentArray( CArray<BGSegment,BGSegment&> &arrayBGSegments ) void SortBGSegmentArray( vector<BGSegment> &arrayBGSegments )
{ {
sort( arrayBGSegments.begin(), arrayBGSegments.end(), CompareBGSegments ); sort( arrayBGSegments.begin(), arrayBGSegments.end(), CompareBGSegments );
} }
+2 -2
View File
@@ -59,8 +59,8 @@ protected:
BGAnimation m_BGADanger; BGAnimation m_BGADanger;
// used in all BackgroundModes except OFF // used in all BackgroundModes except OFF
CArray<BGAnimation*,BGAnimation*> m_BGAnimations; vector<BGAnimation*> m_BGAnimations;
CArray<BGSegment,BGSegment&> m_aBGSegments; vector<BGSegment> m_aBGSegments;
int m_iCurBGSegment; // this increases as we move into new segments int m_iCurBGSegment; // this increases as we move into new segments
BGAnimation* GetCurBGA() { int index = m_aBGSegments[m_iCurBGSegment].m_iBGIndex; return m_BGAnimations[index]; }; BGAnimation* GetCurBGA() { int index = m_aBGSegments[m_iCurBGSegment].m_iBGIndex; return m_BGAnimations[index]; };
BGAnimation* m_pCurrentBGA; BGAnimation* m_pCurrentBGA;
+5 -5
View File
@@ -31,7 +31,7 @@ Course::Course()
m_iExtra = 0; m_iExtra = 0;
} }
void Course::LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs ) void Course::LoadFromCRSFile( CString sPath, vector<Song*> &apSongs )
{ {
MsdFile msd; MsdFile msd;
if( !msd.ReadFile(sPath) ) if( !msd.ReadFile(sPath) )
@@ -144,7 +144,7 @@ void Course::LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs )
} }
void Course::CreateEndlessCourseFromGroupAndDifficulty( CString sGroupName, Difficulty dc, CArray<Song*,Song*> &apSongsInGroup ) void Course::CreateEndlessCourseFromGroupAndDifficulty( CString sGroupName, Difficulty dc, vector<Song*> &apSongsInGroup )
{ {
m_bRepeat = true; m_bRepeat = true;
m_bRandomize = true; m_bRandomize = true;
@@ -241,8 +241,8 @@ void Course::AddStage( Song* pSong, CString sDescription, CString sModifiers )
/* When bShuffled is true, returns courses in the song ordering list. */ /* When bShuffled is true, returns courses in the song ordering list. */
void Course::GetSongAndNotesForCurrentStyle( void Course::GetSongAndNotesForCurrentStyle(
CArray<Song*,Song*>& apSongsOut, vector<Song*>& apSongsOut,
CArray<Notes*,Notes*>& apNotesOut, vector<Notes*>& apNotesOut,
CStringArray& asModifiersOut, CStringArray& asModifiersOut,
bool bShuffled ) bool bShuffled )
{ {
@@ -303,7 +303,7 @@ static int CompareCoursePointersByDifficulty(const Course* pCourse1, const Cours
return pCourse1->GetNumStages() < pCourse2->GetNumStages(); return pCourse1->GetNumStages() < pCourse2->GetNumStages();
} }
void SortCoursePointerArrayByDifficulty( CArray<Course*,Course*> &apCourses ) void SortCoursePointerArrayByDifficulty( vector<Course*> &apCourses )
{ {
sort( apCourses.begin(), apCourses.end(), CompareCoursePointersByDifficulty ); sort( apCourses.begin(), apCourses.end(), CompareCoursePointersByDifficulty );
} }
+4 -4
View File
@@ -50,11 +50,11 @@ public:
void GetSongOptions( SongOptions* pSO_out); void GetSongOptions( SongOptions* pSO_out);
int GetNumStages() const; int GetNumStages() const;
void LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs ); void LoadFromCRSFile( CString sPath, vector<Song*> &apSongs );
void CreateEndlessCourseFromGroupAndDifficulty( CString sGroupName, Difficulty dc, CArray<Song*,Song*> &apSongsInGroup ); void CreateEndlessCourseFromGroupAndDifficulty( CString sGroupName, Difficulty dc, vector<Song*> &apSongsInGroup );
void AddStage( Song* pSong, CString sDescription, CString sModifiers ); void AddStage( Song* pSong, CString sDescription, CString sModifiers );
void GetSongAndNotesForCurrentStyle( CArray<Song*,Song*>& apSongsOut, CArray<Notes*,Notes*>& apNotesOut, CStringArray& asModifiersOut, bool bShuffled ); void GetSongAndNotesForCurrentStyle( vector<Song*>& apSongsOut, vector<Notes*>& apNotesOut, CStringArray& asModifiersOut, bool bShuffled );
RageColor GetColor(); RageColor GetColor();
private: private:
@@ -62,7 +62,7 @@ private:
}; };
void SortCoursePointerArrayByDifficulty( CArray<Course*,Course*> &apCourses ); void SortCoursePointerArrayByDifficulty( vector<Course*> &apCourses );
#endif #endif
+4 -4
View File
@@ -1476,7 +1476,7 @@ const StyleDef* GameManager::GetStyleDefForStyle( Style s )
return &g_StyleDefs[ s ]; return &g_StyleDefs[ s ];
} }
void GameManager::GetGameplayStylesForGame( Game game, CArray<Style,Style>& aStylesAddTo, bool editor ) void GameManager::GetGameplayStylesForGame( Game game, vector<Style>& aStylesAddTo, bool editor )
{ {
for( int s=0; s<NUM_STYLES; s++ ) { for( int s=0; s<NUM_STYLES; s++ ) {
if( g_StyleDefs[s].m_Game != game) if( g_StyleDefs[s].m_Game != game)
@@ -1490,14 +1490,14 @@ void GameManager::GetGameplayStylesForGame( Game game, CArray<Style,Style>& aSty
} }
} }
void GameManager::GetModesChoicesForGame( Game game, CArray<ModeChoice*,ModeChoice*>& apChoicesAddTo ) void GameManager::GetModesChoicesForGame( Game game, vector<ModeChoice*>& apChoicesAddTo )
{ {
for( int s=0; s<NUM_MODE_CHOICES; s++ ) for( int s=0; s<NUM_MODE_CHOICES; s++ )
if( g_ModeChoices[s].game == game) if( g_ModeChoices[s].game == game)
apChoicesAddTo.push_back( &g_ModeChoices[s] ); apChoicesAddTo.push_back( &g_ModeChoices[s] );
} }
void GameManager::GetNotesTypesForGame( Game game, CArray<NotesType,NotesType>& aNotesTypeAddTo ) void GameManager::GetNotesTypesForGame( Game game, vector<NotesType>& aNotesTypeAddTo )
{ {
for( int nt=0; nt<NUM_NOTES_TYPES; nt++ ) for( int nt=0; nt<NUM_NOTES_TYPES; nt++ )
{ {
@@ -1621,7 +1621,7 @@ CString GameManager::GetPathTo( const int col, CString sElementName ) // looks i
return DerefRedir(arrayPossibleFileNames[0]); return DerefRedir(arrayPossibleFileNames[0]);
} }
void GameManager::GetEnabledGames( CArray<Game,Game>& aGamesOut ) void GameManager::GetEnabledGames( vector<Game>& aGamesOut )
{ {
for( int g=0; g<NUM_GAMES; g++ ) for( int g=0; g<NUM_GAMES; g++ )
{ {
+4 -4
View File
@@ -28,9 +28,9 @@ public:
GameDef* GetGameDefForGame( Game g ); GameDef* GetGameDefForGame( Game g );
const StyleDef* GetStyleDefForStyle( Style s ); const StyleDef* GetStyleDefForStyle( Style s );
void GetGameplayStylesForGame( Game game, CArray<Style,Style>& aStylesAddTo, bool editor=false ); void GetGameplayStylesForGame( Game game, vector<Style>& aStylesAddTo, bool editor=false );
void GetModesChoicesForGame( Game game, CArray<ModeChoice*,ModeChoice*>& apChoicesAddTo ); void GetModesChoicesForGame( Game game, vector<ModeChoice*>& apChoicesAddTo );
void GetNotesTypesForGame( Game game, CArray<NotesType,NotesType>& aNotesTypeAddTo ); // only look at edit-specific styles void GetNotesTypesForGame( Game game, vector<NotesType>& aNotesTypeAddTo ); // only look at edit-specific styles
// void GetGameNames( CStringArray &AddTo ); // void GetGameNames( CStringArray &AddTo );
// bool DoesGameExist( CString sGameName ); // bool DoesGameExist( CString sGameName );
@@ -52,7 +52,7 @@ public:
RageColor GetMetricC( CString sClassName, CString sValueName ); RageColor GetMetricC( CString sClassName, CString sValueName );
void GetEnabledGames( CArray<Game,Game>& aGamesOut ); void GetEnabledGames( vector<Game>& aGamesOut );
static int NotesTypeToNumTracks( NotesType nt ); static int NotesTypeToNumTracks( NotesType nt );
static NotesType StringToNotesType( CString sNotesType ); static NotesType StringToNotesType( CString sNotesType );
+1 -1
View File
@@ -126,7 +126,7 @@ public:
// //
// Session Statistics: Arcade: 3 songs. Oni/Endless: one course. // Session Statistics: Arcade: 3 songs. Oni/Endless: one course.
// //
CArray<Song*,Song*> m_apSongsPlayed; // an array of completed songs. vector<Song*> m_apSongsPlayed; // an array of completed songs.
// This is useful for the final evaluation screen, // This is useful for the final evaluation screen,
// and used to calculate the time into a course // and used to calculate the time into a course
+1 -1
View File
@@ -10,7 +10,7 @@ const unsigned MAX_GROUPS_ONSCREEN = 8;
class GroupList: public ActorFrame { class GroupList: public ActorFrame {
Sprite m_sprButton[MAX_GROUPS_ONSCREEN]; Sprite m_sprButton[MAX_GROUPS_ONSCREEN];
BitmapText m_screenLabels[MAX_GROUPS_ONSCREEN]; BitmapText m_screenLabels[MAX_GROUPS_ONSCREEN];
CArray<CString,CString> m_textLabels; vector<CString> m_textLabels;
/* Currently selected label. */ /* Currently selected label. */
unsigned m_iSelection; unsigned m_iSelection;
+1 -1
View File
@@ -34,7 +34,7 @@ public:
InputEventType type; InputEventType type;
}; };
typedef CArray<InputEvent, InputEvent> InputEventArray; typedef vector<InputEvent> InputEventArray;
class InputFilter class InputFilter
{ {
+1 -1
View File
@@ -34,7 +34,7 @@ protected:
GameButton button; GameButton button;
float fTime; float fTime;
}; };
CArray<GameButtonAndTime,GameButtonAndTime> m_aQueue[MAX_GAME_CONTROLLERS]; vector<GameButtonAndTime> m_aQueue[MAX_GAME_CONTROLLERS];
}; };
+2 -2
View File
@@ -124,7 +124,7 @@ void MenuElements::TweenTopLayerOnScreen(float tm)
if(tm == -1) if(tm == -1)
tm = MENU_ELEMENTS_TWEEN_TIME; tm = MENU_ELEMENTS_TWEEN_TIME;
CArray<Actor*,Actor*> apActorsInTopFrame; vector<Actor*> apActorsInTopFrame;
apActorsInTopFrame.push_back( &m_sprTopEdge ); apActorsInTopFrame.push_back( &m_sprTopEdge );
apActorsInTopFrame.push_back( &m_sprStyleIcon ); apActorsInTopFrame.push_back( &m_sprStyleIcon );
apActorsInTopFrame.push_back( &m_MenuTimer ); apActorsInTopFrame.push_back( &m_MenuTimer );
@@ -162,7 +162,7 @@ void MenuElements::TweenTopLayerOffScreen(float tm)
bounce faster. SCREEN_WIDTH+SCREEN_WIDTH/2 would, but ignoring fOriginalX bounce faster. SCREEN_WIDTH+SCREEN_WIDTH/2 would, but ignoring fOriginalX
will make each component tween off at a different rate ... will make each component tween off at a different rate ...
-glenn -glenn
CArray<Actor*,Actor*> apActorsInTopFrame; vector<Actor*> apActorsInTopFrame;
apActorsInTopFrame.push_back( &m_sprTopEdge ); apActorsInTopFrame.push_back( &m_sprTopEdge );
apActorsInTopFrame.push_back( &m_sprStyleIcon ); apActorsInTopFrame.push_back( &m_sprStyleIcon );
apActorsInTopFrame.push_back( &m_MenuTimer ); apActorsInTopFrame.push_back( &m_MenuTimer );
+1 -1
View File
@@ -46,7 +46,7 @@ private:
int SongsExist; int SongsExist;
int SingleLoad; int SingleLoad;
CArray<Song*, Song*> arraySongs; vector<Song*> arraySongs;
}; };
#endif #endif
+1 -1
View File
@@ -34,7 +34,7 @@ void MusicList::AddGroup()
m_ContentsText.push_back(group()); m_ContentsText.push_back(group());
} }
void MusicList::AddSongsToGroup(const CArray<Song*,Song*> &Songs) void MusicList::AddSongsToGroup(const vector<Song*> &Songs)
{ {
// Generate what text will show in the contents for each group // Generate what text will show in the contents for each group
unsigned group = m_ContentsText.size()-1; unsigned group = m_ContentsText.size()-1;
+2 -2
View File
@@ -15,7 +15,7 @@ class MusicList : public ActorFrame {
int m_iNumSongsInGroup; int m_iNumSongsInGroup;
}; };
CArray<group,group> m_ContentsText; vector<group> m_ContentsText;
int NumGroups, CurGroup; int NumGroups, CurGroup;
@@ -26,7 +26,7 @@ public:
void AddGroup(); void AddGroup();
/* Add songs to the group that was just added. */ /* Add songs to the group that was just added. */
void AddSongsToGroup(const CArray<Song*,Song*> &songs); void AddSongsToGroup(const vector<Song*> &songs);
/* Set the displayed group number. */ /* Set the displayed group number. */
void SetGroupNo(int group); void SetGroupNo(int group);
+8 -8
View File
@@ -334,7 +334,7 @@ MusicWheel::MusicWheel()
// init m_mapGroupNameToBannerColor // init m_mapGroupNameToBannerColor
CArray<Song*, Song*> arraySongs = SONGMAN->m_pSongs; vector<Song*> arraySongs = SONGMAN->m_pSongs;
SortSongPointerArrayByGroup( arraySongs ); SortSongPointerArrayByGroup( arraySongs );
m_iSelection = 0; m_iSelection = 0;
@@ -392,7 +392,7 @@ MusicWheel::MusicWheel()
* This will select songs we can't use; we want the first song * This will select songs we can't use; we want the first song
* that's actually visible. Should we select out of wheel data? * that's actually visible. Should we select out of wheel data?
* -glenn */ * -glenn */
CArray<Song*, Song*> arraySongs; vector<Song*> arraySongs;
SONGMAN->GetSongsInGroup( asGroupNames[0], arraySongs ); SONGMAN->GetSongsInGroup( asGroupNames[0], arraySongs );
if( !arraySongs.empty() ) // still nothing selected if( !arraySongs.empty() ) // still nothing selected
GAMESTATE->m_pCurSong = arraySongs[0]; // select the first song GAMESTATE->m_pCurSong = arraySongs[0]; // select the first song
@@ -471,7 +471,7 @@ bool MusicWheel::SelectCourse( const Course *p )
return true; return true;
} }
void MusicWheel::GetSongList(CArray<Song*, Song*> &arraySongs, bool bRoulette ) void MusicWheel::GetSongList(vector<Song*> &arraySongs, bool bRoulette )
{ {
// copy only songs that have at least one Notes for the current GameMode // copy only songs that have at least one Notes for the current GameMode
for( unsigned i=0; i<SONGMAN->m_pSongs.size(); i++ ) for( unsigned i=0; i<SONGMAN->m_pSongs.size(); i++ )
@@ -489,7 +489,7 @@ void MusicWheel::GetSongList(CArray<Song*, Song*> &arraySongs, bool bRoulette )
continue; continue;
} }
CArray<Notes*, Notes*> arraySteps; vector<Notes*> arraySteps;
pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, arraySteps ); pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, arraySteps );
if( !arraySteps.empty() ) if( !arraySteps.empty() )
@@ -511,7 +511,7 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
/////////////////////////////////// ///////////////////////////////////
// Make an array of Song*, then sort them // Make an array of Song*, then sort them
/////////////////////////////////// ///////////////////////////////////
CArray<Song*, Song*> arraySongs; vector<Song*> arraySongs;
GetSongList(arraySongs, so == SORT_ROULETTE); GetSongList(arraySongs, so == SORT_ROULETTE);
@@ -634,7 +634,7 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
{ {
unsigned i; unsigned i;
CArray<Course*,Course*> apCourses; vector<Course*> apCourses;
switch( GAMESTATE->m_PlayMode ) switch( GAMESTATE->m_PlayMode )
{ {
case PLAY_MODE_ONI: case PLAY_MODE_ONI:
@@ -653,8 +653,8 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
Course* pCourse = apCourses[c]; Course* pCourse = apCourses[c];
// check that this course has at least one song playable in the current style // check that this course has at least one song playable in the current style
CArray<Song*,Song*> apSongs; vector<Song*> apSongs;
CArray<Notes*,Notes*> apNotes; vector<Notes*> apNotes;
CStringArray asModifiers; CStringArray asModifiers;
pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, false ); pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, false );
+2 -2
View File
@@ -41,7 +41,7 @@ enum WheelItemType { TYPE_SECTION, TYPE_SONG, TYPE_ROULETTE, TYPE_RANDOM, TYPE_C
struct WheelItemData struct WheelItemData
{ {
public: public:
WheelItemData() {}; // this is needed to use a CArray of these WheelItemData() {}
WheelItemData( WheelItemType wit, Song* pSong, const CString &sSectionName, Course* pCourse, const RageColor color ); WheelItemData( WheelItemType wit, Song* pSong, const CString &sSectionName, Course* pCourse, const RageColor color );
WheelItemType m_WheelItemType; WheelItemType m_WheelItemType;
@@ -123,7 +123,7 @@ public:
bool WheelIsLocked() { return (m_WheelState == STATE_LOCKED ? true : false); } bool WheelIsLocked() { return (m_WheelState == STATE_LOCKED ? true : false); }
protected: protected:
void GetSongList(CArray<Song*, Song*> &arraySongs, bool bRoulette ); void GetSongList(vector<Song*> &arraySongs, bool bRoulette );
void BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItems, SongSortOrder so ); void BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItems, SongSortOrder so );
void RebuildWheelItemDisplays(); void RebuildWheelItemDisplays();
void SetOpenGroup(CString group, SongSortOrder so = NUM_SORT_ORDERS); void SetOpenGroup(CString group, SongSortOrder so = NUM_SORT_ORDERS);
+2 -2
View File
@@ -853,7 +853,7 @@ void NoteDataUtil::Turn( NoteData &in, PlayerOptions::TurnType tt )
case PlayerOptions::TURN_SHUFFLE: case PlayerOptions::TURN_SHUFFLE:
case PlayerOptions::TURN_SUPER_SHUFFLE: // use this code to shuffle the HoldNotes case PlayerOptions::TURN_SUPER_SHUFFLE: // use this code to shuffle the HoldNotes
{ {
CArray<int,int> aiTracksLeftToMap; vector<int> aiTracksLeftToMap;
for( t=0; t<in.m_iNumTracks; t++ ) for( t=0; t<in.m_iNumTracks; t++ )
aiTracksLeftToMap.push_back( t ); aiTracksLeftToMap.push_back( t );
@@ -913,7 +913,7 @@ void NoteDataUtil::Turn( NoteData &in, PlayerOptions::TurnType tt )
continue; // no need to super shuffle this row continue; // no need to super shuffle this row
// shuffle this row // shuffle this row
CArray<int,int> aiTracksThatCouldHaveTapNotes; vector<int> aiTracksThatCouldHaveTapNotes;
for( t=0; t<in.m_iNumTracks; t++ ) for( t=0; t<in.m_iNumTracks; t++ )
if( in.GetTapNote(t, r) != TAP_HOLD ) // any point that isn't part of a hold if( in.GetTapNote(t, r) != TAP_HOLD ) // any point that isn't part of a hold
aiTracksThatCouldHaveTapNotes.push_back( t ); aiTracksThatCouldHaveTapNotes.push_back( t );
+1 -1
View File
@@ -37,7 +37,7 @@ protected:
Sprite m_sprTapParts; // for now, must be an even number of frames Sprite m_sprTapParts; // for now, must be an even number of frames
Sprite m_sprHoldParts; // for now, must be 8 frames Sprite m_sprHoldParts; // for now, must be 8 frames
CArray<RageColor,RageColor> m_colorTapTweens; vector<RageColor> m_colorTapTweens;
}; };
#endif #endif
+3 -3
View File
@@ -176,21 +176,21 @@ void NoteField::DrawPrimitives()
// //
// BPM text // BPM text
// //
CArray<BPMSegment,BPMSegment&> &aBPMSegments = GAMESTATE->m_pCurSong->m_BPMSegments; vector<BPMSegment> &aBPMSegments = GAMESTATE->m_pCurSong->m_BPMSegments;
for( i=0; i<aBPMSegments.size(); i++ ) for( i=0; i<aBPMSegments.size(); i++ )
DrawBPMText( aBPMSegments[i].m_fStartBeat, aBPMSegments[i].m_fBPM ); DrawBPMText( aBPMSegments[i].m_fStartBeat, aBPMSegments[i].m_fBPM );
// //
// Freeze text // Freeze text
// //
CArray<StopSegment,StopSegment&> &aStopSegments = GAMESTATE->m_pCurSong->m_StopSegments; vector<StopSegment> &aStopSegments = GAMESTATE->m_pCurSong->m_StopSegments;
for( i=0; i<aStopSegments.size(); i++ ) for( i=0; i<aStopSegments.size(); i++ )
DrawFreezeText( aStopSegments[i].m_fStartBeat, aStopSegments[i].m_fStopSeconds ); DrawFreezeText( aStopSegments[i].m_fStartBeat, aStopSegments[i].m_fStopSeconds );
// //
// BGChange text // BGChange text
// //
CArray<BackgroundChange,BackgroundChange&> &aBackgroundChanges = GAMESTATE->m_pCurSong->m_BackgroundChanges; vector<BackgroundChange> &aBackgroundChanges = GAMESTATE->m_pCurSong->m_BackgroundChanges;
for( i=0; i<aBackgroundChanges.size(); i++ ) for( i=0; i<aBackgroundChanges.size(); i++ )
DrawBGChangeText( aBackgroundChanges[i].m_fStartBeat, aBackgroundChanges[i].m_sBGName ); DrawBGChangeText( aBackgroundChanges[i].m_fStartBeat, aBackgroundChanges[i].m_sBGName );
+1 -1
View File
@@ -227,7 +227,7 @@ bool CompareNotesPointersByDifficulty(const Notes *pNotes1, const Notes *pNotes2
return CompareNotesPointersByMeter( pNotes1, pNotes2 ); return CompareNotesPointersByMeter( pNotes1, pNotes2 );
} }
void SortNotesArrayByDifficulty( CArray<Notes*,Notes*> &arraySteps ) void SortNotesArrayByDifficulty( vector<Notes*> &arraySteps )
{ {
sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByDifficulty ); sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByDifficulty );
} }
+1 -1
View File
@@ -94,6 +94,6 @@ protected:
}; };
bool CompareNotesPointersByDifficulty(const Notes *pNotes1, const Notes *pNotes2); bool CompareNotesPointersByDifficulty(const Notes *pNotes1, const Notes *pNotes2);
void SortNotesArrayByDifficulty( CArray<Notes*,Notes*> &arrayNotess ); void SortNotesArrayByDifficulty( vector<Notes*> &arrayNotess );
#endif #endif
+2 -2
View File
@@ -153,7 +153,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
int iTrackNum = atoi( value_name.substr(4,2).c_str() ); int iTrackNum = atoi( value_name.substr(4,2).c_str() );
CString &sNoteData = value_data; CString &sNoteData = value_data;
CArray<bool, bool&> arrayNotes; vector<bool> arrayNotes;
for( int i=0; i+1<sNoteData.GetLength(); i+=2 ) for( int i=0; i+1<sNoteData.GetLength(); i+=2 )
{ {
@@ -352,7 +352,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
int iBMSTrackNo = atoi( value_name.substr(4,2).c_str() ); int iBMSTrackNo = atoi( value_name.substr(4,2).c_str() );
CString sNoteData = value_data; CString sNoteData = value_data;
CArray<int, int> arrayNotes; vector<int> arrayNotes;
for( int i=0; i+1<sNoteData.GetLength(); i+=2 ) for( int i=0; i+1<sNoteData.GetLength(); i+=2 )
{ {
+1 -1
View File
@@ -103,7 +103,7 @@ protected:
int m_iTextureWidth, m_iTextureHeight; // dimensions of the texture in memory 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_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 int m_iFramesWide, m_iFramesHigh; // The number of frames of animation in each row and column of this texture
CArray<RectF,RectF> m_TextureCoordRects; // size = m_iFramesWide * m_iFramesHigh vector<RectF> m_TextureCoordRects; // size = m_iFramesWide * m_iFramesHigh
virtual void CreateFrameRects(); virtual void CreateFrameRects();
virtual void GetFrameDimensionsFromFileName( CString sPath, int* puFramesWide, int* puFramesHigh ) const; virtual void GetFrameDimensionsFromFileName( CString sPath, int* puFramesWide, int* puFramesHigh ) const;
+2 -2
View File
@@ -341,7 +341,7 @@ public:
struct CacheEntry { struct CacheEntry {
CStringArray files; CStringArray files;
CStringArray exts; CStringArray exts;
CArray<int,int> Attributes; vector<int> Attributes;
CString dir; CString dir;
}; };
@@ -354,7 +354,7 @@ private:
CacheEntry *LoadDirCache( const CString &sPath ); CacheEntry *LoadDirCache( const CString &sPath );
/* We don't have too many directories ... XXX - glenn */ /* We don't have too many directories ... XXX - glenn */
CArray<CacheEntry *,CacheEntry *> directory_cache; vector<CacheEntry *> directory_cache;
} static DirectoryCache; } static DirectoryCache;
void DirCache::FlushCache() void DirCache::FlushCache()
+1 -1
View File
@@ -39,7 +39,7 @@ private:
bool LoadSound( CString sSoundFilePath ); bool LoadSound( CString sSoundFilePath );
CArray<RageSound*, RageSound*> m_pSamples; vector<RageSound*> m_pSamples;
int m_iIndexLastPlayed; int m_iIndexLastPlayed;
}; };
+1 -1
View File
@@ -49,7 +49,7 @@ protected:
ScreenMessage SM; ScreenMessage SM;
float fDelayRemaining; float fDelayRemaining;
}; };
CArray<QueuedScreenMessage, QueuedScreenMessage&> m_QueuedMessages; vector<QueuedScreenMessage> m_QueuedMessages;
public: public:
+2 -2
View File
@@ -692,7 +692,7 @@ void ScreenEvaluation::TweenOnScreen()
{ {
unsigned i; unsigned i;
CArray<Actor*,Actor*> apActorsInBonusOrStageInfo; vector<Actor*> apActorsInBonusOrStageInfo;
apActorsInBonusOrStageInfo.push_back( &m_sprBonusFrame[p] ); apActorsInBonusOrStageInfo.push_back( &m_sprBonusFrame[p] );
for( i=0; i<NUM_RADAR_VALUES; i++ ) for( i=0; i<NUM_RADAR_VALUES; i++ )
{ {
@@ -711,7 +711,7 @@ void ScreenEvaluation::TweenOnScreen()
apActorsInBonusOrStageInfo[i]->SetTweenX( fOriginalX ); apActorsInBonusOrStageInfo[i]->SetTweenX( fOriginalX );
} }
CArray<Actor*,Actor*> apActorsInGradeOrPercentFrame; vector<Actor*> apActorsInGradeOrPercentFrame;
apActorsInGradeOrPercentFrame.push_back( &m_sprBonusFrame[p] ); apActorsInGradeOrPercentFrame.push_back( &m_sprBonusFrame[p] );
apActorsInGradeOrPercentFrame.push_back( &m_sprGradeFrame[p] ); apActorsInGradeOrPercentFrame.push_back( &m_sprGradeFrame[p] );
apActorsInGradeOrPercentFrame.push_back( &m_Grades[p] ); apActorsInGradeOrPercentFrame.push_back( &m_Grades[p] );
+1 -1
View File
@@ -51,7 +51,7 @@ protected:
MusicBannerWheel m_MusicBannerWheel; MusicBannerWheel m_MusicBannerWheel;
MenuElements m_Menu; MenuElements m_Menu;
FootMeter m_FootMeter[NUM_PLAYERS]; FootMeter m_FootMeter[NUM_PLAYERS];
CArray<Notes*, Notes*> m_arrayNotes[NUM_PLAYERS]; vector<Notes*> m_arrayNotes[NUM_PLAYERS];
int m_iSelection[NUM_PLAYERS]; int m_iSelection[NUM_PLAYERS];
bool m_bGoToOptions; bool m_bGoToOptions;
bool m_bMadeChoice; bool m_bMadeChoice;
+8 -8
View File
@@ -142,8 +142,8 @@ ScreenGameplay::ScreenGameplay()
GAMESTATE->m_iPossibleDancePoints[p] = 0; GAMESTATE->m_iPossibleDancePoints[p] = 0;
Course* pCourse = GAMESTATE->m_pCurCourse; Course* pCourse = GAMESTATE->m_pCurCourse;
CArray<Song*,Song*> apSongs; vector<Song*> apSongs;
CArray<Notes*,Notes*> apNotes; vector<Notes*> apNotes;
CStringArray asModifiers; CStringArray asModifiers;
pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, true ); pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, true );
@@ -502,8 +502,8 @@ bool ScreenGameplay::IsLastSong()
if( pCourse->m_bRepeat ) if( pCourse->m_bRepeat )
return false; return false;
CArray<Song*,Song*> apSongs; vector<Song*> apSongs;
CArray<Notes*,Notes*> apNotes; vector<Notes*> apNotes;
CStringArray asModifiers; CStringArray asModifiers;
pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, true ); pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, true );
@@ -536,8 +536,8 @@ void ScreenGameplay::LoadNextSong( bool bFirstLoad )
GAMESTATE->m_SelectedOptions[p] = GAMESTATE->m_PlayerOptions[p]; GAMESTATE->m_SelectedOptions[p] = GAMESTATE->m_PlayerOptions[p];
} }
Course* pCourse = GAMESTATE->m_pCurCourse; Course* pCourse = GAMESTATE->m_pCurCourse;
CArray<Song*,Song*> apSongs; vector<Song*> apSongs;
CArray<Notes*,Notes*> apNotes; vector<Notes*> apNotes;
CStringArray asModifiers; CStringArray asModifiers;
pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, true ); pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, true );
@@ -1501,7 +1501,7 @@ void ScreenGameplay::TweenOnScreen()
{ {
unsigned i, p; unsigned i, p;
CArray<Actor*,Actor*> apActorsInLifeFrame; vector<Actor*> apActorsInLifeFrame;
apActorsInLifeFrame.push_back( &m_sprLifeFrame ); apActorsInLifeFrame.push_back( &m_sprLifeFrame );
for( p=0; p<NUM_PLAYERS; p++ ) for( p=0; p<NUM_PLAYERS; p++ )
apActorsInLifeFrame.push_back( m_pLifeMeter[p] ); apActorsInLifeFrame.push_back( m_pLifeMeter[p] );
@@ -1519,7 +1519,7 @@ void ScreenGameplay::TweenOnScreen()
} }
CArray<Actor*,Actor*> apActorsInScoreFrame; vector<Actor*> apActorsInScoreFrame;
apActorsInScoreFrame.push_back( &m_sprScoreFrame ); apActorsInScoreFrame.push_back( &m_sprScoreFrame );
for( p=0; p<NUM_PLAYERS; p++ ) for( p=0; p<NUM_PLAYERS; p++ )
{ {
+2 -2
View File
@@ -46,8 +46,8 @@ public:
void RefreshCreditsMessages(); void RefreshCreditsMessages();
private: private:
CArray<Screen*, Screen*> m_ScreenStack; vector<Screen*> m_ScreenStack;
CArray<Screen*, Screen*> m_ScreensToDelete; vector<Screen*> m_ScreensToDelete;
Screen *m_ScreenBuffered; Screen *m_ScreenBuffered;
BitmapText m_textStats; BitmapText m_textStats;
+1 -1
View File
@@ -149,7 +149,7 @@ ScreenMusicScroll::ScreenMusicScroll()
this->AddChild( &m_Background ); this->AddChild( &m_Background );
CArray<Song*, Song*> arraySongs = SONGMAN->m_pSongs; vector<Song*> arraySongs = SONGMAN->m_pSongs;
SortSongPointerArrayByTitle( arraySongs ); SortSongPointerArrayByTitle( arraySongs );
m_iNumLines = 0; m_iNumLines = 0;
+3 -3
View File
@@ -42,7 +42,7 @@ ScreenSelectGame::ScreenSelectGame() :
LOG->Trace( "ScreenSelectGame::ScreenSelectGame()" ); LOG->Trace( "ScreenSelectGame::ScreenSelectGame()" );
/* populate g_SelectGameLines */ /* populate g_SelectGameLines */
CArray<Game,Game> aGames; vector<Game> aGames;
GAMEMAN->GetEnabledGames( aGames ); GAMEMAN->GetEnabledGames( aGames );
unsigned i; unsigned i;
for( i=0; i<aGames.size(); i++ ) for( i=0; i<aGames.size(); i++ )
@@ -70,7 +70,7 @@ void ScreenSelectGame::ImportOptions()
/* Search the list of games for the currently active game. If it's /* Search the list of games for the currently active game. If it's
* not there, we might have set a game and then the user removed its * not there, we might have set a game and then the user removed its
* note skins; reset it to the first available. */ * note skins; reset it to the first available. */
CArray<Game,Game> aGames; vector<Game> aGames;
GAMEMAN->GetEnabledGames( aGames ); GAMEMAN->GetEnabledGames( aGames );
ASSERT(!aGames.empty()); ASSERT(!aGames.empty());
@@ -89,7 +89,7 @@ void ScreenSelectGame::ExportOptions()
// Switch the current style to the frist style of the selected game // Switch the current style to the frist style of the selected game
int iSelection = m_iSelectedOption[0][SG_GAME]; int iSelection = m_iSelectedOption[0][SG_GAME];
CArray<Game,Game> aGames; vector<Game> aGames;
GAMEMAN->GetEnabledGames( aGames ); GAMEMAN->GetEnabledGames( aGames );
Game game = aGames[iSelection]; Game game = aGames[iSelection];
+2 -2
View File
@@ -83,7 +83,7 @@ ScreenSelectGroup::ScreenSelectGroup()
// This will simply the code a bit, and fix a weird case that // This will simply the code a bit, and fix a weird case that
// causes a crash when there are duplicate song names. // causes a crash when there are duplicate song names.
CArray<Song*, Song*> aAllSongs = SONGMAN->m_pSongs; vector<Song*> aAllSongs = SONGMAN->m_pSongs;
// Filter out Songs that can't be played by the current Style // Filter out Songs that can't be played by the current Style
for( j=aAllSongs.size()-1; j>=0; j-- ) // foreach Song, back to front for( j=aAllSongs.size()-1; j>=0; j-- ) // foreach Song, back to front
@@ -112,7 +112,7 @@ ScreenSelectGroup::ScreenSelectGroup()
// Add songs to the MusicList. // Add songs to the MusicList.
for( unsigned g=0; g < asGroupNames.size(); g++ ) /* for each group */ for( unsigned g=0; g < asGroupNames.size(); g++ ) /* for each group */
{ {
CArray<Song*,Song*> aSongsInGroup; vector<Song*> aSongsInGroup;
/* find all songs */ /* find all songs */
for( i=0; i<aAllSongs.size(); i++ ) // foreach Song for( i=0; i<aAllSongs.size(); i++ ) // foreach Song
{ {
+1 -1
View File
@@ -58,7 +58,7 @@ protected:
Sprite m_Infotext[MAX_MODE_CHOICES]; Sprite m_Infotext[MAX_MODE_CHOICES];
CArray<ModeChoice*,ModeChoice*> m_apPossibleModeChoices; vector<ModeChoice*> m_apPossibleModeChoices;
ScrollingList m_ScrollingList; ScrollingList m_ScrollingList;
void RefreshModeChoices(); void RefreshModeChoices();
+2 -2
View File
@@ -334,7 +334,7 @@ void ScreenSelectMusic::TweenOffScreen()
m_MusicSortDisplay.FadeOff( 0, "fade", TWEEN_TIME ); m_MusicSortDisplay.FadeOff( 0, "fade", TWEEN_TIME );
CArray<Actor*,Actor*> apActorsInScore; vector<Actor*> apActorsInScore;
for( p=0; p<NUM_PLAYERS; p++ ) for( p=0; p<NUM_PLAYERS; p++ )
{ {
apActorsInScore.push_back( &m_sprHighScoreFrame[p] ); apActorsInScore.push_back( &m_sprHighScoreFrame[p] );
@@ -354,7 +354,7 @@ void ScreenSelectMusic::TweenScoreOnAndOffAfterChangeSort()
if( !SCORE_CONNECTED_TO_MUSIC_WHEEL ) if( !SCORE_CONNECTED_TO_MUSIC_WHEEL )
return; // do nothing return; // do nothing
CArray<Actor*,Actor*> apActorsInScore; vector<Actor*> apActorsInScore;
for( int p=0; p<NUM_PLAYERS; p++ ) for( int p=0; p<NUM_PLAYERS; p++ )
{ {
apActorsInScore.push_back( &m_sprHighScoreFrame[p] ); apActorsInScore.push_back( &m_sprHighScoreFrame[p] );
+1 -1
View File
@@ -54,7 +54,7 @@ protected:
void UpdateOptionsDisplays(); void UpdateOptionsDisplays();
CArray<Notes*, Notes*> m_arrayNotes[NUM_PLAYERS]; vector<Notes*> m_arrayNotes[NUM_PLAYERS];
int m_iSelection[NUM_PLAYERS]; int m_iSelection[NUM_PLAYERS];
MenuElements m_Menu; MenuElements m_Menu;
+1 -1
View File
@@ -59,7 +59,7 @@ private:
RandomSample m_soundSelect; RandomSample m_soundSelect;
int m_iSelection; int m_iSelection;
CArray<Style,Style> m_aPossibleStyles; vector<Style> m_aPossibleStyles;
Style GetSelectedStyle() { return m_aPossibleStyles[m_iSelection]; }; Style GetSelectedStyle() { return m_aPossibleStyles[m_iSelection]; };
}; };
+2 -2
View File
@@ -44,8 +44,8 @@ protected:
float m_fSelectionLag; float m_fSelectionLag;
int m_iSpacing; int m_iSpacing;
int m_iNumVisible; int m_iNumVisible;
CArray<Sprite*,Sprite*> m_apSprites; // stores the list of elements (left to right) vector<Sprite*> m_apSprites; // stores the list of elements (left to right)
CArray<CroppedSprite*,CroppedSprite*> m_apCSprites; // stores the list of elements (left to right) vector<CroppedSprite*> m_apCSprites; // stores the list of elements (left to right)
}; };
#endif #endif
+15 -15
View File
@@ -46,7 +46,7 @@ static int CompareBPMSegments(const BPMSegment &seg1, const BPMSegment &seg2)
return seg1.m_fStartBeat < seg2.m_fStartBeat; return seg1.m_fStartBeat < seg2.m_fStartBeat;
} }
void SortBPMSegmentsArray( CArray<BPMSegment,BPMSegment&> &arrayBPMSegments ) void SortBPMSegmentsArray( vector<BPMSegment> &arrayBPMSegments )
{ {
sort( arrayBPMSegments.begin(), arrayBPMSegments.end(), CompareBPMSegments ); sort( arrayBPMSegments.begin(), arrayBPMSegments.end(), CompareBPMSegments );
} }
@@ -56,7 +56,7 @@ static int CompareStopSegments(const StopSegment &seg1, const StopSegment &seg2)
return seg1.m_fStartBeat < seg2.m_fStartBeat; return seg1.m_fStartBeat < seg2.m_fStartBeat;
} }
void SortStopSegmentsArray( CArray<StopSegment,StopSegment&> &arrayStopSegments ) void SortStopSegmentsArray( vector<StopSegment> &arrayStopSegments )
{ {
sort( arrayStopSegments.begin(), arrayStopSegments.end(), CompareStopSegments ); sort( arrayStopSegments.begin(), arrayStopSegments.end(), CompareStopSegments );
} }
@@ -66,7 +66,7 @@ int CompareBackgroundChanges(const BackgroundChange &seg1, const BackgroundChang
return seg1.m_fStartBeat < seg2.m_fStartBeat; return seg1.m_fStartBeat < seg2.m_fStartBeat;
} }
void SortBackgroundChangesArray( CArray<BackgroundChange,BackgroundChange&> &arrayBackgroundChanges ) void SortBackgroundChangesArray( vector<BackgroundChange> &arrayBackgroundChanges )
{ {
sort( arrayBackgroundChanges.begin(), arrayBackgroundChanges.end(), CompareBackgroundChanges ); sort( arrayBackgroundChanges.begin(), arrayBackgroundChanges.end(), CompareBackgroundChanges );
} }
@@ -551,7 +551,7 @@ void Song::TidyUpData()
// a NotesType and it's "smaniac", then convert it to "Challenge" // a NotesType and it's "smaniac", then convert it to "Challenge"
for( NotesType nt=(NotesType)0; nt<NUM_NOTES_TYPES; nt=(NotesType)(nt+1) ) for( NotesType nt=(NotesType)0; nt<NUM_NOTES_TYPES; nt=(NotesType)(nt+1) )
{ {
CArray<Notes*,Notes*> apNotes; vector<Notes*> apNotes;
GetNotesThatMatch( nt, apNotes ); GetNotesThatMatch( nt, apNotes );
if( apNotes.size() == 1 ) if( apNotes.size() == 1 )
{ {
@@ -601,7 +601,7 @@ void Song::ReCalulateRadarValuesAndLastBeat()
} }
void Song::GetNotesThatMatch( NotesType nt, CArray<Notes*, Notes*>& arrayAddTo ) const void Song::GetNotesThatMatch( NotesType nt, vector<Notes*>& arrayAddTo ) const
{ {
for( unsigned i=0; i<m_apNotes.size(); i++ ) // for each of the Song's Notes for( unsigned i=0; i<m_apNotes.size(); i++ ) // for each of the Song's Notes
{ {
@@ -712,7 +712,7 @@ void Song::AddAutoGenNotes()
for( NotesType nt=(NotesType)0; nt<NUM_NOTES_TYPES; nt=(NotesType)(nt+1) ) for( NotesType nt=(NotesType)0; nt<NUM_NOTES_TYPES; nt=(NotesType)(nt+1) )
{ {
CArray<Notes*,Notes*> apNotes; vector<Notes*> apNotes;
this->GetNotesThatMatch( nt, apNotes ); this->GetNotesThatMatch( nt, apNotes );
if(apNotes.empty() || apNotes[0]->IsAutogen()) if(apNotes.empty() || apNotes[0]->IsAutogen())
@@ -751,7 +751,7 @@ void Song::AutoGen( NotesType ntTo, NotesType ntFrom )
Grade Song::GetGradeForDifficulty( const StyleDef *st, int p, Difficulty dc ) const Grade Song::GetGradeForDifficulty( const StyleDef *st, int p, Difficulty dc ) const
{ {
// return max grade of notes in difficulty class // return max grade of notes in difficulty class
CArray<Notes*, Notes*> aNotes; vector<Notes*> aNotes;
this->GetNotesThatMatch( st->m_NotesType, aNotes ); this->GetNotesThatMatch( st->m_NotesType, aNotes );
SortNotesArrayByDifficulty( aNotes ); SortNotesArrayByDifficulty( aNotes );
@@ -804,15 +804,15 @@ int CompareSongPointersByTitle(const Song *pSong1, const Song *pSong2)
return pSong1->GetSongFilePath().CompareNoCase(pSong2->GetSongFilePath()) < 0; return pSong1->GetSongFilePath().CompareNoCase(pSong2->GetSongFilePath()) < 0;
} }
void SortSongPointerArrayByTitle( CArray<Song*, Song*> &arraySongPointers ) void SortSongPointerArrayByTitle( vector<Song*> &arraySongPointers )
{ {
sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByTitle ); sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByTitle );
} }
int CompareSongPointersByDifficulty(const Song *pSong1, const Song *pSong2) int CompareSongPointersByDifficulty(const Song *pSong1, const Song *pSong2)
{ {
CArray<Notes*,Notes*> aNotes1; vector<Notes*> aNotes1;
CArray<Notes*,Notes*> aNotes2; vector<Notes*> aNotes2;
pSong1->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, aNotes1 ); pSong1->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, aNotes1 );
pSong2->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, aNotes2 ); pSong2->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, aNotes2 );
@@ -833,7 +833,7 @@ int CompareSongPointersByDifficulty(const Song *pSong1, const Song *pSong2)
return CompareSongPointersByTitle( pSong1, pSong2 ); return CompareSongPointersByTitle( pSong1, pSong2 );
} }
void SortSongPointerArrayByDifficulty( CArray<Song*, Song*> &arraySongPointers ) void SortSongPointerArrayByDifficulty( vector<Song*> &arraySongPointers )
{ {
sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByDifficulty ); sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByDifficulty );
} }
@@ -852,7 +852,7 @@ bool CompareSongPointersByBPM(const Song *pSong1, const Song *pSong2)
return CompareCStringsAsc( pSong1->GetSongFilePath(), pSong2->GetSongFilePath() ); return CompareCStringsAsc( pSong1->GetSongFilePath(), pSong2->GetSongFilePath() );
} }
void SortSongPointerArrayByBPM( CArray<Song*, Song*> &arraySongPointers ) void SortSongPointerArrayByBPM( vector<Song*> &arraySongPointers )
{ {
sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByBPM ); sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByBPM );
} }
@@ -870,7 +870,7 @@ int CompareSongPointersByArtist(const Song *pSong1, const Song *pSong2)
return CompareSongPointersByTitle( pSong1, pSong2 ); return CompareSongPointersByTitle( pSong1, pSong2 );
} }
void SortSongPointerArrayByArtist( CArray<Song*, Song*> &arraySongPointers ) void SortSongPointerArrayByArtist( vector<Song*> &arraySongPointers )
{ {
sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByArtist ); sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByArtist );
} }
@@ -889,7 +889,7 @@ int CompareSongPointersByGroup(const Song *pSong1, const Song *pSong2)
return CompareSongPointersByDifficulty( pSong1, pSong2 ); return CompareSongPointersByDifficulty( pSong1, pSong2 );
} }
void SortSongPointerArrayByGroup( CArray<Song*, Song*> &arraySongPointers ) void SortSongPointerArrayByGroup( vector<Song*> &arraySongPointers )
{ {
sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByGroup ); sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByGroup );
} }
@@ -906,7 +906,7 @@ int CompareSongPointersByMostPlayed(const Song *pSong1, const Song *pSong2)
return CompareSongPointersByTitle( pSong1, pSong2 ); return CompareSongPointersByTitle( pSong1, pSong2 );
} }
void SortSongPointerArrayByMostPlayed( CArray<Song*, Song*> &arraySongPointers ) void SortSongPointerArrayByMostPlayed( vector<Song*> &arraySongPointers )
{ {
sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByMostPlayed ); sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByMostPlayed );
} }
+4 -4
View File
@@ -417,7 +417,7 @@ RageColor SongManager::GetSongColor( const Song* pSong )
} }
void SongManager::GetSongsInGroup( const CString sGroupName, CArray<Song*, Song*> &AddTo ) void SongManager::GetSongsInGroup( const CString sGroupName, vector<Song*> &AddTo )
{ {
for( unsigned i=0; i<m_pSongs.size(); i++ ) for( unsigned i=0; i<m_pSongs.size(); i++ )
{ {
@@ -472,7 +472,7 @@ void SongManager::InitCoursesFromDisk()
for( g=0; g<saGroupNames.size(); g++ ) // foreach Group for( g=0; g<saGroupNames.size(); g++ ) // foreach Group
{ {
CString sGroupName = saGroupNames[g]; CString sGroupName = saGroupNames[g];
CArray<Song*, Song*> apGroupSongs; vector<Song*> apGroupSongs;
GetSongsInGroup( sGroupName, apGroupSongs ); GetSongsInGroup( sGroupName, apGroupSongs );
for( Difficulty dc=DIFFICULTY_EASY; dc<=DIFFICULTY_HARD; dc=Difficulty(dc+1) ) // foreach Difficulty for( Difficulty dc=DIFFICULTY_EASY; dc<=DIFFICULTY_HARD; dc=Difficulty(dc+1) ) // foreach Difficulty
@@ -559,13 +559,13 @@ void SongManager::GetExtraStageInfo( bool bExtra2, CString sPreferredGroup, cons
Song* pExtra2Song = NULL; // a medium-hard Song and Notes. Use this for extra stage 2. Song* pExtra2Song = NULL; // a medium-hard Song and Notes. Use this for extra stage 2.
Notes* pExtra2Notes = NULL; Notes* pExtra2Notes = NULL;
CArray<Song*,Song*> apSongs; vector<Song*> apSongs;
SONGMAN->GetSongsInGroup( GAMESTATE->m_sPreferredGroup, apSongs ); SONGMAN->GetSongsInGroup( GAMESTATE->m_sPreferredGroup, apSongs );
for( unsigned s=0; s<apSongs.size(); s++ ) // foreach song for( unsigned s=0; s<apSongs.size(); s++ ) // foreach song
{ {
Song* pSong = apSongs[s]; Song* pSong = apSongs[s];
CArray<Notes*,Notes*> apNotes; vector<Notes*> apNotes;
pSong->GetNotesThatMatch( sd->m_NotesType, apNotes ); pSong->GetNotesThatMatch( sd->m_NotesType, apNotes );
for( unsigned n=0; n<apNotes.size(); n++ ) // foreach Notes for( unsigned n=0; n<apNotes.size(); n++ ) // foreach Notes
{ {
+5 -5
View File
@@ -26,7 +26,7 @@ public:
SongManager( LoadingWindow *ld ); SongManager( LoadingWindow *ld );
~SongManager(); ~SongManager();
CArray<Song*, Song*> m_pSongs; // all songs that can be played vector<Song*> m_pSongs; // all songs that can be played
void InitSongArrayFromDisk( LoadingWindow *ld ); void InitSongArrayFromDisk( LoadingWindow *ld );
void FreeSongArray(); void FreeSongArray();
@@ -43,17 +43,17 @@ public:
static CString ShortenGroupName( const CString &sOrigGroupName ); static CString ShortenGroupName( const CString &sOrigGroupName );
void GetSongsInGroup( const CString sGroupName, CArray<Song*,Song*> &AddTo ); void GetSongsInGroup( const CString sGroupName, vector<Song*> &AddTo );
// for Oni // for Oni
CArray<Course, Course> m_aOniCourses; vector<Course> m_aOniCourses;
// for Extra Stages // for Extra Stages
CArray<Course, Course> m_aExtraCourses; vector<Course> m_aExtraCourses;
// for Endless // for Endless
CArray<Course, Course> m_aEndlessCourses; vector<Course> m_aEndlessCourses;
void InitCoursesFromDisk(); void InitCoursesFromDisk();
void ReloadCourses(); void ReloadCourses();
+3 -3
View File
@@ -48,7 +48,7 @@ private:
unsigned m_iSelectedGroup; // index into m_sGroups unsigned m_iSelectedGroup; // index into m_sGroups
BitmapText m_textGroup; BitmapText m_textGroup;
CArray<Song*, Song*> m_pSongs; vector<Song*> m_pSongs;
unsigned m_iSelectedSong; // index into m_pSongs unsigned m_iSelectedSong; // index into m_pSongs
Banner m_Banner; Banner m_Banner;
TextBanner m_TextBanner; TextBanner m_TextBanner;
@@ -56,11 +56,11 @@ private:
Sprite m_sprArrowLeft; Sprite m_sprArrowLeft;
Sprite m_sprArrowRight; Sprite m_sprArrowRight;
CArray<Style, Style> m_Styles; vector<Style> m_Styles;
unsigned m_iSelectedStyle; // index into m_Styles unsigned m_iSelectedStyle; // index into m_Styles
BitmapText m_textStyle; BitmapText m_textStyle;
CArray<Notes*, Notes*> m_pNotess; vector<Notes*> m_pNotess;
unsigned m_iSelectedNotes; // index into m_pNotess unsigned m_iSelectedNotes; // index into m_pNotess
BitmapText m_textNotes; BitmapText m_textNotes;
-3
View File
@@ -103,9 +103,6 @@ inline const T& min(const T &a, const T &b, P Pr)
#endif #endif
template <class Type, class IGNOREME>
class StdCArray: public std::vector<Type> {};
#define CArray StdCArray
#define CStringArray vector<CString> #define CStringArray vector<CString>
/* Include this here to make sure our assertion handler is always /* Include this here to make sure our assertion handler is always
+11 -11
View File
@@ -143,9 +143,9 @@ public:
bool HasMovieBackground() const; bool HasMovieBackground() const;
bool HasBGChanges() const; bool HasBGChanges() const;
CArray<BPMSegment, BPMSegment&> m_BPMSegments; // this must be sorted before gameplay vector<BPMSegment> m_BPMSegments; // this must be sorted before gameplay
CArray<StopSegment, StopSegment&> m_StopSegments; // this must be sorted before gameplay vector<StopSegment> m_StopSegments; // this must be sorted before gameplay
CArray<BackgroundChange, BackgroundChange&> m_BackgroundChanges; // this must be sorted before gameplay vector<BackgroundChange> m_BackgroundChanges; // this must be sorted before gameplay
void AddBPMSegment( BPMSegment seg ); void AddBPMSegment( BPMSegment seg );
void AddStopSegment( StopSegment seg ); void AddStopSegment( StopSegment seg );
@@ -198,12 +198,12 @@ public:
CArray<Notes*, Notes*> m_apNotes; vector<Notes*> m_apNotes;
bool SongCompleteForStyle( const StyleDef *st ) const; bool SongCompleteForStyle( const StyleDef *st ) const;
bool SongHasNotesType( NotesType nt ) const; bool SongHasNotesType( NotesType nt ) const;
bool SongHasNotesTypeAndDifficulty( NotesType nt, Difficulty dc ) const; bool SongHasNotesTypeAndDifficulty( NotesType nt, Difficulty dc ) const;
void GetNotesThatMatch( NotesType nt, CArray<Notes*, Notes*>& arrayAddTo ) const; void GetNotesThatMatch( NotesType nt, vector<Notes*>& arrayAddTo ) const;
int GetNumTimesPlayed() const; int GetNumTimesPlayed() const;
bool IsNew() const; bool IsNew() const;
bool IsEasy( NotesType nt ) const; bool IsEasy( NotesType nt ) const;
@@ -213,12 +213,12 @@ public:
}; };
void SortSongPointerArrayByDifficulty( CArray<Song*, Song*> &arraySongPointers ); void SortSongPointerArrayByDifficulty( vector<Song*> &arraySongPointers );
void SortSongPointerArrayByTitle( CArray<Song*, Song*> &arraySongPointers ); void SortSongPointerArrayByTitle( vector<Song*> &arraySongPointers );
void SortSongPointerArrayByBPM( CArray<Song*, Song*> &arraySongPointers ); void SortSongPointerArrayByBPM( vector<Song*> &arraySongPointers );
void SortSongPointerArrayByArtist( CArray<Song*, Song*> &arraySongPointers ); void SortSongPointerArrayByArtist( vector<Song*> &arraySongPointers );
void SortSongPointerArrayByGroup( CArray<Song*, Song*> &arraySongPointers ); void SortSongPointerArrayByGroup( vector<Song*> &arraySongPointers );
void SortSongPointerArrayByMostPlayed( CArray<Song*, Song*> &arraySongPointers ); void SortSongPointerArrayByMostPlayed( vector<Song*> &arraySongPointers );