mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Move fullscreen display resolution control to the GUI with the rest of the fullscreen toggling code. This removes redundancy of code that was in several places through the various video plugins. Unfortunately it means the fullscreen resolution setting also had to be moved to the main configuration dialog. I am sure that will meet some resistance.
Also added a window size setting for windowed mode. Also pulled some X11 specific code out into a separate file. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5395 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -107,9 +107,6 @@ void EnableAlphaToCoverage()
|
||||
|
||||
void InitPP(int adapter, int f, int aa_mode, D3DPRESENT_PARAMETERS *pp)
|
||||
{
|
||||
int FSResX = adapters[adapter].resolutions[resolution].xres;
|
||||
int FSResY = adapters[adapter].resolutions[resolution].yres;
|
||||
|
||||
ZeroMemory(pp, sizeof(D3DPRESENT_PARAMETERS));
|
||||
pp->hDeviceWindow = hWnd;
|
||||
if (auto_depth_stencil)
|
||||
|
@ -72,18 +72,6 @@ struct TabDirect3D : public W32Util::Tab
|
||||
}
|
||||
ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_ASPECTRATIO), g_Config.iAspectRatio);
|
||||
|
||||
for (int i = 0; i < (int)adapter.resolutions.size(); i++)
|
||||
{
|
||||
const D3D::Resolution &r = adapter.resolutions[i];
|
||||
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, r.name, -1, tempwstr, 2000);
|
||||
ComboBox_AddString(GetDlgItem(hDlg, IDC_RESOLUTION), tempwstr);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
tempwstr[i] = g_Config.cFSResolution[i];
|
||||
}
|
||||
ComboBox_SelectString(GetDlgItem(hDlg,IDC_RESOLUTION), -1, tempwstr);
|
||||
|
||||
Button_SetCheck(GetDlgItem(hDlg, IDC_VSYNC), g_Config.bVSync);
|
||||
Button_SetCheck(GetDlgItem(hDlg, IDC_WIDESCREEN_HACK), g_Config.bWidescreenHack);
|
||||
Button_SetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE), g_Config.bSafeTextureCache);
|
||||
@ -136,8 +124,6 @@ struct TabDirect3D : public W32Util::Tab
|
||||
|
||||
void Apply(HWND hDlg)
|
||||
{
|
||||
ComboBox_GetTextA(GetDlgItem(hDlg, IDC_RESOLUTION), g_Config.cFSResolution, 16);
|
||||
|
||||
g_Config.iAdapter = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_ADAPTER));
|
||||
g_Config.iMultisampleMode = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_ANTIALIASMODE));
|
||||
g_Config.bVSync = Button_GetCheck(GetDlgItem(hDlg, IDC_VSYNC)) ? true : false;
|
||||
|
@ -70,27 +70,6 @@ void OnKeyDown(WPARAM wParam)
|
||||
}
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
void ToggleDisplayMode (int bFullscreen)
|
||||
{
|
||||
if (bFullscreen)
|
||||
{
|
||||
DEVMODE dmScreenSettings;
|
||||
memset(&dmScreenSettings,0,sizeof(dmScreenSettings));
|
||||
dmScreenSettings.dmSize = sizeof(dmScreenSettings);
|
||||
sscanf(g_Config.cFSResolution, "%dx%d", &dmScreenSettings.dmPelsWidth, &dmScreenSettings.dmPelsHeight);
|
||||
dmScreenSettings.dmBitsPerPel = 32;
|
||||
dmScreenSettings.dmFields = DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;
|
||||
|
||||
// Try To Set Selected Mode And Get Results. NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
|
||||
ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Change to default resolution
|
||||
ChangeDisplaySettings(NULL, CDS_FULLSCREEN);
|
||||
}
|
||||
}
|
||||
|
||||
LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( iMsg )
|
||||
@ -132,8 +111,6 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
||||
OnKeyDown(lParam);
|
||||
else if (wParam == WIIMOTE_DISCONNECT)
|
||||
PostMessage(m_hParent, WM_USER, wParam, lParam);
|
||||
else if (wParam == TOGGLE_DISPLAYMODE)
|
||||
ToggleDisplayMode(lParam);
|
||||
break;
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
|
@ -14,7 +14,6 @@ void Close();
|
||||
void SetSize(int displayWidth, int displayHeight);
|
||||
bool IsSizing();
|
||||
void OSDMenu(WPARAM wParam);
|
||||
void ToggleDisplayMode (int bFullscreen);
|
||||
|
||||
}
|
||||
|
||||
|
@ -264,12 +264,12 @@ void TeardownDeviceObjects()
|
||||
bool Renderer::Init()
|
||||
{
|
||||
UpdateActiveConfig();
|
||||
int fullScreenRes, w_temp, h_temp;
|
||||
int fullScreenRes, x, y, w_temp, h_temp;
|
||||
s_blendMode = 0;
|
||||
// Multisample Anti-aliasing hasn't been implemented yet
|
||||
int backbuffer_ms_mode = 0; // g_ActiveConfig.iMultisampleMode;
|
||||
|
||||
sscanf(g_Config.cFSResolution, "%dx%d", &w_temp, &h_temp);
|
||||
g_VideoInitialize.pRequestWindowSize(x, y, w_temp, h_temp);
|
||||
|
||||
for (fullScreenRes = 0; fullScreenRes < (int)D3D::GetAdapter(g_ActiveConfig.iAdapter).resolutions.size(); fullScreenRes++)
|
||||
{
|
||||
|
@ -287,7 +287,6 @@ void Shutdown()
|
||||
OpcodeDecoder_Shutdown();
|
||||
Renderer::Shutdown();
|
||||
D3D::Shutdown();
|
||||
EmuWindow::ToggleDisplayMode(false);
|
||||
EmuWindow::Close();
|
||||
s_PluginInitialized = false;
|
||||
}
|
||||
|
@ -46,16 +46,14 @@ BEGIN
|
||||
CONTROL "&Widescreen Hack",IDC_WIDESCREEN_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,25,67,10
|
||||
LTEXT "&Aspect Ratio:",IDC_STATIC,9,40,48,8
|
||||
COMBOBOX IDC_ASPECTRATIO,68,39,89,57,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Full&screen Resolution:",IDC_STATIC,9,56,230,8
|
||||
COMBOBOX IDC_RESOLUTION,68,67,162,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "&Anti-alias mode:",IDC_STATIC,9,87,51,8
|
||||
COMBOBOX IDC_ANTIALIASMODE,68,85,162,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "&Enable CPU->EFB access ",IDC_EFB_ACCESS_ENABLE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,103,94,11
|
||||
GROUPBOX "Safe Texture Cache Mode",IDC_STATIC,109,119,125,27
|
||||
CONTROL "&Safe Texture Cache",IDC_SAFE_TEXTURE_CACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,129,80,11
|
||||
CONTROL "Safe",IDC_SAFE_TEXTURE_CACHE_SAFE,"Button",BS_AUTORADIOBUTTON,117,130,27,10
|
||||
CONTROL "Normal",IDC_SAFE_TEXTURE_CACHE_NORMAL,"Button",BS_AUTORADIOBUTTON,154,130,38,10
|
||||
CONTROL "Fast",IDC_SAFE_TEXTURE_CACHE_FAST,"Button",BS_AUTORADIOBUTTON,198,130,30,10
|
||||
LTEXT "&Anti-alias mode:",IDC_STATIC,9,59,51,8
|
||||
COMBOBOX IDC_ANTIALIASMODE,68,59,162,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "&Enable CPU->EFB access ",IDC_EFB_ACCESS_ENABLE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,80,94,11
|
||||
GROUPBOX "Safe Texture Cache Mode",IDC_STATIC,109,94,125,27
|
||||
CONTROL "&Safe Texture Cache",IDC_SAFE_TEXTURE_CACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,104,80,11
|
||||
CONTROL "Safe",IDC_SAFE_TEXTURE_CACHE_SAFE,"Button",BS_AUTORADIOBUTTON,117,105,27,10
|
||||
CONTROL "Normal",IDC_SAFE_TEXTURE_CACHE_NORMAL,"Button",BS_AUTORADIOBUTTON,154,105,38,10
|
||||
CONTROL "Fast",IDC_SAFE_TEXTURE_CACHE_FAST,"Button",BS_AUTORADIOBUTTON,198,105,30,10
|
||||
END
|
||||
|
||||
IDD_ADVANCED DIALOGEX 0, 0, 244, 200
|
||||
|
Reference in New Issue
Block a user