win32: Add fullscreen on ROM open option.

This commit is contained in:
BearOso 2023-03-13 13:57:30 -05:00
parent c64e99f504
commit e306405cd1
5 changed files with 18 additions and 2 deletions

View File

@ -144,6 +144,7 @@
#define IDC_STRETCH 1109
#define IDC_FULLSCREEN 1110
#define IDC_EMUFULLSCREEN 1111
#define IDC_FULLSCREEN_ON_OPEN 1112
#define IDC_TRANS 1113
#define IDC_HIRES 1114
#define IDC_CHEAT_CODE 1115

View File

@ -132,7 +132,8 @@ BEGIN
LTEXT "%",IDC_LABEL_SFXSPEED_2,156,138,131,14,SS_CENTERIMAGE
CONTROL "Ask for confirmation when saving/loading",IDC_CONFIRMSAVELOAD,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,192,145,8
CONTROL "Add Snes9x to registry for supported file types", IDC_ADD_REGISTRY, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 102, 204, 180, 8
CONTROL "Add Snes9x to registry for supported file types",IDC_ADD_REGISTRY,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,204,180,8
END
IDD_OPEN_ROM DIALOGEX 0, 0, 430, 223
@ -185,7 +186,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,240,270,48,14
PUSHBUTTON "Cancel",IDCANCEL,294,270,48,14
COMBOBOX IDC_OUTPUTMETHOD,72,18,95,58,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_OUTPUTMETHOD,72,17,95,58,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Fullscreen",IDC_FULLSCREEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,30,50,10
CONTROL "Emulate Fullscreen",IDC_EMUFULLSCREEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,41,75,10
CONTROL "Stretch Image",IDC_STRETCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,52,60,10
@ -231,6 +232,7 @@ BEGIN
CONTROL "Scale messages with EPX if possible",IDC_MESSAGES_SCALE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,174,132,8
PUSHBUTTON "Parameters...",IDC_SHADER_GLSL_PARAMETERS,282,246,54,14,WS_DISABLED
CONTROL "Fullscreen on ROM Open",IDC_FULLSCREEN_ON_OPEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,30,97,10,WS_EX_RIGHT
END
IDD_CHEATER DIALOGEX 0, 0, 378, 189

View File

@ -87,6 +87,7 @@ void WinSetDefaultValues ()
GUI.LockDirectories = false;
GUI.window_maximized = false;
GUI.EmulatedFullscreen = false;
GUI.FullscreenOnOpen = false;
WinDeleteRecentGamesList ();
@ -793,6 +794,7 @@ void WinRegisterConfigItems()
AddUInt("Fullscreen:Depth", GUI.FullscreenMode.depth, 16);
AddUInt("Fullscreen:RefreshRate", GUI.FullscreenMode.rate, 60);
AddBool("Fullscreen:DoubleBuffered", GUI.DoubleBuffered, false);
AddBoolC("Fullscreen:FullscreenOnOpen", GUI.FullscreenOnOpen, false, "Change to fullscreen when opening a ROM.");
AddBoolC("Fullscreen:EmulateFullscreen", GUI.EmulateFullscreen, true,"true makes snes9x create a window that spans the entire screen when going fullscreen");
AddBoolC("HideMenu", GUI.HideMenu, false, "true to auto-hide the menu bar on startup.");
AddBoolC("Vsync", GUI.Vsync, false, "true to enable Vsync");

View File

@ -4008,6 +4008,13 @@ static bool LoadROM(const TCHAR *filename, const TCHAR *filename2 /*= NULL*/) {
Settings.Paused = false;
S9xRestoreWindowTitle();
if (GUI.FullscreenOnOpen)
{
if (!GUI.FullScreen && !GUI.EmulatedFullscreen)
ToggleFullScreen();
SetMenu(GUI.hWnd, NULL);
}
return !Settings.StopEmulation;
}
@ -7567,6 +7574,8 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
SendDlgItemMessage(hDlg, IDC_FULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (GUI.EmulateFullscreen)
SendDlgItemMessage(hDlg, IDC_EMUFULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (GUI.FullscreenOnOpen)
SendDlgItemMessage(hDlg, IDC_FULLSCREEN_ON_OPEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (Settings.BilinearFilter)
SendDlgItemMessage(hDlg, IDC_BILINEAR, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (Settings.DisplayFrameRate)
@ -7972,6 +7981,7 @@ updateFilterBox2:
GUI.IntegerScaling = (bool)(IsDlgButtonChecked(hDlg, IDC_INTEGERSCALING) == BST_CHECKED);
fullscreenWanted = (bool)(IsDlgButtonChecked(hDlg, IDC_FULLSCREEN)==BST_CHECKED);
GUI.EmulateFullscreen = (bool)(IsDlgButtonChecked(hDlg, IDC_EMUFULLSCREEN)==BST_CHECKED);
GUI.FullscreenOnOpen = (bool)(IsDlgButtonChecked(hDlg, IDC_FULLSCREEN_ON_OPEN) == BST_CHECKED);
Settings.DisplayFrameRate = IsDlgButtonChecked(hDlg, IDC_SHOWFPS);
GUI.BlendHiRes = (bool)(IsDlgButtonChecked(hDlg, IDC_HIRESBLEND)==BST_CHECKED);

View File

@ -162,6 +162,7 @@ struct sGUI {
bool AVIHiRes;
bool DoubleBuffered;
bool FullScreen;
bool FullscreenOnOpen;
bool Stretch;
bool HeightExtend;
bool AspectRatio;