name cleanup: "pNotes" -> "pSteps"

This commit is contained in:
Chris Danford
2004-05-24 03:41:39 +00:00
parent 99a02deffe
commit 4bb777232d
53 changed files with 359 additions and 359 deletions
+3 -3
View File
@@ -106,10 +106,10 @@ void BeginnerHelper::SetFlash( CString sFilename, float fX, float fY )
m_sFlash.SetY(fY);
}
void BeginnerHelper::AddPlayer( int pn, NoteData *pNotes )
void BeginnerHelper::AddPlayer( int pn, NoteData *pSteps )
{
ASSERT( !m_bInitialized );
ASSERT( pNotes != NULL );
ASSERT( pSteps != NULL );
ASSERT( pn >= 0 && pn < NUM_PLAYERS );
ASSERT( GAMESTATE->IsHumanPlayer(pn) );
@@ -120,7 +120,7 @@ void BeginnerHelper::AddPlayer( int pn, NoteData *pNotes )
if( !DoesFileExist( Character->GetModelPath() ) )
return;
m_NoteData[pn].CopyAll( pNotes );
m_NoteData[pn].CopyAll( pSteps );
m_bPlayerEnabled[pn] = true;
}
+1 -1
View File
@@ -18,7 +18,7 @@ public:
bool Initialize( int iDancePadType );
bool IsInitialized() { return m_bInitialized; }
static bool CanUse();
void AddPlayer( int pn, NoteData *pNotes );
void AddPlayer( int pn, NoteData *pSteps );
void SetFlash(CString sFilename, float fX, float fY);
void ShowStepCircle( int pn, int CSTEP );
void TurnFlashOff();
+17 -17
View File
@@ -484,7 +484,7 @@ static vector<Song*> GetFilteredBestSongs( StepsType st )
continue;
bool FoundMedium = false, FoundHard = false;
FOREACH( Steps*, pSong->m_apNotes, pSteps )
FOREACH( Steps*, pSong->m_vpSteps, pSteps )
{
if( (*pSteps)->m_StepsType != st )
continue;
@@ -563,7 +563,7 @@ Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
entry_difficulty = COURSE_DIFFICULTY_REGULAR;
Song* pSong = NULL; // fill this in
Steps* pNotes = NULL; // fill this in
Steps* pSteps = NULL; // fill this in
/* This applies difficult mode for meter ranges. (If it's a difficulty
* class, we'll do it below.) */
@@ -577,11 +577,11 @@ Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
if( pSong )
{
if( e.difficulty != DIFFICULTY_INVALID )
pNotes = pSong->GetStepsByDifficulty( st, e.difficulty );
pSteps = pSong->GetStepsByDifficulty( st, e.difficulty );
else if( e.low_meter != -1 && e.high_meter != -1 )
pNotes = pSong->GetStepsByMeter( st, low_meter, high_meter );
pSteps = pSong->GetStepsByMeter( st, low_meter, high_meter );
else
pNotes = pSong->GetStepsByDifficulty( st, DIFFICULTY_MEDIUM );
pSteps = pSong->GetStepsByDifficulty( st, DIFFICULTY_MEDIUM );
}
break;
case COURSE_ENTRY_RANDOM:
@@ -608,15 +608,15 @@ Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
continue; /* wrong group */
if( e.difficulty == DIFFICULTY_INVALID )
pNotes = pSong->GetStepsByMeter( st, low_meter, high_meter );
pSteps = pSong->GetStepsByMeter( st, low_meter, high_meter );
else
pNotes = pSong->GetStepsByDifficulty( st, e.difficulty );
pSteps = pSong->GetStepsByDifficulty( st, e.difficulty );
if( pNotes ) // found a match
if( pSteps ) // found a match
break; // stop searching
pSong = NULL;
pNotes = NULL;
pSteps = NULL;
}
}
break;
@@ -645,19 +645,19 @@ Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
}
if( e.difficulty == DIFFICULTY_INVALID )
pNotes = pSong->GetStepsByMeter( st, low_meter, high_meter );
pSteps = pSong->GetStepsByMeter( st, low_meter, high_meter );
else
pNotes = pSong->GetStepsByDifficulty( st, e.difficulty );
pSteps = pSong->GetStepsByDifficulty( st, e.difficulty );
if( pNotes == NULL )
pNotes = pSong->GetClosestNotes( st, DIFFICULTY_MEDIUM );
if( pSteps == NULL )
pSteps = pSong->GetClosestNotes( st, DIFFICULTY_MEDIUM );
}
break;
default:
ASSERT(0);
}
if( !pSong || !pNotes )
if( !pSong || !pSteps )
continue; // this song entry isn't playable. Skip.
/* If e.difficulty == DIFFICULTY_INVALID, then we already adjusted difficulty
@@ -666,20 +666,20 @@ Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
{
/* See if we can find a NoteData after adjusting the difficulty by COURSE_DIFFICULTY_CLASS_CHANGE.
* If we can't, just use the one we already have. */
Difficulty original_dc = pNotes->GetDifficulty();
Difficulty original_dc = pSteps->GetDifficulty();
Difficulty dc = Difficulty( original_dc + COURSE_DIFFICULTY_CLASS_CHANGE[entry_difficulty] );
dc = clamp( dc, DIFFICULTY_BEGINNER, DIFFICULTY_CHALLENGE );
if( dc != original_dc )
{
Steps* pNewNotes = pSong->GetStepsByDifficulty( st, dc );
if( pNewNotes )
pNotes = pNewNotes;
pSteps = pNewNotes;
}
}
TrailEntry te;
te.pSong = pSong;
te.pNotes = pNotes;
te.pSteps = pSteps;
te.Modifiers = e.modifiers;
te.Attacks = e.attacks;
te.bMystery = e.mystery;
+3 -3
View File
@@ -96,7 +96,7 @@ void CourseEntryDisplay::LoadFromTrailEntry( int iNum, const Course *pCourse, Tr
FOREACH_EnabledPlayer(pn)
{
TrailEntry *te = tes[pn];
Difficulty dc = te->pNotes->GetDifficulty();
Difficulty dc = te->pSteps->GetDifficulty();
if( dc == DIFFICULTY_INVALID )
{
int iLow = te->iLowMeter;
@@ -115,8 +115,8 @@ void CourseEntryDisplay::LoadFromTrailEntry( int iNum, const Course *pCourse, Tr
FOREACH_EnabledPlayer(pn)
{
TrailEntry *te = tes[pn];
RageColor colorNotes = SONGMAN->GetDifficultyColor( te->pNotes->GetDifficulty() );
SetDifficulty( pn, ssprintf("%d", te->pNotes->GetMeter()), colorNotes );
RageColor colorNotes = SONGMAN->GetDifficultyColor( te->pSteps->GetDifficulty() );
SetDifficulty( pn, ssprintf("%d", te->pSteps->GetMeter()), colorNotes );
}
m_TextBanner.LoadFromSong( te->pSong );
+3 -3
View File
@@ -49,12 +49,12 @@ bool DifficultyIcon::Load( CString sPath )
return true;
}
void DifficultyIcon::SetFromNotes( PlayerNumber pn, Steps* pNotes )
void DifficultyIcon::SetFromNotes( PlayerNumber pn, Steps* pSteps )
{
if( pNotes == NULL )
if( pSteps == NULL )
m_bBlank = true;
else
SetFromDifficulty( pn, pNotes->GetDifficulty() );
SetFromDifficulty( pn, pSteps->GetDifficulty() );
}
void DifficultyIcon::SetFromDifficulty( PlayerNumber pn, Difficulty dc )
+1 -1
View File
@@ -27,7 +27,7 @@ public:
bool Load( CString sFilePath );
void SetFromNotes( PlayerNumber pn, Steps* pNotes );
void SetFromNotes( PlayerNumber pn, Steps* pSteps );
void SetFromDifficulty( PlayerNumber pn, Difficulty dc );
void SetFromCourseDifficulty( PlayerNumber pn, CourseDifficulty cd );
};
+4 -4
View File
@@ -98,16 +98,16 @@ void DifficultyMeter::Load()
Unset();
}
void DifficultyMeter::SetFromNotes( const Steps* pNotes )
void DifficultyMeter::SetFromNotes( const Steps* pSteps )
{
if( pNotes == NULL )
if( pSteps == NULL )
{
Unset();
return;
}
SetMeter( pNotes->GetMeter(), pNotes->GetDifficulty() );
SetDifficulty( DifficultyToString( pNotes->GetDifficulty() ) );
SetMeter( pSteps->GetMeter(), pSteps->GetDifficulty() );
SetDifficulty( DifficultyToString( pSteps->GetDifficulty() ) );
}
void DifficultyMeter::SetFromCourse( const Course* pCourse, PlayerNumber pn )
+1 -1
View File
@@ -30,7 +30,7 @@ public:
void SetFromGameState( PlayerNumber pn );
void SetFromDifficulty( Difficulty dc );
void SetFromCourseDifficulty( CourseDifficulty cd );
void SetFromNotes( const Steps* pNotes );
void SetFromNotes( const Steps* pSteps );
void SetFromCourse( const Course* pCourse, PlayerNumber pn );
void Unset();
void SetMeter( int iMeter, Difficulty dc );
+3 -3
View File
@@ -63,9 +63,9 @@ void GrooveGraph::SetFromSong( Song* pSong )
{
for( int i=0; i<NUM_DIFFICULTIES; i++ )
{
Steps* pNotes = pSong->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, (Difficulty)i );
if( pNotes )
rvs[i] = pNotes->GetRadarValues();
Steps* pSteps = pSong->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, (Difficulty)i );
if( pSteps )
rvs[i] = pSteps->GetRadarValues();
}
}
+4 -4
View File
@@ -91,17 +91,17 @@ GrooveRadar::GrooveRadarValueMap::GrooveRadarValueMap()
}
}
void GrooveRadar::GrooveRadarValueMap::SetFromNotes( PlayerNumber pn, Steps* pNotes ) // NULL means no song
void GrooveRadar::GrooveRadarValueMap::SetFromNotes( PlayerNumber pn, Steps* pSteps ) // NULL means no song
{
if(DISABLE_RADAR == 1) // if the theme says not to disable it
return;
if( pNotes != NULL )
if( pSteps != NULL )
{
for( int c=0; c<NUM_SHOWN_RADAR_CATEGORIES; c++ )
{
const float fValueCurrent = m_fValuesOld[pn][c] * (1-m_PercentTowardNew[pn]) + m_fValuesNew[pn][c] * m_PercentTowardNew[pn];
m_fValuesOld[pn][c] = fValueCurrent;
m_fValuesNew[pn][c] = pNotes->GetRadarValues()[c];
m_fValuesNew[pn][c] = pSteps->GetRadarValues()[c];
}
if( m_bValuesVisible[pn] == false ) // the values WERE invisible
@@ -111,7 +111,7 @@ void GrooveRadar::GrooveRadarValueMap::SetFromNotes( PlayerNumber pn, Steps* pNo
m_bValuesVisible[pn] = true;
}
else // pNotes == NULL
else // pSteps == NULL
{
m_bValuesVisible[pn] = false;
}
+3 -3
View File
@@ -23,9 +23,9 @@ class GrooveRadar : public ActorFrame
public:
GrooveRadar();
void SetFromNotes( PlayerNumber pn, Steps* pNotes ) // NULL means no Song
void SetFromNotes( PlayerNumber pn, Steps* pSteps ) // NULL means no Song
{
m_GrooveRadarValueMap.SetFromNotes( pn, pNotes );
m_GrooveRadarValueMap.SetFromNotes( pn, pSteps );
}
void TweenOnScreen();
@@ -42,7 +42,7 @@ protected:
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
void SetFromNotes( PlayerNumber pn, Steps* pNotes ); // NULL means no Song
void SetFromNotes( PlayerNumber pn, Steps* pSteps ); // NULL means no Song
void TweenOnScreen();
void TweenOffScreen();
+6 -6
View File
@@ -150,14 +150,14 @@ void MusicWheel::Load()
}
Song* pSong;
Steps* pNotes;
Steps* pSteps;
PlayerOptions po;
SongOptions so;
SONGMAN->GetExtraStageInfo(
GAMESTATE->IsExtraStage2(),
GAMESTATE->GetCurrentStyleDef(),
pSong,
pNotes,
pSteps,
po,
so );
GAMESTATE->m_pCurSong = pSong;
@@ -165,9 +165,9 @@ void MusicWheel::Load()
{
if( GAMESTATE->IsHumanPlayer(p) )
{
GAMESTATE->m_pCurNotes[p] = pNotes;
GAMESTATE->m_pCurNotes[p] = pSteps;
GAMESTATE->m_PlayerOptions[p] = po;
GAMESTATE->m_PreferredDifficulty[p] = pNotes->GetDifficulty();
GAMESTATE->m_PreferredDifficulty[p] = pSteps->GetDifficulty();
}
}
GAMESTATE->m_SongOptions = so;
@@ -593,10 +593,10 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
{
Song* pSong;
Steps* pNotes;
Steps* pSteps;
PlayerOptions po;
SongOptions so;
SONGMAN->GetExtraStageInfo( GAMESTATE->IsExtraStage2(), GAMESTATE->GetCurrentStyleDef(), pSong, pNotes, po, so );
SONGMAN->GetExtraStageInfo( GAMESTATE->IsExtraStage2(), GAMESTATE->GetCurrentStyleDef(), pSong, pSteps, po, so );
bool bFoundExtraSong = false;
+25 -25
View File
@@ -42,14 +42,14 @@ void NoteData::SetNumTracks( int iNewNumTracks )
// Make sure that all tracks are of the same length
ASSERT( m_iNumTracks > 0 );
int rows = m_TapNotes[0].size();
int rows = m_TapSteps[0].size();
for( int t=0; t<MAX_NOTE_TRACKS; t++ )
{
if( t<m_iNumTracks )
m_TapNotes[t].resize( rows, TAP_EMPTY );
m_TapSteps[t].resize( rows, TAP_EMPTY );
else
m_TapNotes[t].clear();
m_TapSteps[t].clear();
}
/* Remove all hold notes that are out of bounds. */
@@ -74,7 +74,7 @@ void NoteData::ClearRange( int iNoteIndexBegin, int iNoteIndexEnd )
void NoteData::ClearAll()
{
for( int t=0; t<m_iNumTracks; t++ )
m_TapNotes[t].clear();
m_TapSteps[t].clear();
m_HoldNotes.clear();
}
@@ -88,7 +88,7 @@ void NoteData::CopyRange( const NoteData* pFrom, int iFromIndexBegin, int iFromI
From.To4s( *pFrom );
To.To4s( *this );
// copy recorded TapNotes
// copy recorded TapSteps
int f = iFromIndexBegin, t = iToIndexBegin;
while( f<=iFromIndexEnd )
@@ -124,7 +124,7 @@ void NoteData::CopyAll( const NoteData* pFrom )
ClearAll();
for( int c=0; c<m_iNumTracks; c++ )
m_TapNotes[c] = pFrom->m_TapNotes[c];
m_TapSteps[c] = pFrom->m_TapSteps[c];
m_HoldNotes = pFrom->m_HoldNotes;
m_AttackMap = pFrom->m_AttackMap;
}
@@ -271,7 +271,7 @@ void NoteData::AddHoldNote( HoldNote add )
int iAddStartIndex = add.iStartRow;
int iAddEndIndex = add.iEndRow;
// delete TapNotes under this HoldNote
// delete TapSteps under this HoldNote
for( i=iAddStartIndex+1; i<=iAddEndIndex; i++ )
SetTapNote(add.iTrack, i, TAP_EMPTY);
@@ -345,7 +345,7 @@ void NoteData::PruneUnusedAttacksFromMap()
}
// Remove all items from m_AttackMap that don't have corresponding
// TapNotes in use.
// TapSteps in use.
for( TapNote tn = TAP_ATTACK_BEGIN; tn<=TAP_ATTACK_END; tn++ )
{
bool bInAttackMap = m_AttackMap.find(tn) != m_AttackMap.end();
@@ -376,7 +376,7 @@ int NoteData::GetFirstRow() const
int i;
for( i=0; i < int(m_TapNotes[0].size()); i++ )
for( i=0; i < int(m_TapSteps[0].size()); i++ )
{
if( !IsRowEmpty(i) )
{
@@ -409,7 +409,7 @@ int NoteData::GetLastRow() const
int i;
for( i = int(m_TapNotes[0].size()); i>=0; i-- ) // iterate back to front
for( i = int(m_TapSteps[0].size()); i>=0; i-- ) // iterate back to front
{
if( !IsRowEmpty(i) )
{
@@ -432,7 +432,7 @@ float NoteData::GetLastBeat() const
return NoteRowToBeat( GetLastRow() );
}
int NoteData::GetNumTapNotes( float fStartBeat, float fEndBeat ) const
int NoteData::GetNumTapSteps( float fStartBeat, float fEndBeat ) const
{
int iNumNotes = 0;
@@ -755,7 +755,7 @@ void NoteData::LoadTransformed( const NoteData* pOriginal, int iNewNumTracks, co
if( iOriginalTrack == -1 )
continue;
m_TapNotes[t] = Original.m_TapNotes[iOriginalTrack];
m_TapSteps[t] = Original.m_TapSteps[iOriginalTrack];
}
Convert4sToHoldNotes();
@@ -795,7 +795,7 @@ void NoteData::LoadOverlapped( const NoteData* pOriginal, int iNewNumTracks )
const int iTrackFrom = i;
int &iTrackTo = DestRow[i];
const TapNote iStepFrom = in.m_TapNotes[iTrackFrom][row];
const TapNote iStepFrom = in.m_TapSteps[iTrackFrom][row];
if( iStepFrom == TAP_EMPTY )
continue;
@@ -891,49 +891,49 @@ void NoteData::LoadTransformedSlidingWindow( const NoteData* pOriginal, int iNew
m_AttackMap = Original.GetAttackMap();
}
void NoteData::PadTapNotes(int rows)
void NoteData::PadTapSteps(int rows)
{
int needed = rows - m_TapNotes[0].size() + 1;
int needed = rows - m_TapSteps[0].size() + 1;
if(needed < 0)
return;
needed += 100; /* optimization: give it a little more than it needs */
for(int track = 0; track < m_iNumTracks; ++track)
m_TapNotes[track].insert(m_TapNotes[track].end(), needed, TAP_EMPTY);
m_TapSteps[track].insert(m_TapSteps[track].end(), needed, TAP_EMPTY);
}
void NoteData::MoveTapNoteTrack(int dest, int src)
{
if(dest == src) return;
m_TapNotes[dest] = m_TapNotes[src];
m_TapNotes[src].clear();
m_TapSteps[dest] = m_TapSteps[src];
m_TapSteps[src].clear();
}
void NoteData::SetTapNote(int track, int row, TapNote t)
{
if(row < 0) return;
PadTapNotes(row);
m_TapNotes[track][row]=t;
PadTapSteps(row);
m_TapSteps[track][row]=t;
}
void NoteData::ReserveRows( int row )
{
for(int track = 0; track < m_iNumTracks; ++track)
m_TapNotes[track].reserve( row );
m_TapSteps[track].reserve( row );
}
void NoteData::EliminateAllButOneTap(int row)
{
if(row < 0) return;
PadTapNotes(row);
PadTapSteps(row);
int track;
for(track = 0; track < m_iNumTracks; ++track)
{
if( m_TapNotes[track][row] == TAP_TAP )
if( m_TapSteps[track][row] == TAP_TAP )
break;
}
@@ -941,8 +941,8 @@ void NoteData::EliminateAllButOneTap(int row)
for( ; track < m_iNumTracks; ++track)
{
if( m_TapNotes[track][row] == TAP_TAP )
m_TapNotes[track][row] = TAP_EMPTY;
if( m_TapSteps[track][row] == TAP_TAP )
m_TapSteps[track][row] = TAP_EMPTY;
}
}
+10 -10
View File
@@ -23,15 +23,15 @@
class NoteData
{
/* Keep this aligned, so that they all have the same size. */
vector<TapNote> m_TapNotes[MAX_NOTE_TRACKS];
vector<TapNote> m_TapSteps[MAX_NOTE_TRACKS];
int m_iNumTracks;
vector<HoldNote> m_HoldNotes;
map<TapNote,Attack> m_AttackMap;
/* Pad m_TapNotes so it includes the row "rows". */
void PadTapNotes(int rows);
/* Pad m_TapSteps so it includes the row "rows". */
void PadTapSteps(int rows);
void LoadOverlapped( const NoteData* pOriginal, int iNewNumTracks );
@@ -56,8 +56,8 @@ public:
* range; pretend the song goes on with TAP_EMPTYs indefinitely. */
inline TapNote GetTapNote(unsigned track, int row) const
{
if(row < 0 || row >= (int) m_TapNotes[track].size()) return TapNote(TAP_EMPTY);
return m_TapNotes[track][row];
if(row < 0 || row >= (int) m_TapSteps[track].size()) return TapNote(TAP_EMPTY);
return m_TapSteps[track][row];
}
void ReserveRows( int row );
@@ -65,7 +65,7 @@ public:
* which is much faster. Be sure that 0 <= row < GetMaxRow(). */
inline TapNote GetTapNoteX(unsigned track, int row) const
{
return m_TapNotes[track][row];
return m_TapSteps[track][row];
}
void MoveTapNoteTrack(int dest, int src);
void SetTapNote(int track, int row, TapNote t);
@@ -99,7 +99,7 @@ public:
//
// used in edit/record
//
void AddHoldNote( HoldNote newNote ); // add note hold note merging overlapping HoldNotes and destroying TapNotes underneath
void AddHoldNote( HoldNote newNote ); // add note hold note merging overlapping HoldNotes and destroying TapSteps underneath
void RemoveHoldNote( int index );
HoldNote &GetHoldNote( int index ) { ASSERT( index < (int) m_HoldNotes.size() ); return m_HoldNotes[index]; }
const HoldNote &GetHoldNote( int index ) const { ASSERT( index < (int) m_HoldNotes.size() ); return m_HoldNotes[index]; }
@@ -116,13 +116,13 @@ public:
/* Return the highest beat/row that might contain notes. (Use GetLastBeat if you need
* accuracy.) */
float GetMaxBeat() const { return NoteRowToBeat(GetMaxRow()); }
int GetMaxRow() const { return int(m_TapNotes[0].size()); }
int GetMaxRow() const { return int(m_TapSteps[0].size()); }
float GetFirstBeat() const; // return the beat number of the first note
int GetFirstRow() const;
float GetLastBeat() const; // return the beat number of the last note
int GetLastRow() const;
int GetNumTapNotes( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
int GetNumTapSteps( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
int GetNumMines( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
int GetNumHands( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
int GetNumRowsWithTap( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
@@ -138,7 +138,7 @@ public:
void LoadTransformed( const NoteData* pOriginal, int iNewNumTracks, const int iOriginalTrackToTakeFrom[] ); // -1 for iOriginalTracksToTakeFrom means no track
void LoadTransformedSlidingWindow( const NoteData* pOriginal, int iNewNumTracks ); // used by autogen
// Convert between HoldNote representation and '2' and '3' markers in TapNotes
// Convert between HoldNote representation and '2' and '3' markers in TapSteps
void Convert2sAnd3sToHoldNotes();
void ConvertHoldNotesTo2sAnd3s();
void To2sAnd3s( const NoteData &out );
+7 -7
View File
@@ -321,7 +321,7 @@ float NoteDataUtil::GetStreamRadarValue( const NoteData &in, float fSongSeconds
if( !fSongSeconds )
return 0.0f;
// density of steps
int iNumNotes = in.GetNumTapNotes() + in.GetNumHoldNotes();
int iNumNotes = in.GetNumTapSteps() + in.GetNumHoldNotes();
float fNotesPerSecond = iNumNotes/fSongSeconds;
float fReturn = fNotesPerSecond / 7;
return min( fReturn, 1.0f );
@@ -342,7 +342,7 @@ float NoteDataUtil::GetVoltageRadarValue( const NoteData &in, float fSongSeconds
for( int i=0; i<=int(fLastBeat); i+=BEAT_WINDOW )
{
int iNumNotesThisWindow = in.GetNumTapNotes((float)i,(float)i+BEAT_WINDOW) + in.GetNumHoldNotes((float)i,(float)i+BEAT_WINDOW);
int iNumNotesThisWindow = in.GetNumTapSteps((float)i,(float)i+BEAT_WINDOW) + in.GetNumHoldNotes((float)i,(float)i+BEAT_WINDOW);
float fDensityThisWindow = iNumNotesThisWindow/(float)BEAT_WINDOW;
fMaxDensitySoFar = max( fMaxDensitySoFar, fDensityThisWindow );
}
@@ -392,7 +392,7 @@ void NoteDataUtil::RemoveHoldNotes(NoteData &in, float fStartBeat, float fEndBea
int iStartIndex = BeatToNoteRow( fStartBeat );
int iEndIndex = BeatToNoteRow( fEndBeat );
// turn all the HoldNotes into TapNotes
// turn all the HoldNotes into TapSteps
for( int i=in.GetNumHoldNotes()-1; i>=0; i-- ) // iterate backwards so we can delete
{
const HoldNote hn = in.GetHoldNote( i );
@@ -410,7 +410,7 @@ void NoteDataUtil::RemoveSimultaneousNotes(NoteData &in, int iMaxSimultaneous, f
int iStartIndex = BeatToNoteRow( fStartBeat );
int iEndIndex = BeatToNoteRow( fEndBeat );
// turn all the HoldNotes into TapNotes
// turn all the HoldNotes into TapSteps
for( int r=iStartIndex; r<=iEndIndex; r++ ) // iterate backwards so we can delete
{
if( in.IsRowEmpty(r) )
@@ -629,7 +629,7 @@ static void SuperShuffleTaps( NoteData &in, int iStartIndex, int iEndIndex )
{
/* We already did the normal shuffling code above, which did a good job
* of shuffling HoldNotes without creating impossible patterns.
* Now, go in and shuffle the TapNotes per-row.
* Now, go in and shuffle the TapSteps per-row.
*
* This is only called by NoteDataUtil::Turn. "in" is in 4s, and iStartIndex
* and iEndIndex are in range. */
@@ -1192,7 +1192,7 @@ void NoteDataUtil::SnapToNearestNoteType( NoteData &in, NoteType nt1, NoteType n
in.ConvertHoldNotesTo2sAnd3s();
// iterate over all TapNotes in the interval and snap them
// iterate over all TapSteps in the interval and snap them
for( int i=iNoteIndexBegin; i<=iNoteIndexEnd; i++ )
{
int iOldIndex = i;
@@ -1218,7 +1218,7 @@ void NoteDataUtil::SnapToNearestNoteType( NoteData &in, NoteType nt1, NoteType n
const TapNote oldnote = in.GetTapNote(c, iNewIndex);
if( note == TAP_TAP &&
(oldnote == TAP_HOLD_HEAD || oldnote == TAP_HOLD_TAIL) )
continue; // HoldNotes override TapNotes
continue; // HoldNotes override TapSteps
/* If two hold note boundaries are getting snapped together,
* merge them. */
+7 -7
View File
@@ -31,9 +31,9 @@ void NoteDataWithScoring::Init()
m_HoldNoteScores.clear();
}
int NoteDataWithScoring::GetNumTapNotesWithScore( TapNoteScore tns, const float fStartBeat, float fEndBeat ) const
int NoteDataWithScoring::GetNumTapStepsWithScore( TapNoteScore tns, const float fStartBeat, float fEndBeat ) const
{
int iNumSuccessfulTapNotes = 0;
int iNumSuccessfulTapSteps = 0;
if(fEndBeat == -1)
fEndBeat = GetMaxBeat()+1;
@@ -46,11 +46,11 @@ int NoteDataWithScoring::GetNumTapNotesWithScore( TapNoteScore tns, const float
for( int t=0; t<GetNumTracks(); t++ )
{
if( this->GetTapNote(t, i) != TAP_EMPTY && GetTapNoteScore(t, i) >= tns )
iNumSuccessfulTapNotes++;
iNumSuccessfulTapSteps++;
}
}
return iNumSuccessfulTapNotes;
return iNumSuccessfulTapSteps;
}
int NoteDataWithScoring::GetNumNWithScore( TapNoteScore tns, int MinTaps, const float fStartBeat, float fEndBeat ) const
@@ -281,17 +281,17 @@ float NoteDataWithScoring::GetActualRadarValue( RadarCategory rv, PlayerNumber p
float NoteDataWithScoring::GetActualStreamRadarValue( float fSongSeconds, PlayerNumber pn ) const
{
int TotalSteps = GetNumTapNotes();
int TotalSteps = GetNumTapSteps();
if( !TotalSteps )
return 1;
const int Perfects = GetNumTapNotesWithScore(TNS_PERFECT);
const int Perfects = GetNumTapStepsWithScore(TNS_PERFECT);
return clamp( float(Perfects)/TotalSteps, 0.0f, 1.0f );
}
float NoteDataWithScoring::GetActualVoltageRadarValue( float fSongSeconds, PlayerNumber pn ) const
{
/* g_CurStageStats.iMaxCombo is unrelated to GetNumTapNotes: m_bComboContinuesBetweenSongs
/* g_CurStageStats.iMaxCombo is unrelated to GetNumTapSteps: m_bComboContinuesBetweenSongs
* might be on, and the way combo is counted varies depending on the mode and score
* keeper. Instead, let's use the length of the longest recorded combo. This is
* only subtly different: it's the percent of the song the longest combo took to get. */
+1 -1
View File
@@ -65,7 +65,7 @@ public:
void Init();
// statistics
int GetNumTapNotesWithScore( TapNoteScore tns, const float fStartBeat = 0, const float fEndBeat = -1 ) const;
int GetNumTapStepsWithScore( TapNoteScore tns, const float fStartBeat = 0, const float fEndBeat = -1 ) const;
int GetNumNWithScore( TapNoteScore tns, int MinTaps, const float fStartBeat = 0, const float fEndBeat = -1 ) const;
int GetNumHoldNotesWithScore( HoldNoteScore hns, const float fStartBeat = 0, const float fEndBeat = -1 ) const;
int GetSuccessfulMines( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
+1 -1
View File
@@ -4,7 +4,7 @@
-----------------------------------------------------------------------------
Class: NoteDisplay
Desc: Draws TapNotes and HoldNotes.
Desc: Draws TapSteps and HoldNotes.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Brian Bugh
+1 -1
View File
@@ -581,7 +581,7 @@ void NoteField::DrawPrimitives()
//
// Draw all TapNotes in this column
// Draw all TapSteps in this column
//
CurDisplay = m_BeatToNoteDisplays.begin();
NextDisplay = CurDisplay; ++NextDisplay;
+1 -1
View File
@@ -426,7 +426,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
const bool ok = LoadFromBMSFile( out.GetSongDir() + arrayBMSFileNames[i],
*pNewNotes );
if( ok )
out.m_apNotes.push_back( pNewNotes );
out.m_vpSteps.push_back( pNewNotes );
else
delete pNewNotes;
}
+1 -1
View File
@@ -455,7 +455,7 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out )
*pNewNotes
);
if(pNewNotes->m_StepsType != STEPS_TYPE_INVALID)
out.m_apNotes.push_back( pNewNotes );
out.m_vpSteps.push_back( pNewNotes );
else
delete pNewNotes;
}
+1 -1
View File
@@ -361,7 +361,7 @@ bool KSFLoader::LoadFromDir( CString sDir, Song &out )
continue;
}
out.m_apNotes.push_back( pNewNotes );
out.m_vpSteps.push_back( pNewNotes );
}
return true;
+2 -2
View File
@@ -337,7 +337,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
{
Steps* pNewNotes = new Steps;
ASSERT( pNewNotes );
out.m_apNotes.push_back( pNewNotes );
out.m_vpSteps.push_back( pNewNotes );
if( iNumParams < 7 )
{
@@ -457,7 +457,7 @@ bool SMLoader::LoadEdit( CString sEditFilePath, ProfileSlot slot )
return false;
}
pSong->m_apNotes.push_back( pNewNotes );
pSong->m_vpSteps.push_back( pNewNotes );
return true; // Only allow one Steps per edit file!
}
else
+7 -7
View File
@@ -397,20 +397,20 @@ bool NotesWriterDWI::Write( CString sPath, const Song &out )
f.PutLine( ";" );
}
for( unsigned i=0; i<out.m_apNotes.size(); i++ )
for( unsigned i=0; i<out.m_vpSteps.size(); i++ )
{
if( out.m_apNotes[i]->IsAutogen() )
if( out.m_vpSteps[i]->IsAutogen() )
continue; // don't save autogen notes
if(!WriteDWINotesTag( f, *out.m_apNotes[i] ))
if(!WriteDWINotesTag( f, *out.m_vpSteps[i] ))
continue;
WriteDWINotesField( f, *out.m_apNotes[i], 0 );
if(out.m_apNotes[i]->m_StepsType==STEPS_TYPE_DANCE_DOUBLE ||
out.m_apNotes[i]->m_StepsType==STEPS_TYPE_DANCE_COUPLE)
WriteDWINotesField( f, *out.m_vpSteps[i], 0 );
if(out.m_vpSteps[i]->m_StepsType==STEPS_TYPE_DANCE_DOUBLE ||
out.m_vpSteps[i]->m_StepsType==STEPS_TYPE_DANCE_COUPLE)
{
f.PutLine( ":" );
WriteDWINotesField( f, *out.m_apNotes[i], 4 );
WriteDWINotesField( f, *out.m_vpSteps[i], 4 );
}
f.PutLine( ";" );
+5 -5
View File
@@ -204,17 +204,17 @@ bool NotesWriterSM::Write(CString sPath, const Song &out, bool bSavingCache)
//
// Save all Steps for this file
//
for( i=0; i<out.m_apNotes.size(); i++ )
for( i=0; i<out.m_vpSteps.size(); i++ )
{
Steps* pNotes = out.m_apNotes[i];
if( pNotes->IsAutogen() )
Steps* pSteps = out.m_vpSteps[i];
if( pSteps->IsAutogen() )
continue; /* don't write autogen notes */
/* Only save steps that weren't loaded from a profile. */
if( pNotes->WasLoadedFromProfile() )
if( pSteps->WasLoadedFromProfile() )
continue;
WriteSMNotesTag( *out.m_apNotes[i], f, bSavingCache );
WriteSMNotesTag( *out.m_vpSteps[i], f, bSavingCache );
}
return true;
+4 -4
View File
@@ -300,7 +300,7 @@ void PlayerMinus::Update( float fDeltaTime )
//
// Check for TapNote misses
//
UpdateTapNotesMissedOlderThan( GetMaxStepDistanceSeconds() );
UpdateTapStepsMissedOlderThan( GetMaxStepDistanceSeconds() );
//
// update pressed flag
@@ -847,7 +847,7 @@ void PlayerMinus::Step( int col, RageTimer tm )
/* AI will generate misses here. Don't handle a miss like a regular note because
* we want the judgment animation to appear delayed. Instead, return early if
* AI generated a miss, and let UpdateMissedTapNotesOlderThan() detect and handle the
* AI generated a miss, and let UpdateMissedTapStepsOlderThan() detect and handle the
* misses. */
if( score == TNS_MISS )
return;
@@ -1030,9 +1030,9 @@ void PlayerMinus::OnRowCompletelyJudged( int iIndexThatWasSteppedOn )
}
void PlayerMinus::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds )
void PlayerMinus::UpdateTapStepsMissedOlderThan( float fMissIfOlderThanSeconds )
{
//LOG->Trace( "Steps::UpdateTapNotesMissedOlderThan(%f)", fMissIfOlderThanThisBeat );
//LOG->Trace( "Steps::UpdateTapStepsMissedOlderThan(%f)", fMissIfOlderThanThisBeat );
int iMissIfOlderThanThisIndex;
{
const float fEarliestTime = GAMESTATE->m_fMusicSeconds - fMissIfOlderThanSeconds;
+1 -1
View File
@@ -61,7 +61,7 @@ public:
static float GetMaxStepDistanceSeconds();
protected:
void UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat );
void UpdateTapStepsMissedOlderThan( float fMissIfOlderThanThisBeat );
void OnRowCompletelyJudged( int iStepIndex );
void HandleTapRowScore( unsigned row );
void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
+1 -1
View File
@@ -578,7 +578,7 @@ bool PlayerOptions::IsEasierForCourse( Course* pCourse, StepsType st, CourseDiff
FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e )
{
if( e->pSong && IsEasierForSongAndSteps(e->pSong, e->pNotes) )
if( e->pSong && IsEasierForSongAndSteps(e->pSong, e->pSteps) )
return true;
}
return false;
+6 -6
View File
@@ -362,8 +362,8 @@ void ProfileManager::ReadSM300NoteScores()
Difficulty dc = StringToDifficulty( szStepsDescription );
// Search for the corresponding Notes poister.
Steps* pNotes = pSong->GetStepsByDifficulty( st, dc );
if( pNotes == NULL ) // didn't find a match
Steps* pSteps = pSong->GetStepsByDifficulty( st, dc );
if( pSteps == NULL ) // didn't find a match
continue; // skip this estry
@@ -371,20 +371,20 @@ void ProfileManager::ReadSM300NoteScores()
char szGradeLetters[10]; // longest possible string is "AAA"
int iMaxCombo; // throw away
pNotes->m_MemCardDatas[PROFILE_SLOT_MACHINE].vHighScores.resize(1);
pSteps->m_MemCardDatas[PROFILE_SLOT_MACHINE].vHighScores.resize(1);
iRetVal = sscanf(
value,
"%d::%[^:]::%d::%d",
&pNotes->m_MemCardDatas[PROFILE_SLOT_MACHINE].iNumTimesPlayed,
&pSteps->m_MemCardDatas[PROFILE_SLOT_MACHINE].iNumTimesPlayed,
szGradeLetters,
&pNotes->m_MemCardDatas[PROFILE_SLOT_MACHINE].vHighScores[0].iScore,
&pSteps->m_MemCardDatas[PROFILE_SLOT_MACHINE].vHighScores[0].iScore,
&iMaxCombo
);
if( iRetVal != 4 )
continue;
pNotes->m_MemCardDatas[PROFILE_SLOT_MACHINE].vHighScores[0].grade = StringToGrade( szGradeLetters );
pSteps->m_MemCardDatas[PROFILE_SLOT_MACHINE].vHighScores[0].grade = StringToGrade( szGradeLetters );
}
}
}
+1 -1
View File
@@ -43,7 +43,7 @@ public:
virtual void Update( float fDelta ) { }
/* Note that pNoteData will include any transformations due to modifiers. */
virtual void OnNextSong( int iSongInCourseIndex, const Steps* pNotes, const NoteData* pNoteData ) = 0; // before a song plays (called multiple times if course)
virtual void OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData ) = 0; // before a song plays (called multiple times if course)
virtual void HandleTapScore( TapNoteScore score ) = 0;
virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) = 0;
+13 -13
View File
@@ -26,19 +26,19 @@
#include "ProfileManager.h"
#include "NetworkSyncManager.h"
ScoreKeeperMAX2::ScoreKeeperMAX2( const vector<Song*>& apSongs, const vector<Steps*>& apNotes_, const vector<AttackArray> &asModifiers, PlayerNumber pn_ ):
ScoreKeeper(pn_), apNotes(apNotes_)
ScoreKeeperMAX2::ScoreKeeperMAX2( const vector<Song*>& apSongs, const vector<Steps*>& apSteps_, const vector<AttackArray> &asModifiers, PlayerNumber pn_ ):
ScoreKeeper(pn_), apSteps(apSteps_)
{
ASSERT( apSongs.size() == apNotes_.size() );
ASSERT( apSongs.size() == apSteps_.size() );
ASSERT( apSongs.size() == asModifiers.size() );
//
// Fill in g_CurStageStats, calculate multiplier
//
int iTotalPossibleDancePoints = 0;
for( unsigned i=0; i<apNotes.size(); i++ )
for( unsigned i=0; i<apSteps.size(); i++ )
{
Song* pSong = apSongs[i];
Steps* pSteps = apNotes[i];
Steps* pSteps = apSteps[i];
NoteData notedata;
pSteps->GetNoteData( &notedata );
@@ -108,7 +108,7 @@ ScoreKeeperMAX2::ScoreKeeperMAX2( const vector<Song*>& apSongs, const vector<Ste
}
void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, const Steps* pNotes, const NoteData* pNoteData )
void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData )
{
/*
http://www.aaroninjapan.com/ddr2.html
@@ -133,7 +133,7 @@ void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, const Steps* pNotes, c
m_iMaxPossiblePoints = 0;
if( GAMESTATE->IsCourseMode() )
{
const int numSongsInCourse = apNotes.size();
const int numSongsInCourse = apSteps.size();
ASSERT( numSongsInCourse != 0 );
const int iIndex = iSongInCourseIndex % numSongsInCourse;
@@ -158,7 +158,7 @@ void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, const Steps* pNotes, c
}
else
{
const int iMeter = clamp( pNotes->GetMeter(), 1, 10 );
const int iMeter = clamp( pSteps->GetMeter(), 1, 10 );
// long ver and marathon ver songs have higher max possible scores
int iLengthMultiplier = SongManager::GetNumStagesForSong( GAMESTATE->m_pCurSong );
@@ -183,7 +183,7 @@ void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, const Steps* pNotes, c
ASSERT( m_iPointBonus >= 0 );
m_iTapNotesHit = 0;
m_iTapStepsHit = 0;
}
static int GetScore(int p, int B, int S, int n)
@@ -267,7 +267,7 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score )
default: p = 0; break;
}
m_iTapNotesHit++;
m_iTapStepsHit++;
const int N = m_iNumTapsAndHolds;
const int sum = (N * (N + 1)) / 2;
@@ -286,15 +286,15 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score )
}
else
{
iScore += GetScore(p, B, sum, m_iTapNotesHit);
iScore += GetScore(p, B, sum, m_iTapStepsHit);
const int &iCurrentCombo = g_CurStageStats.iCurCombo[m_PlayerNumber];
g_CurStageStats.iBonus[m_PlayerNumber] += m_ComboBonusFactor[score] * iCurrentCombo;
}
/* Subtract the maximum this step could have been worth from the bonus. */
m_iPointBonus -= GetScore(10, B, sum, m_iTapNotesHit);
m_iPointBonus -= GetScore(10, B, sum, m_iTapStepsHit);
if ( m_iTapNotesHit == m_iNumTapsAndHolds && score >= TNS_PERFECT )
if ( m_iTapStepsHit == m_iNumTapsAndHolds && score >= TNS_PERFECT )
{
if (!g_CurStageStats.bFailedEarlier[m_PlayerNumber])
iScore += m_iPointBonus;
+4 -4
View File
@@ -20,7 +20,7 @@ class ScoreKeeperMAX2: public ScoreKeeper
{
int m_iScoreRemainder;
int m_iMaxPossiblePoints;
int m_iTapNotesHit; // number of notes judged so far, needed by scoring
int m_iTapStepsHit; // number of notes judged so far, needed by scoring
int m_iNumTapsAndHolds;
int m_iMaxScoreSoFar; // for nonstop scoring
@@ -28,7 +28,7 @@ class ScoreKeeperMAX2: public ScoreKeeper
int m_iCurToastyCombo;
bool m_bIsLastSongInCourse;
const vector<Steps*>& apNotes;
const vector<Steps*>& apSteps;
void AddScore( TapNoteScore score );
@@ -38,10 +38,10 @@ class ScoreKeeperMAX2: public ScoreKeeper
int m_ComboBonusFactor[NUM_TAP_NOTE_SCORES];
public:
ScoreKeeperMAX2( const vector<Song*>& apSongs, const vector<Steps*>& apNotes, const vector<AttackArray> &asModifiers, PlayerNumber pn);
ScoreKeeperMAX2( const vector<Song*>& apSongs, const vector<Steps*>& apSteps, const vector<AttackArray> &asModifiers, PlayerNumber pn);
// before a song plays (called multiple times if course)
void OnNextSong( int iSongInCourseIndex, const Steps* pNotes, const NoteData* pNoteData );
void OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData );
void HandleTapScore( TapNoteScore score );
void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow );
+1 -1
View File
@@ -26,7 +26,7 @@ ScoreKeeperRave::ScoreKeeperRave(PlayerNumber pn) : ScoreKeeper(pn)
ATTACK_DURATION_SECONDS.Refresh();
}
void ScoreKeeperRave::OnNextSong( int iSongInCourseIndex, const Steps* pNotes, const NoteData* pNoteData )
void ScoreKeeperRave::OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData )
{
}
+1 -1
View File
@@ -21,7 +21,7 @@ public:
// Overrides
ScoreKeeperRave(PlayerNumber pn);
void Update( float fDelta );
void OnNextSong( int iSongInCourseIndex, const Steps* pNotes, const NoteData* pNoteData ); // before a song plays (called multiple times if course)
void OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData ); // before a song plays (called multiple times if course)
void HandleTapScore( TapNoteScore score );
void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow );
void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
+45 -45
View File
@@ -279,11 +279,11 @@ ScreenEdit::ScreenEdit( CString sName ) : Screen( sName )
SCREENMAN->RefreshCreditsMessages();
m_pSong = GAMESTATE->m_pCurSong;
m_pNotes = GAMESTATE->m_pCurNotes[PLAYER_1];
m_pSteps = GAMESTATE->m_pCurNotes[PLAYER_1];
m_pAttacksFromCourse = NULL;
NoteData noteData;
m_pNotes->GetNoteData( &noteData );
m_pSteps->GetNoteData( &noteData );
m_EditMode = MODE_EDITING;
@@ -554,7 +554,7 @@ void ScreenEdit::Update( float fDeltaTime )
void ScreenEdit::UpdateTextInfo()
{
int iNumTapNotes = m_NoteFieldEdit.GetNumTapNotes();
int iNumTapSteps = m_NoteFieldEdit.GetNumTapSteps();
int iNumHoldNotes = m_NoteFieldEdit.GetNumHoldNotes();
CString sNoteType;
@@ -584,11 +584,11 @@ void ScreenEdit::UpdateTextInfo()
sText += ssprintf( "Snap to:\n %s\n", sNoteType.c_str() );
sText += ssprintf( "Selection begin:\n %s\n", m_NoteFieldEdit.m_fBeginMarker==-1 ? "not set" : ssprintf("%.2f",m_NoteFieldEdit.m_fBeginMarker).c_str() );
sText += ssprintf( "Selection end:\n %s\n", m_NoteFieldEdit.m_fEndMarker==-1 ? "not set" : ssprintf("%.2f",m_NoteFieldEdit.m_fEndMarker).c_str() );
sText += ssprintf( "Difficulty:\n %s\n", DifficultyToString( m_pNotes->GetDifficulty() ).c_str() );
sText += ssprintf( "Difficulty:\n %s\n", DifficultyToString( m_pSteps->GetDifficulty() ).c_str() );
sText += ssprintf( "Description:\n %s\n", GAMESTATE->m_pCurNotes[PLAYER_1] ? GAMESTATE->m_pCurNotes[PLAYER_1]->GetDescription().c_str() : "no description" );
sText += ssprintf( "Main title:\n %s\n", m_pSong->m_sMainTitle.c_str() );
sText += ssprintf( "Sub title:\n %s\n", m_pSong->m_sSubTitle.c_str() );
sText += ssprintf( "Tap Steps:\n %d\n", iNumTapNotes );
sText += ssprintf( "Tap Steps:\n %d\n", iNumTapSteps );
sText += ssprintf( "Hold Steps:\n %d\n", iNumHoldNotes );
sText += ssprintf( "Beat 0 Offset:\n %.3f secs\n", m_pSong->m_Timing.m_fBeat0OffsetInSeconds );
sText += ssprintf( "Preview Start:\n %.2f secs\n", m_pSong->m_fMusicSampleStartSeconds );
@@ -945,12 +945,12 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
case SDLK_F6:
{
// save current steps
Steps* pNotes = GAMESTATE->m_pCurNotes[PLAYER_1];
ASSERT( pNotes );
pNotes->SetNoteData( &m_NoteFieldEdit );
Steps* pSteps = GAMESTATE->m_pCurNotes[PLAYER_1];
ASSERT( pSteps );
pSteps->SetNoteData( &m_NoteFieldEdit );
// Get all Steps of this StepsType
StepsType st = pNotes->m_StepsType;
StepsType st = pSteps->m_StepsType;
vector<Steps*> vSteps;
GAMESTATE->m_pCurSong->GetSteps( vSteps, st );
@@ -958,7 +958,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
StepsUtil::SortStepsByTypeAndDifficulty( vSteps );
// Find out what index the current Steps are
vector<Steps*>::iterator it = find( vSteps.begin(), vSteps.end(), pNotes );
vector<Steps*>::iterator it = find( vSteps.begin(), vSteps.end(), pSteps );
ASSERT( it != vSteps.end() );
switch( DeviceI.button )
@@ -982,14 +982,14 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
default: ASSERT(0); return;
}
pNotes = *it;
GAMESTATE->m_pCurNotes[PLAYER_1] = m_pNotes = pNotes;
pNotes->GetNoteData( &m_NoteFieldEdit );
pSteps = *it;
GAMESTATE->m_pCurNotes[PLAYER_1] = m_pSteps = pSteps;
pSteps->GetNoteData( &m_NoteFieldEdit );
SCREENMAN->SystemMessage( ssprintf(
"Switched to %s %s '%s'",
GAMEMAN->NotesTypeToString( pNotes->m_StepsType ).c_str(),
DifficultyToString( pNotes->GetDifficulty() ).c_str(),
pNotes->GetDescription().c_str() ) );
GAMEMAN->NotesTypeToString( pSteps->m_StepsType ).c_str(),
DifficultyToString( pSteps->GetDifficulty() ).c_str(),
pSteps->GetDescription().c_str() ) );
SOUND->PlayOnce( THEME->GetPathToS("ScreenEdit switch") );
}
break;
@@ -1328,7 +1328,7 @@ void ScreenEdit::TransitionFromRecordToEdit()
int iNoteIndexBegin = BeatToNoteRow( m_NoteFieldEdit.m_fBeginMarker );
int iNoteIndexEnd = BeatToNoteRow( m_NoteFieldEdit.m_fEndMarker );
// delete old TapNotes in the range
// delete old TapSteps in the range
m_NoteFieldEdit.ClearRange( iNoteIndexBegin, iNoteIndexEnd );
m_NoteFieldEdit.CopyRange( &m_NoteFieldRecord, iNoteIndexBegin, iNoteIndexEnd, iNoteIndexBegin );
@@ -1348,9 +1348,9 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
case SM_GoToNextScreen:
// Reload song from disk to discard changes.
GAMESTATE->m_pCurSong->RevertFromDisk( true );
/* We might do something with m_pNotes (eg. UpdateTextInfo) before we end up
* in ScreenEditMenu, and m_pNotes might be invalid due to RevertFromDisk. */
m_pNotes = GAMESTATE->m_pCurNotes[PLAYER_1];
/* We might do something with m_pSteps (eg. UpdateTextInfo) before we end up
* in ScreenEditMenu, and m_pSteps might be invalid due to RevertFromDisk. */
m_pSteps = GAMESTATE->m_pCurNotes[PLAYER_1];
SCREENMAN->SetNewScreen( "ScreenEditMenu" );
break;
case SM_BackFromMainMenu:
@@ -1417,9 +1417,9 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
if( !g_DoReload )
return;
const StepsType st = m_pNotes->m_StepsType;
const StepsType st = m_pSteps->m_StepsType;
StepsID id;
id.FromSteps( m_pNotes );
id.FromSteps( m_pSteps );
GAMESTATE->m_pCurNotes[PLAYER_1] = NULL; /* make RevertFromDisk not try to reset it */
GAMESTATE->m_pCurSong->RevertFromDisk();
@@ -1452,8 +1452,8 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
SCREENMAN->SystemMessage( sMessage );
m_pNotes = GAMESTATE->m_pCurNotes[PLAYER_1] = pSteps;
m_pNotes->GetNoteData( &m_NoteFieldEdit );
m_pSteps = GAMESTATE->m_pCurNotes[PLAYER_1] = pSteps;
m_pSteps->GetNoteData( &m_NoteFieldEdit );
break;
}
@@ -1497,8 +1497,8 @@ void ScreenEdit::OnSnapModeChange()
void ChangeDescription( CString sNew )
{
Steps* pNotes = GAMESTATE->m_pCurNotes[PLAYER_1];
pNotes->SetDescription(sNew);
Steps* pSteps = GAMESTATE->m_pCurNotes[PLAYER_1];
pSteps->SetDescription(sNew);
}
void ChangeMainTitle( CString sNew )
@@ -1552,16 +1552,16 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, int* iAnswers )
{
case edit_notes_statistics:
{
/* XXX: If the difficulty is changed from EDIT, and pNotes->WasLoadedFromProfile()
/* XXX: If the difficulty is changed from EDIT, and pSteps->WasLoadedFromProfile()
* is true, we should warn that the steps will no longer be saved to the profile. */
Steps* pNotes = GAMESTATE->m_pCurNotes[PLAYER_1];
Steps* pSteps = GAMESTATE->m_pCurNotes[PLAYER_1];
float fMusicSeconds = m_soundMusic.GetLengthSeconds();
g_EditNotesStatistics.rows[difficulty].defaultChoice = pNotes->GetDifficulty();
g_EditNotesStatistics.rows[meter].defaultChoice = pNotes->GetMeter()-1;
g_EditNotesStatistics.rows[predict_meter].choices.resize(1);g_EditNotesStatistics.rows[predict_meter].choices[0] = ssprintf("%f",pNotes->PredictMeter());
g_EditNotesStatistics.rows[description].choices.resize(1); g_EditNotesStatistics.rows[description].choices[0] = pNotes->GetDescription();
g_EditNotesStatistics.rows[tap_notes].choices.resize(1); g_EditNotesStatistics.rows[tap_notes].choices[0] = ssprintf("%d", m_NoteFieldEdit.GetNumTapNotes());
g_EditNotesStatistics.rows[difficulty].defaultChoice = pSteps->GetDifficulty();
g_EditNotesStatistics.rows[meter].defaultChoice = pSteps->GetMeter()-1;
g_EditNotesStatistics.rows[predict_meter].choices.resize(1);g_EditNotesStatistics.rows[predict_meter].choices[0] = ssprintf("%f",pSteps->PredictMeter());
g_EditNotesStatistics.rows[description].choices.resize(1); g_EditNotesStatistics.rows[description].choices[0] = pSteps->GetDescription();
g_EditNotesStatistics.rows[tap_notes].choices.resize(1); g_EditNotesStatistics.rows[tap_notes].choices[0] = ssprintf("%d", m_NoteFieldEdit.GetNumTapSteps());
g_EditNotesStatistics.rows[hold_notes].choices.resize(1); g_EditNotesStatistics.rows[hold_notes].choices[0] = ssprintf("%d", m_NoteFieldEdit.GetNumHoldNotes());
g_EditNotesStatistics.rows[stream].choices.resize(1); g_EditNotesStatistics.rows[stream].choices[0] = ssprintf("%f", NoteDataUtil::GetStreamRadarValue(m_NoteFieldEdit,fMusicSeconds));
g_EditNotesStatistics.rows[voltage].choices.resize(1); g_EditNotesStatistics.rows[voltage].choices[0] = ssprintf("%f", NoteDataUtil::GetVoltageRadarValue(m_NoteFieldEdit,fMusicSeconds));
@@ -1589,16 +1589,16 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, int* iAnswers )
case save:
{
// copy edit into current Steps
Steps* pNotes = GAMESTATE->m_pCurNotes[PLAYER_1];
ASSERT( pNotes );
Steps* pSteps = GAMESTATE->m_pCurNotes[PLAYER_1];
ASSERT( pSteps );
pNotes->SetNoteData( &m_NoteFieldEdit );
pSteps->SetNoteData( &m_NoteFieldEdit );
GAMESTATE->m_pCurSong->Save();
// we shouldn't say we're saving a DWI if we're on any game besides
// dance, it just looks tacky and people may be wondering where the
// DWI file is :-)
if ((int)pNotes->m_StepsType <= (int)STEPS_TYPE_DANCE_SOLO)
if ((int)pSteps->m_StepsType <= (int)STEPS_TYPE_DANCE_SOLO)
SCREENMAN->SystemMessage( "Saved as SM and DWI." );
else
SCREENMAN->SystemMessage( "Saved as SM." );
@@ -1883,7 +1883,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
if( sIter[i]->IsAutogen() )
continue;
/* XXX: Edits are distinguished by description. Compare vs m_pNotes. */
/* XXX: Edits are distinguished by description. Compare vs m_pSteps. */
if( (sIter[i]->m_StepsType == GAMESTATE->m_pCurNotes[PLAYER_1]->m_StepsType) &&
(sIter[i]->GetDifficulty() == GAMESTATE->m_pCurNotes[PLAYER_1]->GetDifficulty()) )
continue;
@@ -1937,9 +1937,9 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
{
/* FirstBeat affects backgrounds, so commit changes to memory (not to disk)
* and recalc it. */
Steps* pNotes = GAMESTATE->m_pCurNotes[PLAYER_1];
ASSERT( pNotes );
pNotes->SetNoteData( &m_NoteFieldEdit );
Steps* pSteps = GAMESTATE->m_pCurNotes[PLAYER_1];
ASSERT( pSteps );
pSteps->SetNoteData( &m_NoteFieldEdit );
m_pSong->ReCalculateRadarValuesAndLastBeat();
m_Background.Unload();
@@ -2083,16 +2083,16 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
void ScreenEdit::HandleEditNotesStatisticsChoice( EditNotesStatisticsChoice c, int* iAnswers )
{
Steps* pNotes = GAMESTATE->m_pCurNotes[PLAYER_1];
Steps* pSteps = GAMESTATE->m_pCurNotes[PLAYER_1];
Difficulty dc = (Difficulty)iAnswers[difficulty];
pNotes->SetDifficulty( dc );
pSteps->SetDifficulty( dc );
int iMeter = iAnswers[meter]+1;
pNotes->SetMeter( iMeter );
pSteps->SetMeter( iMeter );
switch( c )
{
case description:
SCREENMAN->TextEntry( SM_None, "Edit notes description.\nPress Enter to confirm,\nEscape to cancel.", m_pNotes->GetDescription(), ChangeDescription, NULL );
SCREENMAN->TextEntry( SM_None, "Edit notes description.\nPress Enter to confirm,\nEscape to cancel.", m_pSteps->GetDescription(), ChangeDescription, NULL );
break;
}
}
+1 -1
View File
@@ -55,7 +55,7 @@ protected:
EditMode m_EditMode;
Song* m_pSong;
Steps* m_pNotes;
Steps* m_pSteps;
BGAnimation m_BGAnimation;
+12 -12
View File
@@ -84,8 +84,8 @@ void ScreenEditMenu::MenuRight( PlayerNumber pn, const InputEventType type )
void DeleteCurNotes( void* pThrowAway )
{
Song* pSong = GAMESTATE->m_pCurSong;
Steps* pNotesToDelete = GAMESTATE->m_pCurNotes[PLAYER_1];
pSong->RemoveNotes( pNotesToDelete );
Steps* pStepsToDelete = GAMESTATE->m_pCurNotes[PLAYER_1];
pSong->RemoveSteps( pStepsToDelete );
pSong->Save();
}
@@ -98,7 +98,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
Song* pSong = m_Selector.GetSelectedSong();
StepsType st = m_Selector.GetSelectedNotesType();
Difficulty dc = m_Selector.GetSelectedDifficulty();
Steps* pNotes = m_Selector.GetSelectedNotes();
Steps* pSteps = m_Selector.GetSelectedNotes();
// StepsType soureNT = m_Selector.GetSelectedSourceNotesType();
// Difficulty sourceDiff = m_Selector.GetSelectedSourceDifficulty();
Steps* pSourceNotes = m_Selector.GetSelectedSourceNotes();
@@ -106,7 +106,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
GAMESTATE->m_pCurSong = pSong;
GAMESTATE->m_CurStyle = GAMEMAN->GetEditorStyleForNotesType( st );
GAMESTATE->m_pCurNotes[PLAYER_1] = pNotes;
GAMESTATE->m_pCurNotes[PLAYER_1] = pSteps;
//
// handle error cases
@@ -122,18 +122,18 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
{
case EditMenu::ACTION_EDIT:
// Prepare prepare for ScreenEdit
ASSERT( pNotes );
ASSERT( pSteps );
SOUND->StopMusic();
SCREENMAN->PlayStartSound();
StartTransitioning( SM_GoToNextScreen );
break;
case EditMenu::ACTION_DELETE:
ASSERT( pNotes );
ASSERT( pSteps );
SCREENMAN->Prompt( SM_RefreshSelector, "These notes will be lost permanently.\n\nContinue with delete?", true, false, DeleteCurNotes );
m_Selector.RefreshNotes();
return;
case EditMenu::ACTION_COPY:
ASSERT( !pNotes );
ASSERT( !pSteps );
ASSERT( pSourceNotes );
{
// Yuck. Doing the memory allocation doesn't seem right since
@@ -141,7 +141,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
Steps* pNewNotes = new Steps;
pNewNotes->CopyFrom( pSourceNotes, st );
pNewNotes->SetDifficulty( dc );
pSong->AddNotes( pNewNotes );
pSong->AddSteps( pNewNotes );
SCREENMAN->SystemMessage( "Steps created from copy." );
SOUND->PlayOnce( THEME->GetPathToS("ScreenEditMenu create") );
@@ -150,7 +150,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
}
return;
case EditMenu::ACTION_AUTOGEN:
ASSERT( !pNotes );
ASSERT( !pSteps );
ASSERT( pSourceNotes );
{
// Yuck. Doing the memory allocation doesn't seem right since
@@ -159,7 +159,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
pNewNotes->AutogenFrom( pSourceNotes, st );
pNewNotes->DeAutogen();
pNewNotes->SetDifficulty( dc ); // override difficulty with the user's choice
pSong->AddNotes( pNewNotes );
pSong->AddSteps( pNewNotes );
SCREENMAN->SystemMessage( "Steps created from AutoGen." );
SOUND->PlayOnce( THEME->GetPathToS("ScreenEditMenu create") );
@@ -168,7 +168,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
}
return;
case EditMenu::ACTION_BLANK:
ASSERT( !pNotes );
ASSERT( !pSteps );
{
// Yuck. Doing the memory allocation doesn't seem right since
// Song allocates all of the other Steps.
@@ -176,7 +176,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
pNewNotes->CreateBlank( st );
pNewNotes->SetDifficulty( dc );
pNewNotes->SetMeter( 1 );
pSong->AddNotes( pNewNotes );
pSong->AddSteps( pNewNotes );
SCREENMAN->SystemMessage( "Blank Steps created." );
SOUND->PlayOnce( THEME->GetPathToS("ScreenEditMenu create") );
+2 -2
View File
@@ -118,8 +118,8 @@ void ScreenEvaluation::Init()
GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
GAMESTATE->m_pCurSong = SONGMAN->GetRandomSong();
GAMESTATE->m_pCurCourse = SONGMAN->GetRandomCourse();
GAMESTATE->m_pCurNotes[PLAYER_1] = GAMESTATE->m_pCurSong->m_apNotes[0];
GAMESTATE->m_pCurNotes[PLAYER_2] = GAMESTATE->m_pCurSong->m_apNotes[0];
GAMESTATE->m_pCurNotes[PLAYER_1] = GAMESTATE->m_pCurSong->m_vpSteps[0];
GAMESTATE->m_pCurNotes[PLAYER_2] = GAMESTATE->m_pCurSong->m_vpSteps[0];
g_CurStageStats.pSteps[PLAYER_1] = GAMESTATE->m_pCurNotes[PLAYER_1];
g_CurStageStats.pSteps[PLAYER_2] = GAMESTATE->m_pCurNotes[PLAYER_2];
GAMESTATE->m_PlayerOptions[PLAYER_1].m_fScrollSpeed = 2;
+9 -9
View File
@@ -680,22 +680,22 @@ void ScreenEz2SelectMusic::AfterNotesChange( PlayerNumber pn )
m_iSelection[pn] = clamp( m_iSelection[pn], 0, int(m_arrayNotes[pn].size()-1) ); // bounds clamping
Steps* pNotes = m_arrayNotes[pn].empty()? NULL: m_arrayNotes[pn][m_iSelection[pn]];
Steps* pSteps = m_arrayNotes[pn].empty()? NULL: m_arrayNotes[pn][m_iSelection[pn]];
GAMESTATE->m_pCurNotes[pn] = pNotes;
GAMESTATE->m_pCurNotes[pn] = pSteps;
if( pNotes != NULL && pn == GAMESTATE->m_MasterPlayerNumber )
if( pSteps != NULL && pn == GAMESTATE->m_MasterPlayerNumber )
{
m_PumpDifficultyRating.SetText(ssprintf("Lv.%d",pNotes->GetMeter()));
m_PumpDifficultyRating.SetDiffuse( SONGMAN->GetDifficultyColor(pNotes->GetDifficulty()) );
m_DifficultyRating.SetDifficulty(pNotes->GetMeter());
m_PumpDifficultyRating.SetText(ssprintf("Lv.%d",pSteps->GetMeter()));
m_PumpDifficultyRating.SetDiffuse( SONGMAN->GetDifficultyColor(pSteps->GetDifficulty()) );
m_DifficultyRating.SetDifficulty(pSteps->GetMeter());
}
// GAMESTATE->m_pCurNotes[pn] = pNotes;
// GAMESTATE->m_pCurNotes[pn] = pSteps;
// Steps* m_pNotes = GAMESTATE->m_pCurNotes[pn];
// Steps* m_pSteps = GAMESTATE->m_pCurNotes[pn];
// m_FootMeter[pn].SetFromNotes( pNotes );
// m_FootMeter[pn].SetFromNotes( pSteps );
}
+9 -9
View File
@@ -179,7 +179,7 @@ void ScreenGameplay::Init()
//
// fill in m_apSongsQueue, m_apNotesQueue, m_asModifiersQueue
// fill in m_apSongsQueue, m_vpStepsQueue, m_asModifiersQueue
//
if( GAMESTATE->IsCourseMode() )
{
@@ -209,11 +209,11 @@ void ScreenGameplay::Init()
{
Trail *pTrail = pCourse->GetTrail( st, GAMESTATE->m_PreferredCourseDifficulty[p] );
m_apNotesQueue[p].clear();
m_vpStepsQueue[p].clear();
m_asModifiersQueue[p].clear();
FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e )
{
m_apNotesQueue[p].push_back( e->pNotes );
m_vpStepsQueue[p].push_back( e->pSteps );
AttackArray a;
e->GetAttackArray( a );
m_asModifiersQueue[p].push_back( a );
@@ -226,7 +226,7 @@ void ScreenGameplay::Init()
m_apSongsQueue.push_back( GAMESTATE->m_pCurSong );
FOREACH_PlayerNumber(p)
{
m_apNotesQueue[p].push_back( GAMESTATE->m_pCurNotes[p] );
m_vpStepsQueue[p].push_back( GAMESTATE->m_pCurNotes[p] );
m_asModifiersQueue[p].push_back( AttackArray() );
}
}
@@ -240,9 +240,9 @@ void ScreenGameplay::Init()
FOREACH_EnabledPlayer(p)
{
ASSERT( !m_apNotesQueue[p].empty() );
g_CurStageStats.pSteps[p] = m_apNotesQueue[p][0];
g_CurStageStats.iMeter[p] = m_apNotesQueue[p][0]->GetMeter();
ASSERT( !m_vpStepsQueue[p].empty() );
g_CurStageStats.pSteps[p] = m_vpStepsQueue[p][0];
g_CurStageStats.iMeter[p] = m_vpStepsQueue[p][0]->GetMeter();
/* Record combo rollover. */
g_CurStageStats.UpdateComboList( (PlayerNumber)p, 0, true );
@@ -265,7 +265,7 @@ void ScreenGameplay::Init()
{
case PrefsManager::SCORING_MAX2:
case PrefsManager::SCORING_5TH:
m_pPrimaryScoreKeeper[p] = new ScoreKeeperMAX2( m_apSongsQueue, m_apNotesQueue[p], m_asModifiersQueue[p], (PlayerNumber)p );
m_pPrimaryScoreKeeper[p] = new ScoreKeeperMAX2( m_apSongsQueue, m_vpStepsQueue[p], m_asModifiersQueue[p], (PlayerNumber)p );
break;
default: ASSERT(0);
}
@@ -794,7 +794,7 @@ void ScreenGameplay::SetupSong( int p, int iSongIndex )
/* This is the first beat that can be changed without it being visible. Until
* we draw for the first time, any beat can be changed. */
GAMESTATE->m_fLastDrawnBeat[p] = -100;
GAMESTATE->m_pCurNotes[p] = m_apNotesQueue[p][iSongIndex];
GAMESTATE->m_pCurNotes[p] = m_vpStepsQueue[p][iSongIndex];
// Put course options into effect.
GAMESTATE->m_ModsToApply[p].clear();
+1 -1
View File
@@ -96,7 +96,7 @@ protected:
NUM_DANCING_STATES
} m_DancingState;
vector<Song*> m_apSongsQueue; // size may be >1 if playing a course
vector<Steps*> m_apNotesQueue[NUM_PLAYERS]; // size may be >1 if playing a course
vector<Steps*> m_vpStepsQueue[NUM_PLAYERS]; // size may be >1 if playing a course
vector<AttackArray> m_asModifiersQueue[NUM_PLAYERS];// size may be >1 if playing a course
bool m_bChangedOffsetOrBPM;
+4 -4
View File
@@ -85,18 +85,18 @@ bool ScreenJukebox::SetSong( bool bDemonstration )
continue; // skip
Difficulty dc = vDifficultiesToShow[ rand()%vDifficultiesToShow.size() ];
Steps* pNotes = pSong->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc );
Steps* pSteps = pSong->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc );
if( pNotes == NULL )
if( pSteps == NULL )
continue; // skip
if( !PREFSMAN->m_bAutogenSteps && pNotes->IsAutogen())
if( !PREFSMAN->m_bAutogenSteps && pSteps->IsAutogen())
continue; // skip
// Found something we can use!
GAMESTATE->m_pCurSong = pSong;
for( int p=0; p<NUM_PLAYERS; p++ )
GAMESTATE->m_pCurNotes[p] = pNotes;
GAMESTATE->m_pCurNotes[p] = pSteps;
return true; // done looking
}
+2 -2
View File
@@ -155,10 +155,10 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
ss.iActualDancePoints[PLAYER_2] = 100;
ss.iScore[PLAYER_2] = 100;
ASSERT( ss.pSong );
ASSERT( ss.pSong->m_apNotes.size() );
ASSERT( ss.pSong->m_vpSteps.size() );
FOREACH_PlayerNumber( p )
{
GAMESTATE->m_pCurNotes[p] = ss.pSteps[p] = ss.pSong->m_apNotes[0];
GAMESTATE->m_pCurNotes[p] = ss.pSteps[p] = ss.pSong->m_vpSteps[0];
ss.iPossibleDancePoints[p] = 1000;
ss.iActualDancePoints[p] = 985;
+2 -2
View File
@@ -1162,10 +1162,10 @@ void ScreenSelectMusic::MenuStart( PlayerNumber pn )
{
/* Check if user selected the real extra stage. */
Song* pSong;
Steps* pNotes;
Steps* pSteps;
PlayerOptions po;
SongOptions so;
SONGMAN->GetExtraStageInfo( false, GAMESTATE->GetCurrentStyleDef(), pSong, pNotes, po, so );
SONGMAN->GetExtraStageInfo( false, GAMESTATE->GetCurrentStyleDef(), pSong, pSteps, po, so );
ASSERT(pSong);
/* Enable 2nd extra stage if user chose the correct song */
+62 -62
View File
@@ -93,18 +93,18 @@ Song::Song()
Song::~Song()
{
for( unsigned i=0; i<m_apNotes.size(); i++ )
SAFE_DELETE( m_apNotes[i] );
for( unsigned i=0; i<m_vpSteps.size(); i++ )
SAFE_DELETE( m_vpSteps[i] );
m_apNotes.clear();
m_vpSteps.clear();
}
/* Reset to an empty song. */
void Song::Reset()
{
for( unsigned i=0; i<m_apNotes.size(); i++ )
SAFE_DELETE( m_apNotes[i] );
m_apNotes.clear();
for( unsigned i=0; i<m_vpSteps.size(); i++ )
SAFE_DELETE( m_vpSteps[i] );
m_vpSteps.clear();
Song empty;
*this = empty;
@@ -394,14 +394,14 @@ static void DeleteDuplicateSteps( Song *song, vector<Steps*> &vSteps )
LOG->Trace("Removed %p duplicate steps in song \"%s\" with description \"%s\" and meter \"%i\"",
s2, song->GetSongDir().c_str(), s1->GetDescription().c_str(), s1->GetMeter() );
/* Don't use RemoveNotes; autogen notes havn't yet been created and it'll
/* Don't use RemoveSteps; autogen notes havn't yet been created and it'll
* create them. */
for( int k=song->m_apNotes.size()-1; k>=0; k-- )
for( int k=song->m_vpSteps.size()-1; k>=0; k-- )
{
if( song->m_apNotes[k] == s2 )
if( song->m_vpSteps[k] == s2 )
{
delete song->m_apNotes[k];
song->m_apNotes.erase( song->m_apNotes.begin()+k );
delete song->m_vpSteps[k];
song->m_vpSteps.erase( song->m_vpSteps.begin()+k );
break;
}
}
@@ -813,9 +813,9 @@ void Song::TidyUpData()
// Compress all Steps
for( i=0; i<m_apNotes.size(); i++ )
for( i=0; i<m_vpSteps.size(); i++ )
{
m_apNotes[i]->Compress();
m_vpSteps[i]->Compress();
}
}
@@ -829,12 +829,12 @@ void Song::TranslateTitles()
void Song::ReCalculateRadarValuesAndLastBeat()
{
for( unsigned i=0; i<m_apNotes.size(); i++ )
for( unsigned i=0; i<m_vpSteps.size(); i++ )
{
Steps* pNotes = m_apNotes[i];
Steps* pSteps = m_vpSteps[i];
/* If it's autogen, radar vals and first/last beat will come from the parent. */
if( pNotes->IsAutogen() )
if( pSteps->IsAutogen() )
continue;
@@ -842,12 +842,12 @@ void Song::ReCalculateRadarValuesAndLastBeat()
// calculate radar values
//
NoteData tempNoteData;
pNotes->GetNoteData( &tempNoteData );
pSteps->GetNoteData( &tempNoteData );
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ )
{
float fVal = NoteDataUtil::GetRadarValue( tempNoteData, (RadarCategory)r, m_fMusicLengthSeconds );
pNotes->SetRadarValue(r, fVal);
pSteps->SetRadarValue(r, fVal);
}
@@ -860,7 +860,7 @@ void Song::ReCalculateRadarValuesAndLastBeat()
// Don't set first/last beat based on lights. They often start very
// early and end very late.
if( pNotes->m_StepsType == STEPS_TYPE_LIGHTS_CABINET )
if( pSteps->m_StepsType == STEPS_TYPE_LIGHTS_CABINET )
continue;
float fFirstBeat = tempNoteData.GetFirstBeat();
@@ -882,12 +882,12 @@ void Song::GetSteps( vector<Steps*>& arrayAddTo, StepsType st, Difficulty dc, in
if( st != STEPS_TYPE_LIGHTS_CABINET && !PREFSMAN->m_bAutogenSteps )
bIncludeAutoGen = false;
for( unsigned i=0; i<m_apNotes.size(); i++ ) // for each of the Song's Steps
for( unsigned i=0; i<m_vpSteps.size(); i++ ) // for each of the Song's Steps
{
if( !Max )
break;
Steps* pSteps = m_apNotes[i];
Steps* pSteps = m_vpSteps[i];
if( st != STEPS_TYPE_INVALID && pSteps->m_StepsType != st )
continue;
@@ -943,29 +943,29 @@ Steps* Song::GetStepsByDescription( StepsType st, CString sDescription ) const
Steps* Song::GetClosestNotes( StepsType st, Difficulty dc ) const
{
Difficulty newDC = dc;
Steps* pNotes;
pNotes = GetStepsByDifficulty( st, newDC );
if( pNotes )
return pNotes;
Steps* pSteps;
pSteps = GetStepsByDifficulty( st, newDC );
if( pSteps )
return pSteps;
newDC = (Difficulty)(dc-1);
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
pNotes = GetStepsByDifficulty( st, newDC );
if( pNotes )
return pNotes;
pSteps = GetStepsByDifficulty( st, newDC );
if( pSteps )
return pSteps;
newDC = (Difficulty)(dc+1);
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
pNotes = GetStepsByDifficulty( st, newDC );
if( pNotes )
return pNotes;
pSteps = GetStepsByDifficulty( st, newDC );
if( pSteps )
return pSteps;
newDC = (Difficulty)(dc-2);
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
pNotes = GetStepsByDifficulty( st, newDC );
if( pNotes )
return pNotes;
pSteps = GetStepsByDifficulty( st, newDC );
if( pSteps )
return pSteps;
newDC = (Difficulty)(dc+2);
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
pNotes = GetStepsByDifficulty( st, newDC );
return pNotes;
pSteps = GetStepsByDifficulty( st, newDC );
return pSteps;
}
/* Return whether the song is playable in the given style. */
@@ -1057,12 +1057,12 @@ void Song::AddAutoGenNotes()
{
bool HasNotes[NUM_STEPS_TYPES];
memset( HasNotes, 0, sizeof(HasNotes) );
for( unsigned i=0; i < m_apNotes.size(); i++ ) // foreach Steps
for( unsigned i=0; i < m_vpSteps.size(); i++ ) // foreach Steps
{
if( m_apNotes[i]->IsAutogen() )
if( m_vpSteps[i]->IsAutogen() )
continue;
StepsType st = m_apNotes[i]->m_StepsType;
StepsType st = m_vpSteps[i]->m_StepsType;
HasNotes[st] = true;
}
@@ -1102,26 +1102,26 @@ void Song::AutoGen( StepsType ntTo, StepsType ntFrom )
{
// int iNumTracksOfTo = GAMEMAN->NotesTypeToNumTracks(ntTo);
for( unsigned int j=0; j<m_apNotes.size(); j++ )
for( unsigned int j=0; j<m_vpSteps.size(); j++ )
{
const Steps* pOriginalNotes = m_apNotes[j];
const Steps* pOriginalNotes = m_vpSteps[j];
if( pOriginalNotes->m_StepsType == ntFrom )
{
Steps* pNewNotes = new Steps;
pNewNotes->AutogenFrom(pOriginalNotes, ntTo);
this->m_apNotes.push_back( pNewNotes );
this->m_vpSteps.push_back( pNewNotes );
}
}
}
void Song::RemoveAutoGenNotes()
{
for( int j=m_apNotes.size()-1; j>=0; j-- )
for( int j=m_vpSteps.size()-1; j>=0; j-- )
{
if( m_apNotes[j]->IsAutogen() )
if( m_vpSteps[j]->IsAutogen() )
{
delete m_apNotes[j];
m_apNotes.erase( m_apNotes.begin()+j );
delete m_vpSteps[j];
m_vpSteps.erase( m_vpSteps.begin()+j );
}
}
}
@@ -1150,9 +1150,9 @@ bool Song::IsEasy( StepsType st ) const
bool Song::HasEdits( StepsType st ) const
{
for( unsigned i=0; i<m_apNotes.size(); i++ )
for( unsigned i=0; i<m_vpSteps.size(); i++ )
{
Steps* pSteps = m_apNotes[i];
Steps* pSteps = m_vpSteps[i];
if( pSteps->m_StepsType == st &&
pSteps->GetDifficulty() == DIFFICULTY_EDIT )
{
@@ -1269,24 +1269,24 @@ CString Song::GetFullTranslitTitle() const
return Title;
}
void Song::AddNotes( Steps* pNotes )
void Song::AddSteps( Steps* pSteps )
{
m_apNotes.push_back( pNotes );
m_vpSteps.push_back( pSteps );
}
void Song::RemoveNotes( const Steps* pNotes )
void Song::RemoveSteps( const Steps* pSteps )
{
// Avoid any stale Note::parent pointers by removing all AutoGen'd Steps,
// then adding them again.
RemoveAutoGenNotes();
for( int j=m_apNotes.size()-1; j>=0; j-- )
for( int j=m_vpSteps.size()-1; j>=0; j-- )
{
if( m_apNotes[j] == pNotes )
if( m_vpSteps[j] == pSteps )
{
delete m_apNotes[j];
m_apNotes.erase( m_apNotes.begin()+j );
delete m_vpSteps[j];
m_vpSteps.erase( m_vpSteps.begin()+j );
break;
}
}
@@ -1317,20 +1317,20 @@ bool Song::Matches(CString sGroup, CString sSong) const
void Song::FreeAllLoadedFromProfiles()
{
for( unsigned s=0; s<m_apNotes.size(); s++ )
for( unsigned s=0; s<m_vpSteps.size(); s++ )
{
Steps* pSteps = m_apNotes[s];
Steps* pSteps = m_vpSteps[s];
if( pSteps->WasLoadedFromProfile() )
this->RemoveNotes( pSteps );
this->RemoveSteps( pSteps );
}
}
int Song::GetNumStepsLoadedFromProfile( ProfileSlot slot ) const
{
int iCount = 0;
for( unsigned s=0; s<m_apNotes.size(); s++ )
for( unsigned s=0; s<m_vpSteps.size(); s++ )
{
Steps* pSteps = m_apNotes[s];
Steps* pSteps = m_vpSteps[s];
if( pSteps->GetLoadedFromProfileSlot() == slot )
iCount++;
}
@@ -1341,9 +1341,9 @@ bool Song::IsEditAlreadyLoaded( Steps* pSteps ) const
{
ASSERT( pSteps->GetDifficulty() == DIFFICULTY_EDIT );
for( unsigned i=0; i<m_apNotes.size(); i++ )
for( unsigned i=0; i<m_vpSteps.size(); i++ )
{
Steps* pOther = m_apNotes[i];
Steps* pOther = m_vpSteps[i];
if( pOther->GetDifficulty() == DIFFICULTY_EDIT &&
pOther->m_StepsType == pSteps->m_StepsType &&
pOther->GetHash() == pSteps->GetHash() )
+24 -24
View File
@@ -281,7 +281,7 @@ void SongManager::LoadGroupSymLinks(CString sDir, CString sGroupFolder)
delete pNewSong; // The song failed to load.
else
{
pNewSong->m_apNotes.clear(); // No memory hogs..
pNewSong->m_vpSteps.clear(); // No memory hogs..
pNewSong->m_BackgroundChanges.clear();
pNewSong->m_bIsSymLink = true; // Very important so we don't double-parse later
@@ -388,20 +388,20 @@ RageColor SongManager::GetSongColor( const Song* pSong )
* set up, which is too restrictive. How to handle this?
*/
// const StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
for( unsigned i=0; i<pSong->m_apNotes.size(); i++ )
for( unsigned i=0; i<pSong->m_vpSteps.size(); i++ )
{
const Steps* pNotes = pSong->m_apNotes[i];
switch( pNotes->GetDifficulty() )
const Steps* pSteps = pSong->m_vpSteps[i];
switch( pSteps->GetDifficulty() )
{
case DIFFICULTY_CHALLENGE:
case DIFFICULTY_EDIT:
continue;
}
// if(pNotes->m_StepsType != nt)
// if(pSteps->m_StepsType != nt)
// continue;
if( pNotes->GetMeter() >= EXTRA_COLOR_METER )
if( pSteps->GetMeter() >= EXTRA_COLOR_METER )
return EXTRA_COLOR;
}
@@ -607,10 +607,10 @@ void SongManager::Cleanup()
for( i=0; i<m_pSongs.size(); i++ )
{
Song* pSong = m_pSongs[i];
for( unsigned n=0; n<pSong->m_apNotes.size(); n++ )
for( unsigned n=0; n<pSong->m_vpSteps.size(); n++ )
{
Steps* pNotes = pSong->m_apNotes[n];
pNotes->Compress();
Steps* pSteps = pSong->m_vpSteps[n];
pSteps->Compress();
}
}
@@ -652,7 +652,7 @@ void SongManager::GetEndlessCourses( vector<Course*> &AddTo, bool bIncludeAutoge
bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredGroup,
Song*& pSongOut, Steps*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out )
Song*& pSongOut, Steps*& pStepsOut, PlayerOptions& po_out, SongOptions& so_out )
{
const CString sCourseSuffix = sPreferredGroup + "/" + (bExtra2 ? "extra2" : "extra1") + ".crs";
CString sCoursePath = SONGS_DIR + sCourseSuffix;
@@ -675,7 +675,7 @@ bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredG
so_out.FromString( pTrail->m_vEntries[0].Modifiers );
pSongOut = pTrail->m_vEntries[0].pSong;
pNotesOut = pTrail->m_vEntries[0].pNotes;
pStepsOut = pTrail->m_vEntries[0].pSteps;
return true;
}
@@ -698,7 +698,7 @@ bool CompareNotesPointersForExtra(const Steps *n1, const Steps *n2)
}
void SongManager::GetExtraStageInfo( bool bExtra2, const StyleDef *sd,
Song*& pSongOut, Steps*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out )
Song*& pSongOut, Steps*& pStepsOut, PlayerOptions& po_out, SongOptions& so_out )
{
CString sGroup = GAMESTATE->m_sPreferredGroup;
if( sGroup == GROUP_ALL_MUSIC )
@@ -717,7 +717,7 @@ void SongManager::GetExtraStageInfo( bool bExtra2, const StyleDef *sd,
GAMESTATE->m_pCurSong? GAMESTATE->m_pCurSong->GetSongDir().c_str():"",
GAMESTATE->m_pCurSong? GAMESTATE->m_pCurSong->m_sGroupName.c_str():"") );
if(GetExtraStageInfoFromCourse(bExtra2, sGroup, pSongOut, pNotesOut, po_out, so_out))
if(GetExtraStageInfoFromCourse(bExtra2, sGroup, pSongOut, pStepsOut, po_out, so_out))
return;
// Choose a hard song for the extra stage
@@ -732,25 +732,25 @@ void SongManager::GetExtraStageInfo( bool bExtra2, const StyleDef *sd,
{
Song* pSong = apSongs[s];
vector<Steps*> apNotes;
pSong->GetSteps( apNotes, sd->m_StepsType );
for( unsigned n=0; n<apNotes.size(); n++ ) // foreach Steps
vector<Steps*> apSteps;
pSong->GetSteps( apSteps, sd->m_StepsType );
for( unsigned n=0; n<apSteps.size(); n++ ) // foreach Steps
{
Steps* pNotes = apNotes[n];
Steps* pSteps = apSteps[n];
if( pExtra1Notes == NULL || CompareNotesPointersForExtra(pExtra1Notes,pNotes) ) // pNotes is harder than pHardestNotes
if( pExtra1Notes == NULL || CompareNotesPointersForExtra(pExtra1Notes,pSteps) ) // pSteps is harder than pHardestNotes
{
pExtra1Song = pSong;
pExtra1Notes = pNotes;
pExtra1Notes = pSteps;
}
// for extra 2, we don't want to choose the hardest notes possible. So, we'll disgard Steps with meter > 8
if( bExtra2 && pNotes->GetMeter() > 8 )
if( bExtra2 && pSteps->GetMeter() > 8 )
continue; // skip
if( pExtra2Notes == NULL || CompareNotesPointersForExtra(pExtra2Notes,pNotes) ) // pNotes is harder than pHardestNotes
if( pExtra2Notes == NULL || CompareNotesPointersForExtra(pExtra2Notes,pSteps) ) // pSteps is harder than pHardestNotes
{
pExtra2Song = pSong;
pExtra2Notes = pNotes;
pExtra2Notes = pSteps;
}
}
}
@@ -767,7 +767,7 @@ void SongManager::GetExtraStageInfo( bool bExtra2, const StyleDef *sd,
ASSERT( pExtra2Song && pExtra1Song && pExtra2Notes && pExtra1Notes );
pSongOut = (bExtra2 ? pExtra2Song : pExtra1Song);
pNotesOut = (bExtra2 ? pExtra2Notes : pExtra1Notes);
pStepsOut = (bExtra2 ? pExtra2Notes : pExtra1Notes);
po_out.Init();
@@ -1037,7 +1037,7 @@ static bool CheckPointer( const Steps *p )
for( unsigned i = 0; i < songs.size(); ++i )
{
for( unsigned j = 0; j < songs.size(); ++j )
if( songs[i]->m_apNotes[j] == p )
if( songs[i]->m_vpSteps[j] == p )
return true;
}
return false;
+2 -2
View File
@@ -84,7 +84,7 @@ public:
void GetEndlessCourses( vector<Course*> &AddTo, bool bIncludeAutogen ); // add to if set to REPEAT.
void GetExtraStageInfo( bool bExtra2, const StyleDef *s,
Song*& pSongOut, Steps*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out );
Song*& pSongOut, Steps*& pStepsOut, PlayerOptions& po_out, SongOptions& so_out );
Song* GetSongFromDir( CString sDir );
Course* GetCourseFromPath( CString sPath ); // path to .crs file, or path to song group dir
@@ -101,7 +101,7 @@ protected:
void LoadStepManiaSongDir( CString sDir, LoadingWindow *ld );
void LoadDWISongDir( CString sDir );
bool GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredGroup,
Song*& pSongOut, Steps*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out );
Song*& pSongOut, Steps*& pStepsOut, PlayerOptions& po_out, SongOptions& so_out );
void SanityCheckGroupDir( CString sDir ) const;
void AddGroup( CString sDir, CString sGroupDirName );
+14 -14
View File
@@ -290,30 +290,30 @@ CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
}
case SORT_EASY_METER:
{
Steps* pNotes = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_EASY);
if( pNotes )
return ssprintf("%02d", pNotes->GetMeter() );
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_EASY);
if( pSteps )
return ssprintf("%02d", pSteps->GetMeter() );
return "N/A";
}
case SORT_MEDIUM_METER:
{
Steps* pNotes = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_MEDIUM);
if( pNotes )
return ssprintf("%02d", pNotes->GetMeter() );
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_MEDIUM);
if( pSteps )
return ssprintf("%02d", pSteps->GetMeter() );
return "N/A";
}
case SORT_HARD_METER:
{
Steps* pNotes = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_HARD);
if( pNotes )
return ssprintf("%02d", pNotes->GetMeter() );
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_HARD);
if( pSteps )
return ssprintf("%02d", pSteps->GetMeter() );
return "N/A";
}
case SORT_CHALLENGE_METER:
{
Steps* pNotes = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_CHALLENGE);
if( pNotes )
return ssprintf("%02d", pNotes->GetMeter() );
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_CHALLENGE);
if( pSteps )
return ssprintf("%02d", pSteps->GetMeter() );
return "N/A";
}
case SORT_SORT_MENU:
@@ -352,8 +352,8 @@ void SongUtil::SortSongPointerArrayByMeter( vector<Song*> &arraySongPointers, Di
song_sort_val.clear();
for(unsigned i = 0; i < arraySongPointers.size(); ++i)
{
Steps* pNotes = arraySongPointers[i]->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc );
song_sort_val[arraySongPointers[i]] = ssprintf("%i", pNotes ? pNotes->GetMeter() : 0);
Steps* pSteps = arraySongPointers[i]->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc );
song_sort_val[arraySongPointers[i]] = ssprintf("%i", pSteps ? pSteps->GetMeter() : 0);
}
stable_sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongPointersBySortValueAscending );
}
+7 -7
View File
@@ -77,28 +77,28 @@ void StepsUtil::SortStepsPointerArrayByNumPlays( vector<Steps*> &vStepsPointers,
steps_sort_val.clear();
}
bool StepsUtil::CompareNotesPointersByRadarValues(const Steps* pNotes1, const Steps* pNotes2)
bool StepsUtil::CompareNotesPointersByRadarValues(const Steps* pSteps1, const Steps* pSteps2)
{
float fScore1 = 0;
float fScore2 = 0;
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ )
{
fScore1 += pNotes1->GetRadarValues()[r];
fScore2 += pNotes2->GetRadarValues()[r];
fScore1 += pSteps1->GetRadarValues()[r];
fScore2 += pSteps2->GetRadarValues()[r];
}
return fScore1 < fScore2;
}
bool StepsUtil::CompareNotesPointersByMeter(const Steps *pNotes1, const Steps* pNotes2)
bool StepsUtil::CompareNotesPointersByMeter(const Steps *pSteps1, const Steps* pSteps2)
{
return pNotes1->GetMeter() < pNotes2->GetMeter();
return pSteps1->GetMeter() < pSteps2->GetMeter();
}
bool StepsUtil::CompareNotesPointersByDifficulty(const Steps *pNotes1, const Steps *pNotes2)
bool StepsUtil::CompareNotesPointersByDifficulty(const Steps *pSteps1, const Steps *pSteps2)
{
return pNotes1->GetDifficulty() < pNotes2->GetDifficulty();
return pSteps1->GetDifficulty() < pSteps2->GetDifficulty();
}
void StepsUtil::SortNotesArrayByDifficulty( vector<Steps*> &arraySteps )
+3 -3
View File
@@ -22,9 +22,9 @@ struct XNode;
namespace StepsUtil
{
bool CompareNotesPointersByRadarValues(const Steps* pNotes1, const Steps* pNotes2);
bool CompareNotesPointersByMeter(const Steps *pNotes1, const Steps* pNotes2);
bool CompareNotesPointersByDifficulty(const Steps *pNotes1, const Steps *pNotes2);
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<Steps*> &arrayNotess );
bool CompareStepsPointersByTypeAndDifficulty(const Steps *pStep1, const Steps *pStep2);
void SortStepsByTypeAndDifficulty( vector<Steps*> &arraySongPointers );
+4 -4
View File
@@ -37,9 +37,9 @@ RadarValues Trail::GetRadarValues() const
FOREACH_CONST( TrailEntry, m_vEntries, e )
{
const Steps *pNotes = e->pNotes;
ASSERT( pNotes );
rv += pNotes->GetRadarValues();
const Steps *pSteps = e->pSteps;
ASSERT( pSteps );
rv += pSteps->GetRadarValues();
}
return rv;
@@ -58,7 +58,7 @@ int Trail::GetTotalMeter() const
int iTotalMeter = 0;
FOREACH_CONST( TrailEntry, m_vEntries, e )
{
iTotalMeter += e->pNotes->GetMeter();
iTotalMeter += e->pSteps->GetMeter();
}
return iTotalMeter;
+2 -2
View File
@@ -20,7 +20,7 @@ struct TrailEntry
{
TrailEntry():
pSong(NULL),
pNotes(NULL),
pSteps(NULL),
bMystery(false),
iLowMeter(-1),
iHighMeter(-1)
@@ -29,7 +29,7 @@ struct TrailEntry
void GetAttackArray( AttackArray &out ) const;
Song* pSong;
Steps* pNotes;
Steps* pSteps;
CString Modifiers;
AttackArray Attacks;
bool bMystery;
+4 -4
View File
@@ -180,12 +180,12 @@ public:
bool HasSignificantBpmChangesOrStops() const;
vector<Steps*> m_apNotes;
vector<Steps*> m_vpSteps;
bool SongCompleteForStyle( const StyleDef *st ) const;
bool SongHasNotesType( StepsType st ) const;
bool SongHasNotesTypeAndDifficulty( StepsType st, Difficulty dc ) const;
const vector<Steps*>& GetAllSteps() const { return m_apNotes; }
const vector<Steps*>& GetAllSteps() const { return m_vpSteps; }
void GetSteps( vector<Steps*>& arrayAddTo, StepsType st = STEPS_TYPE_INVALID, Difficulty dc = DIFFICULTY_INVALID, int iMeterLow = -1, int iMeterHigh = -1, const CString &sDescription = "", bool bIncludeAutoGen = true, int Max = -1 ) const;
Steps* GetStepsByDifficulty( StepsType st, Difficulty dc, bool bIncludeAutoGen = true ) const;
Steps* GetStepsByMeter( StepsType st, int iMeterLow, int iMeterHigh ) const;
@@ -198,8 +198,8 @@ public:
bool NeverDisplayed() const { return GetDisplayed() == SHOW_NEVER; }
bool RouletteDisplayed() const { return GetDisplayed() != SHOW_NEVER; }
void AddNotes( Steps* pNotes ); // we are responsible for deleting the memory pointed to by pNotes!
void RemoveNotes( const Steps* pNotes );
void AddSteps( Steps* pSteps ); // we are responsible for deleting the memory pointed to by pSteps!
void RemoveSteps( const Steps* pSteps );
void FreeAllLoadedFromProfiles();
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; }