mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Second and final pass of clearing out tabs.
This commit is contained in:
@ -17,12 +17,6 @@ namespace ciface
|
||||
namespace DInput
|
||||
{
|
||||
|
||||
//BOOL CALLBACK DIEnumEffectsCallback(LPCDIEFFECTINFO pdei, LPVOID pvRef)
|
||||
//{
|
||||
// ((std::list<DIEFFECTINFO>*)pvRef)->push_back(*pdei);
|
||||
// return DIENUM_CONTINUE;
|
||||
//}
|
||||
|
||||
BOOL CALLBACK DIEnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef)
|
||||
{
|
||||
((std::list<DIDEVICEOBJECTINSTANCE>*)pvRef)->push_back(*lpddoi);
|
||||
|
@ -17,7 +17,7 @@ namespace ciface
|
||||
namespace DInput
|
||||
{
|
||||
|
||||
#define DATA_BUFFER_SIZE 32
|
||||
#define DATA_BUFFER_SIZE 32
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Modified some MSDN code to get all the XInput device GUID.Data1 values in a vector,
|
||||
@ -130,7 +130,7 @@ void InitJoystick(IDirectInput8* const idi8, std::vector<Core::Device*>& devices
|
||||
|
||||
// this is used to number the joysticks
|
||||
// multiple joysticks with the same name shall get unique ids starting at 0
|
||||
std::map< std::basic_string<TCHAR>, int> name_counts;
|
||||
std::map< std::basic_string<TCHAR>, int> name_counts;
|
||||
|
||||
std::vector<DWORD> xinput_guids;
|
||||
GetXInputGUIDS( xinput_guids );
|
||||
|
@ -218,12 +218,12 @@ bool KeyboardMouse::UpdateOutput()
|
||||
{
|
||||
bool want_on = false;
|
||||
if (m_state_out[i])
|
||||
want_on = m_state_out[i] > GetTickCount() % 255 ; // light should flash when output is 0.5
|
||||
want_on = m_state_out[i] > GetTickCount() % 255 ; // light should flash when output is 0.5
|
||||
|
||||
// lights are set to their original state when output is zero
|
||||
if (want_on ^ m_current_state_out[i])
|
||||
{
|
||||
kbinputs.push_back(KInput(named_lights[i].code)); // press
|
||||
kbinputs.push_back(KInput(named_lights[i].code)); // press
|
||||
kbinputs.push_back(KInput(named_lights[i].code, true)); // release
|
||||
|
||||
m_current_state_out[i] ^= 1;
|
||||
|
@ -61,7 +61,7 @@ bool ForceFeedbackDevice::InitForceFeedback(const LPDIRECTINPUTDEVICE8 device, i
|
||||
memset(&eff, 0, sizeof(eff));
|
||||
eff.dwSize = sizeof(DIEFFECT);
|
||||
eff.dwFlags = DIEFF_CARTESIAN | DIEFF_OBJECTOFFSETS;
|
||||
eff.dwDuration = INFINITE; // (4 * DI_SECONDS)
|
||||
eff.dwDuration = INFINITE; // (4 * DI_SECONDS)
|
||||
eff.dwSamplePeriod = 0;
|
||||
eff.dwGain = DI_FFNOMINALMAX;
|
||||
eff.dwTriggerButton = DIEB_NOTRIGGER;
|
||||
@ -175,7 +175,7 @@ void ForceFeedbackDevice::ForceConstant::SetState(const ControlState state)
|
||||
if (val != new_val)
|
||||
{
|
||||
val = new_val;
|
||||
m_state.params = ¶ms; // tells UpdateOutput the state has changed
|
||||
m_state.params = ¶ms; // tells UpdateOutput the state has changed
|
||||
|
||||
// tells UpdateOutput to either start or stop the force
|
||||
m_state.size = new_val ? sizeof(params) : 0;
|
||||
@ -190,7 +190,7 @@ void ForceFeedbackDevice::ForceRamp::SetState(const ControlState state)
|
||||
if (params.lStart != new_val)
|
||||
{
|
||||
params.lStart = params.lEnd = new_val;
|
||||
m_state.params = ¶ms; // tells UpdateOutput the state has changed
|
||||
m_state.params = ¶ms; // tells UpdateOutput the state has changed
|
||||
|
||||
// tells UpdateOutput to either start or stop the force
|
||||
m_state.size = new_val ? sizeof(params) : 0;
|
||||
@ -206,9 +206,9 @@ void ForceFeedbackDevice::ForcePeriodic::SetState(const ControlState state)
|
||||
if (val != new_val)
|
||||
{
|
||||
val = new_val;
|
||||
//params.dwPeriod = 0;//DWORD(0.05 * DI_SECONDS); // zero is working fine for me
|
||||
//params.dwPeriod = 0;//DWORD(0.05 * DI_SECONDS); // zero is working fine for me
|
||||
|
||||
m_state.params = ¶ms; // tells UpdateOutput the state has changed
|
||||
m_state.params = ¶ms; // tells UpdateOutput the state has changed
|
||||
|
||||
// tells UpdateOutput to either start or stop the force
|
||||
m_state.size = new_val ? sizeof(params) : 0;
|
||||
|
@ -25,33 +25,36 @@ private:
|
||||
: m_element(element), m_device(device) {}
|
||||
ControlState GetState() const;
|
||||
private:
|
||||
const IOHIDElementRef m_element;
|
||||
const IOHIDDeviceRef m_device;
|
||||
const IOHIDElementRef m_element;
|
||||
const IOHIDDeviceRef m_device;
|
||||
};
|
||||
|
||||
class Axis : public Input
|
||||
{
|
||||
public:
|
||||
enum direction {
|
||||
enum direction
|
||||
{
|
||||
positive = 0,
|
||||
negative
|
||||
};
|
||||
std::string GetName() const;
|
||||
Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction dir);
|
||||
ControlState GetState() const;
|
||||
|
||||
private:
|
||||
const IOHIDElementRef m_element;
|
||||
const IOHIDDeviceRef m_device;
|
||||
std::string m_name;
|
||||
const direction m_direction;
|
||||
float m_neutral;
|
||||
float m_scale;
|
||||
const IOHIDElementRef m_element;
|
||||
const IOHIDDeviceRef m_device;
|
||||
std::string m_name;
|
||||
const direction m_direction;
|
||||
float m_neutral;
|
||||
float m_scale;
|
||||
};
|
||||
|
||||
class Hat : public Input
|
||||
{
|
||||
public:
|
||||
enum direction {
|
||||
enum direction
|
||||
{
|
||||
up = 0,
|
||||
right,
|
||||
down,
|
||||
@ -60,11 +63,12 @@ private:
|
||||
std::string GetName() const;
|
||||
Hat(IOHIDElementRef element, IOHIDDeviceRef device, direction dir);
|
||||
ControlState GetState() const;
|
||||
|
||||
private:
|
||||
const IOHIDElementRef m_element;
|
||||
const IOHIDDeviceRef m_device;
|
||||
const char* m_name;
|
||||
const direction m_direction;
|
||||
const IOHIDElementRef m_element;
|
||||
const IOHIDDeviceRef m_device;
|
||||
const char* m_name;
|
||||
const direction m_direction;
|
||||
};
|
||||
|
||||
public:
|
||||
@ -78,9 +82,9 @@ public:
|
||||
int GetId() const;
|
||||
|
||||
private:
|
||||
const IOHIDDeviceRef m_device;
|
||||
const std::string m_device_name;
|
||||
const int m_index;
|
||||
const IOHIDDeviceRef m_device;
|
||||
const std::string m_device_name;
|
||||
const int m_index;
|
||||
|
||||
ForceFeedback::FFDeviceAdapterReference m_ff_device;
|
||||
};
|
||||
|
@ -31,7 +31,7 @@ void Init( std::vector<Core::Device*>& devices )
|
||||
{
|
||||
// this is used to number the joysticks
|
||||
// multiple joysticks with the same name shall get unique ids starting at 0
|
||||
std::map<std::string, int> name_counts;
|
||||
std::map<std::string, int> name_counts;
|
||||
|
||||
if (SDL_Init( SDL_INIT_FLAGS ) >= 0)
|
||||
{
|
||||
@ -335,7 +335,7 @@ bool Joystick::UpdateOutput()
|
||||
{
|
||||
if (i.effect.type) // if ouputstate >0
|
||||
{
|
||||
SDL_HapticUpdateEffect(m_haptic, i.id, &i.effect); // update the effect
|
||||
SDL_HapticUpdateEffect(m_haptic, i.id, &i.effect); // update the effect
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
#ifdef USE_SDL_HAPTIC
|
||||
#include <SDL_haptic.h>
|
||||
#define SDL_INIT_FLAGS SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC
|
||||
#define SDL_INIT_FLAGS SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC
|
||||
#else
|
||||
#define SDL_INIT_FLAGS SDL_INIT_JOYSTICK
|
||||
#define SDL_INIT_FLAGS SDL_INIT_JOYSTICK
|
||||
#endif
|
||||
|
||||
namespace ciface
|
||||
|
@ -121,7 +121,7 @@ Device::Device(const XINPUT_CAPABILITIES& caps, u8 index)
|
||||
// get supported triggers
|
||||
for (int i = 0; i != sizeof(named_triggers)/sizeof(*named_triggers); ++i)
|
||||
{
|
||||
//BYTE val = (&caps.Gamepad.bLeftTrigger)[i]; // should be max value / MSDN lies
|
||||
//BYTE val = (&caps.Gamepad.bLeftTrigger)[i]; // should be max value / MSDN lies
|
||||
if ((&caps.Gamepad.bLeftTrigger)[i])
|
||||
AddInput(new Trigger(i, (&m_state_in.Gamepad.bLeftTrigger)[i], 255 ));
|
||||
}
|
||||
@ -143,7 +143,7 @@ Device::Device(const XINPUT_CAPABILITIES& caps, u8 index)
|
||||
// get supported motors
|
||||
for (int i = 0; i != sizeof(named_motors)/sizeof(*named_motors); ++i)
|
||||
{
|
||||
//WORD val = (&caps.Vibration.wLeftMotorSpeed)[i]; // should be max value / nope, more lies
|
||||
//WORD val = (&caps.Vibration.wLeftMotorSpeed)[i]; // should be max value / nope, more lies
|
||||
if ((&caps.Vibration.wLeftMotorSpeed)[i])
|
||||
AddOutput(new Motor(i, (&m_state_out.wLeftMotorSpeed)[i], 65535));
|
||||
}
|
||||
|
Reference in New Issue
Block a user