[Bf-blender-cvs] [3f76977] master: Splash screen: use a retina resolution image for Mac OS X.
Brecht Van Lommel
noreply at git.blender.org
Tue Feb 18 19:41:05 CET 2014
Commit: 3f769776fe65aa121b26f6af38682b5ecf6a09aa
Author: Brecht Van Lommel
Date: Mon Feb 17 21:52:20 2014 +0100
https://developer.blender.org/rB3f769776fe65aa121b26f6af38682b5ecf6a09aa
Splash screen: use a retina resolution image for Mac OS X.
===================================================================
M SConstruct
A release/datafiles/splash_2x.png
M release/datafiles/splash_template.xcf
M source/blender/editors/datafiles/CMakeLists.txt
M source/blender/editors/datafiles/SConscript
M source/blender/editors/include/ED_datafiles.h
M source/blender/windowmanager/intern/wm_operators.c
===================================================================
diff --git a/SConstruct b/SConstruct
index e24638a..dde9d66 100644
--- a/SConstruct
+++ b/SConstruct
@@ -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
index 0000000..707cfee
Binary files /dev/null and b/release/datafiles/splash_2x.png differ
diff --git a/release/datafiles/splash_template.xcf b/release/datafiles/splash_template.xcf
index 6d7e7d4..b314147 100644
Binary files a/release/datafiles/splash_template.xcf and b/release/datafiles/splash_template.xcf differ
diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt
index 35a6691..87f07ac 100644
--- a/source/blender/editors/datafiles/CMakeLists.txt
+++ b/source/blender/editors/datafiles/CMakeLists.txt
@@ -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
diff --git a/source/blender/editors/datafiles/SConscript b/source/blender/editors/datafiles/SConscript
index dadd4bd..47819d0 100644
--- a/source/blender/editors/datafiles/SConscript
+++ b/source/blender/editors/datafiles/SConscript
@@ -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"),
diff --git a/source/blender/editors/include/ED_datafiles.h b/source/blender/editors/include/ED_datafiles.h
index 81dbb8e..9022a14 100644
--- a/source/blender/editors/include/ED_datafiles.h
+++ b/source/blender/editors/include/ED_datafiles.h
@@ -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[];
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index c02cc45..a7d8cba 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -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);
More information about the Bf-blender-cvs
mailing list