Merge pull request #3091 from jriwanek-forks/cleanups
Make dual video card code use array
This commit is contained in:
@@ -488,8 +488,8 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
|
||||
return (1);
|
||||
}
|
||||
|
||||
extern int gfxcard_2;
|
||||
gfxcard_2 = 0;
|
||||
extern int gfxcard[2];
|
||||
gfxcard[1] = 0;
|
||||
|
||||
/* Create console window. */
|
||||
if (force_debug) {
|
||||
|
||||
@@ -93,7 +93,7 @@ static int temp_dynarec;
|
||||
#endif
|
||||
|
||||
/* Video category */
|
||||
static int temp_gfxcard, temp_gfxcard_2, temp_ibm8514, temp_voodoo, temp_xga;
|
||||
static int temp_gfxcard[2], temp_ibm8514, temp_voodoo, temp_xga;
|
||||
|
||||
/* Input devices category */
|
||||
static int temp_mouse, temp_joystick;
|
||||
@@ -326,8 +326,8 @@ win_settings_init(void)
|
||||
temp_sync = time_sync;
|
||||
|
||||
/* Video category */
|
||||
temp_gfxcard = gfxcard;
|
||||
temp_gfxcard_2 = gfxcard_2;
|
||||
temp_gfxcard[0] = gfxcard[0];
|
||||
temp_gfxcard[1] = gfxcard[1];
|
||||
temp_voodoo = voodoo_enabled;
|
||||
temp_ibm8514 = ibm8514_enabled;
|
||||
temp_xga = xga_enabled;
|
||||
@@ -453,8 +453,8 @@ win_settings_changed(void)
|
||||
i = i || (temp_sync != time_sync);
|
||||
|
||||
/* Video category */
|
||||
i = i || (gfxcard != temp_gfxcard);
|
||||
i = i || (gfxcard_2 != temp_gfxcard_2);
|
||||
i = i || (gfxcard[0] != temp_gfxcard[0]);
|
||||
i = i || (gfxcard[1] != temp_gfxcard[1]);
|
||||
i = i || (voodoo_enabled != temp_voodoo);
|
||||
i = i || (ibm8514_enabled != temp_ibm8514);
|
||||
i = i || (xga_enabled != temp_xga);
|
||||
@@ -546,8 +546,8 @@ win_settings_save(void)
|
||||
time_sync = temp_sync;
|
||||
|
||||
/* Video category */
|
||||
gfxcard = temp_gfxcard;
|
||||
gfxcard_2 = temp_gfxcard_2;
|
||||
gfxcard[0] = temp_gfxcard[0];
|
||||
gfxcard[1] = temp_gfxcard[1];
|
||||
voodoo_enabled = temp_voodoo;
|
||||
ibm8514_enabled = temp_ibm8514;
|
||||
xga_enabled = temp_xga;
|
||||
@@ -1090,7 +1090,7 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
else
|
||||
settings_add_string(hdlg, IDC_COMBO_VIDEO, (LPARAM) device_name);
|
||||
settings_list_to_device[0][d] = c;
|
||||
if ((c == 0) || (c == temp_gfxcard))
|
||||
if ((c == 0) || (c == temp_gfxcard[0]))
|
||||
settings_set_cur_sel(hdlg, IDC_COMBO_VIDEO, d);
|
||||
d++;
|
||||
}
|
||||
@@ -1120,7 +1120,7 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
if (!device_name[0])
|
||||
break;
|
||||
|
||||
if ((c > 1) && (video_card_get_flags(c) == video_card_get_flags(temp_gfxcard))) {
|
||||
if ((c > 1) && (video_card_get_flags(c) == video_card_get_flags(temp_gfxcard[0]))) {
|
||||
c++;
|
||||
continue;
|
||||
}
|
||||
@@ -1133,7 +1133,7 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
else
|
||||
settings_add_string(hdlg, IDC_COMBO_VIDEO_2, (LPARAM) device_name);
|
||||
settings_list_to_device[1][d] = c;
|
||||
if ((c == 0) || (c == temp_gfxcard_2))
|
||||
if ((c == 0) || (c == temp_gfxcard[1]))
|
||||
settings_set_cur_sel(hdlg, IDC_COMBO_VIDEO_2, d);
|
||||
d++;
|
||||
}
|
||||
@@ -1163,8 +1163,8 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDC_COMBO_VIDEO:
|
||||
temp_gfxcard = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)];
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(temp_gfxcard));
|
||||
temp_gfxcard[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)];
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(temp_gfxcard[0]));
|
||||
|
||||
// Secondary Video Card
|
||||
c = d = 0;
|
||||
@@ -1182,7 +1182,7 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
if (!device_name[0])
|
||||
break;
|
||||
|
||||
if ((c > 1) && (video_card_get_flags(c) == video_card_get_flags(temp_gfxcard))) {
|
||||
if ((c > 1) && (video_card_get_flags(c) == video_card_get_flags(temp_gfxcard[0]))) {
|
||||
c++;
|
||||
continue;
|
||||
}
|
||||
@@ -1195,7 +1195,7 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
else
|
||||
settings_add_string(hdlg, IDC_COMBO_VIDEO_2, (LPARAM) device_name);
|
||||
settings_list_to_device[1][d] = c;
|
||||
if ((c == 0) || (c == temp_gfxcard_2))
|
||||
if ((c == 0) || (c == temp_gfxcard[1]))
|
||||
settings_set_cur_sel(hdlg, IDC_COMBO_VIDEO_2, d);
|
||||
d++;
|
||||
}
|
||||
@@ -1211,8 +1211,8 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case IDC_COMBO_VIDEO_2:
|
||||
temp_gfxcard_2 = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)];
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_VID_2, video_card_has_config(temp_gfxcard_2));
|
||||
temp_gfxcard[1] = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)];
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_VID_2, video_card_has_config(temp_gfxcard[1]));
|
||||
break;
|
||||
|
||||
case IDC_CHECK_VOODOO:
|
||||
@@ -1241,23 +1241,23 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case IDC_CONFIGURE_VID:
|
||||
temp_gfxcard = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)];
|
||||
temp_deviceconfig |= deviceconfig_open(hdlg, (void *) video_card_getdevice(temp_gfxcard));
|
||||
temp_gfxcard[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)];
|
||||
temp_deviceconfig |= deviceconfig_open(hdlg, (void *) video_card_getdevice(temp_gfxcard[0]));
|
||||
break;
|
||||
|
||||
case IDC_CONFIGURE_VID_2:
|
||||
temp_gfxcard_2 = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)];
|
||||
temp_deviceconfig |= deviceconfig_open(hdlg, (void *) video_card_getdevice(temp_gfxcard_2));
|
||||
temp_gfxcard[1] = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)];
|
||||
temp_deviceconfig |= deviceconfig_open(hdlg, (void *) video_card_getdevice(temp_gfxcard[1]));
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
case WM_SAVESETTINGS:
|
||||
temp_gfxcard = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)];
|
||||
temp_gfxcard_2 = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)];
|
||||
temp_voodoo = settings_get_check(hdlg, IDC_CHECK_VOODOO);
|
||||
temp_ibm8514 = settings_get_check(hdlg, IDC_CHECK_IBM8514);
|
||||
temp_xga = settings_get_check(hdlg, IDC_CHECK_XGA);
|
||||
temp_gfxcard[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)];
|
||||
temp_gfxcard[1] = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)];
|
||||
temp_voodoo = settings_get_check(hdlg, IDC_CHECK_VOODOO);
|
||||
temp_ibm8514 = settings_get_check(hdlg, IDC_CHECK_IBM8514);
|
||||
temp_xga = settings_get_check(hdlg, IDC_CHECK_XGA);
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
|
||||
Reference in New Issue
Block a user