Skip to content

Commit

Permalink
bminer bmopbtmimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 15, 2020
1 parent ecfd546 commit bc3e79a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/Etterna/Globals/MinaCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,6 @@ Calc::Chisel(float player_skill,
{

float gotpoints = 0.f;
int possiblepoints = 0;
float reqpoints = static_cast<float>(MaxPoints) * score_goal;
float max_points_lost = static_cast<float>(MaxPoints) - reqpoints;
for (int iter = 1; iter <= 8; iter++) {
Expand All @@ -1108,9 +1107,8 @@ Calc::Chisel(float player_skill,
if (ss == Skill_Overall || ss == Skill_Stamina)
return 0.f; // not how we set these values

// reset tallied score
gotpoints = 0.f;
possiblepoints = 0;
// reset tallied score, always deduct rather than accumulate now
gotpoints = MaxPoints;

// jack sequencer point loss for jack speed and (maybe?)
// cj
Expand All @@ -1125,11 +1123,11 @@ Calc::Chisel(float player_skill,
max(JackLoss(player_skill, 1, max_points_lost, false),
max(JackLoss(player_skill, 2, max_points_lost, false),
JackLoss(player_skill, 3, max_points_lost, false)));
gotpoints = MaxPoints - jloss;
gotpoints -= jloss;
} else {
if (ss == Skill_Technical)
gotpoints -=
JackLoss(player_skill, 0, max_points_lost, false);
sqrt(JackLoss(player_skill, 0, max_points_lost, false));
left_hand.CalcInternal(gotpoints, player_skill, ss, stamina);
right_hand.CalcInternal(gotpoints, player_skill, ss, stamina);
}
Expand Down Expand Up @@ -1359,18 +1357,20 @@ Hand::CalcInternal(float& gotpoints, float& x, int ss, bool stam, bool debug)
debugValues[1][MSD] = stam_adj_diff;

for (size_t i = 0; i < v.size(); ++i) {
float gainedpoints = x > v[i] ? static_cast<float>(v_itvpoints[i])
: static_cast<float>(v_itvpoints[i]) *
fastpow(x / v[i], 1.7f);
gotpoints += gainedpoints;
debugValues[2][PtLoss][i] =
(static_cast<float>(v_itvpoints[i]) - gainedpoints);
if (x > v[i]) {
float pts = static_cast<float>(v_itvpoints[i]);
float lostpoints = gotpoints -=
(pts - (pts * fastpow(x / v[i], 1.7f)));
gotpoints -= lostpoints;
debugValues[2][PtLoss][i] = lostpoints;
}
}
} else
for (size_t i = 0; i < v.size(); ++i)
gotpoints += x > v[i] ? static_cast<float>(v_itvpoints[i])
: static_cast<float>(v_itvpoints[i]) *
fastpow(x / v[i], 1.7f);
if (x < v[i]) {
float pts = static_cast<float>(v_itvpoints[i]);
gotpoints -= (pts - (pts * fastpow(x / v[i], 1.7f)));
}
}

inline void
Expand Down Expand Up @@ -3947,5 +3947,5 @@ MinaSDCalcDebug(const vector<NoteInfo>& NoteInfo,
int
GetCalcVersion()
{
return 311;
return 312;
}

0 comments on commit bc3e79a

Please sign in to comment.