diff --git a/direct/src/distributed/config_distributed.cxx b/direct/src/distributed/config_distributed.cxx index 2ee3b9fe99..d3d3be3354 100644 --- a/direct/src/distributed/config_distributed.cxx +++ b/direct/src/distributed/config_distributed.cxx @@ -26,16 +26,23 @@ ConfigureFn(config_distributed) { init_libdistributed(); } -// This represents the amount of time to block waiting for the TCP -// connection to the game server. It is only used when the connection -// method is NSPR. -const int game_server_timeout_ms = config_distributed.GetInt("game-server-timeout-ms", 20000); +ConfigVariableInt game_server_timeout_ms +("game-server-timeout-ms", 20000, + PRC_DESC("This represents the amount of time to block waiting for the TCP " + "connection to the game server. It is only used when the connection " + "method is NSPR.")); -// These represent the time in seconds by which to artificially lag -// inbound messages. It is only used when the connection method is -// NSPR. -const double min_lag = config_distributed.GetDouble("min-lag", 0.0); -const double max_lag = config_distributed.GetDouble("max-lag", 0.0); +ConfigVariableDouble min_lag +("min-lag", 0.0, + PRC_DESC("This represents the time in seconds by which to artificially lag " + "inbound messages. It is only used when the connection method is " + "NSPR.")); + +ConfigVariableDouble max_lag +("max-lag", 0.0, + PRC_DESC("This represents the time in seconds by which to artificially lag " + "inbound messages. It is only used when the connection method is " + "NSPR.")); //////////////////////////////////////////////////////////////////// // Function: init_libdistributed diff --git a/direct/src/distributed/config_distributed.h b/direct/src/distributed/config_distributed.h index 835dbb88bd..844b4f16e5 100644 --- a/direct/src/distributed/config_distributed.h +++ b/direct/src/distributed/config_distributed.h @@ -22,12 +22,14 @@ #include "directbase.h" #include "notifyCategoryProxy.h" #include "dconfig.h" +#include "configVariableInt.h" +#include "configVariableDouble.h" NotifyCategoryDecl(distributed, EXPCL_DIRECT, EXPTP_DIRECT); -extern const int game_server_timeout_ms; -extern const double min_lag; -extern const double max_lag; +extern ConfigVariableInt game_server_timeout_ms; +extern ConfigVariableDouble min_lag; +extern ConfigVariableDouble max_lag; extern EXPCL_DIRECT void init_libdistributed(); diff --git a/direct/src/interval/config_interval.cxx b/direct/src/interval/config_interval.cxx index f5033043d5..0d6fd13356 100644 --- a/direct/src/interval/config_interval.cxx +++ b/direct/src/interval/config_interval.cxx @@ -35,13 +35,16 @@ ConfigureFn(config_interval) { init_libinterval(); } -// Set this to the default value for set_precision() for each -// CMetaInterval created. -const double interval_precision = config_interval.GetDouble("interval-precision", 1000.0); +ConfigVariableDouble interval_precision +("interval-precision", 1000.0, + PRC_DESC("Set this to the default value for set_precision() for each " + "CMetaInterval created.")); + +ConfigVariableBool verify_intervals +("verify-intervals", false, + PRC_DESC("Set this true to generate an assertion failure if interval " + "functions are called out-of-order.")); -// Set this true to generate an assertion failure if interval -// functions are called out-of-order. -const bool verify_intervals = config_interval.GetBool("verify-intervals", false); //////////////////////////////////////////////////////////////////// // Function: init_libinterval diff --git a/direct/src/interval/config_interval.h b/direct/src/interval/config_interval.h index 1783c8e3f1..39703ba38b 100644 --- a/direct/src/interval/config_interval.h +++ b/direct/src/interval/config_interval.h @@ -22,11 +22,13 @@ #include "directbase.h" #include "notifyCategoryProxy.h" #include "dconfig.h" +#include "configVariableDouble.h" +#include "configVariableBool.h" NotifyCategoryDecl(interval, EXPCL_DIRECT, EXPTP_DIRECT); -extern const double interval_precision; -extern const bool verify_intervals; +extern ConfigVariableDouble interval_precision; +extern ConfigVariableBool verify_intervals; extern EXPCL_DIRECT void init_libinterval();