Skip to content

Commit 24067c4

Browse files
remove dead code relating to composite charts
1 parent 8c145b0 commit 24067c4

File tree

5 files changed

+5
-131
lines changed

5 files changed

+5
-131
lines changed

src/NoteData.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,6 @@ void NoteData::SetNumTracks( int iNewNumTracks )
3030
CalcNumTracksLCD();
3131
}
3232

33-
bool NoteData::IsComposite() const
34-
{
35-
return false;
36-
for( int track = 0; track < GetNumTracks(); ++track )
37-
{
38-
FOREACHM_CONST( int, TapNote, m_TapNotes[track], tn )
39-
if( tn->second.pn != PLAYER_INVALID )
40-
return true;
41-
}
42-
}
43-
4433
// Clear (rowBegin,rowEnd).
4534
void NoteData::ClearRangeForTrack( int rowBegin, int rowEnd, int iTrack )
4635
{
@@ -790,10 +779,6 @@ int NoteData::GetNumFakes( int iStartIndex, int iEndIndex ) const
790779

791780
bool NoteData::IsPlayer1(const int track, const TapNote &tn) const
792781
{
793-
if (this->IsComposite())
794-
{
795-
return tn.pn == PLAYER_1;
796-
}
797782
return track < (this->GetNumTracks() / 2);
798783
}
799784

src/NoteData.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ class NoteData
183183

184184
int GetNumTracks() const { return m_TapNotes.size(); }
185185
void SetNumTracks( int iNewNumTracks );
186-
bool IsComposite() const;
187186
bool operator==( const NoteData &nd ) const { return m_TapNotes == nd.m_TapNotes; }
188187
bool operator!=( const NoteData &nd ) const { return m_TapNotes != nd.m_TapNotes; }
189188

src/NoteDataUtil.cpp

Lines changed: 3 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ void NoteDataUtil::LoadFromETTNoteDataString( NoteData& out, const RString &sSMN
496496
out.RevalidateATIs(vector<int>(), false);
497497
}
498498

499-
void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, const RString &sSMNoteData_, bool bComposite )
499+
void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, const RString &sSMNoteData_)
500500
{
501501
// Load note data
502502
RString sSMNoteData;
@@ -520,31 +520,7 @@ void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, const RString &sSMNo
520520
int iNumTracks = out.GetNumTracks();
521521
out.Init();
522522
out.SetNumTracks( iNumTracks );
523-
524-
if( !bComposite )
525-
{
526-
LoadFromSMNoteDataStringWithPlayer( out, sSMNoteData, 0, sSMNoteData.size(),
527-
PLAYER_INVALID, iNumTracks );
528-
return;
529-
}
530-
531-
int start = 0, size = -1;
532-
533-
vector<NoteData> vParts;
534-
FOREACH_PlayerNumber( pn )
535-
{
536-
// Split in place.
537-
split( sSMNoteData, "&", start, size, false );
538-
if( unsigned(start) == sSMNoteData.size() )
539-
break;
540-
vParts.push_back( NoteData() );
541-
NoteData &nd = vParts.back();
542-
543-
nd.SetNumTracks( iNumTracks );
544-
LoadFromSMNoteDataStringWithPlayer( nd, sSMNoteData, start, size, pn, iNumTracks );
545-
}
546-
CombineCompositeNoteData( out, vParts );
547-
out.RevalidateATIs(vector<int>(), false);
523+
LoadFromSMNoteDataStringWithPlayer( out, sSMNoteData, 0, sSMNoteData.size(), PLAYER_INVALID, iNumTracks );
548524
}
549525

550526
void NoteDataUtil::InsertHoldTails( NoteData &inout )
@@ -578,8 +554,6 @@ void NoteDataUtil::GetSMNoteDataString( const NoteData &in, RString &sRet )
578554
vector<NoteData> parts;
579555
float fLastBeat = -1.0f;
580556

