mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 15:49:50 -06:00
Fix the default setting for the fullscreen resolution on linux.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7320 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -221,6 +221,11 @@ void XRRConfiguration::Update()
|
|||||||
// Get the resolution setings for fullscreen mode
|
// Get the resolution setings for fullscreen mode
|
||||||
unsigned int fullWidth, fullHeight;
|
unsigned int fullWidth, fullHeight;
|
||||||
char *output_name = NULL;
|
char *output_name = NULL;
|
||||||
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.find(':') ==
|
||||||
|
std::string::npos)
|
||||||
|
sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str(),
|
||||||
|
"%ux%u", &fullWidth, &fullHeight);
|
||||||
|
else
|
||||||
sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str(),
|
sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str(),
|
||||||
"%a[^:]: %ux%u", &output_name, &fullWidth, &fullHeight);
|
"%a[^:]: %ux%u", &output_name, &fullWidth, &fullHeight);
|
||||||
|
|
||||||
@ -232,8 +237,15 @@ void XRRConfiguration::Update()
|
|||||||
XRRCrtcInfo *crtc_info = XRRGetCrtcInfo(dpy, screenResources, output_info->crtc);
|
XRRCrtcInfo *crtc_info = XRRGetCrtcInfo(dpy, screenResources, output_info->crtc);
|
||||||
if (crtc_info)
|
if (crtc_info)
|
||||||
{
|
{
|
||||||
if (!strcmp(output_name, output_info->name))
|
if (!output_name || !strcmp(output_name, output_info->name))
|
||||||
{
|
{
|
||||||
|
// Use the first output for the default setting.
|
||||||
|
if (!output_name)
|
||||||
|
{
|
||||||
|
output_name = strdup(output_info->name);
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution =
|
||||||
|
StringFromFormat("%s: %ux%u", output_info->name, fullWidth, fullHeight);
|
||||||
|
}
|
||||||
outputInfo = output_info;
|
outputInfo = output_info;
|
||||||
crtcInfo = crtc_info;
|
crtcInfo = crtc_info;
|
||||||
for (int j = 0; j < output_info->nmode && fullMode == 0; j++)
|
for (int j = 0; j < output_info->nmode && fullMode == 0; j++)
|
||||||
@ -333,14 +345,14 @@ void XRRConfiguration::AddResolutions(wxArrayString& arrayStringFor_FullscreenRe
|
|||||||
for (int k = 0; k < screenResources->nmode; k++)
|
for (int k = 0; k < screenResources->nmode; k++)
|
||||||
if (output_info->modes[j] == screenResources->modes[k].id)
|
if (output_info->modes[j] == screenResources->modes[k].id)
|
||||||
{
|
{
|
||||||
std::string strRes(screenResources->modes[k].name);
|
const std::string strRes =
|
||||||
|
std::string(output_info->name) + ": " +
|
||||||
|
std::string(screenResources->modes[k].name);
|
||||||
// Only add unique resolutions
|
// Only add unique resolutions
|
||||||
if (std::find(resos.begin(), resos.end(), strRes) == resos.end())
|
if (std::find(resos.begin(), resos.end(), strRes) == resos.end())
|
||||||
{
|
{
|
||||||
resos.push_back(strRes);
|
resos.push_back(strRes);
|
||||||
arrayStringFor_FullscreenResolution.Add(
|
arrayStringFor_FullscreenResolution.Add(wxString::FromUTF8(strRes.c_str()));
|
||||||
wxString::FromUTF8(output_info->name) + wxT(": ") +
|
|
||||||
wxString::FromUTF8(screenResources->modes[k].name));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user