Skip to content

Commit

Permalink
Add to NoteDataUtil a way to quickly segment a file's Notedata
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Oct 4, 2019
1 parent d403b18 commit 373e034
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/Etterna/Models/NoteData/NoteDataUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3104,6 +3104,15 @@ NoteDataUtil::DeleteRows(NoteData& nd, int iStartIndex, int iRowsToDelete)
nd.RevalidateATIs(vector<int>(), false);
}

void
NoteDataUtil::RemoveAllButRange(NoteData& nd, int iStartIndex, int iEndIndex)
{
ASSERT(abs(iStartIndex - iEndIndex) > 0);
nd.ClearRange(0, iStartIndex - 1);
nd.ClearRange(iEndIndex, MAX_NOTE_ROW);
nd.RevalidateATIs(vector<int>(), false);
}

void
NoteDataUtil::RemoveAllTapsOfType(NoteData& ndInOut, TapNoteType typeToRemove)
{
Expand Down
5 changes: 4 additions & 1 deletion src/Etterna/Models/NoteData/NoteDataUtil.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef NOTEDATAUTIL_H
#ifndef NOTEDATAUTIL_H
#define NOTEDATAUTIL_H

#include "Etterna/Models/Misc/GameConstantsAndTypes.h"
Expand Down Expand Up @@ -296,6 +296,9 @@ InsertRows(NoteData& nd, int iStartIndex, int iRowsToShift);
void
DeleteRows(NoteData& nd, int iStartIndex, int iRowsToShift);

void
RemoveAllButRange(NoteData& nd, int iStartIndex, int iEndIndex);

void
RemoveAllTapsOfType(NoteData& ndInOut, TapNoteType typeToRemove);
void
Expand Down

0 comments on commit 373e034

Please sign in to comment.