src/osd/winui/properties.c
| r7982 | r7983 | |
| 212 | 212 | /* No longer used by the core, but we need it to predefine configurable screens for all games. */ |
| 213 | 213 | #ifndef MAX_SCREENS |
| 214 | 214 | /* maximum number of screens for one game */ |
| 215 | | #define MAX_SCREENS 8 |
| 215 | #define MAX_SCREENS 4 |
| 216 | 216 | #endif |
| 217 | 217 | |
| 218 | 218 | static core_options *pOrigOpts, *pDefaultOpts; |
| r7982 | r7983 | |
| 226 | 226 | static int g_nPropertyMode = 0; |
| 227 | 227 | static BOOL g_bUseDefaults = FALSE; |
| 228 | 228 | static BOOL g_bReset = FALSE; |
| 229 | | static BOOL g_bAutoAspect[MAX_SCREENS] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}; |
| 229 | static BOOL g_bAutoAspect[MAX_SCREENS] = {FALSE, FALSE, FALSE, FALSE}; |
| 230 | 230 | static BOOL g_bAutoSnapSize = FALSE; |
| 231 | 231 | static HICON g_hIcon = NULL; |
| 232 | 232 | |
| r7982 | r7983 | |
| 357 | 357 | HWND hCtrl = GetDlgItem(hWnd, IDC_SCREENSELECT); |
| 358 | 358 | if (hCtrl) |
| 359 | 359 | nSelectedScreen = ComboBox_GetCurSel(hCtrl); |
| 360 | | if ((nSelectedScreen < 0) || (nSelectedScreen >= MAX_SCREENS)) |
| 360 | if ((nSelectedScreen < 0) || (nSelectedScreen >= NUMSELECTSCREEN)) |
| 361 | 361 | nSelectedScreen = 0; |
| 362 | 362 | return nSelectedScreen; |
| 363 | 363 | |
| r7982 | r7983 | |
| 1782 | 1782 | EnableWindow(GetDlgItem(hWnd, IDC_SNAPSIZEWIDTH), !g_bAutoSnapSize); |
| 1783 | 1783 | EnableWindow(GetDlgItem(hWnd, IDC_SNAPSIZEX), !g_bAutoSnapSize); |
| 1784 | 1784 | |
| 1785 | | |
| 1786 | 1785 | EnableWindow(GetDlgItem(hWnd,IDC_D3D_FILTER),d3d); |
| 1787 | 1786 | EnableWindow(GetDlgItem(hWnd,IDC_D3D_VERSION),d3d); |
| 1788 | 1787 | |
| 1789 | 1788 | //Switchres and D3D or ddraw enable the per screen parameters |
| 1790 | 1789 | |
| 1791 | | EnableWindow(GetDlgItem(hWnd, IDC_NUMSCREENS), (ddraw || d3d) && multimon); |
| 1792 | | EnableWindow(GetDlgItem(hWnd, IDC_NUMSCREENSDISP), (ddraw || d3d) && multimon); |
| 1793 | | EnableWindow(GetDlgItem(hWnd, IDC_SCREENSELECT), (ddraw || d3d) && multimon); |
| 1794 | | EnableWindow(GetDlgItem(hWnd, IDC_SCREENSELECTTEXT), (ddraw || d3d) && multimon); |
| 1790 | EnableWindow(GetDlgItem(hWnd, IDC_NUMSCREENS), (ddraw || d3d)); |
| 1791 | EnableWindow(GetDlgItem(hWnd, IDC_NUMSCREENSDISP), (ddraw || d3d)); |
| 1792 | EnableWindow(GetDlgItem(hWnd, IDC_SCREENSELECT), (ddraw || d3d)); |
| 1793 | EnableWindow(GetDlgItem(hWnd, IDC_SCREENSELECTTEXT), (ddraw || d3d)); |
| 1795 | 1794 | |
| 1796 | 1795 | EnableWindow(GetDlgItem(hWnd, IDC_ARTWORK_CROP), useart); |
| 1797 | 1796 | EnableWindow(GetDlgItem(hWnd, IDC_BACKDROPS), useart); |
| r7982 | r7983 | |
| 1978 | 1977 | /* Remove all items in the list. */ |
| 1979 | 1978 | (void)ComboBox_ResetContent(control); |
| 1980 | 1979 | (void)ComboBox_InsertString(control, 0, TEXT("Auto")); |
| 1981 | | (void)ComboBox_SetItemData(control, 0, (const char*)mame_strdup("auto")); |
| 1980 | (void)ComboBox_SetItemData(control, 0, (void*)tstring_from_utf8("auto")); |
| 1982 | 1981 | |
| 1983 | 1982 | //Dynamically populate it, by enumerating the Monitors |
| 1984 | 1983 | //iMonitors = GetSystemMetrics(SM_CMONITORS); // this gets the count of monitors attached |
| r7982 | r7983 | |
| 2779 | 2778 | { |
| 2780 | 2779 | int i, curSel; |
| 2781 | 2780 | curSel = ComboBox_GetCurSel(hCtrl); |
| 2782 | | if ((curSel < 0) || (curSel >= MAX_SCREENS)) |
| 2781 | if ((curSel < 0) || (curSel >= NUMSELECTSCREEN)) |
| 2783 | 2782 | curSel = 0; |
| 2784 | 2783 | (void)ComboBox_ResetContent(hCtrl); |
| 2785 | 2784 | for (i = 0; i < NUMSELECTSCREEN && i < options_get_int(pCurrentOpts, WINOPTION_NUMSCREENS) ; i++) |
| r7982 | r7983 | |
| 2788 | 2787 | (void)ComboBox_SetItemData( hCtrl, i, g_ComboBoxSelectScreen[i].m_pData); |
| 2789 | 2788 | } |
| 2790 | 2789 | // Smaller Amount of screens was selected, so use 0 |
| 2791 | | if( i< curSel ) |
| 2790 | if( i < curSel ) |
| 2792 | 2791 | (void)ComboBox_SetCurSel(hCtrl, 0); |
| 2793 | 2792 | else |
| 2794 | 2793 | (void)ComboBox_SetCurSel(hCtrl, curSel); |