Skip to content

Commit

Permalink
add back wip nps vector
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Dec 25, 2016
1 parent 44a80fe commit fc51138
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/Steps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,40 @@ RString Steps::GenerateChartKey(NoteData& nd, TimingData *td)
return o;
}

int Steps::GetNPSVector(NoteData nd, vector<float>& etar)
{
vector<vector<int>> doot;
vector<int> scoot;
int intN = 1;
float intI = 0.5f;
int intT = 0;
vector<int> intervaltaps;
vector<int>& nerv = nd.GetNonEmptyRowVector();

for (size_t r = 0; r < nerv.size(); r++)
{
int row = nerv[r];
if (etar[row] >= intN * intI) {
doot.push_back(scoot);
scoot.clear();
intN += 1;

intervaltaps.push_back(intT / intI);
intT = 0;
}
scoot.push_back(row);
for (int t = 0; t < nd.GetNumTracks(); ++t)
{
const TapNote &tn = nd.GetTapNote(t, row);
if (tn.type == TapNoteType_Tap || tn.type == TapNoteType_HoldHead) {
intT += 1;
}

}
}
return 1;
}

void Steps::Compress() const
{
// Always leave lights data uncompressed.
Expand Down
2 changes: 2 additions & 0 deletions src/Steps.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ class Steps
// prolly needs an enum or something idk - mina
float GetMSD(float x, int i) const;

int GetNPSVector(NoteData nd, vector<float>& etar);

/* This is a reimplementation of the lua version of the script to generate chart keys, except this time
using the notedata stored in game memory immediately after reading it than parsing it using lua. - Mina */
RString GenerateChartKey(NoteData& nd, TimingData *td);
Expand Down

0 comments on commit fc51138

Please sign in to comment.