581-
SplitCompositeNoteData( in, parts );
582-
583557
FOREACH( NoteData, parts, nd )
584558
{
585559
InsertHoldTails( *nd );
@@ -657,7 +631,6 @@ void NoteDataUtil::GetETTNoteDataString(const NoteData &in, RString &sRet) {
657631
// Get note data
658632
vector<NoteData> parts;
659633
float fLastBeat = -1.f;
660-
SplitCompositeNoteData(in, parts);
661634

662635
FOREACH(NoteData, parts, nd) {
663636
fLastBeat = max(fLastBeat, nd->GetLastBeat());
@@ -810,72 +783,6 @@ void NoteDataUtil::GetETTNoteDataString(const NoteData &in, RString &sRet) {
810783
sRet.shrink_to_fit();
811784
}
812785

813-
void NoteDataUtil::SplitCompositeNoteData( const NoteData &in, vector<NoteData> &out )
814-
{
815-
if( !in.IsComposite() )
816-
{
817-
out.push_back( in );
818-
return;
819-
}
820-
821-
FOREACH_PlayerNumber( pn )
822-
{
823-
out.push_back( NoteData() );
824-
out.back().SetNumTracks( in.GetNumTracks() );
825-
}
826-
827-
for( int t = 0; t < in.GetNumTracks(); ++t )
828-
{
829-
for( NoteData::const_iterator iter = in.begin(t); iter != in.end(t); ++iter )
830-
{
831-
int row = iter->first;
832-
TapNote tn = iter->second;
833-
/*
834-
XXX: This code is (hopefully) a temporary hack to make sure that
835-
routine charts don't have any notes without players assigned to them.
836-
I suspect this is due to a related bug that these problems were
837-
occuring to begin with, but at this time, I am unsure how to deal with it.
838-
Hopefully this hack can be removed soon. -- Jason "Wolfman2000" Felds
839-
*/
840-
const Style *curStyle = GAMESTATE->GetCurrentStyle(PLAYER_INVALID);
841-
if( (curStyle == NULL || curStyle->m_StyleType == StyleType_TwoPlayersSharedSides )
842-
&& static_cast<int>( tn.pn ) > NUM_PlayerNumber )
843-
{
844-
tn.pn = PLAYER_1;
845-
}
846-
unsigned index = static_cast<int>( tn.pn );
847-
848-
ASSERT_M( index < NUM_PlayerNumber, ssprintf("We have a note not assigned to a player. The note in question is on beat %f, column %i.", NoteRowToBeat(row), t + 1) );
849-
tn.pn = PLAYER_INVALID;
850-
out[index].SetTapNote( t, row, tn );
851-
}
852-
}
853-
}
854-
855-
void NoteDataUtil::CombineCompositeNoteData( NoteData &out, const vector<NoteData> &in )
856-
{
857-
FOREACH_CONST( NoteData, in, nd )
858-
{
859-
const int iMaxTracks = min( out.GetNumTracks(), nd->GetNumTracks() );
860-
861-
for( int track = 0; track < iMaxTracks; ++track )
862-
{
863-
for( NoteData::const_iterator i = nd->begin(track); i != nd->end(track); ++i )
864-
{
865-
int row = i->first;
866-
if( out.IsHoldNoteAtRow(track, i->first) )
867-
continue;
868-
if( i->second.type == TapNoteType_HoldHead )
869-
out.AddHoldNote( track, row, row + i->second.iDuration, i->second );
870-
else
871-
out.SetTapNote( track, row, i->second );
872-
}
873-
}
874-
}
875-
out.RevalidateATIs(vector<int>(), false);
876-
}
877-
878-
879786
void NoteDataUtil::LoadTransformedSlidingWindow( const NoteData &in, NoteData &out, int iNewNumTracks )
880787
{
881788
// reset all notes
@@ -1282,18 +1189,7 @@ void NoteDataUtil::RemoveSimultaneousNotes( NoteData &in, int iMaxSimultaneous,
12821189
// given time. Never touch data outside of the range given; if many hold notes are overlapping
12831190
// iStartIndex, and we'd have to change those holds to obey iMaxSimultaneous, just do the best
12841191
// we can without doing so.
1285-
if( in.IsComposite() )
1286-
{
1287-
// Do this per part.
1288-
vector<NoteData> vParts;
1289-
1290-
SplitCompositeNoteData( in, vParts );
1291-
FOREACH( NoteData, vParts, nd )
1292-
RemoveSimultaneousNotes( *nd, iMaxSimultaneous, iStartIndex, iEndIndex );
1293-
in.Init();
1294-
in.SetNumTracks( vParts.front().GetNumTracks() );
1295-
CombineCompositeNoteData( in, vParts );
1296-
}
1192+
12971193
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( in, r, iStartIndex, iEndIndex )
12981194
{
12991195
set<int> viTracksHeld;

src/NoteDataUtil.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ namespace NoteDataUtil
2424
{
2525
NoteType GetSmallestNoteTypeForMeasure( const NoteData &nd, int iMeasureIndex );
2626
NoteType GetSmallestNoteTypeInRange( const NoteData &nd, int iStartIndex, int iEndIndex );
27-
void LoadFromSMNoteDataString( NoteData &out, const RString &sSMNoteData, bool bComposite );
27+
void LoadFromSMNoteDataString( NoteData &out, const RString &sSMNoteData);
2828
void LoadFromETTNoteDataString(NoteData& out, const RString &sSMNoteData);
2929
void GetSMNoteDataString( const NoteData &in, RString &notes_out );
3030
void GetETTNoteDataString(const NoteData &in, RString &notes_out);
31-
void SplitCompositeNoteData( const NoteData &in, vector<NoteData> &out );
32-
void CombineCompositeNoteData( NoteData &out, const vector<NoteData> &in );
3331
/**
3432
* @brief Autogenerate notes from one type to another.
3533
*

src/Steps.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,10 @@ void Steps::Decompress() {
325325
/* there is no data, do nothing */
326326
return;
327327
}
328-
329-
330328
// load from compressed
331-
bool bComposite = false;
332329
m_bNoteDataIsFilled = true;
333330
m_pNoteData->SetNumTracks(GAMEMAN->GetStepsTypeInfo(m_StepsType).iNumTracks);
334-
NoteDataUtil::LoadFromSMNoteDataString(*m_pNoteData, m_sNoteDataCompressed, bComposite);
335-
331+
NoteDataUtil::LoadFromSMNoteDataString(*m_pNoteData, m_sNoteDataCompressed);
336332
}
337333

338334
bool Steps::IsRecalcValid() {

0 commit comments

Comments
 (0)