summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorGlenn Rice <glennricster@gmail.com>2011-03-08 22:43:44 +0000
committerGlenn Rice <glennricster@gmail.com>2011-03-08 22:43:44 +0000
commit431f6b596adcc41bcbf3eaff3019f2fe143999c4 (patch)
tree56f646533d688b020a698ca26e706b757566ea7b /Source/Core
parent6e348a27315347870791851522bf04562cddee9f (diff)
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
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinWX/Src/X11Utils.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/Source/Core/DolphinWX/Src/X11Utils.cpp b/Source/Core/DolphinWX/Src/X11Utils.cpp
index 8705ab15aa..0944d55cc1 100644
--- a/Source/Core/DolphinWX/Src/X11Utils.cpp
+++ b/Source/Core/DolphinWX/Src/X11Utils.cpp
@@ -221,8 +221,13 @@ void XRRConfiguration::Update()
// Get the resolution setings for fullscreen mode
unsigned int fullWidth, fullHeight;
char *output_name = NULL;
- sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str(),
- "%a[^:]: %ux%u", &output_name, &fullWidth, &fullHeight);
+ 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(),
+ "%a[^:]: %ux%u", &output_name, &fullWidth, &fullHeight);
for (int i = 0; i < screenResources->noutput; i++)
{
@@ -232,8 +237,15 @@ void XRRConfiguration::Update()
XRRCrtcInfo *crtc_info = XRRGetCrtcInfo(dpy, screenResources, output_info->crtc);
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;
crtcInfo = crtc_info;
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++)
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
if (std::find(resos.begin(), resos.end(), strRes) == resos.end())
{
resos.push_back(strRes);
- arrayStringFor_FullscreenResolution.Add(
- wxString::FromUTF8(output_info->name) + wxT(": ") +
- wxString::FromUTF8(screenResources->modes[k].name));
+ arrayStringFor_FullscreenResolution.Add(wxString::FromUTF8(strRes.c_str()));
}
}
}