From d9ec4d402aabf5132ced6937150024ef72e18711 Mon Sep 17 00:00:00 2001 From: tobspr Date: Tue, 23 Feb 2016 18:06:13 +0100 Subject: [PATCH] Add print-pipe-types prc variable to prevent pipe output --- direct/src/showbase/ShowBase.py | 10 ++++++++-- panda/src/framework/config_framework.cxx | 2 ++ panda/src/framework/config_framework.h | 1 + panda/src/framework/pandaFramework.cxx | 6 +++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index 13ffbc7f45..0a3abdc07b 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -532,12 +532,19 @@ class ShowBase(DirectObject.DirectObject): del self.winList del self.pipe - def makeDefaultPipe(self, printPipeTypes = True): + def makeDefaultPipe(self, printPipeTypes = None): """ Creates the default GraphicsPipe, which will be used to make windows unless otherwise specified. """ assert self.pipe == None + + if printPipeTypes is None: + # When the user didn't specify an explicit setting, take the value + # from the config variable. We could just omit the parameter, however + # this way we can keep backward compatibility. + printPipeTypes = ConfigVariableBool("print-pipe-types", True) + selection = GraphicsPipeSelection.getGlobalPtr() if printPipeTypes: selection.printPipeTypes() @@ -567,7 +574,6 @@ class ShowBase(DirectObject.DirectObject): Creates all GraphicsPipes that the system knows about and fill up self.pipeList with them. """ - shouldPrintPipes = 0 selection = GraphicsPipeSelection.getGlobalPtr() selection.loadAuxModules() diff --git a/panda/src/framework/config_framework.cxx b/panda/src/framework/config_framework.cxx index aed06fa8ed..e5c5d42e70 100644 --- a/panda/src/framework/config_framework.cxx +++ b/panda/src/framework/config_framework.cxx @@ -31,6 +31,8 @@ ConfigVariableBool show_frame_rate_meter ("show-frame-rate-meter", false); ConfigVariableBool show_scene_graph_analyzer_meter ("show-scene-graph-analyzer-meter", false); +ConfigVariableBool print_pipe_types +("print-pipe-types", true); ConfigVariableString window_type ("window-type", "onscreen"); diff --git a/panda/src/framework/config_framework.h b/panda/src/framework/config_framework.h index 28ac64f177..9dd5dfad5c 100644 --- a/panda/src/framework/config_framework.h +++ b/panda/src/framework/config_framework.h @@ -27,6 +27,7 @@ NotifyCategoryDecl(framework, EXPCL_FRAMEWORK, EXPTP_FRAMEWORK); extern ConfigVariableDouble aspect_ratio; extern ConfigVariableBool show_frame_rate_meter; extern ConfigVariableBool show_scene_graph_analyzer_meter; +extern ConfigVariableBool print_pipe_types; extern ConfigVariableString window_type; extern ConfigVariableString record_session; diff --git a/panda/src/framework/pandaFramework.cxx b/panda/src/framework/pandaFramework.cxx index 05d4a4edb9..435be0e348 100644 --- a/panda/src/framework/pandaFramework.cxx +++ b/panda/src/framework/pandaFramework.cxx @@ -769,7 +769,11 @@ make_default_pipe() { // folks) that have been loaded in at runtime from the load-display andor // aux-display Configrc variables. GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr(); - selection->print_pipe_types(); + + if (print_pipe_types) { + selection->print_pipe_types(); + } + _default_pipe = selection->make_default_pipe(); if (_default_pipe == (GraphicsPipe*)NULL) {