Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: trunk/Source/modules/gamepad/Gamepad.cpp

Issue 171423019: Revert 167539 "Updating Blink-side Gamepad API to match latest spec" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/Source/modules/gamepad/Gamepad.h ('k') | trunk/Source/modules/gamepad/Gamepad.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/modules/gamepad/Gamepad.cpp
===================================================================
--- trunk/Source/modules/gamepad/Gamepad.cpp (revision 167540)
+++ trunk/Source/modules/gamepad/Gamepad.cpp (working copy)
@@ -44,18 +44,11 @@
std::copy(data, data + count, m_axes.begin());
}
-void Gamepad::buttons(unsigned count, blink::WebGamepadButton* data)
+void Gamepad::buttons(unsigned count, float* data)
{
- if (m_buttons.size() != count) {
- m_buttons.resize(count);
- for (unsigned i = 0; i < count; ++i)
- m_buttons[i] = GamepadButton::create();
- }
-
- for (unsigned i = 0; i < count; ++i) {
- m_buttons[i]->pressed(data[i].pressed);
- m_buttons[i]->value(data[i].value);
- }
+ m_buttons.resize(count);
+ if (count)
+ std::copy(data, data + count, m_buttons.begin());
}
Gamepad::~Gamepad()
« no previous file with comments | « trunk/Source/modules/gamepad/Gamepad.h ('k') | trunk/Source/modules/gamepad/Gamepad.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698