diff options
| author | iCatButler <i.am.catbutler@gmail.com> | 2018-03-13 17:25:13 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-13 17:25:13 +0000 |
| commit | 768332417644451d38ce1a737465656c7cc75de3 (patch) | |
| tree | e6ca381effb72ccc4161d40f224b817a6631bc03 /plugins/dfinput/pad.c | |
| parent | 15fe3782c1375634b7a9bd9bbbadfd75e7b06fed (diff) | |
| parent | 2d0b10f982e0b835f4b27be26b138703907a4219 (diff) | |
| download | pcsxr-768332417644451d38ce1a737465656c7cc75de3.tar.gz | |
Merge pull request #6 from loathingKernel/fix-linux-build
Fix compilation on Linux and add the new setting to the UI
Diffstat (limited to 'plugins/dfinput/pad.c')
| -rwxr-xr-x | plugins/dfinput/pad.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/dfinput/pad.c b/plugins/dfinput/pad.c index bd3aef73..f413d0a4 100755 --- a/plugins/dfinput/pad.c +++ b/plugins/dfinput/pad.c @@ -17,11 +17,15 @@ */ #include "pad.h" -#if !SDL_VERSION_ATLEAST(2,0,0) && defined(__linux__) +#if defined(__linux__) +#include <sys/types.h> +#include <sys/wait.h> +#if !SDL_VERSION_ATLEAST(2,0,0) #include <linux/input.h> #include <sys/file.h> #include <time.h> #endif +#endif #if SDL_VERSION_ATLEAST(2,0,0) int has_haptic; @@ -122,10 +126,10 @@ long PADopen(unsigned long *Disp) { #if SDL_VERSION_ATLEAST(2,0,0) SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER); - - has_haptic = 0; - if (SDL_InitSubSystem(SDL_INIT_HAPTIC) == 0) - has_haptic = 1; + + has_haptic = 0; + if (SDL_InitSubSystem(SDL_INIT_HAPTIC) == 0) + has_haptic = 1; #endif InitSDLJoy(); @@ -491,7 +495,7 @@ unsigned char PADpoll(unsigned char value) { if (buf == NULL) { return 0; } - + switch (CurCmd) { case CMD_READ_DATA_AND_VIBRATE: if (g.cfg.PadDef[CurPad].Type == PSE_PAD_TYPE_ANALOGPAD) { @@ -510,7 +514,7 @@ unsigned char PADpoll(unsigned char value) { if (!JoyHapticRumble(CurPad, g.PadState[CurPad].VibF[0], g.PadState[CurPad].VibF[1])) { //gpuVisualVibration(g.PadState[CurPad].VibF[0], g.PadState[CurPad].VibF[1]); } - + if(gpuVisualVibration != NULL && g.cfg.PadDef[CurPad].VisualVibration) { gpuVisualVibration(g.PadState[CurPad].VibF[0], g.PadState[CurPad].VibF[1]); |
