@@ -2030,119 +2030,81 @@ void MainMenuGUI::UpdateTeamBoxes()
2030
2030
// ////////////////////////////////////////////////////////////////////////////////////////
2031
2031
// Description: Updates the contents of the screen resolution combo box
2032
2032
2033
- void MainMenuGUI::UpdateResolutionCombo ()
2034
- {
2033
+ void MainMenuGUI::UpdateResolutionCombo () {
2035
2034
// Refill possible resolutions
2036
2035
m_pResolutionCombo->SetText (" " );
2037
2036
m_pResolutionCombo->ClearList ();
2038
2037
2039
- // Only refill possible resolutions if empty
2040
- if (m_pResolutionCombo->GetCount () <= 0 )
2041
- {
2042
- GFX_MODE_LIST *pList = get_gfx_mode_list (GFX_DIRECTX_ACCEL);
2038
+ if (m_pResolutionCombo->GetCount () <= 0 ) {
2039
+ // Get a list of modes from the fullscreen driver even though we're not using it. This is so we don't need to populate the list manually and has all the reasonable resolutions.
2040
+ GFX_MODE_LIST *resList = get_gfx_mode_list (GFX_DIRECTX_ACCEL);
2043
2041
2044
2042
int width = 0 ;
2045
2043
int height = 0 ;
2046
- char resString[256 ] = " " ;
2044
+ char resString[256 ] = " " ;
2047
2045
// Index of found useful resolution (32bit)
2048
2046
int foundIndex = 0 ;
2049
- // The saved index of the entry that has the current resolution setting
2050
2047
int currentResIndex = -1 ;
2051
2048
2052
2049
// Process and annotate the list
2053
- for (int i = 0 ; pList && i < pList->num_modes ; ++i)
2054
- {
2050
+ for (int i = 0 ; resList && i < resList->num_modes ; ++i) {
2055
2051
// Only list 32 bpp modes
2056
- if (pList->mode [i].bpp == 32 )
2057
- {
2058
- width = pList->mode [i].width ;
2059
- height = pList->mode [i].height ;
2052
+ if (resList->mode [i].bpp == 32 ) {
2053
+ width = resList->mode [i].width ;
2054
+ height = resList->mode [i].height ;
2060
2055
2061
2056
// Resolutions must be multiples of 4 or we'll get 'Overlays not supported' during GFX mode init
2062
- if (g_FrameMan.IsValidResolution (width, height) && width % 4 == 0 )
2063
- {
2057
+ if (g_FrameMan.IsValidResolution (width, height) && width % 4 == 0 ) {
2064
2058
// Fix wacky resolutions that are taller than wide
2065
- if (height > width)
2066
- {
2067
- height = pList->mode [i].width ;
2068
- width = pList->mode [i].height ;
2059
+ if (height > width) {
2060
+ height = resList->mode [i].width ;
2061
+ width = resList->mode [i].height ;
2069
2062
}
2070
-
2071
- // Try to figure the max available resotion
2072
- if (width > m_MaxResX)
2073
- {
2063
+ // Try to figure the max available resolution
2064
+ if (width > m_MaxResX) {
2074
2065
m_MaxResX = width;
2075
2066
m_MaxResY = height;
2076
2067
}
2077
-
2078
- // Construct and add the resolution string to the combobox
2079
2068
sprintf_s (resString, sizeof (resString), " %ix%i" , width, height);
2080
2069
2081
2070
// Add useful notation to the standardized resolutions
2082
- if (width == 320 && height == 200 )
2083
- strcat (resString, " CGA" );
2084
- if (width == 320 && height == 240 )
2085
- strcat (resString, " QVGA" );
2086
- if (width == 640 && height == 480 )
2087
- strcat (resString, " VGA" );
2088
- if (width == 720 && height == 480 )
2089
- strcat (resString, " NTSC" );
2090
- if (width == 768 && height == 576 )
2091
- strcat (resString, " PAL" );
2092
- if ((width == 800 || height == 854 ) && height == 480 )
2093
- strcat (resString, " WVGA" );
2094
- if (width == 800 && height == 600 )
2095
- strcat (resString, " SVGA" );
2096
- if (width == 1024 && height == 600 )
2097
- strcat (resString, " WSVGA" );
2098
- if (width == 1024 && height == 768 )
2099
- strcat (resString, " XGA" );
2100
- if (width == 1280 && height == 720 )
2101
- strcat (resString, " HD720" );
2102
- if (width == 1280 && (height == 768 || height == 800 ))
2103
- strcat (resString, " WXGA" );
2104
- // These below are forced to be done in 2X pixels fullscreen
2105
- if (width == 1280 && height == 1024 )
2106
- strcat (resString, " SXGA" );
2107
- if (width == 1400 && height == 1050 )
2108
- strcat (resString, " SXGA+" );
2109
- if (width == 1600 && height == 1200 )
2110
- strcat (resString, " UGA" );
2111
- if (width == 1680 && height == 1050 )
2112
- strcat (resString, " WSXGA+" );
2113
- if (width == 1920 && height == 1080 )
2114
- strcat (resString, " HD1080" );
2115
- if (width == 1920 && height == 1200 )
2116
- strcat (resString, " WUXGA" );
2117
- if (width == 2048 && height == 1080 )
2118
- strcat (resString, " 2K" );
2071
+ if (width == 800 && height == 600 ) { strcat_s (resString, sizeof (resString), " SVGA" ); }
2072
+ if (width == 1024 && height == 600 ) { strcat_s (resString, sizeof (resString), " WSVGA" ); }
2073
+ if (width == 1024 && height == 768 ) { strcat_s (resString, sizeof (resString), " XGA" ); }
2074
+ if (width == 1280 && height == 720 ) { strcat_s (resString, sizeof (resString), " HD" ); }
2075
+ if (width == 1280 && (height == 768 || height == 800 )) { strcat_s (resString, sizeof (resString), " WXGA" ); }
2076
+ if (width == 1280 && height == 1024 ) { strcat_s (resString, sizeof (resString), " SXGA" ); }
2077
+ if (width == 1400 && height == 1050 ) { strcat_s (resString, sizeof (resString), " SXGA+" ); }
2078
+ if (width == 1600 && height == 900 ) { strcat_s (resString, sizeof (resString), " HD+" ); }
2079
+ if (width == 1600 && height == 1200 ) { strcat_s (resString, sizeof (resString), " UGA" ); }
2080
+ if (width == 1680 && height == 1050 ) { strcat_s (resString, sizeof (resString), " WSXGA+" ); }
2081
+ if (width == 1920 && height == 1080 ) { strcat_s (resString, sizeof (resString), " FHD" ); }
2082
+ if (width == 1920 && height == 1200 ) { strcat_s (resString, sizeof (resString), " WUXGA" ); }
2083
+ if (width == 2048 && height == 1080 ) { strcat_s (resString, sizeof (resString), " DCI 2K" ); }
2084
+ if (width == 2560 && height == 1440 ) { strcat_s (resString, sizeof (resString), " QHD" ); }
2085
+ if (width == 3200 && height == 1800 ) { strcat_s (resString, sizeof (resString), " QHD+" ); }
2086
+ if (width == 3840 && height == 2160 ) { strcat_s (resString, sizeof (resString), " 4K UHD" ); }
2087
+ if (width == 4096 && height == 2160 ) { strcat_s (resString, sizeof (resString), " DCI 4K" ); }
2119
2088
2120
2089
m_pResolutionCombo->AddItem (resString);
2121
2090
2122
2091
// If this is what we're currently set to have at next start, select it afterward
2123
- if ((g_FrameMan.GetNewResX () * g_FrameMan.GetNewNxFullscreen ()) == width && (g_FrameMan.GetNewResY () * g_FrameMan.GetNewNxFullscreen ()) == height)
2092
+ if ((g_FrameMan.GetNewResX () * g_FrameMan.ResolutionMultiplier ()) == width && (g_FrameMan.GetNewResY () * g_FrameMan.ResolutionMultiplier ()) == height) {
2124
2093
currentResIndex = foundIndex;
2125
-
2094
+ }
2126
2095
// Only increment this when we find a usable 32bit resolution
2127
2096
foundIndex++;
2128
2097
}
2129
2098
}
2130
2099
}
2131
-
2132
- // Get rid of the mode list, we're done with it
2133
- if (pList)
2134
- {
2135
- destroy_gfx_mode_list (pList);
2136
- }
2100
+ if (resList) { destroy_gfx_mode_list (resList); }
2137
2101
2138
2102
// If none of the listed matched our resolution set for next start, add a 'custom' one to display as the current res
2139
- if (currentResIndex < 0 )
2140
- {
2141
- sprintf_s (resString, sizeof (resString), " %ix%i Custom" , g_FrameMan.GetNewResX () * g_FrameMan.GetNewNxFullscreen (), g_FrameMan.GetNewResY () * g_FrameMan.GetNewNxFullscreen ());
2142
- m_pResolutionCombo->AddItem (resString);
2143
- currentResIndex = m_pResolutionCombo->GetCount () - 1 ;
2144
- }
2145
-
2103
+ if (currentResIndex < 0 ) {
2104
+ sprintf_s (resString, sizeof (resString), " %ix%i Custom" , g_FrameMan.GetNewResX () * g_FrameMan.ResolutionMultiplier (), g_FrameMan.GetNewResY () * g_FrameMan.ResolutionMultiplier ());
2105
+ m_pResolutionCombo->AddItem (resString);
2106
+ currentResIndex = m_pResolutionCombo->GetCount () - 1 ;
2107
+ }
2146
2108
// Show the current resolution item to be the selected one
2147
2109
m_pResolutionCombo->SetSelectedIndex (currentResIndex);
2148
2110
}
0 commit comments