From 198295e9caf72e2523138817427179b44f5790d5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 17 Sep 2011 16:57:37 +0000 Subject: image button was hard coded to draw the splash screen which it loaded from PNG data on every draw. now pass the ImBuf when callign the image button so we could have different images in buttons later on. --- source/blender/windowmanager/intern/wm_operators.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 68a4eebf93f..5e4505abaa5 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -80,6 +80,7 @@ #include "BIF_glutil.h" /* for paint cursor */ #include "IMB_imbuf_types.h" +#include "IMB_imbuf.h" #include "ED_screen.h" #include "ED_util.h" @@ -1206,6 +1207,9 @@ static int wm_resource_check_prev(void) static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(arg)) { + extern char datatoc_splash_png[]; + extern int datatoc_splash_png_size; + uiBlock *block; uiBut *but; uiLayout *layout, *split, *col; @@ -1214,6 +1218,8 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar int i; MenuType *mt= WM_menutype_find("USERPREF_MT_splash", TRUE); char url[96]; + /* hardcoded to splash, loading and freeing every draw, eek! */ + ImBuf *ibuf= IMB_ibImageFromMemory((unsigned char*)datatoc_splash_png, datatoc_splash_png_size, IB_rect); #ifdef WITH_BUILDINFO int ver_width, rev_width; @@ -1237,7 +1243,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN); - but= uiDefBut(block, BUT_IMAGE, 0, "", 0, 10, 501, 282, NULL, 0.0, 0.0, 0, 0, ""); + but= uiDefBut(block, BUT_IMAGE, 0, "", 0, 10, 501, 282, ibuf, 0.0, 0.0, 0, 0, ""); /* button owns the imbuf now */ uiButSetFunc(but, wm_block_splash_close, block, NULL); uiBlockSetFunc(block, wm_block_splash_refreshmenu, block, NULL); -- cgit v1.2.3 From 7da6e0c82e2deac0bf177d8a273dc217202b3659 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 18 Sep 2011 09:46:47 +0000 Subject: Fix for [#28672] Blender segfault after exiting a game that was opened with autoplay on (Blender, not blenderplayer) Autoplay misses uninitialisation, I'm just fixing the reported crash, it still misses all other frees, but as the program exits, we don't care? --- source/blender/windowmanager/intern/wm_init_exit.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 850de9029c9..365301538b0 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -296,6 +296,8 @@ int WM_init_game(bContext *C) WM_operator_name_call(C, "VIEW3D_OT_game_start", WM_OP_EXEC_DEFAULT, NULL); + sound_exit(); + return 1; } else -- cgit v1.2.3