mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 03:18:37 +08:00
More fixes to Joypad renaming.
Windows did not compile anymore because DI8DEVTYPE_JOYPAD obviously isn't defined in the directx headers ^^ I also did the same renaming as in #7473 for the windows platform and reverted the changes in the gamepad mappings.
This commit is contained in:
parent
719b2e6eaa
commit
d963fa9a01
@ -580,7 +580,7 @@ static const char *s_ControllerMappings [] =
|
||||
"4f0400b3000000000000504944564944,Thrustmaster Firestorm Dual Power,a:b0,b:b2,y:b3,x:b1,start:b10,guide:b8,back:b9,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,",
|
||||
"4f0415b3000000000000504944564944,Thrustmaster Dual Analog 3.2,x:b1,a:b0,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
|
||||
"4f0423b3000000000000504944564944,Dual Trigger 3-in-1,a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:b6,righttrigger:b7",
|
||||
"63252305000000000000504944564944,USB Vibration Joypad (BM),x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
|
||||
"63252305000000000000504944564944,USB Vibration Joystick (BM),x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
|
||||
"6d0416c2000000000000504944564944,Generic DirectInput Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
||||
"6d0418c2000000000000504944564944,Logitech RumblePad 2 USB,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
|
||||
"6d0419c2000000000000504944564944,Logitech F710 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
||||
@ -596,7 +596,7 @@ static const char *s_ControllerMappings [] =
|
||||
"8f0e1200000000000000504944564944,Acme,x:b2,a:b0,b:b1,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,",
|
||||
"9000318000000000000504944564944,Mayflash Wiimote PC Adapter,a:b2,b:h0.4,x:b0,y:b1,back:b4,start:b5,guide:b11,leftshoulder:b6,rightshoulder:b3,leftx:a0,lefty:a1,",
|
||||
"a3060cff000000000000504944564944,Saitek P2500,a:b2,b:b3,y:b1,x:b0,start:b4,guide:b10,back:b5,leftstick:b8,rightstick:b9,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
|
||||
"c0111352000000000000504944564944,Battalife Joypad,x:b4,a:b6,b:b7,y:b5,back:b2,start:b3,leftshoulder:b0,rightshoulder:b1,leftx:a0,lefty:a1,",
|
||||
"c0111352000000000000504944564944,Battalife Joystick,x:b4,a:b6,b:b7,y:b5,back:b2,start:b3,leftshoulder:b0,rightshoulder:b1,leftx:a0,lefty:a1,",
|
||||
"c911f055000000000000504944564944,GAMEPAD,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
|
||||
"d6206dca000000000000504944564944,PowerA Pro Ex,a:b1,b:b2,x:b0,y:b3,back:b8,guide:b12,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.0,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
|
||||
"ff113133000000000000504944564944,Gembird JPD-DualForce,a:b2,b:b3,x:b0,y:b1,start:b9,back:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,leftstick:b10,rightstick:b11,",
|
||||
@ -613,7 +613,7 @@ static const char *s_ControllerMappings [] =
|
||||
"0d0f0000000000006600000000000000,HORIPAD FPS PLUS 4,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:b6,righttrigger:a4,",
|
||||
"10280000000000000900000000000000,8Bitdo SFC30 GamePad,a:b1,b:b0,x:b4,y:b3,back:b10,start:b11,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,",
|
||||
"2509000000000000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,x:b3,y:b2,back:b8,guide:b10,start:b9,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:b11,dpdown:b13,dpleft:b12,dpright:b14,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
|
||||
"351200000000000021ab000000000000,SFC30 Joypad,a:b1,b:b0,x:b4,y:b3,back:b10,start:b11,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,",
|
||||
"351200000000000021ab000000000000,SFC30 Joystick,a:b1,b:b0,x:b4,y:b3,back:b10,start:b11,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,",
|
||||
"4c050000000000006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
|
||||
"4c05000000000000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||
"4f0400000000000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,y:b3,x:b1,start:b10,guide:b8,back:b9,leftstick:b11,rightstick:,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b5,righttrigger:b7,",
|
||||
@ -684,13 +684,13 @@ static const char *s_ControllerMappings [] =
|
||||
"030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
|
||||
"030000006f0e00003901000020060000,Afterglow Wired Controller for Xbox One,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
|
||||
"030000006f0e00004601000001010000,Rock Candy Wired Controller for Xbox One,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,guide:b8,leftstick:b9,rightstick:b10,lefttrigger:a2,righttrigger:a5,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
|
||||
"03000000790000000600000010010000,DragonRise Inc. Generic USB Joypad,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
|
||||
"03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
|
||||
"03000000790000001100000010010000,RetroLink Saturn Classic Controller,x:b3,a:b0,b:b1,y:b4,back:b5,guide:b2,start:b8,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,",
|
||||
"03000000830500006020000010010000,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,x:b3,y:b2,back:b6,start:b7,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,",
|
||||
"030000008916000000fd000024010000,Razer Onza Tournament,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:b13,dpleft:b11,dpdown:b14,dpright:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,",
|
||||
"030000008916000001fd000024010000,Razer Onza Classic Edition,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:b11,dpdown:b14,dpright:b12,dpup:b13,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
|
||||
"030000008f0e00000300000010010000,GreenAsia Inc. USB Joypad,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,",
|
||||
"030000008f0e00001200000010010000,GreenAsia Inc. USB Joypad,x:b2,a:b0,b:b1,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,",
|
||||
"030000008f0e00000300000010010000,GreenAsia Inc. USB Joystick,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,",
|
||||
"030000008f0e00001200000010010000,GreenAsia Inc. USB Joystick,x:b2,a:b0,b:b1,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,",
|
||||
"03000000a30600000901000000010000,Saitek P880,a:b2,b:b3,y:b1,x:b0,leftstick:b8,rightstick:b9,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b6,righttrigger:b7,",
|
||||
"03000000a30600000c04000011010000,Saitek P2900 Wireless Pad,a:b1,b:b2,y:b3,x:b0,start:b12,guide:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b4,righttrigger:b5,",
|
||||
"03000000a306000018f5000010010000,Saitek PLC Saitek P3200 Rumble Pad,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
|
||||
|
@ -26,7 +26,6 @@
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
//author: Andreas Haas <hondres, liugam3@gmail.com>
|
||||
#include "joypad.h"
|
||||
#include <iostream>
|
||||
#include <wbemidl.h>
|
||||
@ -39,11 +38,11 @@
|
||||
DWORD WINAPI _xinput_get_state(DWORD dwUserIndex, XINPUT_STATE* pState) { return ERROR_DEVICE_NOT_CONNECTED; }
|
||||
DWORD WINAPI _xinput_set_state(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration) { return ERROR_DEVICE_NOT_CONNECTED; }
|
||||
|
||||
joypad_windows::joypad_windows() {
|
||||
JoypadWindows::JoypadWindows() {
|
||||
|
||||
}
|
||||
|
||||
joypad_windows::joypad_windows(InputDefault* _input, HWND* hwnd) {
|
||||
JoypadWindows::JoypadWindows(InputDefault* _input, HWND* hwnd) {
|
||||
|
||||
input = _input;
|
||||
hWnd = hwnd;
|
||||
@ -67,7 +66,7 @@ joypad_windows::joypad_windows(InputDefault* _input, HWND* hwnd) {
|
||||
probe_joypads();
|
||||
}
|
||||
|
||||
joypad_windows::~joypad_windows() {
|
||||
JoypadWindows::~JoypadWindows() {
|
||||
|
||||
close_joypad();
|
||||
dinput->Release();
|
||||
@ -75,7 +74,7 @@ joypad_windows::~joypad_windows() {
|
||||
}
|
||||
|
||||
|
||||
bool joypad_windows::have_device(const GUID &p_guid) {
|
||||
bool JoypadWindows::have_device(const GUID &p_guid) {
|
||||
|
||||
for (int i = 0; i < JOYPADS_MAX; i++) {
|
||||
|
||||
@ -88,7 +87,7 @@ bool joypad_windows::have_device(const GUID &p_guid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int joypad_windows::check_free_joy_slot() const {
|
||||
int JoypadWindows::check_free_joy_slot() const {
|
||||
|
||||
for (int i = 0; i < JOYPADS_MAX; i++) {
|
||||
|
||||
@ -100,7 +99,7 @@ int joypad_windows::check_free_joy_slot() const {
|
||||
|
||||
|
||||
// adapted from SDL2, works a lot better than the MSDN version
|
||||
bool joypad_windows::is_xinput_device(const GUID *p_guid) {
|
||||
bool JoypadWindows::is_xinput_device(const GUID *p_guid) {
|
||||
|
||||
static GUID IID_ValveStreamingGamepad = { MAKELONG(0x28DE, 0x11FF), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } };
|
||||
static GUID IID_X360WiredGamepad = { MAKELONG(0x045E, 0x02A1), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } };
|
||||
@ -144,7 +143,7 @@ bool joypad_windows::is_xinput_device(const GUID *p_guid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool joypad_windows::setup_dinput_joypad(const DIDEVICEINSTANCE* instance) {
|
||||
bool JoypadWindows::setup_dinput_joypad(const DIDEVICEINSTANCE* instance) {
|
||||
|
||||
HRESULT hr;
|
||||
int num = check_free_joy_slot();
|
||||
@ -157,7 +156,7 @@ bool joypad_windows::setup_dinput_joypad(const DIDEVICEINSTANCE* instance) {
|
||||
|
||||
const DWORD devtype = (instance->dwDevType & 0xFF);
|
||||
|
||||
if ((devtype != DI8DEVTYPE_JOYPAD) && (devtype != DI8DEVTYPE_GAMEPAD) && (devtype != DI8DEVTYPE_1STPERSON)) {
|
||||
if ((devtype != DI8DEVTYPE_JOYSTICK) && (devtype != DI8DEVTYPE_GAMEPAD) && (devtype != DI8DEVTYPE_1STPERSON)) {
|
||||
//printf("ignore device %s, type %x\n", instance->tszProductName, devtype);
|
||||
return false;
|
||||
}
|
||||
@ -179,7 +178,7 @@ bool joypad_windows::setup_dinput_joypad(const DIDEVICEINSTANCE* instance) {
|
||||
|
||||
id_to_change = joypad_count;
|
||||
|
||||
joy->di_joy->SetDataFormat(&c_dfDIJoypad2);
|
||||
joy->di_joy->SetDataFormat(&c_dfDIJoystick2);
|
||||
joy->di_joy->SetCooperativeLevel(*hWnd, DISCL_FOREGROUND);
|
||||
joy->di_joy->EnumObjects(objectsCallback, this, NULL);
|
||||
joy->joy_axis.sort();
|
||||
@ -194,7 +193,7 @@ bool joypad_windows::setup_dinput_joypad(const DIDEVICEINSTANCE* instance) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void joypad_windows::setup_joypad_object(const DIDEVICEOBJECTINSTANCE *ob, int p_joy_id) {
|
||||
void JoypadWindows::setup_joypad_object(const DIDEVICEOBJECTINSTANCE *ob, int p_joy_id) {
|
||||
|
||||
if (ob->dwType & DIDFT_AXIS) {
|
||||
|
||||
@ -246,10 +245,10 @@ void joypad_windows::setup_joypad_object(const DIDEVICEOBJECTINSTANCE *ob, int p
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CALLBACK joypad_windows::enumCallback(const DIDEVICEINSTANCE* instance, void* pContext) {
|
||||
BOOL CALLBACK JoypadWindows::enumCallback(const DIDEVICEINSTANCE* instance, void* pContext) {
|
||||
|
||||
|
||||
joypad_windows* self = (joypad_windows*)pContext;
|
||||
JoypadWindows* self = (JoypadWindows*)pContext;
|
||||
if (self->is_xinput_device(&instance->guidProduct)) {;
|
||||
return DIENUM_CONTINUE;
|
||||
}
|
||||
@ -257,15 +256,15 @@ BOOL CALLBACK joypad_windows::enumCallback(const DIDEVICEINSTANCE* instance, voi
|
||||
return DIENUM_CONTINUE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK joypad_windows::objectsCallback(const DIDEVICEOBJECTINSTANCE *instance, void *context) {
|
||||
BOOL CALLBACK JoypadWindows::objectsCallback(const DIDEVICEOBJECTINSTANCE *instance, void *context) {
|
||||
|
||||
joypad_windows* self = (joypad_windows*)context;
|
||||
JoypadWindows* self = (JoypadWindows*)context;
|
||||
self->setup_joypad_object(instance, self->id_to_change);
|
||||
|
||||
return DIENUM_CONTINUE;
|
||||
}
|
||||
|
||||
void joypad_windows::close_joypad(int id) {
|
||||
void JoypadWindows::close_joypad(int id) {
|
||||
|
||||
if (id == -1) {
|
||||
|
||||
@ -287,7 +286,7 @@ void joypad_windows::close_joypad(int id) {
|
||||
joypad_count--;
|
||||
}
|
||||
|
||||
void joypad_windows::probe_joypads() {
|
||||
void JoypadWindows::probe_joypads() {
|
||||
|
||||
DWORD dwResult;
|
||||
for (DWORD i = 0; i < XUSER_MAX_COUNT; i++) {
|
||||
@ -333,7 +332,7 @@ void joypad_windows::probe_joypads() {
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int joypad_windows::process_joypads(unsigned int p_last_id) {
|
||||
unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) {
|
||||
|
||||
HRESULT hr;
|
||||
|
||||
@ -438,7 +437,7 @@ unsigned int joypad_windows::process_joypads(unsigned int p_last_id) {
|
||||
return p_last_id;
|
||||
}
|
||||
|
||||
unsigned int joypad_windows::post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad) {
|
||||
unsigned int JoypadWindows::post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad) {
|
||||
|
||||
int dpad_val = 0;
|
||||
|
||||
@ -487,7 +486,7 @@ unsigned int joypad_windows::post_hat(unsigned int p_last_id, int p_device, DWOR
|
||||
return input->joy_hat(p_last_id, p_device, dpad_val);
|
||||
};
|
||||
|
||||
InputDefault::JoyAxis joypad_windows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool p_negate) const {
|
||||
InputDefault::JoyAxis JoypadWindows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool p_negate) const {
|
||||
|
||||
InputDefault::JoyAxis jx;
|
||||
if (Math::abs(p_val) < MIN_JOY_AXIS) {
|
||||
@ -519,7 +518,7 @@ InputDefault::JoyAxis joypad_windows::axis_correct(int p_val, bool p_xinput, boo
|
||||
return jx;
|
||||
}
|
||||
|
||||
void joypad_windows::joypad_vibration_start_xinput(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp) {
|
||||
void JoypadWindows::joypad_vibration_start_xinput(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp) {
|
||||
xinput_gamepad &joy = x_joypads[p_device];
|
||||
if (joy.attached) {
|
||||
XINPUT_VIBRATION effect;
|
||||
@ -533,7 +532,7 @@ void joypad_windows::joypad_vibration_start_xinput(int p_device, float p_weak_ma
|
||||
}
|
||||
}
|
||||
|
||||
void joypad_windows::joypad_vibration_stop_xinput(int p_device, uint64_t p_timestamp) {
|
||||
void JoypadWindows::joypad_vibration_stop_xinput(int p_device, uint64_t p_timestamp) {
|
||||
xinput_gamepad &joy = x_joypads[p_device];
|
||||
if (joy.attached) {
|
||||
XINPUT_VIBRATION effect;
|
||||
@ -547,7 +546,7 @@ void joypad_windows::joypad_vibration_stop_xinput(int p_device, uint64_t p_times
|
||||
}
|
||||
|
||||
|
||||
void joypad_windows::load_xinput() {
|
||||
void JoypadWindows::load_xinput() {
|
||||
|
||||
xinput_get_state = &_xinput_get_state;
|
||||
xinput_set_state = &_xinput_set_state;
|
||||
@ -576,7 +575,7 @@ void joypad_windows::load_xinput() {
|
||||
xinput_set_state = set_func;
|
||||
}
|
||||
|
||||
void joypad_windows::unload_xinput() {
|
||||
void JoypadWindows::unload_xinput() {
|
||||
|
||||
if (xinput_dll) {
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
//author: Andreas Haas <hondres, liugam3@gmail.com>
|
||||
#ifndef JOYPAD_H
|
||||
#define JOYPAD_H
|
||||
|
||||
@ -48,12 +47,12 @@ if(x != NULL) \
|
||||
#define XUSER_MAX_COUNT 4
|
||||
#endif
|
||||
|
||||
class joypad_windows
|
||||
class JoypadWindows
|
||||
{
|
||||
public:
|
||||
joypad_windows();
|
||||
joypad_windows(InputDefault* _input, HWND* hwnd);
|
||||
~joypad_windows();
|
||||
JoypadWindows();
|
||||
JoypadWindows(InputDefault* _input, HWND* hwnd);
|
||||
~JoypadWindows();
|
||||
|
||||
void probe_joypads();
|
||||
unsigned int process_joypads(unsigned int p_last_id);
|
||||
|
@ -1120,7 +1120,7 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_
|
||||
visual_server->init();
|
||||
|
||||
input = memnew( InputDefault );
|
||||
joypad = memnew (joypad_windows(input, &hWnd));
|
||||
joypad = memnew (JoypadWindows(input, &hWnd));
|
||||
|
||||
AudioDriverManagerSW::get_driver(p_audio_driver)->set_singleton();
|
||||
|
||||
|
@ -61,7 +61,7 @@
|
||||
/**
|
||||
@author Juan Linietsky <reduzio@gmail.com>
|
||||
*/
|
||||
class joypad_windows;
|
||||
class JoypadWindows;
|
||||
class OS_Windows : public OS {
|
||||
|
||||
enum {
|
||||
@ -133,7 +133,7 @@ class OS_Windows : public OS {
|
||||
CursorShape cursor_shape;
|
||||
|
||||
InputDefault *input;
|
||||
joypad_windows *joypad;
|
||||
JoypadWindows *joypad;
|
||||
|
||||
#ifdef RTAUDIO_ENABLED
|
||||
AudioDriverRtAudio driver_rtaudio;
|
||||
|
Loading…
Reference in New Issue
Block a user