Skip to content

Commit

Permalink
fix lazy mem allocation in jackstam
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 21, 2020
1 parent 544a1ff commit 6b069ab
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Etterna/Globals/MinaCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,6 @@ Calc::JackStamAdjust(float x, int t, int mode)
125.f; // how fast the floor rises (it's lava)
static const float stam_prop = 1.5424f;

// adsafasdf fix later
stam_adj_jacks[t] = diff;
if (debugmode) {
left_hand.debugValues[2][JackStamMod].resize(numitv);
right_hand.debugValues[2][JackStamMod].resize(numitv);
Expand Down Expand Up @@ -674,7 +672,6 @@ Calc::CalcMain(const vector<NoteInfo>& NoteInfo,
}

TotalMaxPoints();
stam_adj_jacks->resize(4);

vector<float> mcbloop(NUM_Skillset);
// overall and stam will be left as 0.f by this loop
Expand Down Expand Up @@ -914,12 +911,23 @@ Calc::InitializeHands(const vector<NoteInfo>& NoteInfo,
// werwerwer
for (auto m : zto3) {
jacks[m]->resize(4);
for (auto t : zto3)
for (auto t : zto3) {
SequenceJack(fingers[t], t, m);

// resize stam adjusted jack vecs, technically if we flattened the
// vector we
// could allocate only once for all rate passes when doing caching,
// but for various other reasons it was easier to keep them split by
// intervals in a double vector, this should maybe be changed?
stam_adj_jacks[t].resize(fingers[t].size());
for (size_t i = 0; i < fingers[t].size(); ++i)
stam_adj_jacks[t][i].resize(fingers[t][i].size());
}
}
return true;
}

// DON'T refpass, since we manipulate the vector and this is done before
float
Hand::CalcMSEstimate(vector<float> input)
{
Expand Down

0 comments on commit 6b069ab

Please sign in to comment.