Just some cleaning

This commit is contained in:
ekudritski 2016-02-11 12:30:20 +02:00
parent 8c5c4608d2
commit e2c5236706
4 changed files with 9 additions and 10 deletions

View File

@ -1446,7 +1446,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l
case PSN_SETACTIVE: case PSN_SETACTIVE:
return 0; return 0;
case PSN_APPLY: case PSN_APPLY:
SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR);
return 1; return 1;
} }
break; break;
@ -1504,9 +1504,8 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l
const static unsigned int axisUIDs[3] = {UID_AXIS_NEG, UID_AXIS_POS, UID_AXIS}; const static unsigned int axisUIDs[3] = {UID_AXIS_NEG, UID_AXIS_POS, UID_AXIS};
int uid = dev->virtualControls[b->controlIndex].uid; int uid = dev->virtualControls[b->controlIndex].uid;
uid = (uid&0x00FFFFFF) | axisUIDs[cbsel]; uid = (uid&0x00FFFFFF) | axisUIDs[cbsel];
Binding backup = *b;
DeleteSelected(port, slot); DeleteSelected(port, slot);
int index = BindCommand(dev, uid, port, slot, backup.command, backup.sensitivity, backup.turbo, backup.deadZone); int index = BindCommand(dev, uid, port, slot, b->command, b->sensitivity, b->turbo, b->deadZone);
ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED); ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED);
PropSheet_Changed(hWndProp, hWnd); PropSheet_Changed(hWndProp, hWnd);
} }
@ -2023,10 +2022,10 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
case PSN_APPLY: case PSN_APPLY:
selected = 0; selected = 0;
if (SaveSettings()) { if (SaveSettings()) {
SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE); SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE);
return 0; return 0;
} }
SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR);
return 1; return 1;
} }
} }

View File

@ -73,11 +73,11 @@ struct Binding {
unsigned char turbo; unsigned char turbo;
}; };
#define UID_AXIS (1<<31) #define UID_AXIS (1U<<31)
#define UID_POV (1<<30) #define UID_POV (1<<30)
#define UID_AXIS_POS (1<<24) #define UID_AXIS_POS (1U<<24)
#define UID_AXIS_NEG (2<<24) #define UID_AXIS_NEG (2U<<24)
#define UID_POV_N (3<<24) #define UID_POV_N (3<<24)
#define UID_POV_E (4<<24) #define UID_POV_E (4<<24)
#define UID_POV_S (5<<24) #define UID_POV_S (5<<24)

View File

@ -1213,7 +1213,7 @@ u8 CALLBACK PADpoll(u8 value) {
b1 -= ((sum->sticks[0].vert > 0) << 6); b1 -= ((sum->sticks[0].vert > 0) << 6);
b1 -= ((sum->sticks[0].horiz < 0) << 7); b1 -= ((sum->sticks[0].horiz < 0) << 7);
//Left, Right and Down are always pressed. //Left, Right and Down are always pressed on Pop'n Music controller.
if (config.padConfigs[query.port][query.slot].type == PopnPad) if (config.padConfigs[query.port][query.slot].type == PopnPad)
b1=b1 & 0x1f; b1=b1 & 0x1f;

View File

@ -214,7 +214,7 @@ public:
newVibration[1] = 65535; newVibration[1] = 65535;
} }
if (newVibration[0] || newVibration[1] || newVibration[0] != xInputVibration.wLeftMotorSpeed || newVibration[1] != xInputVibration.wRightMotorSpeed) { if (newVibration[0] || newVibration[1] || newVibration[0] != xInputVibration.wLeftMotorSpeed || newVibration[1] != xInputVibration.wRightMotorSpeed) {
XINPUT_VIBRATION newv = {newVibration[0], newVibration[1]}; XINPUT_VIBRATION newv = {(WORD)newVibration[0], (WORD)newVibration[1]};
if (ERROR_SUCCESS == pXInputSetState(index, &newv)) { if (ERROR_SUCCESS == pXInputSetState(index, &newv)) {
xInputVibration = newv; xInputVibration = newv;
} }