- Split the joystick menu into two parts: A top level with general options
and a list of all attached controllers, and a second level for configuring an individual controller. - Fixed: Pressing Up at the top of a menu with more lines than fit on screen would find an incorrect bottom position if the menu had a custom top height. - Added the cvars joy_dinput, joy_ps2raw, and joy_xinput to enable/disable specific game controller input systems independant of each other. - Device change broadcasts are now sent to the Doom event queue, so device scanning can be handled in one common place. - Added a fast version of IsXInputDevice that uses the Raw Input device list, because querying WMI for this information is painfully slow. - Added support for compiling with FMOD Ex 4.26+ and running the game with an older DLL. This combination will now produce sound. SVN r1717 (trunk)
This commit is contained in:
parent
8e5b7373b8
commit
f74f6a1659
15 changed files with 584 additions and 330 deletions
|
|
@ -120,6 +120,7 @@ public:
|
|||
bool WndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result);
|
||||
void AddAxes(float axes[NUM_JOYAXIS]);
|
||||
void GetDevices(TArray<IJoystickConfig *> &sticks);
|
||||
IJoystickConfig *Rescan();
|
||||
|
||||
protected:
|
||||
HMODULE XInputDLL;
|
||||
|
|
@ -136,6 +137,13 @@ protected:
|
|||
|
||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
||||
CUSTOM_CVAR(Bool, joy_xinput, true, CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_NOINITCALL)
|
||||
{
|
||||
I_StartupXInput();
|
||||
event_t ev = { EV_DeviceChange };
|
||||
D_PostEvent(&ev);
|
||||
}
|
||||
|
||||
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
||||
|
||||
static XInputGetStateType InputGetState;
|
||||
|
|
@ -734,6 +742,17 @@ bool FXInputManager::WndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM
|
|||
return false;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// FXInputManager :: Rescan
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
IJoystickConfig *FXInputManager::Rescan()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// I_StartupXInput
|
||||
|
|
@ -742,10 +761,25 @@ bool FXInputManager::WndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM
|
|||
|
||||
void I_StartupXInput()
|
||||
{
|
||||
FJoystickCollection *joys = new FXInputManager;
|
||||
if (joys->GetDevice())
|
||||
if (!joy_xinput || !use_joystick || Args->CheckParm("-nojoy"))
|
||||
{
|
||||
JoyDevices[INPUT_XInput] = joys;
|
||||
if (JoyDevices[INPUT_XInput] != NULL)
|
||||
{
|
||||
delete JoyDevices[INPUT_XInput];
|
||||
JoyDevices[INPUT_XInput] = NULL;
|
||||
UpdateJoystickMenu(NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (JoyDevices[INPUT_XInput] == NULL)
|
||||
{
|
||||
FJoystickCollection *joys = new FXInputManager;
|
||||
if (joys->GetDevice())
|
||||
{
|
||||
JoyDevices[INPUT_XInput] = joys;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue