X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flibgame%2Fmisc.c;h=7047ba92d120b280eacbefa00c12289152982963;hb=1a41e7b2976c6486eb1412c55ed98c7fcc9f3e51;hp=17072d87cf249b43c38bbd21ebe0b27783dbef21;hpb=7719feee76dac64d8f6153d4c379c44db1d89f7d;p=rocksndiamonds.git diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 17072d87..7047ba92 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -331,6 +331,11 @@ void Debug(char *mode, char *format, ...) { va_list ap; + // if optional debug mode specified, limit debug output accordingly + if (options.debug_mode != NULL && + !strEqual(options.debug_mode, mode)) + return; + va_start(ap, format); Log(LOG_DEBUG, mode, format, ap); va_end(ap); @@ -1036,6 +1041,7 @@ void GetOptions(int argc, char *argv[], options.execute_command = NULL; options.special_flags = NULL; + options.debug_mode = NULL; options.mytapes = FALSE; options.serveronly = FALSE; @@ -1170,6 +1176,10 @@ void GetOptions(int argc, char *argv[], else if (strncmp(option, "-debug", option_len) == 0) { options.debug = TRUE; + + // optionally, debug output can be limited to a specific debug mode + if (option_arg != next_option) + options.debug_mode = getStringCopy(option_arg); } else if (strncmp(option, "-verbose", option_len) == 0) {