Skip to content

Commit

Permalink
fix nrv to timestamp converter and account for rate
Browse files Browse the repository at this point in the history
technically it shouldnt matter for the sake of the plot however we might as well be thorough
  • Loading branch information
MinaciousGrace committed Nov 22, 2017
1 parent e09236e commit 71b8795
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/StageStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ static HighScore FillInHighScore(const PlayerStageStats &pss, const PlayerState
auto steps = SONGMAN->GetStepsByChartkey(hs.GetChartKey());
auto td = steps->GetTimingData();
SCOREMAN->SetAllTopScores(); // this is super lazy and a chart specific function should be made -mina
hs.timeStamps = td->ConvertReplayNoteRowsToTimestamps(pss.GetNoteRowVector());
hs.timeStamps = td->ConvertReplayNoteRowsToTimestamps(pss.GetNoteRowVector(), hs.GetMusicRate());
DLMAN->UploadScore(&hs);
hs.timeStamps.clear();
hs.timeStamps.shrink_to_fit();
Expand Down
4 changes: 2 additions & 2 deletions src/TimingData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1413,10 +1413,10 @@ float TimingData::WhereUAtBroNoOffset(float beat) const {
return GetElapsedTimeFromBeatNoOffset(beat);
}

vector<float> TimingData::ConvertReplayNoteRowsToTimestamps(vector<int> nrv) {
vector<float> TimingData::ConvertReplayNoteRowsToTimestamps(vector<int> nrv, float rate) {
vector<float> o;
for (auto nr : nrv)
o.emplace_back(WhereUAtBroNoOffset(nr));
o.emplace_back(WhereUAtBro(nr) / rate);
return o;
}

Expand Down
2 changes: 1 addition & 1 deletion src/TimingData.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ class TimingData
float WhereUAtBroNoOffset(float beat);
float WhereUAtBro(int row);

vector<float> ConvertReplayNoteRowsToTimestamps(vector<int> nrv);
vector<float> ConvertReplayNoteRowsToTimestamps(vector<int> nrv, float rate);

bool ValidSequentialAssumption = true;
void InvalidateSequentialAssmption() { ValidSequentialAssumption = false; }
Expand Down

0 comments on commit 71b8795

Please sign in to comment.