From a003a73c3f4c9f6022f9b3380540a63b2435674c Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 31 Mar 2011 09:16:36 +0000 Subject: [PATCH] Add default-antialias-enable configuration variable --- panda/src/pgraph/antialiasAttrib.cxx | 12 ++++++++---- panda/src/pgraph/config_pgraph.cxx | 5 +++++ panda/src/pgraph/config_pgraph.h | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/panda/src/pgraph/antialiasAttrib.cxx b/panda/src/pgraph/antialiasAttrib.cxx index d6e9908abb..474726324b 100644 --- a/panda/src/pgraph/antialiasAttrib.cxx +++ b/panda/src/pgraph/antialiasAttrib.cxx @@ -35,7 +35,7 @@ int AntialiasAttrib::_attrib_slot; // M_faster to specify a performance/quality tradeoff // hint. // -// If M_none is specified, no antialiasing is performed. +// If M_none is specified, no antialiasing is performed. // // If M_multisample is specified, it means to use the // special framebuffer multisample bits for @@ -74,18 +74,22 @@ make(unsigned short mode) { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) AntialiasAttrib:: make_default() { - return return_new(new AntialiasAttrib(M_none)); + if (default_antialias_enable) { + return return_new(new AntialiasAttrib(M_auto)); + } else { + return return_new(new AntialiasAttrib(M_none)); + } } //////////////////////////////////////////////////////////////////// // Function: AntialiasAttrib::output // Access: Public, Virtual -// Description: +// Description: //////////////////////////////////////////////////////////////////// void AntialiasAttrib:: output(ostream &out) const { out << get_type() << ":"; - + int type = get_mode_type(); char sep = ' '; diff --git a/panda/src/pgraph/config_pgraph.cxx b/panda/src/pgraph/config_pgraph.cxx index 91ca87be17..a0d88b0fbe 100644 --- a/panda/src/pgraph/config_pgraph.cxx +++ b/panda/src/pgraph/config_pgraph.cxx @@ -305,6 +305,11 @@ ConfigVariableInt max_lenses "this can be used as a simple sanity check. Set it larger or " "smaller to suit your needs.")); +ConfigVariableBool default_antialias_enable +("default-antialias-enable", false, + PRC_DESC("Set this true to enable the M_auto antialiasing mode for all " + "nodes by default.")); + ConfigVariableBool polylight_info ("polylight-info", false, PRC_DESC("Set this true to view some info statements regarding the polylight. " diff --git a/panda/src/pgraph/config_pgraph.h b/panda/src/pgraph/config_pgraph.h index b9fb6c3759..41061e4c19 100644 --- a/panda/src/pgraph/config_pgraph.h +++ b/panda/src/pgraph/config_pgraph.h @@ -58,6 +58,7 @@ extern EXPCL_PANDA_PGRAPH ConfigVariableBool premunge_data; extern ConfigVariableBool preserve_geom_nodes; extern ConfigVariableBool flatten_geoms; extern EXPCL_PANDA_PGRAPH ConfigVariableInt max_lenses; +extern ConfigVariableBool default_antialias_enable; extern ConfigVariableBool polylight_info; extern ConfigVariableDouble lod_fade_time;