Skip to content

Commit 8b4978b

Browse files
tidy
1 parent dbc7277 commit 8b4978b

File tree

11 files changed

+91
-121
lines changed

11 files changed

+91
-121
lines changed

src/Etterna/Globals/MinaCalc.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ Calc::InitializeHands(const vector<NoteInfo>& NoteInfo,
678678

679679
ulbu_that_which_consumes_all.heres_my_diffs(left_hand.soap,
680680
right_hand.soap);
681-
681+
682682
ulbu_that_which_consumes_all(
683683
nervIntervals, music_rate, left_hand.doot, right_hand.doot);
684684

@@ -726,8 +726,6 @@ Hand::InitBaseDiff(Finger& f1, Finger& f2)
726726
}
727727

728728
for (int i = 0; i < f1.size(); i++) {
729-
// scaler for things with higher things
730-
static const float higher_thing_scaler = 1.175F;
731729
float nps = 1.6F * static_cast<float>(f1[i].size() + f2[i].size());
732730
soap[NPSBase][i] = finalscaler * nps;
733731
}
@@ -747,7 +745,6 @@ Calc::Chisel(float player_skill,
747745

748746
float gotpoints = 0.F;
749747
float reqpoints = static_cast<float>(MaxPoints) * score_goal;
750-
float max_points_lost = static_cast<float>(MaxPoints) - reqpoints;
751748
float jloss = 0.F;
752749
for (int iter = 1; iter <= 8; iter++) {
753750
do {
@@ -856,7 +853,7 @@ Hand::InitAdjDiff()
856853

857854
// stam, nothing, don't handle here
858855
{},
859-
856+
860857
// jackspeed
861858
{
862859
OHTrill,

src/Etterna/Globals/MinaCalc/Agnostic/HA_Sequencers/FlamSequencing.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ struct flam
6767

6868
inline void grow(const float& ms_now, const unsigned& notes)
6969
{
70-
if (size == max_flam_jammies)
70+
if (size == max_flam_jammies) {
7171
return;
72+
}
7273

7374
unsigned_unseen |= notes;
7475
ms.at(size - 1) = ms_now;

src/Etterna/Globals/MinaCalc/Agnostic/HA_Sequencers/ThingSequencing.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ struct TT_Sequencing
299299
inline void reset()
300300
{
301301
slip_counter = 0;
302-
mod_parts.fill(1.f);
302+
mod_parts.fill(1.F);
303303
}
304304

305305
inline auto construct_mod_part() -> float { return scaler; }

src/Etterna/Globals/MinaCalc/Dependent/HD_PatternMods/OHJ.h

-9
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,6 @@ struct OHJumpModGuyThing
9494
prop_component = fastsqrt(prop_component);
9595
}
9696

97-
inline void set_debug_output(vector<float> doot[], const int& i)
98-
{
99-
doot[OHJSeqComp][i] = max_seq_component;
100-
doot[OHJPropComp][i] = prop_component;
101-
doot[OHJBaseProp][i] = base_seq_prop;
102-
doot[OHJMaxSeq][i] = floatymcfloatface;
103-
doot[OHJCCTaps][i] = static_cast<float>(cc_taps);
104-
}
105-
10697
inline void set_pmod(const metaItvHandInfo& mitvhi)
10798
{
10899
const auto& itvhi = mitvhi._itvhi;

src/Etterna/Globals/MinaCalc/Dependent/HD_PatternMods/Roll.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct RollMod
5252
#pragma endregion params and param map
5353

5454
int window = 0;
55-
Roll_Sequencer _roll;
55+
Roll_Sequencer _roll{};
5656
CalcMovingWindow<float> _mw_pmod;
5757

5858
float moving_cv = cv_reset;
@@ -99,7 +99,7 @@ struct RollMod
9999

100100
interval_end();
101101
_mw_pmod(pmod);
102-
return 1.f;
102+
return neutral;
103103
//_mw_pmod.get_mean_of_window(window);
104104
}
105105

src/Etterna/Globals/MinaCalc/Dependent/HD_PatternMods/RunningMan.h

-18
Original file line numberDiff line numberDiff line change
@@ -191,31 +191,13 @@ struct RunningManMod
191191
inline void advance_sequencing(const col_type& ct,
192192
const base_type& bt,
193193
const meta_type& mt,
194-
const float& row_time,
195-
const int& offhand_taps,
196194
const AnchorSequencer& as)
197195
{
198196
for (auto& c : ct_loop_no_jumps) {
199197
rms.at(c)(ct, bt, mt, as.anch[c]);
200198
}
201199
}
202200

203-
inline void set_dbg(vector<float> doot[], const int& i)
204-
{
205-
if (debug_lmao) {
206-
// doot[RanLen][i] = 1.F;
207-
// doot[RanAnchLen][i] = (static_cast<float>(rm._len) / 30.F) +
208-
// 0.5F; doot[RanAnchLenMod][i] = anchor_len_comp; doot[RanOHT][i] =
209-
// static_cast<float>(rm.oht_taps); doot[RanOffS][i] =
210-
// static_cast<float>(rm.off_taps_sh); doot[RanJack][i] =
211-
// static_cast<float>(rm.jack_taps); doot[RanPropAll][i] =
212-
// total_prop; doot[RanPropOff][i] = off_tap_prop;
213-
// doot[RanPropOffS][i] = off_tap_same_prop;
214-
// doot[RanPropOHT][i] = oht_bonus;
215-
// doot[RanPropJack][i] = jack_bonus;
216-
}
217-
}
218-
219201
inline auto get_highest_anchor_difficulty() -> float
220202
{
221203
return max(rms.at(col_left).get_difficulty(),

src/Etterna/Globals/MinaCalc/Dependent/HD_Sequencers/GenericSequencing.h

+14-6
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,14 @@ struct Anchor_Sequencing
134134

135135
inline auto get_difficulty() -> float
136136
{
137-
if (_len <= 2)
137+
if (_len <= 2) {
138+
138139
return ms_to_scaled_nps(_sc_ms + 90.F);
139-
if (_len == 3)
140+
}
141+
if (_len == 3) {
142+
140143
return ms_to_scaled_nps(_sc_ms + 180.F);
144+
}
141145
float flool = ms_from(_last, _start);
142146
float pule = (flool + 270.F) / static_cast<float>(_len - 1);
143147
float drool = ms_to_scaled_nps(pule);
@@ -263,8 +267,10 @@ struct SequencerGeneral
263267
inline void set_sc_ms(const col_type& ct)
264268
{
265269
// single notes are simple
266-
if (ct == col_left || ct == col_right)
270+
if (ct == col_left || ct == col_right) {
271+
267272
_mw_sc_ms.at(ct)(_as.anch.at(ct)._sc_ms);
273+
}
268274

269275
// oh jumps mean we do both, we will allow whatever is querying for the
270276
// value to choose which column value they want (lower by default)
@@ -323,8 +329,10 @@ struct SequencerGeneral
323329

324330
inline auto get_sc_ms_now(const col_type& ct, bool lower = true) -> float
325331
{
326-
if (ct == col_init)
332+
if (ct == col_init) {
333+
327334
return ms_init;
335+
}
328336

329337
// if ohjump, grab the smaller value by default
330338
if (ct == col_ohjump) {
@@ -366,7 +374,7 @@ struct SequencerGeneral
366374
itv_row_counter = 0;
367375
}
368376

369-
std::array<float, 6> _cv_check = { 0.f, 0.f, 0.f, 0.f, 0.f, 0.f };
377+
std::array<float, 6> _cv_check = { 0.F, 0.F, 0.F, 0.F, 0.F, 0.F };
370378
CalcMovingWindow<float> _cv_check2;
371379

372380
[[nodiscard]] inline auto cccccc_check() -> float
@@ -386,7 +394,7 @@ struct SequencerGeneral
386394

387395
[[nodiscard]] inline auto get_cv_mean(const int& window) -> float
388396
{
389-
float o = 0.f;
397+
float o = 0.F;
390398

391399
int i = max_moving_window_size;
392400
while (i > max_moving_window_size - window) {

src/Etterna/Globals/MinaCalc/Dependent/HD_Sequencers/RMSequencing.h

+19-16
Original file line numberDiff line numberDiff line change
@@ -265,21 +265,19 @@ struct RM_Sequencer
265265
inline auto off_len_exceeds_max() -> bool
266266
{
267267
// haven't exceeded anything
268-
if (_rm.off_len <= max_off_spacing)
268+
if (_rm.off_len <= max_off_spacing) {
269269
return false;
270+
}
270271

271-
if (had_burst) {
272-
// already had a burst and exceeding normal limit
273-
return true;
274-
} else if (_rm.off_len > max_burst_len) {
275-
// exceeded the burst limit
272+
// already had a burst and exceeding normal limit or exceeded the burst
273+
// limit
274+
if (had_burst || _rm.off_len > max_burst_len) {
276275
return true;
277-
} else {
278-
// have exceeded the normal limit but not had a burst yet, set
279-
// bursting to true and return false
280-
is_bursting = true;
281-
return false;
282276
}
277+
// have exceeded the normal limit but not had a burst yet, set
278+
// bursting to true and return false
279+
is_bursting = true;
280+
return false;
283281
}
284282

285283
inline auto jack_len_exceeds_max() -> bool
@@ -392,8 +390,10 @@ struct RM_Sequencer
392390
// metatype won't be set until it finds 1212, but we want to
393391
// explicitly track the number of off_anchor taps in the oht, so
394392
// boost by 1 when we see meta_oht and oht_len == 0
395-
if (_rm.oht_len == 0)
393+
if (_rm.oht_len == 0) {
394+
396395
_rm.add_oht_tap();
396+
}
397397

398398
_rm.add_oht_tap();
399399
if (oht_len_exceeds_max()) {
@@ -452,8 +452,10 @@ struct RM_Sequencer
452452
// in the anchoring block because technically jacks can either be on the
453453
// anchor column or not, and i don't want to have to split logic again
454454
// between anchor column jacks and off anchor jacks on the same hand
455-
if (as._ct == _ct)
455+
if (as._ct == _ct) {
456+
456457
last_anchor_time = as._last;
458+
}
457459

458460
// determine what we should do
459461
switch (bt) {
@@ -526,14 +528,15 @@ struct RM_Sequencer
526528

527529
inline auto get_difficulty() -> float
528530
{
529-
if (_status == rm_inactive || _rm._len < 3)
530-
return 1.f;
531+
if (_status == rm_inactive || _rm._len < 3) {
532+
return 1.F;
533+
}
531534

532535
float flool = ms_from(last_anchor_time, _start);
533536

534537
// may be unnecessary
535538
float glunk =
536-
CalcClamp(static_cast<float>(_rm.off_taps_sh) / 3.f, 0.1f, 1.f);
539+
CalcClamp(static_cast<float>(_rm.off_taps_sh) / 3.F, 0.1F, 1.F);
537540

538541
float pule = (flool + 25.F) / static_cast<float>(_rm._len - 1);
539542
float drool = ms_to_scaled_nps(pule);

src/Etterna/Globals/MinaCalc/Dependent/IntervalHandInfo.h

+6-14
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,18 @@ struct ItvHandInfo
3232

3333
// update interval mws for col taps
3434
for (auto& ct : ct_loop) {
35-
_mw_col_taps[ct](_col_taps[ct]);
35+
_mw_col_taps.at(ct)(_col_taps.at(ct));
3636
}
3737

3838
// reset taps per col on this hand
3939
_col_taps.fill(0);
40-
41-
// reset offhand taps
42-
_offhand_taps = 0;
4340
}
4441

4542
// zeroes out all values for everything, complete reset for when we swap
4643
// hands maybe move to constructor and reconstruct when swapping hands??
4744
inline void zero()
4845
{
4946
_col_taps.fill(0);
50-
_offhand_taps = 0;
5147

5248
for (auto& mw : _mw_col_taps) {
5349
mw.zero();
@@ -59,23 +55,23 @@ struct ItvHandInfo
5955
[[nodiscard]] inline auto get_col_taps_nowi(const col_type& ct) const -> int
6056
{
6157
assert(ct < num_col_types);
62-
return _mw_col_taps[ct].get_now();
58+
return _mw_col_taps.at(ct).get_now();
6359
}
6460

6561
// cast to float for divisioning and clean screen
6662
[[nodiscard]] inline auto get_col_taps_nowf(const col_type& ct) const
6763
-> float
6864
{
6965
assert(ct < num_col_types);
70-
return static_cast<float>(_mw_col_taps[ct].get_now());
66+
return static_cast<float>(_mw_col_taps.at(ct).get_now());
7167
}
7268

7369
[[nodiscard]] inline auto get_col_taps_windowi(const col_type& ct,
7470
const int& window) const
7571
-> int
7672
{
7773
assert(ct < num_col_types && window < max_moving_window_size);
78-
return _mw_col_taps[ct].get_total_for_window(window);
74+
return _mw_col_taps.at(ct).get_total_for_window(window);
7975
}
8076

8177
// cast to float for divisioning and clean screen
@@ -85,7 +81,7 @@ struct ItvHandInfo
8581
{
8682
assert(ct < num_col_types && window < max_moving_window_size);
8783
return static_cast<float>(
88-
_mw_col_taps[ct].get_total_for_window(window));
84+
_mw_col_taps.at(ct).get_total_for_window(window));
8985
}
9086

9187
// col operations
@@ -165,11 +161,7 @@ struct ItvHandInfo
165161
return static_cast<float>(_mw_hand_taps.get_total_for_window(window));
166162
}
167163

168-
// uhh we uhh.. something sets this i think... this is not handled well
169-
public:
170-
int _offhand_taps = 0;
171-
172-
protected:
164+
private:
173165
std::array<int, num_col_types> _col_taps = { 0, 0, 0 };
174166

175167
// switch to keeping generic moving windows here, if any mod needs a moving

0 commit comments

Comments
 (0)