[Bf-blender-cvs] [a3e17cd3ac] app-templates: UI: be more specific about splash sizes

Campbell Barton noreply at git.blender.org
Thu Mar 23 00:58:47 CET 2017


Commit: a3e17cd3ac0674956d9b0570c51c6e35b51d9f30
Author: Campbell Barton
Date:   Thu Mar 23 10:58:31 2017 +1100
Branches: app-templates
https://developer.blender.org/rBa3e17cd3ac0674956d9b0570c51c6e35b51d9f30

UI: be more specific about splash sizes

===================================================================

M	source/blender/windowmanager/intern/wm_operators.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index c4891f4c63..0d47d39d5d 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1776,20 +1776,20 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
 			        (U.pixelsize == 2) ? "splash_2x.png" : "splash.png");
 			ibuf_template = IMB_loadiffname(temp_path, IB_rect, NULL);
 			if (ibuf_template) {
+				const int x_expect = ibuf_template->x;
+				const int y_expect = 230 * (int)U.pixelsize;
 				/* don't cover the header text */
-				if (ibuf_template->x == ibuf->x && ibuf_template->y <= ibuf->y) {
+				if (ibuf_template->x == x_expect && ibuf_template->y == y_expect) {
 					memcpy(ibuf->rect, ibuf_template->rect, ibuf_template->x * ibuf_template->y * sizeof(char[4]));
 				}
 				else {
-					printf("Splash has bad size: %s\n", temp_path);
+					printf("Splash expected %dx%d found %dx%d, ignoring: %s\n",
+					       x_expect, y_expect, ibuf_template->x, ibuf_template->y, temp_path);
 				}
 				IMB_freeImBuf(ibuf_template);
 			}
 		}
 	}
-
-
-
 #endif
 
 	block = UI_block_begin(C, ar, "_popup", UI_EMBOSS);




More information about the Bf-blender-cvs mailing list