- 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
|
|
@ -47,6 +47,7 @@
|
|||
#endif
|
||||
#include <windows.h>
|
||||
#include <mmsystem.h>
|
||||
#include <dbt.h>
|
||||
#include <dinput.h>
|
||||
#include <malloc.h>
|
||||
|
||||
|
|
@ -118,7 +119,8 @@
|
|||
#endif
|
||||
|
||||
static void FindRawInputFunctions();
|
||||
BOOL DI_InitJoy (void);
|
||||
FJoystickCollection *JoyDevices[NUM_JOYDEVICES];
|
||||
|
||||
|
||||
extern HINSTANCE g_hInst;
|
||||
extern DWORD SessionID;
|
||||
|
|
@ -551,6 +553,16 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
case WM_ERASEBKGND:
|
||||
return true;
|
||||
|
||||
case WM_DEVICECHANGE:
|
||||
if (wParam == DBT_DEVNODES_CHANGED ||
|
||||
wParam == DBT_DEVICEARRIVAL ||
|
||||
wParam == DBT_CONFIGCHANGED)
|
||||
{
|
||||
event_t ev = { EV_DeviceChange };
|
||||
D_PostEvent(&ev);
|
||||
}
|
||||
return DefWindowProc (hWnd, message, wParam, lParam);
|
||||
|
||||
default:
|
||||
return DefWindowProc (hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
|
@ -765,6 +777,24 @@ void I_GetJoysticks(TArray<IJoystickConfig *> &sticks)
|
|||
}
|
||||
}
|
||||
|
||||
// If a new controller was added, returns a pointer to it.
|
||||
IJoystickConfig *I_UpdateDeviceList()
|
||||
{
|
||||
IJoystickConfig *newone = NULL;
|
||||
for (int i = 0; i < NUM_JOYDEVICES; ++i)
|
||||
{
|
||||
if (JoyDevices[i] != NULL)
|
||||
{
|
||||
IJoystickConfig *thisnewone = JoyDevices[i]->Rescan();
|
||||
if (newone == NULL)
|
||||
{
|
||||
newone = thisnewone;
|
||||
}
|
||||
}
|
||||
}
|
||||
return newone;
|
||||
}
|
||||
|
||||
void I_PutInClipboard (const char *str)
|
||||
{
|
||||
if (str == NULL || !OpenClipboard (Window))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue