Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
comex committed Sep 2, 2013
1 parent fd7cf5b commit 403744d
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions Source/Core/DolphinWX/Src/VideoConfigDiag.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit 403744d

Please sign in to comment.