Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-31 04:59:17 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-31 04:59:17 +0400
commit5b88712ff932fcbcd0bb0fb257e8e9c2e247a82a (patch)
treeca0f15ee78fee5aef80ebf5c0f9f46529b65a9e2 /source/creator
parentebb229110e4af5d2df5613b6345da2f602b90092 (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/creator')
-rw-r--r--source/creator/creator.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c
index c4da823381c..353fb6425c7 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -360,7 +360,7 @@ static int background_mode(int UNUSED(argc), const char **UNUSED(argv), void *UN
static int debug_mode(int UNUSED(argc), const char **UNUSED(argv), void *data)
{
- G.f |= G_DEBUG; /* std output printf's */
+ G.debug |= G_DEBUG; /* std output printf's */
printf(BLEND_VERSION_STRING_FMT);
MEM_set_memory_debug();
@@ -372,19 +372,16 @@ static int debug_mode(int UNUSED(argc), const char **UNUSED(argv), void *data)
return 0;
}
-#ifdef WITH_LIBMV
-static int debug_mode_libmv(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
+static int debug_mode_generic(int UNUSED(argc), const char **UNUSED(argv), void *data)
{
- libmv_startDebugLogging();
-
+ G.debug |= GET_INT_FROM_POINTER(data);
return 0;
}
-#endif
-#ifdef WITH_FFMPEG
-static int debug_mode_ffmpeg(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
+#ifdef WITH_LIBMV
+static int debug_mode_libmv(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
{
- G.f |= G_DEBUG_FFMPEG;
+ libmv_startDebugLogging();
return 0;
}
@@ -520,7 +517,7 @@ static int no_joystick(int UNUSED(argc), const char **UNUSED(argv), void *data)
* failed joystick initialization delays over 5 seconds, before game engine start
*/
SYS_WriteCommandLineInt(*syshandle, "nojoystick", 1);
- if (G.f & G_DEBUG) printf("disabling nojoystick\n");
+ if (G.debug & G_DEBUG) printf("disabling nojoystick\n");
#endif
return 0;
@@ -1100,11 +1097,15 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
BLI_argsAdd(ba, 1, "-a", NULL, playback_doc, playback_mode, NULL);
BLI_argsAdd(ba, 1, "-d", "--debug", debug_doc, debug_mode, ba);
- BLI_argsAdd(ba, 1, NULL, "--debug-fpe", "\n\tEnable floating point exceptions", set_fpe, NULL);
-
#ifdef WITH_FFMPEG
- BLI_argsAdd(ba, 1, NULL, "--debug-ffmpeg", "\n\tEnable debug messages from FFmpeg library", debug_mode_ffmpeg, NULL);
+ BLI_argsAdd(ba, 1, NULL, "--debug-ffmpeg", "\n\tEnable debug messages from FFmpeg library", debug_mode_generic, (void *)G_DEBUG_FFMPEG);
#endif
+ BLI_argsAdd(ba, 1, NULL, "--debug-python", "\n\tEnable debug messages for python", debug_mode_generic, (void *)G_DEBUG_FFMPEG);
+ BLI_argsAdd(ba, 1, NULL, "--debug-events", "\n\tEnable debug messages for the event system", debug_mode_generic, (void *)G_DEBUG_EVENTS);
+ BLI_argsAdd(ba, 1, NULL, "--debug-wm", "\n\tEnable debug messages for the window manager", debug_mode_generic, (void *)G_DEBUG_WM);
+ BLI_argsAdd(ba, 1, NULL, "--debug-all", "\n\tEnable all debug messages (excludes libmv)", debug_mode_generic, (void *)G_DEBUG_ALL);
+
+ BLI_argsAdd(ba, 1, NULL, "--debug-fpe", "\n\tEnable floating point exceptions", set_fpe, NULL);
#ifdef WITH_LIBMV
BLI_argsAdd(ba, 1, NULL, "--debug-libmv", "\n\tEnable debug messages from libmv library", debug_mode_libmv, NULL);