hle: kernel: Migrate KEvent to KAutoObject.

This commit is contained in:
bunnei 2021-04-04 00:56:09 -07:00
parent 086db71e94
commit addc0bf037
37 changed files with 269 additions and 266 deletions

View file

@ -253,9 +253,8 @@ void Controller_NPad::InitNewlyAddedController(std::size_t controller_idx) {
void Controller_NPad::OnInit() {
auto& kernel = system.Kernel();
for (std::size_t i = 0; i < styleset_changed_events.size(); ++i) {
styleset_changed_events[i] =
Kernel::KEvent::Create(kernel, fmt::format("npad:NpadStyleSetChanged_{}", i));
styleset_changed_events[i]->Initialize();
styleset_changed_events[i] = std::make_unique<Kernel::KEvent>(kernel);
styleset_changed_events[i]->Initialize(fmt::format("npad:NpadStyleSetChanged_{}", i));
}
if (!IsControllerActivated()) {

View file

@ -573,7 +573,7 @@ private:
NpadHandheldActivationMode handheld_activation_mode{NpadHandheldActivationMode::Dual};
NpadCommunicationMode communication_mode{NpadCommunicationMode::Default};
// Each controller should have their own styleset changed event
std::array<std::shared_ptr<Kernel::KEvent>, 10> styleset_changed_events;
std::array<std::unique_ptr<Kernel::KEvent>, 10> styleset_changed_events;
std::array<std::array<std::chrono::steady_clock::time_point, 2>, 10> last_vibration_timepoints;
std::array<std::array<VibrationValue, 2>, 10> latest_vibration_values{};
bool permit_vibration_session_enabled{false};