summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2013-08-29 01:42:45 -0400
committercomex <comexk@gmail.com>2013-09-01 22:58:35 -0400
commit403744dee83b04cdc27284491d121d045c64a99c (patch)
tree9214bc982720e5a9b230ef98074e6cf3a5db7fd6 /Source/Core
parentfd7cf5bb719d0fb04814d9df4a6a783d648dad40 (diff)
Fix use of deprecated screen resolution API.
(This is currently pointless, as the code in question is not used on OS X anyway, but I'd like to see that option come back. In any case, fixes the warning)
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinWX/Src/VideoConfigDiag.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp
index a606bf413e..0721ed3689 100644
--- a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp
+++ b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp
@@ -154,32 +154,32 @@ wxArrayString GetListOfResolutions()
#elif defined(HAVE_XRANDR) && HAVE_XRANDR
main_frame->m_XRRConfig->AddResolutions(retlist);
#elif defined(__APPLE__)
- CFArrayRef modes = CGDisplayAvailableModes(CGMainDisplayID());
+ CFArrayRef modes = CGDisplayCopyAllDisplayModes(CGMainDisplayID(), NULL);
for (CFIndex i = 0; i < CFArrayGetCount(modes); i++)
{
std::stringstream res;
- CFDictionaryRef mode;
- CFNumberRef ref;
- int w, h, d;
-
- mode = (CFDictionaryRef)CFArrayGetValueAtIndex(modes, i);
- ref = (CFNumberRef)CFDictionaryGetValue(mode, kCGDisplayWidth);
- CFNumberGetValue(ref, kCFNumberIntType, &w);
- ref = (CFNumberRef)CFDictionaryGetValue(mode, kCGDisplayHeight);
- CFNumberGetValue(ref, kCFNumberIntType, &h);
- ref = (CFNumberRef)CFDictionaryGetValue(mode,
- kCGDisplayBitsPerPixel);
- CFNumberGetValue(ref, kCFNumberIntType, &d);
-
- if (CFDictionaryContainsKey(mode, kCGDisplayModeIsStretched))
+ CGDisplayModeRef mode;
+ CFStringRef encoding;
+ size_t w, h;
+ bool is32;
+
+ mode = (CGDisplayModeRef)CFArrayGetValueAtIndex(modes, i);
+ w = CGDisplayModeGetWidth(mode);
+ h = CGDisplayModeGetHeight(mode);
+ encoding = CGDisplayModeCopyPixelEncoding(mode);
+ is32 = CFEqual(encoding, CFSTR(IO32BitDirectPixels));
+ CFRelease(encoding);
+
+ if (!is32)
continue;
- if (d != 32)
+ if (CGDisplayModeGetIOFlags(mode) & kDisplayModeStretchedFlag)
continue;
res << w << "x" << h;
retlist.Add(res.str());
}
+ CFRelease(modes);
#endif
return retlist;
}