diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-31 04:59:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-31 04:59:17 +0400 |
commit | 5b88712ff932fcbcd0bb0fb257e8e9c2e247a82a (patch) | |
tree | ca0f15ee78fee5aef80ebf5c0f9f46529b65a9e2 /source/blender/editors/interface | |
parent | ebb229110e4af5d2df5613b6345da2f602b90092 (diff) |
move debug flag into its own global var (G.debug), split up debug options.
--debug
--debug-ffmpeg
--debug-python
--debug-events
--debug-wm
This makes debug output easier to read - event debug prints would flood output too much before.
For convenience:
--debug-all turns all debug flags on (works as --debug did before).
also removed some redundant whitespace in debug prints and prefix some prints with __func__ to give some context.
Diffstat (limited to 'source/blender/editors/interface')
6 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 955d564e111..c7f8ad521fa 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -135,7 +135,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str) /* button must have RNA-pointer to a numeric-capable property */ if (ELEM(NULL, but->rnapoin.data, but->rnaprop)) { - if (G.f & G_DEBUG) + if (G.debug & G_DEBUG) printf("ERROR: create expression failed - button has no RNA info attached\n"); return 0; } @@ -144,7 +144,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str) // FIXME: until materials can be handled by depsgraph, don't allow drivers to be created for them id = (ID *)but->rnapoin.id.data; if ((id == NULL) || (GS(id->name) == ID_MA) || (GS(id->name) == ID_TE)) { - if (G.f & G_DEBUG) + if (G.debug & G_DEBUG) printf("ERROR: create expression failed - invalid id-datablock for adding drivers (%p)\n", id); return 0; } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 420cae87851..887ae250c1b 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4585,7 +4585,7 @@ static int ui_but_menu(bContext *C, uiBut *but) } } - /* perhaps we should move this into (G.f & G_DEBUG) - campbell */ + /* perhaps we should move this into (G.debug & G_DEBUG) - campbell */ uiItemFullO(layout, "UI_OT_editsource", "Edit Source", ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0); uiPupMenuEnd(C, pup); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 24881c034f4..d028fcd93ae 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -757,7 +757,7 @@ int UI_icon_get_width(int icon_id) icon = BKE_icon_get(icon_id); if (icon == NULL) { - if (G.f & G_DEBUG) + if (G.debug & G_DEBUG) printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id); return 0; } @@ -782,7 +782,7 @@ int UI_icon_get_height(int icon_id) icon = BKE_icon_get(icon_id); if (icon == NULL) { - if (G.f & G_DEBUG) + if (G.debug & G_DEBUG) printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id); return 0; } @@ -830,7 +830,7 @@ static void icon_create_rect(struct PreviewImage *prv_img, enum eIconSizes size) unsigned int render_size = preview_render_size(size); if (!prv_img) { - if (G.f & G_DEBUG) + if (G.debug & G_DEBUG) printf("%s, error: requested preview image does not exist", __func__); } if (!prv_img->rect[size]) { @@ -847,7 +847,7 @@ static void icon_create_rect(struct PreviewImage *prv_img, enum eIconSizes size) static void icon_set_image(bContext *C, ID *id, PreviewImage *prv_img, enum eIconSizes size) { if (!prv_img) { - if (G.f & G_DEBUG) + if (G.debug & G_DEBUG) printf("%s: no preview image for this ID: %s\n", __func__, id->name); return; } @@ -967,7 +967,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al alpha *= btheme->tui.icon_alpha; if (icon == NULL) { - if (G.f & G_DEBUG) + if (G.debug & G_DEBUG) printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id); return; } diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 34116f24901..ebaef26082f 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -460,7 +460,7 @@ static int reports_to_text_exec(bContext *C, wmOperator *UNUSED(op)) * - if commandline debug option enabled, show debug reports too * - otherwise, up to info (which is what users normally see) */ - str = BKE_reports_string(reports, (G.f & G_DEBUG) ? RPT_DEBUG : RPT_INFO); + str = BKE_reports_string(reports, (G.debug & G_DEBUG) ? RPT_DEBUG : RPT_INFO); if (str) { write_text(txt, str); diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 91e3b99e23b..5d527667170 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -356,7 +356,7 @@ void uiStyleInit(void) } if (font->blf_id == -1) { - if (G.f & G_DEBUG) + if (G.debug & G_DEBUG) printf("%s: error, no fonts available\n", __func__); } else { diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 5c05e9d2ba1..7eac3050b97 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -852,8 +852,8 @@ void UI_view2d_totRect_set_resize(View2D *v2d, int width, int height, int resize height -= V2D_SCROLL_HEIGHT; if (ELEM3(0, v2d, width, height)) { - if (G.f & G_DEBUG) - printf("Error: View2D totRect set exiting: v2d=%p width=%d height=%d \n", (void *)v2d, width, height); // XXX temp debug info + if (G.debug & G_DEBUG) + printf("Error: View2D totRect set exiting: v2d=%p width=%d height=%d\n", (void *)v2d, width, height); // XXX temp debug info return; } |