@@ -234,7 +234,7 @@ int MainMenuGUI::Create(Controller *pController)
234
234
m_aSkirmishButton[P4TEAM] = dynamic_cast <GUIButton *>(m_pGUIController->GetControl (" ButtonP4Team" ));
235
235
m_pCPUTeamLabel = dynamic_cast <GUILabel *>(m_pGUIController->GetControl (" LabelCPUTeam" ));
236
236
237
- m_aOptionButton[FULLSCREEN ] = dynamic_cast <GUIButton *>(m_pGUIController->GetControl (" ButtonFullscreen" ));
237
+ m_aOptionButton[RESOLUTIONMULTIPLIER ] = dynamic_cast <GUIButton *>(m_pGUIController->GetControl (" ButtonFullscreen" ));
238
238
m_aOptionButton[P1NEXT] = dynamic_cast <GUIButton *>(m_pGUIController->GetControl (" ButtonP1NextDevice" ));
239
239
m_aOptionButton[P2NEXT] = dynamic_cast <GUIButton *>(m_pGUIController->GetControl (" ButtonP2NextDevice" ));
240
240
m_aOptionButton[P3NEXT] = dynamic_cast <GUIButton *>(m_pGUIController->GetControl (" ButtonP3NextDevice" ));
@@ -353,15 +353,13 @@ int MainMenuGUI::Create(Controller *pController)
353
353
m_pResolutionCombo = dynamic_cast <GUIComboBox *>(m_pGUIController->GetControl (" ComboResolution" ));
354
354
UpdateResolutionCombo ();
355
355
356
- // Set labels only when we know max resolution, as it defines whether we can switch to 2X windowed mode or not
357
- if (g_FrameMan.IsFullscreen ())
358
- m_aOptionButton[FULLSCREEN]->SetText (" Go 1X Window" );
359
- else
360
- {
361
- if (g_FrameMan.NxWindowed () == 1 && g_FrameMan.GetResX () <= m_MaxResX / 2 - 25 && g_FrameMan.GetResY () <= m_MaxResY / 2 - 25 )
362
- m_aOptionButton[FULLSCREEN]->SetText (" Go 2X Window" );
363
- else
364
- m_aOptionButton[FULLSCREEN]->SetText (" Go Fullscreen" );
356
+ // Set labels only when we know max resolution, as it defines whether we can switch to 2X windowed mode or not
357
+ if (g_FrameMan.ResolutionMultiplier () == 1 && g_FrameMan.GetResX () <= m_MaxResX / 2 && g_FrameMan.GetResY () <= m_MaxResY / 2 ) {
358
+ m_aOptionButton[RESOLUTIONMULTIPLIER]->SetText (" Go 2X" );
359
+ } else if (g_FrameMan.ResolutionMultiplier () > 1 ) {
360
+ m_aOptionButton[RESOLUTIONMULTIPLIER]->SetText (" Go 1X" );
361
+ } else {
362
+ m_aOptionButton[RESOLUTIONMULTIPLIER]->SetText (" Unavailable" );
365
363
}
366
364
367
365
m_pResolutionNoticeLabel = dynamic_cast <GUILabel *>(m_pGUIController->GetControl (" LabelResolutionNotice" ));
@@ -1025,40 +1023,28 @@ void MainMenuGUI::Update()
1025
1023
g_GUISound.ExitMenuSound ()->Play ();
1026
1024
}
1027
1025
1028
- // Fullscreen toggle button pressed
1029
- if (anEvent.GetControl () == m_aOptionButton[FULLSCREEN])
1030
- {
1031
- g_GUISound.ButtonPressSound ()->Play ();
1026
+ // Multiplier toggle button pressed
1027
+ if (anEvent.GetControl () == m_aOptionButton[RESOLUTIONMULTIPLIER]) {
1028
+ g_GUISound.ButtonPressSound ()->Play ();
1032
1029
1033
- // Was fullscreen, switch to 1x window
1034
- if (g_FrameMan.IsFullscreen ())
1035
- {
1036
- // First set the multiplier back to 1 and then switch to fullscreen so we get the right multiplier
1037
- g_FrameMan.SwitchWindowMultiplier (1 );
1038
- g_FrameMan.ToggleFullscreen ();
1039
- }
1040
- // Was windowed
1041
- else
1042
- {
1043
- // Was at 1x, change to 2x, but only if resolution is reasonable
1044
- if (g_FrameMan.NxWindowed () == 1 && g_FrameMan.GetResX () <= m_MaxResX / 2 - 25 && g_FrameMan.GetResY () <= m_MaxResY / 2 - 25 )
1045
- g_FrameMan.SwitchWindowMultiplier (2 );
1046
- // Was at 2x, change to fullscreen
1047
- else
1048
- g_FrameMan.ToggleFullscreen ();
1049
- }
1030
+ if (g_FrameMan.ResolutionMultiplier () > 1 ) {
1031
+ g_FrameMan.SwitchResolutionMultiplier (1 );
1032
+ } else if (g_FrameMan.ResolutionMultiplier () == 1 && g_FrameMan.GetResX () <= m_MaxResX / 2 && g_FrameMan.GetResY () <= m_MaxResY / 2 ) {
1033
+ g_FrameMan.SwitchResolutionMultiplier (2 );
1034
+ }
1035
+ }
1050
1036
1051
- // Update the label to whatever we ended up with
1052
- if (g_FrameMan. IsFullscreen ())
1053
- m_aOptionButton[FULLSCREEN ]->SetText ( " Go 1X Window " );
1054
- else
1055
- {
1056
- if (g_FrameMan. NxWindowed () == 1 && g_FrameMan. GetResX () <= m_MaxResX / 2 - 25 && g_FrameMan. GetResY () <= m_MaxResY / 2 - 25 )
1057
- m_aOptionButton[FULLSCREEN ]->SetText (" Go 2X Window " );
1058
- else
1059
- m_aOptionButton[FULLSCREEN ]->SetText ( " Go Fullscreen " );
1060
- }
1061
- }
1037
+ // Update the label to whatever we ended up with
1038
+ if (g_FrameMan. ResolutionMultiplier () == 1 && g_FrameMan. GetResX () <= m_MaxResX / 2 && g_FrameMan. GetResY () <= m_MaxResY / 2 ) {
1039
+ m_aOptionButton[RESOLUTIONMULTIPLIER ]->SetVisible ( true );
1040
+ m_aOptionButton[RESOLUTIONMULTIPLIER]-> SetText ( " Go 2X " );
1041
+ } else if (g_FrameMan. ResolutionMultiplier () > 1 ) {
1042
+ m_aOptionButton[RESOLUTIONMULTIPLIER]-> SetVisible ( true );
1043
+ m_aOptionButton[RESOLUTIONMULTIPLIER ]->SetText (" Go 1X " );
1044
+ } else {
1045
+ // m_aOptionButton[RESOLUTIONMULTIPLIER ]->SetVisible(false );
1046
+ m_aOptionButton[RESOLUTIONMULTIPLIER]-> SetText ( " Unavailable " );
1047
+ }
1062
1048
1063
1049
// Return to main menu button pressed
1064
1050
if (anEvent.GetControl () == m_aMainMenuButton[BACKTOMAIN])
@@ -1595,19 +1581,10 @@ void MainMenuGUI::Update()
1595
1581
int newResY = g_FrameMan.GetResY ();
1596
1582
sscanf (pResItem->m_Name .c_str (), " %4dx%4d" , &newResX, &newResY);
1597
1583
// Sanity check the values and then set them as the new resolution to be switched to next time FrameMan is created
1598
- /* if (newResX >= 400 && newResX < 3000 && newResY >= 400 && newResY < 3000)*/
1599
- if (g_FrameMan.IsValidResolution (newResX, newResY))
1600
- {
1601
- // Force double virtual fullscreen res if the res is too high
1602
- if (newResX >= 1280 )
1603
- g_FrameMan.SetNewNxFullscreen (2 );
1604
- // Not oversized resolution
1605
- else
1606
- g_FrameMan.SetNewNxFullscreen (1 );
1607
-
1608
- g_FrameMan.SetNewResX (newResX /= g_FrameMan.GetNewNxFullscreen ());
1609
- g_FrameMan.SetNewResY (newResY /= g_FrameMan.GetNewNxFullscreen ());
1610
- }
1584
+ if (g_FrameMan.IsValidResolution (newResX, newResY)) {
1585
+ g_FrameMan.SetNewResX (newResX / g_FrameMan.ResolutionMultiplier ());
1586
+ g_FrameMan.SetNewResY (newResY / g_FrameMan.ResolutionMultiplier ());
1587
+ }
1611
1588
}
1612
1589
1613
1590
// Update the resolution restart notice
0 commit comments