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;
protected:
CArray<Actor*,Actor*> m_SubActors;
vector<Actor*> m_SubActors;
};
#endif
+1 -1
View File
@@ -42,7 +42,7 @@ public:
void LosingFocus();
protected:
CArray<BGAnimationLayer*,BGAnimationLayer*> m_Layers;
vector<BGAnimationLayer*> m_Layers;
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;
}
void SortBGSegmentArray( CArray<BGSegment,BGSegment&> &arrayBGSegments )
void SortBGSegmentArray( vector<BGSegment> &arrayBGSegments )
{
sort( arrayBGSegments.begin(), arrayBGSegments.end(), CompareBGSegments );
}
+2 -2
View File
@@ -59,8 +59,8 @@ protected:
BGAnimation m_BGADanger;
// used in all BackgroundModes except OFF
CArray<BGAnimation*,BGAnimation*> m_BGAnimations;
CArray<BGSegment,BGSegment&> m_aBGSegments;
vector<BGAnimation*> m_BGAnimations;
vector<BGSegment> m_aBGSegments;
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* m_pCurrentBGA;
+5 -5
View File
@@ -31,7 +31,7 @@ Course::Course()
m_iExtra = 0;
}
void Course::LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs )
void Course::LoadFromCRSFile( CString sPath, vector<Song*> &apSongs )
{
MsdFile msd;
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_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. */
void Course::GetSongAndNotesForCurrentStyle(
CArray<Song*,Song*>& apSongsOut,
CArray<Notes*,Notes*>& apNotesOut,
vector<Song*>& apSongsOut,
vector<Notes*>& apNotesOut,
CStringArray& asModifiersOut,
bool bShuffled )
{
@@ -303,7 +303,7 @@ static int CompareCoursePointersByDifficulty(const Course* pCourse1, const Cours
return pCourse1->GetNumStages() < pCourse2->GetNumStages();
}
void SortCoursePointerArrayByDifficulty( CArray<Course*,Course*> &apCourses )
void SortCoursePointerArrayByDifficulty( vector<Course*> &apCourses )
{
sort( apCourses.begin(), apCourses.end(), CompareCoursePointersByDifficulty );
}
+4 -4
View File
@@ -50,11 +50,11 @@ public:
void GetSongOptions( SongOptions* pSO_out);
int GetNumStages() const;
void LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs );
void CreateEndlessCourseFromGroupAndDifficulty( CString sGroupName, Difficulty dc, CArray<Song*,Song*> &apSongsInGroup );
void LoadFromCRSFile( CString sPath, vector<Song*> &apSongs );
void CreateEndlessCourseFromGroupAndDifficulty( CString sGroupName, Difficulty dc, vector<Song*> &apSongsInGroup );
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();
private:
@@ -62,7 +62,7 @@ private:
};
void SortCoursePointerArrayByDifficulty( CArray<Course*,Course*> &apCourses );
void SortCoursePointerArrayByDifficulty( vector<Course*> &apCourses );
#endif
+4 -4
View File
@@ -1476,7 +1476,7 @@ const StyleDef* GameManager::GetStyleDefForStyle( Style 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++ ) {
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++ )
if( g_ModeChoices[s].game == game)
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++ )
{
@@ -1621,7 +1621,7 @@ CString GameManager::GetPathTo( const int col, CString sElementName ) // looks i
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++ )
{
+4 -4
View File
@@ -28,9 +28,9 @@ public:
GameDef* GetGameDefForGame( Game g );
const StyleDef* GetStyleDefForStyle( Style s );
void GetGameplayStylesForGame( Game game, CArray<Style,Style>& aStylesAddTo, bool editor=false );
void GetModesChoicesForGame( Game game, CArray<ModeChoice*,ModeChoice*>& apChoicesAddTo );
void GetNotesTypesForGame( Game game, CArray<NotesType,NotesType>& aNotesTypeAddTo ); // only look at edit-specific styles
void GetGameplayStylesForGame( Game game, vector<Style>& aStylesAddTo, bool editor=false );
void GetModesChoicesForGame( Game game, vector<ModeChoice*>& apChoicesAddTo );
void GetNotesTypesForGame( Game game, vector<NotesType>& aNotesTypeAddTo ); // only look at edit-specific styles
// void GetGameNames( CStringArray &AddTo );
// bool DoesGameExist( CString sGameName );
@@ -52,7 +52,7 @@ public:
RageColor GetMetricC( CString sClassName, CString sValueName );
void GetEnabledGames( CArray<Game,Game>& aGamesOut );
void GetEnabledGames( vector<Game>& aGamesOut );
static int NotesTypeToNumTracks( NotesType nt );
static NotesType StringToNotesType( CString sNotesType );
+1 -1
View File
@@ -126,7 +126,7 @@ public:
//
// 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,
// 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 {
Sprite m_sprButton[MAX_GROUPS_ONSCREEN];
BitmapText m_screenLabels[MAX_GROUPS_ONSCREEN];
CArray<CString,CString> m_textLabels;
vector<CString> m_textLabels;
/* Currently selected label. */
unsigned m_iSelection;
+1 -1
View File
@@ -34,7 +34,7 @@ public:
InputEventType type;
};
typedef CArray<InputEvent, InputEvent> InputEventArray;
typedef vector<InputEvent> InputEventArray;
class InputFilter
{
+1 -1
View File
@@ -34,7 +34,7 @@ protected:
GameButton button;
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)
tm = MENU_ELEMENTS_TWEEN_TIME;
CArray<Actor*,Actor*> apActorsInTopFrame;
vector<Actor*> apActorsInTopFrame;
apActorsInTopFrame.push_back( &m_sprTopEdge );
apActorsInTopFrame.push_back( &m_sprStyleIcon );
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
will make each component tween off at a different rate ...
-glenn
CArray<Actor*,Actor*> apActorsInTopFrame;
vector<Actor*> apActorsInTopFrame;
apActorsInTopFrame.push_back( &m_sprTopEdge );
apActorsInTopFrame.push_back( &m_sprStyleIcon );
apActorsInTopFrame.push_back( &m_MenuTimer );
+1 -1
View File
@@ -46,7 +46,7 @@ private:
int SongsExist;
int SingleLoad;
CArray<Song*, Song*> arraySongs;
vector<Song*> arraySongs;
};
#endif
+1 -1
View File
@@ -34,7 +34,7 @@ void MusicList::AddGroup()
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
unsigned group = m_ContentsText.size()-1;
+2 -2
View File
@@ -15,7 +15,7 @@ class MusicList : public ActorFrame {
int m_iNumSongsInGroup;
};
CArray<group,group> m_ContentsText;
vector<group> m_ContentsText;
int NumGroups, CurGroup;
@@ -26,7 +26,7 @@ public:
void AddGroup();
/* 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. */
void SetGroupNo(int group);
+8 -8
View File
@@ -334,7 +334,7 @@ MusicWheel::MusicWheel()
// init m_mapGroupNameToBannerColor
CArray<Song*, Song*> arraySongs = SONGMAN->m_pSongs;
vector<Song*> arraySongs = SONGMAN->m_pSongs;
SortSongPointerArrayByGroup( arraySongs );
m_iSelection = 0;
@@ -392,7 +392,7 @@ MusicWheel::MusicWheel()
* This will select songs we can't use; we want the first song
* that's actually visible. Should we select out of wheel data?
* -glenn */
CArray<Song*, Song*> arraySongs;
vector<Song*> arraySongs;
SONGMAN->GetSongsInGroup( asGroupNames[0], arraySongs );
if( !arraySongs.empty() ) // still nothing selected
GAMESTATE->m_pCurSong = arraySongs[0]; // select the first song
@@ -471,7 +471,7 @@ bool MusicWheel::SelectCourse( const Course *p )
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
for( unsigned i=0; i<SONGMAN->m_pSongs.size(); i++ )
@@ -489,7 +489,7 @@ void MusicWheel::GetSongList(CArray<Song*, Song*> &arraySongs, bool bRoulette )
continue;
}
CArray<Notes*, Notes*> arraySteps;
vector<Notes*> arraySteps;
pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, arraySteps );
if( !arraySteps.empty() )
@@ -511,7 +511,7 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
///////////////////////////////////
// Make an array of Song*, then sort them
///////////////////////////////////
CArray<Song*, Song*> arraySongs;
vector<Song*> arraySongs;
GetSongList(arraySongs, so == SORT_ROULETTE);
@@ -634,7 +634,7 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
{
unsigned i;
CArray<Course*,Course*> apCourses;
vector<Course*> apCourses;
switch( GAMESTATE->m_PlayMode )
{
case PLAY_MODE_ONI:
@@ -653,8 +653,8 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
Course* pCourse = apCourses[c];
// check that this course has at least one song playable in the current style
CArray<Song*,Song*> apSongs;
CArray<Notes*,Notes*> apNotes;
vector<Song*> apSongs;
vector<Notes*> apNotes;
CStringArray asModifiers;
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
{
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 );
WheelItemType m_WheelItemType;
@@ -123,7 +123,7 @@ public:
bool WheelIsLocked() { return (m_WheelState == STATE_LOCKED ? true : false); }
protected:
void GetSongList(CArray<Song*, Song*> &arraySongs, bool bRoulette );
void GetSongList(vector<Song*> &arraySongs, bool bRoulette );
void BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItems, SongSortOrder so );
void RebuildWheelItemDisplays();
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_SUPER_SHUFFLE: // use this code to shuffle the HoldNotes
{
CArray<int,int> aiTracksLeftToMap;
vector<int> aiTracksLeftToMap;
for( t=0; t<in.m_iNumTracks; 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
// shuffle this row
CArray<int,int> aiTracksThatCouldHaveTapNotes;
vector<int> aiTracksThatCouldHaveTapNotes;
for( t=0; t<in.m_iNumTracks; t++ )
if( in.GetTapNote(t, r) != TAP_HOLD ) // any point that isn't part of a hold
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_sprHoldParts; // for now, must be 8 frames
CArray<RageColor,RageColor> m_colorTapTweens;
vector<RageColor> m_colorTapTweens;
};
#endif
+3 -3
View File
@@ -176,21 +176,21 @@ void NoteField::DrawPrimitives()
//
// 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++ )
DrawBPMText( aBPMSegments[i].m_fStartBeat, aBPMSegments[i].m_fBPM );
//
// 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++ )
DrawFreezeText( aStopSegments[i].m_fStartBeat, aStopSegments[i].m_fStopSeconds );
//
// 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++ )
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 );
}
void SortNotesArrayByDifficulty( CArray<Notes*,Notes*> &arraySteps )
void SortNotesArrayByDifficulty( vector<Notes*> &arraySteps )
{
sort( arraySteps.begin(), arraySteps.end(), CompareNotesPointersByDifficulty );
}
+1 -1
View File
@@ -94,6 +94,6 @@ protected:
};
bool CompareNotesPointersByDifficulty(const Notes *pNotes1, const Notes *pNotes2);
void SortNotesArrayByDifficulty( CArray<Notes*,Notes*> &arrayNotess );
void SortNotesArrayByDifficulty( vector<Notes*> &arrayNotess );
#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() );
CString &sNoteData = value_data;
CArray<bool, bool&> arrayNotes;
vector<bool> arrayNotes;
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() );
CString sNoteData = value_data;
CArray<int, int> arrayNotes;
vector<int> arrayNotes;
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_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
CArray<RectF,RectF> m_TextureCoordRects; // size = m_iFramesWide * m_iFramesHigh
vector<RectF> m_TextureCoordRects; // size = m_iFramesWide * m_iFramesHigh
virtual void CreateFrameRects();
virtual void GetFrameDimensionsFromFileName( CString sPath, int* puFramesWide, int* puFramesHigh ) const;
+2 -2
View File
@@ -341,7 +341,7 @@ public:
struct CacheEntry {
CStringArray files;
CStringArray exts;
CArray<int,int> Attributes;
vector<int> Attributes;
CString dir;
};
@@ -354,7 +354,7 @@ private:
CacheEntry *LoadDirCache( const CString &sPath );
/* We don't have too many directories ... XXX - glenn */
CArray<CacheEntry *,CacheEntry *> directory_cache;
vector<CacheEntry *> directory_cache;
} static DirectoryCache;
void DirCache::FlushCache()
+1 -1
View File
@@ -39,7 +39,7 @@ private:
bool LoadSound( CString sSoundFilePath );
CArray<RageSound*, RageSound*> m_pSamples;
vector<RageSound*> m_pSamples;
int m_iIndexLastPlayed;
};
+1 -1
View File
@@ -49,7 +49,7 @@ protected:
ScreenMessage SM;
float fDelayRemaining;
};
CArray<QueuedScreenMessage, QueuedScreenMessage&> m_QueuedMessages;
vector<QueuedScreenMessage> m_QueuedMessages;
public:
+2 -2
View File
@@ -692,7 +692,7 @@ void ScreenEvaluation::TweenOnScreen()
{
unsigned i;
CArray<Actor*,Actor*> apActorsInBonusOrStageInfo;
vector<Actor*> apActorsInBonusOrStageInfo;
apActorsInBonusOrStageInfo.push_back( &m_sprBonusFrame[p] );
for( i=0; i<NUM_RADAR_VALUES; i++ )
{
@@ -711,7 +711,7 @@ void ScreenEvaluation::TweenOnScreen()
apActorsInBonusOrStageInfo[i]->SetTweenX( fOriginalX );
}
CArray<Actor*,Actor*> apActorsInGradeOrPercentFrame;
vector<Actor*> apActorsInGradeOrPercentFrame;
apActorsInGradeOrPercentFrame.push_back( &m_sprBonusFrame[p] );
apActorsInGradeOrPercentFrame.push_back( &m_sprGradeFrame[p] );
apActorsInGradeOrPercentFrame.push_back( &m_Grades[p] );
+1 -1
View File
@@ -51,7 +51,7 @@ protected:
MusicBannerWheel m_MusicBannerWheel;
MenuElements m_Menu;
FootMeter m_FootMeter[NUM_PLAYERS];
CArray<Notes*, Notes*> m_arrayNotes[NUM_PLAYERS];
vector<Notes*> m_arrayNotes[NUM_PLAYERS];
int m_iSelection[NUM_PLAYERS];
bool m_bGoToOptions;
bool m_bMadeChoice;
+8 -8
View File
@@ -142,8 +142,8 @@ ScreenGameplay::ScreenGameplay()
GAMESTATE->m_iPossibleDancePoints[p] = 0;
Course* pCourse = GAMESTATE->m_pCurCourse;
CArray<Song*,Song*> apSongs;
CArray<Notes*,Notes*> apNotes;
vector<Song*> apSongs;
vector<Notes*> apNotes;
CStringArray asModifiers;
pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, true );
@@ -502,8 +502,8 @@ bool ScreenGameplay::IsLastSong()
if( pCourse->m_bRepeat )
return false;
CArray<Song*,Song*> apSongs;
CArray<Notes*,Notes*> apNotes;
vector<Song*> apSongs;
vector<Notes*> apNotes;
CStringArray asModifiers;
pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, true );
@@ -536,8 +536,8 @@ void ScreenGameplay::LoadNextSong( bool bFirstLoad )
GAMESTATE->m_SelectedOptions[p] = GAMESTATE->m_PlayerOptions[p];
}
Course* pCourse = GAMESTATE->m_pCurCourse;
CArray<Song*,Song*> apSongs;
CArray<Notes*,Notes*> apNotes;
vector<Song*> apSongs;
vector<Notes*> apNotes;
CStringArray asModifiers;
pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, true );
@@ -1501,7 +1501,7 @@ void ScreenGameplay::TweenOnScreen()
{
unsigned i, p;
CArray<Actor*,Actor*> apActorsInLifeFrame;
vector<Actor*> apActorsInLifeFrame;
apActorsInLifeFrame.push_back( &m_sprLifeFrame );
for( p=0; p<NUM_PLAYERS; 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 );
for( p=0; p<NUM_PLAYERS; p++ )
{
+2 -2
View File
@@ -46,8 +46,8 @@ public:
void RefreshCreditsMessages();
private:
CArray<Screen*, Screen*> m_ScreenStack;
CArray<Screen*, Screen*> m_ScreensToDelete;
vector<Screen*> m_ScreenStack;
vector<Screen*> m_ScreensToDelete;
Screen *m_ScreenBuffered;
BitmapText m_textStats;
+1 -1
View File
@@ -149,7 +149,7 @@ ScreenMusicScroll::ScreenMusicScroll()
this->AddChild( &m_Background );
CArray<Song*, Song*> arraySongs = SONGMAN->m_pSongs;
vector<Song*> arraySongs = SONGMAN->m_pSongs;
SortSongPointerArrayByTitle( arraySongs );
m_iNumLines = 0;
+3 -3
View File
@@ -42,7 +42,7 @@ ScreenSelectGame::ScreenSelectGame() :
LOG->Trace( "ScreenSelectGame::ScreenSelectGame()" );
/* populate g_SelectGameLines */
CArray<Game,Game> aGames;
vector<Game> aGames;
GAMEMAN->GetEnabledGames( aGames );
unsigned 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
* not there, we might have set a game and then the user removed its
* note skins; reset it to the first available. */
CArray<Game,Game> aGames;
vector<Game> aGames;
GAMEMAN->GetEnabledGames( aGames );
ASSERT(!aGames.empty());
@@ -89,7 +89,7 @@ void ScreenSelectGame::ExportOptions()
// Switch the current style to the frist style of the selected game
int iSelection = m_iSelectedOption[0][SG_GAME];
CArray<Game,Game> aGames;
vector<Game> aGames;
GAMEMAN->GetEnabledGames( aGames );
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
// 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
for( j=aAllSongs.size()-1; j>=0; j-- ) // foreach Song, back to front
@@ -112,7 +112,7 @@ ScreenSelectGroup::ScreenSelectGroup()
// Add songs to the MusicList.
for( unsigned g=0; g < asGroupNames.size(); g++ ) /* for each group */
{
CArray<Song*,Song*> aSongsInGroup;
vector<Song*> aSongsInGroup;
/* find all songs */
for( i=0; i<aAllSongs.size(); i++ ) // foreach Song
{
+1 -1
View File
@@ -58,7 +58,7 @@ protected:
Sprite m_Infotext[MAX_MODE_CHOICES];
CArray<ModeChoice*,ModeChoice*> m_apPossibleModeChoices;
vector<ModeChoice*> m_apPossibleModeChoices;
ScrollingList m_ScrollingList;
void RefreshModeChoices();
+2 -2
View File
@@ -334,7 +334,7 @@ void ScreenSelectMusic::TweenOffScreen()
m_MusicSortDisplay.FadeOff( 0, "fade", TWEEN_TIME );
CArray<Actor*,Actor*> apActorsInScore;
vector<Actor*> apActorsInScore;
for( p=0; p<NUM_PLAYERS; p++ )
{
apActorsInScore.push_back( &m_sprHighScoreFrame[p] );
@@ -354,7 +354,7 @@ void ScreenSelectMusic::TweenScoreOnAndOffAfterChangeSort()
if( !SCORE_CONNECTED_TO_MUSIC_WHEEL )
return; // do nothing
CArray<Actor*,Actor*> apActorsInScore;
vector<Actor*> apActorsInScore;
for( int p=0; p<NUM_PLAYERS; p++ )
{
apActorsInScore.push_back( &m_sprHighScoreFrame[p] );
+1 -1
View File
@@ -54,7 +54,7 @@ protected:
void UpdateOptionsDisplays();
CArray<Notes*, Notes*> m_arrayNotes[NUM_PLAYERS];
vector<Notes*> m_arrayNotes[NUM_PLAYERS];
int m_iSelection[NUM_PLAYERS];
MenuElements m_Menu;
+1 -1
View File
@@ -59,7 +59,7 @@ private:
RandomSample m_soundSelect;
int m_iSelection;
CArray<Style,Style> m_aPossibleStyles;
vector<Style> m_aPossibleStyles;
Style GetSelectedStyle() { return m_aPossibleStyles[m_iSelection]; };
};
+2 -2
View File
@@ -44,8 +44,8 @@ protected:
float m_fSelectionLag;
int m_iSpacing;
int m_iNumVisible;
CArray<Sprite*,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<Sprite*> m_apSprites; // stores the list of elements (left to right)
vector<CroppedSprite*> m_apCSprites; // stores the list of elements (left to right)
};
#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;
}
void SortBPMSegmentsArray( CArray<BPMSegment,BPMSegment&> &arrayBPMSegments )
void SortBPMSegmentsArray( vector<BPMSegment> &arrayBPMSegments )
{
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;
}
void SortStopSegmentsArray( CArray<StopSegment,StopSegment&> &arrayStopSegments )
void SortStopSegmentsArray( vector<StopSegment> &arrayStopSegments )
{
sort( arrayStopSegments.begin(), arrayStopSegments.end(), CompareStopSegments );
}
@@ -66,7 +66,7 @@ int CompareBackgroundChanges(const BackgroundChange &seg1, const BackgroundChang
return seg1.m_fStartBeat < seg2.m_fStartBeat;
}
void SortBackgroundChangesArray( CArray<BackgroundChange,BackgroundChange&> &arrayBackgroundChanges )
void SortBackgroundChangesArray( vector<BackgroundChange> &arrayBackgroundChanges )
{
sort( arrayBackgroundChanges.begin(), arrayBackgroundChanges.end(), CompareBackgroundChanges );
}
@@ -551,7 +551,7 @@ void Song::TidyUpData()
// a NotesType and it's "smaniac", then convert it to "Challenge"
for( NotesType nt=(NotesType)0; nt<NUM_NOTES_TYPES; nt=(NotesType)(nt+1) )
{
CArray<Notes*,Notes*> apNotes;
vector<Notes*> apNotes;
GetNotesThatMatch( nt, apNotes );
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
{
@@ -712,7 +712,7 @@ void Song::AddAutoGenNotes()
for( NotesType nt=(NotesType)0; nt<NUM_NOTES_TYPES; nt=(NotesType)(nt+1) )
{
CArray<Notes*,Notes*> apNotes;
vector<Notes*> apNotes;
this->GetNotesThatMatch( nt, apNotes );
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
{
// return max grade of notes in difficulty class
CArray<Notes*, Notes*> aNotes;
vector<Notes*> aNotes;
this->GetNotesThatMatch( st->m_NotesType, aNotes );
SortNotesArrayByDifficulty( aNotes );
@@ -804,15 +804,15 @@ int CompareSongPointersByTitle(const Song *pSong1, const Song *pSong2)
return pSong1->GetSongFilePath().CompareNoCase(pSong2->GetSongFilePath()) < 0;
}
void SortSongPointerArrayByTitle( CArray<Song*, Song*> &arraySongPointers )
void SortSongPointerArrayByTitle( vector<Song*> &arraySongPointers )
{
sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByTitle );
}
int CompareSongPointersByDifficulty(const Song *pSong1, const Song *pSong2)
{
CArray<Notes*,Notes*> aNotes1;
CArray<Notes*,Notes*> aNotes2;
vector<Notes*> aNotes1;
vector<Notes*> aNotes2;
pSong1->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, aNotes1 );
pSong2->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, aNotes2 );
@@ -833,7 +833,7 @@ int CompareSongPointersByDifficulty(const Song *pSong1, const Song *pSong2)
return CompareSongPointersByTitle( pSong1, pSong2 );
}
void SortSongPointerArrayByDifficulty( CArray<Song*, Song*> &arraySongPointers )
void SortSongPointerArrayByDifficulty( vector<Song*> &arraySongPointers )
{
sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByDifficulty );
}
@@ -852,7 +852,7 @@ bool CompareSongPointersByBPM(const Song *pSong1, const Song *pSong2)
return CompareCStringsAsc( pSong1->GetSongFilePath(), pSong2->GetSongFilePath() );
}
void SortSongPointerArrayByBPM( CArray<Song*, Song*> &arraySongPointers )
void SortSongPointerArrayByBPM( vector<Song*> &arraySongPointers )
{
sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByBPM );
}
@@ -870,7 +870,7 @@ int CompareSongPointersByArtist(const Song *pSong1, const Song *pSong2)
return CompareSongPointersByTitle( pSong1, pSong2 );
}
void SortSongPointerArrayByArtist( CArray<Song*, Song*> &arraySongPointers )
void SortSongPointerArrayByArtist( vector<Song*> &arraySongPointers )
{
sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByArtist );
}
@@ -889,7 +889,7 @@ int CompareSongPointersByGroup(const Song *pSong1, const Song *pSong2)
return CompareSongPointersByDifficulty( pSong1, pSong2 );
}
void SortSongPointerArrayByGroup( CArray<Song*, Song*> &arraySongPointers )
void SortSongPointerArrayByGroup( vector<Song*> &arraySongPointers )
{
sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersByGroup );
}
@@ -906,7 +906,7 @@ int CompareSongPointersByMostPlayed(const Song *pSong1, const Song *pSong2)
return CompareSongPointersByTitle( pSong1, pSong2 );
}
void SortSongPointerArrayByMostPlayed( CArray<Song*, Song*> &arraySongPointers )
void SortSongPointerArrayByMostPlayed( vector<Song*> &arraySongPointers )
{
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++ )
{
@@ -472,7 +472,7 @@ void SongManager::InitCoursesFromDisk()
for( g=0; g<saGroupNames.size(); g++ ) // foreach Group
{
CString sGroupName = saGroupNames[g];
CArray<Song*, Song*> apGroupSongs;
vector<Song*> apGroupSongs;
GetSongsInGroup( sGroupName, apGroupSongs );
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.
Notes* pExtra2Notes = NULL;
CArray<Song*,Song*> apSongs;
vector<Song*> apSongs;
SONGMAN->GetSongsInGroup( GAMESTATE->m_sPreferredGroup, apSongs );
for( unsigned s=0; s<apSongs.size(); s++ ) // foreach song
{
Song* pSong = apSongs[s];
CArray<Notes*,Notes*> apNotes;
vector<Notes*> apNotes;
pSong->GetNotesThatMatch( sd->m_NotesType, apNotes );
for( unsigned n=0; n<apNotes.size(); n++ ) // foreach Notes
{
+5 -5
View File
@@ -26,7 +26,7 @@ public:
SongManager( LoadingWindow *ld );
~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 FreeSongArray();
@@ -43,17 +43,17 @@ public:
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
CArray<Course, Course> m_aOniCourses;
vector<Course> m_aOniCourses;
// for Extra Stages
CArray<Course, Course> m_aExtraCourses;
vector<Course> m_aExtraCourses;
// for Endless
CArray<Course, Course> m_aEndlessCourses;
vector<Course> m_aEndlessCourses;
void InitCoursesFromDisk();
void ReloadCourses();
+3 -3
View File
@@ -48,7 +48,7 @@ private:
unsigned m_iSelectedGroup; // index into m_sGroups
BitmapText m_textGroup;
CArray<Song*, Song*> m_pSongs;
vector<Song*> m_pSongs;
unsigned m_iSelectedSong; // index into m_pSongs
Banner m_Banner;
TextBanner m_TextBanner;
@@ -56,11 +56,11 @@ private:
Sprite m_sprArrowLeft;
Sprite m_sprArrowRight;
CArray<Style, Style> m_Styles;
vector<Style> m_Styles;
unsigned m_iSelectedStyle; // index into m_Styles
BitmapText m_textStyle;
CArray<Notes*, Notes*> m_pNotess;
vector<Notes*> m_pNotess;
unsigned m_iSelectedNotes; // index into m_pNotess
BitmapText m_textNotes;
-3
View File
@@ -103,9 +103,6 @@ inline const T& min(const T &a, const T &b, P Pr)
#endif
template <class Type, class IGNOREME>
class StdCArray: public std::vector<Type> {};
#define CArray StdCArray
#define CStringArray vector<CString>
/* Include this here to make sure our assertion handler is always
+11 -11
View File
@@ -143,9 +143,9 @@ public:
bool HasMovieBackground() const;
bool HasBGChanges() const;
CArray<BPMSegment, BPMSegment&> m_BPMSegments; // this must be sorted before gameplay
CArray<StopSegment, StopSegment&> m_StopSegments; // this must be sorted before gameplay
CArray<BackgroundChange, BackgroundChange&> m_BackgroundChanges; // this must be sorted before gameplay
vector<BPMSegment> m_BPMSegments; // this must be sorted before gameplay
vector<StopSegment> m_StopSegments; // this must be sorted before gameplay
vector<BackgroundChange> m_BackgroundChanges; // this must be sorted before gameplay
void AddBPMSegment( BPMSegment 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 SongHasNotesType( NotesType nt ) 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;
bool IsNew() const;
bool IsEasy( NotesType nt ) const;
@@ -213,12 +213,12 @@ public:
};
void SortSongPointerArrayByDifficulty( CArray<Song*, Song*> &arraySongPointers );
void SortSongPointerArrayByTitle( CArray<Song*, Song*> &arraySongPointers );
void SortSongPointerArrayByBPM( CArray<Song*, Song*> &arraySongPointers );
void SortSongPointerArrayByArtist( CArray<Song*, Song*> &arraySongPointers );
void SortSongPointerArrayByGroup( CArray<Song*, Song*> &arraySongPointers );
void SortSongPointerArrayByMostPlayed( CArray<Song*, Song*> &arraySongPointers );
void SortSongPointerArrayByDifficulty( vector<Song*> &arraySongPointers );
void SortSongPointerArrayByTitle( vector<Song*> &arraySongPointers );
void SortSongPointerArrayByBPM( vector<Song*> &arraySongPointers );
void SortSongPointerArrayByArtist( vector<Song*> &arraySongPointers );
void SortSongPointerArrayByGroup( vector<Song*> &arraySongPointers );
void SortSongPointerArrayByMostPlayed( vector<Song*> &arraySongPointers );