OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/gamepad/gamepad_platform_data_fetcher_win.h" | 5 #include "content/browser/gamepad/gamepad_platform_data_fetcher_win.h" |
6 | 6 |
7 #include <dinput.h> | 7 #include <dinput.h> |
8 #include <dinputd.h> | 8 #include <dinputd.h> |
9 | 9 |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 raw.buttons[16] = 0.0; | 466 raw.buttons[16] = 0.0; |
467 | 467 |
468 for (int i = 0; i < 10; i++) | 468 for (int i = 0; i < 10; i++) |
469 raw.axes[i] = state.axes[i]; | 469 raw.axes[i] = state.axes[i]; |
470 pad_state_[index].mapper(raw, pad); | 470 pad_state_[index].mapper(raw, pad); |
471 } | 471 } |
472 | 472 |
473 bool GamepadPlatformDataFetcherWin::GetXInputDllFunctions() { | 473 bool GamepadPlatformDataFetcherWin::GetXInputDllFunctions() { |
474 xinput_get_capabilities_ = NULL; | 474 xinput_get_capabilities_ = NULL; |
475 xinput_get_state_ = NULL; | 475 xinput_get_state_ = NULL; |
476 xinput_enable_ = static_cast<XInputEnableFunc>( | 476 xinput_enable_ = reinterpret_cast<XInputEnableFunc>( |
477 xinput_dll_.GetFunctionPointer("XInputEnable")); | 477 xinput_dll_.GetFunctionPointer("XInputEnable")); |
478 if (!xinput_enable_) | 478 if (!xinput_enable_) |
479 return false; | 479 return false; |
480 xinput_get_capabilities_ = static_cast<XInputGetCapabilitiesFunc>( | 480 xinput_get_capabilities_ = reinterpret_cast<XInputGetCapabilitiesFunc>( |
481 xinput_dll_.GetFunctionPointer("XInputGetCapabilities")); | 481 xinput_dll_.GetFunctionPointer("XInputGetCapabilities")); |
482 if (!xinput_get_capabilities_) | 482 if (!xinput_get_capabilities_) |
483 return false; | 483 return false; |
484 xinput_get_state_ = static_cast<XInputGetStateFunc>( | 484 xinput_get_state_ = reinterpret_cast<XInputGetStateFunc>( |
485 xinput_dll_.GetFunctionPointer("XInputGetState")); | 485 xinput_dll_.GetFunctionPointer("XInputGetState")); |
486 if (!xinput_get_state_) | 486 if (!xinput_get_state_) |
487 return false; | 487 return false; |
488 xinput_enable_(true); | 488 xinput_enable_(true); |
489 return true; | 489 return true; |
490 } | 490 } |
491 | 491 |
492 } // namespace content | 492 } // namespace content |
OLD | NEW |