Splash screen: use a retina resolution image for Mac OS X.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 17 Feb 2014 20:52:20 +0000 (21:52 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 18 Feb 2014 18:38:44 +0000 (19:38 +0100)
SConstruct
release/datafiles/splash_2x.png [new file with mode: 0644]
release/datafiles/splash_template.xcf
source/blender/editors/datafiles/CMakeLists.txt
source/blender/editors/datafiles/SConscript
source/blender/editors/include/ED_datafiles.h
source/blender/windowmanager/intern/wm_operators.c

index e24638aa15ca3cfc7763e29852e10516d42c0f39..dde9d66af5f5f195e76f8e31917410c7cd401549 100644 (file)
@@ -694,6 +694,7 @@ if B.targets != ['cudakernels']:
     data_to_c_simple("release/datafiles/bmonofont.ttf")
 
     data_to_c_simple("release/datafiles/splash.png")
+    data_to_c_simple("release/datafiles/splash_2x.png")
 
     # data_to_c_simple("release/datafiles/blender_icons16.png")
     # data_to_c_simple("release/datafiles/blender_icons32.png")
diff --git a/release/datafiles/splash_2x.png b/release/datafiles/splash_2x.png
new file mode 100644 (file)
index 0000000..707cfee
Binary files /dev/null and b/release/datafiles/splash_2x.png differ
index 6d7e7d42c9f54173365ee04d3d28ca9f7abb1127..b3141471c51b23792798590dbfbec712153fb795 100644 (file)
Binary files a/release/datafiles/splash_template.xcf and b/release/datafiles/splash_template.xcf differ
index 35a669175dff2bb75cbfb1ca23bc39edd4ef8cc9..87f07acfb3e102bf225a44bf7db26f0a2fe0b4ab 100644 (file)
@@ -47,6 +47,7 @@ if(WITH_BLENDER)
 
                # images
                data_to_c_simple(../../../../release/datafiles/splash.png SRC)
+               data_to_c_simple(../../../../release/datafiles/splash_2x.png SRC)
                # XXX These are handy, but give nasty "false changes" in svn :/
                #svg_to_png(../../../../release/datafiles/blender_icons.svg
                           #../../../../release/datafiles/blender_icons16.png
index dadd4bd1f19625eb424ff2793a0e43d214e2826f..47819d0e33c5b808d7aa41d9d132fb6c4712dc67 100644 (file)
@@ -41,6 +41,7 @@ sources.extend((
     os.path.join(env['DATA_SOURCES'], "bmonofont.ttf.c"),
 
     os.path.join(env['DATA_SOURCES'], "splash.png.c"),
+    os.path.join(env['DATA_SOURCES'], "splash_2x.png.c"),
     os.path.join(env['DATA_SOURCES'], "blender_icons16.png.c"),
     os.path.join(env['DATA_SOURCES'], "blender_icons32.png.c"),
     os.path.join(env['DATA_SOURCES'], "prvicons.png.c"),
index 81dbb8e9aa54dbb2484901a63e1aae8e35a4c5ab..9022a1481aa789ea8daee8d5e20112d6ff69034c 100644 (file)
@@ -54,6 +54,9 @@ extern char datatoc_prvicons_png[];
 extern int datatoc_splash_png_size;
 extern char datatoc_splash_png[];
 
+extern int datatoc_splash_2x_png_size;
+extern char datatoc_splash_2x_png[];
+
 extern int datatoc_bfont_pfb_size;
 extern char datatoc_bfont_pfb[];
 
index c02cc456a4672a081217bfdef2a3e70b8ee13c3f..a7d8cba4d20d5eddd3282f413ec1dc458dd65e1b 100644 (file)
@@ -1767,8 +1767,19 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
        extern char datatoc_splash_png[];
        extern int datatoc_splash_png_size;
 
-       ImBuf *ibuf = IMB_ibImageFromMemory((unsigned char *)datatoc_splash_png,
-                                           datatoc_splash_png_size, IB_rect, NULL, "<splash screen>");
+       extern char datatoc_splash_2x_png[];
+       extern int datatoc_splash_2x_png_size;
+
+       ImBuf *ibuf;
+
+       if (U.pixelsize == 2) {
+               ibuf = IMB_ibImageFromMemory((unsigned char *)datatoc_splash_2x_png,
+                                            datatoc_splash_2x_png_size, IB_rect, NULL, "<splash screen>");
+       }
+       else {
+               ibuf = IMB_ibImageFromMemory((unsigned char *)datatoc_splash_png,
+                                            datatoc_splash_png_size, IB_rect, NULL, "<splash screen>");
+       }
 #else
        ImBuf *ibuf = NULL;
 #endif
@@ -1797,7 +1808,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
         * with the OS when the splash shows, window clipping in this case gives
         * ugly results and clipping the splash isn't useful anyway, just disable it [#32938] */
        uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_NO_WIN_CLIP);
-       
+
        /* XXX splash scales with pixelsize, should become widget-units */
        but = uiDefBut(block, BUT_IMAGE, 0, "", 0, 0.5f * U.widget_unit, U.pixelsize * 501, U.pixelsize * 282, ibuf, 0.0, 0.0, 0, 0, ""); /* button owns the imbuf now */
        uiButSetFunc(but, wm_block_splash_close, block, NULL);