mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-22 23:07:56 -05:00
hidbus: Use ReadBufferSpan
This commit is contained in:
@ -737,11 +737,12 @@ Core::HID::NpadStyleTag Controller_NPad::GetSupportedStyleSet() const {
|
||||
return hid_core.GetSupportedStyleTag();
|
||||
}
|
||||
|
||||
void Controller_NPad::SetSupportedNpadIdTypes(const u8* const data, std::size_t length) {
|
||||
void Controller_NPad::SetSupportedNpadIdTypes(std::span<const u8> data) {
|
||||
const auto length = data.size();
|
||||
ASSERT(length > 0 && (length % sizeof(u32)) == 0);
|
||||
supported_npad_id_types.clear();
|
||||
supported_npad_id_types.resize(length / sizeof(u32));
|
||||
std::memcpy(supported_npad_id_types.data(), data, length);
|
||||
std::memcpy(supported_npad_id_types.data(), data.data(), length);
|
||||
}
|
||||
|
||||
void Controller_NPad::GetSupportedNpadIdTypes(u32* data, std::size_t max_length) {
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <mutex>
|
||||
#include <span>
|
||||
|
||||
#include "common/bit_field.h"
|
||||
#include "common/common_types.h"
|
||||
@ -95,7 +96,7 @@ public:
|
||||
void SetSupportedStyleSet(Core::HID::NpadStyleTag style_set);
|
||||
Core::HID::NpadStyleTag GetSupportedStyleSet() const;
|
||||
|
||||
void SetSupportedNpadIdTypes(const u8* const data, std::size_t length);
|
||||
void SetSupportedNpadIdTypes(std::span<const u8> data);
|
||||
void GetSupportedNpadIdTypes(u32* data, std::size_t max_length);
|
||||
std::size_t GetSupportedNpadIdTypesSize() const;
|
||||
|
||||
|
Reference in New Issue
Block a user