@@ -52,8 +52,8 @@ void ControllerWithScheduler::issue_nop(const Cancellable* cancellable, Millisec
5252}
5353void ControllerWithScheduler::issue_buttons (
5454 const Cancellable* cancellable,
55- Button button ,
56- Milliseconds delay, Milliseconds hold, Milliseconds cooldown
55+ Milliseconds delay, Milliseconds hold, Milliseconds cooldown ,
56+ Button button
5757){
5858 std::lock_guard<std::mutex> lg0 (m_issue_lock);
5959 std::lock_guard<std::mutex> lg1 (m_state_lock);
@@ -90,8 +90,8 @@ void ControllerWithScheduler::issue_buttons(
9090}
9191void ControllerWithScheduler::issue_dpad (
9292 const Cancellable* cancellable,
93- DpadPosition position ,
94- Milliseconds delay, Milliseconds hold, Milliseconds cooldown
93+ Milliseconds delay, Milliseconds hold, Milliseconds cooldown ,
94+ DpadPosition position
9595){
9696 std::lock_guard<std::mutex> lg0 (m_issue_lock);
9797 std::lock_guard<std::mutex> lg1 (m_state_lock);
@@ -115,8 +115,8 @@ void ControllerWithScheduler::issue_dpad(
115115}
116116void ControllerWithScheduler::issue_left_joystick (
117117 const Cancellable* cancellable,
118- uint8_t x, uint8_t y ,
119- Milliseconds delay, Milliseconds hold, Milliseconds cooldown
118+ Milliseconds delay, Milliseconds hold, Milliseconds cooldown ,
119+ uint8_t x, uint8_t y
120120){
121121 std::lock_guard<std::mutex> lg0 (m_issue_lock);
122122 std::lock_guard<std::mutex> lg1 (m_state_lock);
@@ -142,8 +142,8 @@ void ControllerWithScheduler::issue_left_joystick(
142142}
143143void ControllerWithScheduler::issue_right_joystick (
144144 const Cancellable* cancellable,
145- uint8_t x, uint8_t y ,
146- Milliseconds delay, Milliseconds hold, Milliseconds cooldown
145+ Milliseconds delay, Milliseconds hold, Milliseconds cooldown ,
146+ uint8_t x, uint8_t y
147147){
148148 std::lock_guard<std::mutex> lg0 (m_issue_lock);
149149 std::lock_guard<std::mutex> lg1 (m_state_lock);
@@ -168,11 +168,11 @@ void ControllerWithScheduler::issue_right_joystick(
168168}
169169void ControllerWithScheduler::issue_full_controller_state (
170170 const Cancellable* cancellable,
171+ Milliseconds hold,
171172 Button button,
172173 DpadPosition position,
173174 uint8_t left_x, uint8_t left_y,
174- uint8_t right_x, uint8_t right_y,
175- Milliseconds hold
175+ uint8_t right_x, uint8_t right_y
176176){
177177 std::lock_guard<std::mutex> lg0 (m_issue_lock);
178178 std::lock_guard<std::mutex> lg1 (m_state_lock);
@@ -233,15 +233,16 @@ void ControllerWithScheduler::issue_full_controller_state(
233233
234234void ControllerWithScheduler::issue_mash_button (
235235 const Cancellable* cancellable,
236- Button button, Milliseconds duration
236+ Milliseconds duration,
237+ Button button
237238){
238239 if (cancellable){
239240 cancellable->throw_if_cancelled ();
240241 }
241242 ThrottleScope scope (m_logging_throttler);
242243 bool log = true ;
243244 while (duration > Milliseconds::zero ()){
244- issue_buttons (cancellable, button, 8 *8ms, 5 *8ms, 3 *8ms);
245+ issue_buttons (cancellable, 8 *8ms, 5 *8ms, 3 *8ms, button );
245246
246247 // We never log before the first issue to avoid delaying the critical path.
247248 // But we do want to log before the mash spam. So we log after the first
@@ -262,16 +263,17 @@ void ControllerWithScheduler::issue_mash_button(
262263}
263264void ControllerWithScheduler::issue_mash_button (
264265 const Cancellable* cancellable,
265- Button button0, Button button1, Milliseconds duration
266+ Milliseconds duration,
267+ Button button0, Button button1
266268){
267269 if (cancellable){
268270 cancellable->throw_if_cancelled ();
269271 }
270272 ThrottleScope scope (m_logging_throttler);
271273 bool log = true ;
272274 while (duration > Milliseconds::zero ()){
273- issue_buttons (cancellable, button0, Milliseconds ( 4 * 8 ) , 5 *8ms, 3 *8ms);
274- issue_buttons (cancellable, button1, Milliseconds ( 4 * 8 ) , 5 *8ms, 3 *8ms);
275+ issue_buttons (cancellable, 4 *8ms , 5 *8ms, 3 *8ms, button0 );
276+ issue_buttons (cancellable, 4 *8ms , 5 *8ms, 3 *8ms, button1 );
275277
276278 // We never log before the first issue to avoid delaying the critical path.
277279 // But we do want to log before the mash spam. So we log after the first
@@ -302,7 +304,7 @@ void ControllerWithScheduler::issue_mash_AZs(
302304 if (duration <= Milliseconds::zero ()){
303305 break ;
304306 }
305- issue_buttons (cancellable, BUTTON_A, 3 *8ms, 6 *8ms, 3 *8ms);
307+ issue_buttons (cancellable, 3 *8ms, 6 *8ms, 3 *8ms, BUTTON_A );
306308
307309 // We never log before the first issue to avoid delaying the critical path.
308310 // But we do want to log before the mash spam. So we log after the first
@@ -319,20 +321,20 @@ void ControllerWithScheduler::issue_mash_AZs(
319321 if (duration <= Milliseconds::zero ()){
320322 break ;
321323 }
322- issue_buttons (cancellable, BUTTON_ZL, 3 *8ms, 6 *8ms, 3 *8ms);
324+ issue_buttons (cancellable, 3 *8ms, 6 *8ms, 3 *8ms, BUTTON_ZL );
323325 duration -= std::min (3 *8ms, duration);
324326
325327 if (duration <= Milliseconds::zero ()){
326328 break ;
327329 }
328- issue_buttons (cancellable, BUTTON_ZR, 3 *8ms, 6 *8ms, 3 *8ms);
330+ issue_buttons (cancellable, 3 *8ms, 6 *8ms, 3 *8ms, BUTTON_ZR );
329331 duration -= std::min (3 *8ms, duration);
330332 }
331333}
332334void ControllerWithScheduler::issue_system_scroll (
333335 const Cancellable* cancellable,
334- DpadPosition direction, // Diagonals not allowed.
335- Milliseconds delay, Milliseconds hold, Milliseconds cooldown
336+ Milliseconds delay, Milliseconds hold, Milliseconds cooldown,
337+ DpadPosition direction // Diagonals not allowed.
336338){
337339 if (cancellable){
338340 cancellable->throw_if_cancelled ();
@@ -347,8 +349,9 @@ void ControllerWithScheduler::issue_system_scroll(
347349 do {
348350 if (dpad <= left_joystick && dpad <= right_joystick){
349351 issue_dpad (
350- cancellable, direction,
351- delay, hold, cooldown
352+ cancellable,
353+ delay, hold, cooldown,
354+ direction
352355 );
353356 break ;
354357 }
@@ -397,9 +400,9 @@ void ControllerWithScheduler::issue_system_scroll(
397400 }
398401
399402 if (left_joystick <= dpad && left_joystick <= right_joystick){
400- issue_left_joystick (cancellable, x, y, delay, hold, cooldown );
403+ issue_left_joystick (cancellable, delay, hold, cooldown, x, y );
401404 }else {
402- issue_right_joystick (cancellable, x, y, delay, hold, cooldown );
405+ issue_right_joystick (cancellable, delay, hold, cooldown, x, y );
403406 }
404407 }while (false );
405408
0 commit comments