mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Merge pull request #13096 from mitaclaw/ranges-modernization-7-rewrite
Ranges Algorithms Modernization - Rewrite
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <ranges>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/ranges.h>
|
||||
@ -284,11 +285,10 @@ void ReshapableInput::SaveConfig(Common::IniFile::Section* section,
|
||||
50.0);
|
||||
}
|
||||
|
||||
std::vector<std::string> save_data(m_calibration.size());
|
||||
std::transform(
|
||||
m_calibration.begin(), m_calibration.end(), save_data.begin(),
|
||||
[](ControlState val) { return fmt::format("{:.2f}", val * CALIBRATION_CONFIG_SCALE); });
|
||||
section->Set(group + CALIBRATION_CONFIG_NAME, fmt::to_string(fmt::join(save_data, " ")), "");
|
||||
const std::ranges::transform_view scaled_calibration(
|
||||
m_calibration, [](ControlState val) { return val * CALIBRATION_CONFIG_SCALE; });
|
||||
section->Set(group + CALIBRATION_CONFIG_NAME,
|
||||
fmt::format("{:.2f}", fmt::join(scaled_calibration, " ")), "");
|
||||
|
||||
// Save center value.
|
||||
static constexpr char center_format[] = "{:.2f} {:.2f}";
|
||||
|
@ -915,7 +915,7 @@ static void ResetRumbleLockNeeded()
|
||||
return;
|
||||
}
|
||||
|
||||
std::fill(std::begin(s_controller_rumble), std::end(s_controller_rumble), 0);
|
||||
s_controller_rumble.fill(0);
|
||||
|
||||
std::array<u8, CONTROLLER_OUTPUT_RUMBLE_PAYLOAD_SIZE> rumble = {
|
||||
0x11, s_controller_rumble[0], s_controller_rumble[1], s_controller_rumble[2],
|
||||
|
Reference in New Issue
Block a user