From 1b129d905dd5e3445a55bb01bd6fb4c465ee50db Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 27 Aug 2013 21:37:10 +0000 Subject: [PATCH] lod config vars should be defined in pgraphnodes, not pgraph --- panda/src/pgraph/config_pgraph.cxx | 35 -------------------- panda/src/pgraph/config_pgraph.h | 6 ---- panda/src/pgraphnodes/config_pgraphnodes.cxx | 35 ++++++++++++++++++++ panda/src/pgraphnodes/config_pgraphnodes.h | 14 +++++++- panda/src/pgraphnodes/lodNode.h | 2 +- 5 files changed, 49 insertions(+), 43 deletions(-) diff --git a/panda/src/pgraph/config_pgraph.cxx b/panda/src/pgraph/config_pgraph.cxx index 2f42f16f4d..97f54ff1a3 100644 --- a/panda/src/pgraph/config_pgraph.cxx +++ b/panda/src/pgraph/config_pgraph.cxx @@ -256,12 +256,6 @@ ConfigVariableBool retransform_sprites "re-transformed back into the original object space, which is " "necessary in order for fog to work correctly on the sprites.")); -ConfigVariableBool support_fade_lod -("support-fade-lod", true, - PRC_DESC("Set this false to make FadeLOD nodes behave like regular LOD nodes " - "(ignoring the fade time). This may be useful, for instance, to " - "test the performance impact of using FadeLOD nodes.")); - ConfigVariableBool depth_offset_decals ("depth-offset-decals", false, PRC_DESC("Set this true to allow decals to be implemented via the advanced " @@ -334,35 +328,6 @@ ConfigVariableBool polylight_info PRC_DESC("Set this true to view some info statements regarding the polylight. " "It is helpful for debugging.")); -ConfigVariableDouble lod_fade_time -("lod-fade-time", 0.5, - PRC_DESC("The default amount of time (in seconds) over which a FadeLODNode " - "transitions between its different levels.")); - -ConfigVariableString lod_fade_bin_name -("lod-fade-bin-name", "fixed", - PRC_DESC("The default bin name in which to place the fading part of a " - "FadeLODNode transition.")); - -ConfigVariableInt lod_fade_bin_draw_order -("lod-fade-bin-draw-order", 0, - PRC_DESC("The default bin draw order to assign the fading part of a " - "FadeLODNode transition.")); - -ConfigVariableInt lod_fade_state_override -("lod-fade-state-override", 1000, - PRC_DESC("The default override value to assign to the fade attribs " - "in order to effect a FadeLODNode transition.")); - -ConfigVariableBool verify_lods -("verify-lods", false, - PRC_DESC("When this is true, LODNodes will test when they are rendered to " - "ensure that each child's geometry fits entirely within the radius " - "defined by its switch-out distance. When it is false, LODNodes " - "may have any switch in and out distances, regardless of the " - "actual size of their geometry. This test is only made in NDEBUG " - "mode (the variable is ignored in a production build).")); - ConfigVariableBool show_vertex_animation ("show-vertex-animation", false, PRC_DESC("Set this true to flash any objects whose vertices are animated " diff --git a/panda/src/pgraph/config_pgraph.h b/panda/src/pgraph/config_pgraph.h index e1a7b050b1..3595917bae 100644 --- a/panda/src/pgraph/config_pgraph.h +++ b/panda/src/pgraph/config_pgraph.h @@ -52,7 +52,6 @@ extern ConfigVariableBool uniquify_transforms; extern ConfigVariableBool uniquify_states; extern ConfigVariableBool uniquify_attribs; extern ConfigVariableBool retransform_sprites; -extern ConfigVariableBool support_fade_lod; extern ConfigVariableBool depth_offset_decals; extern ConfigVariableInt max_collect_vertices; extern ConfigVariableInt max_collect_indices; @@ -63,11 +62,6 @@ extern EXPCL_PANDA_PGRAPH ConfigVariableInt max_lenses; extern ConfigVariableBool default_antialias_enable; extern ConfigVariableBool polylight_info; -extern ConfigVariableDouble lod_fade_time; -extern ConfigVariableString lod_fade_bin_name; -extern ConfigVariableInt lod_fade_bin_draw_order; -extern ConfigVariableInt lod_fade_state_override; -extern ConfigVariableBool verify_lods; extern ConfigVariableBool show_vertex_animation; extern ConfigVariableBool show_transparency; diff --git a/panda/src/pgraphnodes/config_pgraphnodes.cxx b/panda/src/pgraphnodes/config_pgraphnodes.cxx index f553043efb..79423f9b7a 100644 --- a/panda/src/pgraphnodes/config_pgraphnodes.cxx +++ b/panda/src/pgraphnodes/config_pgraphnodes.cxx @@ -47,6 +47,41 @@ ConfigVariableEnum default_lod_type PRC_DESC("Set this to either 'pop' or 'fade' to determine the type of " "LODNode that is created by LODNode::make_default_lod().")); +ConfigVariableBool support_fade_lod +("support-fade-lod", true, + PRC_DESC("Set this false to make FadeLOD nodes behave like regular LOD nodes " + "(ignoring the fade time). This may be useful, for instance, to " + "test the performance impact of using FadeLOD nodes.")); + +ConfigVariableDouble lod_fade_time +("lod-fade-time", 0.5, + PRC_DESC("The default amount of time (in seconds) over which a FadeLODNode " + "transitions between its different levels.")); + +ConfigVariableString lod_fade_bin_name +("lod-fade-bin-name", "fixed", + PRC_DESC("The default bin name in which to place the fading part of a " + "FadeLODNode transition.")); + +ConfigVariableInt lod_fade_bin_draw_order +("lod-fade-bin-draw-order", 0, + PRC_DESC("The default bin draw order to assign the fading part of a " + "FadeLODNode transition.")); + +ConfigVariableInt lod_fade_state_override +("lod-fade-state-override", 1000, + PRC_DESC("The default override value to assign to the fade attribs " + "in order to effect a FadeLODNode transition.")); + +ConfigVariableBool verify_lods +("verify-lods", false, + PRC_DESC("When this is true, LODNodes will test when they are rendered to " + "ensure that each child's geometry fits entirely within the radius " + "defined by its switch-out distance. When it is false, LODNodes " + "may have any switch in and out distances, regardless of the " + "actual size of their geometry. This test is only made in NDEBUG " + "mode (the variable is ignored in a production build).")); + ConfigVariableInt parallax_mapping_samples ("parallax-mapping-samples", 3, PRC_DESC("Sets the amount of samples to use in the parallax mapping " diff --git a/panda/src/pgraphnodes/config_pgraphnodes.h b/panda/src/pgraphnodes/config_pgraphnodes.h index 244aed5105..955798fd22 100644 --- a/panda/src/pgraphnodes/config_pgraphnodes.h +++ b/panda/src/pgraphnodes/config_pgraphnodes.h @@ -16,9 +16,14 @@ #define CONFIG_PGRAPHNODES_H #include "pandabase.h" -#include "lodNodeType.h" +#include "notifyCategoryProxy.h" +#include "dconfig.h" +#include "configVariableBool.h" #include "configVariableEnum.h" #include "configVariableDouble.h" +#include "configVariableInt.h" +#include "configVariableString.h" +#include "lodNodeType.h" class DSearchPath; @@ -26,6 +31,13 @@ ConfigureDecl(config_pgraphnodes, EXPCL_PANDA_PGRAPHNODES, EXPTP_PANDA_PGRAPHNOD NotifyCategoryDecl(pgraphnodes, EXPCL_PANDA_PGRAPHNODES, EXPTP_PANDA_PGRAPHNODES); extern ConfigVariableEnum default_lod_type; +extern ConfigVariableBool support_fade_lod; +extern ConfigVariableDouble lod_fade_time; +extern ConfigVariableString lod_fade_bin_name; +extern ConfigVariableInt lod_fade_bin_draw_order; +extern ConfigVariableInt lod_fade_state_override; +extern ConfigVariableBool verify_lods; + extern ConfigVariableInt parallax_mapping_samples; extern ConfigVariableDouble parallax_mapping_scale; diff --git a/panda/src/pgraphnodes/lodNode.h b/panda/src/pgraphnodes/lodNode.h index 769b32aa83..abd98e4cc5 100644 --- a/panda/src/pgraphnodes/lodNode.h +++ b/panda/src/pgraphnodes/lodNode.h @@ -16,7 +16,7 @@ #define LODNODE_H #include "pandabase.h" - +#include "config_pgraphnodes.h" #include "pandaNode.h" #include "luse.h" #include "pvector.h"