Skip to content

Commit 2ce9e02

Browse files
authored
Merge pull request #207 from ejaquay/swapjoybug
Fix swap joysticks screen size bug
2 parents a933088 + f80c043 commit 2ce9e02

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*.aps
2424
*.vscode
2525

26+
__obj
27+
2628
Debug
2729
Release
2830
All

config.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ LRESULT CALLBACK Paths(HWND, UINT, WPARAM, LPARAM);
7373
void ApplyConfig(void);
7474
void ApplyCpuConfig(HWND);
7575
void ApplyAudioConfig(HWND);
76-
void ApplyJoyStickConfig(HWND);
76+
void ApplyJoyStickConfig(void);
7777

7878
/********************************************/
7979
/* Local Globals */
@@ -1314,12 +1314,12 @@ LRESULT CALLBACK JoyStickConfig(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
13141314
DestroyWindow(hDlg);
13151315
break;
13161316
case IDOK:
1317-
ApplyJoyStickConfig(hDlg);
1317+
ApplyJoyStickConfig();
13181318
hJoyStickDlg = NULL;
13191319
DestroyWindow(hDlg);
13201320
break;
13211321
case IDAPPLY:
1322-
ApplyJoyStickConfig(hDlg);
1322+
ApplyJoyStickConfig();
13231323
break;
13241324
case IDC_SHOWMOUSE:
13251325
if (HIWORD(wParam) == BN_CLICKED) {
@@ -1420,21 +1420,20 @@ LRESULT CALLBACK JoyStickConfig(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
14201420
return(0);
14211421
}
14221422

1423-
void ApplyJoyStickConfig(HWND hDlg)
1423+
void ApplyJoyStickConfig()
14241424
{
14251425
RightJS=TempRightJS;
14261426
LeftJS=TempLeftJS;
14271427
SetStickNumbers(LeftJS.DiDevice,RightJS.DiDevice);
14281428
ApplyConfig();
14291429
}
14301430

1431-
void SwapJoySticks() {
1432-
JoyStick tmpJS;
1433-
tmpJS = LeftJS;
1434-
LeftJS = RightJS;
1435-
RightJS = tmpJS;
1436-
SetStickNumbers(LeftJS.DiDevice,RightJS.DiDevice);
1437-
ApplyConfig();
1431+
void SwapJoySticks()
1432+
{
1433+
TempRightJS = LeftJS;
1434+
TempLeftJS = RightJS;
1435+
TempConfig = CurrentConfig;
1436+
ApplyJoyStickConfig();
14381437
if (hJoyStickDlg) SendMessage(hJoyStickDlg,WM_INITDIALOG,0,0);
14391438
}
14401439

0 commit comments

Comments
 (0)