]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/core/bitmap.cpp
Compilation fix for r74440 and STL builds.
[wxWidgets.git] / src / osx / core / bitmap.cpp
index bf31f8a00c0798847d7ef0361c64df0782b74b49..ac0804d1f1a19f9a509577998178f46cb655a859 100644 (file)
@@ -1851,9 +1851,23 @@ bool wxBundleResourceHandler::LoadFile(wxBitmap *bitmap,
 {
     wxString ext = GetExtension().Lower();
     wxCFStringRef resname(name);
 {
     wxString ext = GetExtension().Lower();
     wxCFStringRef resname(name);
+    wxCFStringRef resname2x(name+"@2x");
     wxCFStringRef restype(ext);
     wxCFStringRef restype(ext);
+    double scale = 1.0;
     
     
-    wxCFRef<CFURLRef> imageURL(CFBundleCopyResourceURL(CFBundleGetMainBundle(), resname, restype, NULL));
+    wxCFRef<CFURLRef> imageURL;
+    
+    if ( wxOSXGetMainScreenContentScaleFactor() > 1.9 )
+    {
+        imageURL.reset(CFBundleCopyResourceURL(CFBundleGetMainBundle(), resname2x, restype, NULL));
+        scale = 2.0;
+    }
+    
+    if ( imageURL.get() == NULL )
+    {
+        imageURL.reset(CFBundleCopyResourceURL(CFBundleGetMainBundle(), resname, restype, NULL));
+        scale = 1.0;
+    }
     
     if ( imageURL.get() != NULL )
     {
     
     if ( imageURL.get() != NULL )
     {
@@ -1869,7 +1883,7 @@ bool wxBundleResourceHandler::LoadFile(wxBitmap *bitmap,
                                                        kCGRenderingIntentDefault);
         if ( image != NULL )
         {
                                                        kCGRenderingIntentDefault);
         if ( image != NULL )
         {
-            bitmap->Create(image);
+            bitmap->Create(image,scale);
             CGImageRelease(image);
         }
     }
             CGImageRelease(image);
         }
     }