Index: Source/modules/gamepad/Gamepad.cpp |
diff --git a/Source/modules/gamepad/Gamepad.cpp b/Source/modules/gamepad/Gamepad.cpp |
index c83ccaf90a457ce81bcf3bc81f7680410dfefc00..fbbfb9b53d9b476907a24fd0912332de868746f4 100644 |
--- a/Source/modules/gamepad/Gamepad.cpp |
+++ b/Source/modules/gamepad/Gamepad.cpp |
@@ -44,12 +44,21 @@ void Gamepad::axes(unsigned count, float* data) |
std::copy(data, data + count, m_axes.begin()); |
} |
+#if defined(ENABLE_NEW_GAMEPAD_API) |
+void Gamepad::buttons(unsigned count, blink::WebGamepadButton* data) |
+{ |
+ m_buttons.resize(count); |
+ for (unsigned i = 0; i < count; ++i) |
+ m_buttons[i] = data[i].value; |
+} |
+#else |
void Gamepad::buttons(unsigned count, float* data) |
{ |
m_buttons.resize(count); |
if (count) |
std::copy(data, data + count, m_buttons.begin()); |
} |
+#endif |
Gamepad::~Gamepad() |
{ |