diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index d0d4f5f73d..712d9a4bae 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -341,8 +341,7 @@ void NoteData::Convert2sAnd3sToHoldNotes() SetTapNote(col, j, TAP_EMPTY); - HoldNote hn = { col, NoteRowToBeat(i), NoteRowToBeat(j) }; - AddHoldNote( hn ); + AddHoldNote( HoldNote(col, NoteRowToBeat(i), NoteRowToBeat(j)) ); break; } } @@ -385,7 +384,7 @@ void NoteData::Convert4sToHoldNotes() if( GetTapNote(col, i) != TAP_HOLD ) // this is a HoldNote body continue; - HoldNote hn = { col, NoteRowToBeat(i), 0 }; + HoldNote hn( col, NoteRowToBeat(i), 0 ); // search for end of HoldNote do { SetTapNote(col, i, TAP_EMPTY); diff --git a/stepmania/src/NoteTypes.h b/stepmania/src/NoteTypes.h index 15cfb7b957..a6d7c85bc5 100644 --- a/stepmania/src/NoteTypes.h +++ b/stepmania/src/NoteTypes.h @@ -75,6 +75,7 @@ CString NoteTypeToString( NoteType nt ); struct HoldNote { + HoldNote( int t, float s, float e ) { iTrack=t; fStartBeat=s; fEndBeat=e; } int iTrack; float fStartBeat; float fEndBeat; diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index b07fe4a0b8..95b34e6e91 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -125,11 +125,11 @@ bool KSFLoader::LoadFromKSFFile( const CString &sPath, Notes &out ) if( iHoldStartRow[t] != -1 ) // this ends the hold { - HoldNote hn = { + HoldNote hn ( t, /* button */ iHoldStartRow[t]/(float)iTickCount, /* start */ (r-1)/(float)iTickCount /* end */ - }; + ); notedata.AddHoldNote( hn ); iHoldStartRow[t] = -1; } diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index f2d83a724a..b13796fe51 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -380,7 +380,7 @@ void ScreenEdit::Update( float fDeltaTime ) fEndBeat = froundf( fEndBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); // create a new hold note - HoldNote newHN = { t, fStartBeat, fEndBeat }; + HoldNote newHN( t, fStartBeat, fEndBeat ); m_NoteFieldRecord.AddHoldNote( newHN ); } } @@ -684,10 +684,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ continue; // create a new hold note - HoldNote newHN; - newHN.iTrack = col; - newHN.fStartBeat = min(fStartBeat, fEndBeat); - newHN.fEndBeat = max(fStartBeat, fEndBeat); + HoldNote newHN( col, min(fStartBeat, fEndBeat), max(fStartBeat, fEndBeat) ); newHN.fStartBeat = max(newHN.fStartBeat, 0); newHN.fEndBeat = max(newHN.fEndBeat, 0);