diff --git a/dtool/PandaVersion.pp b/dtool/PandaVersion.pp index c2cf5e677c..393b24b818 100644 --- a/dtool/PandaVersion.pp +++ b/dtool/PandaVersion.pp @@ -18,3 +18,12 @@ // Panda. If you build your own Panda, leave this unchanged. #define PANDA_DISTRIBUTOR homebuilt +// This string is used to describe the Panda3D "package" associated +// with this current build of Panda. It should increment with major +// and minor version changes, but not sequence (or "bugfix") changes. +// It should be unique for each unique distributor. The default is +// the empty string, which means this build does not precisely match +// any distributable Panda3D packages. If you are making a Panda3D +// build which you will be using to produce a distributable Panda3D +// package, you should set this string appropriately. +#define PANDA_PACKAGE_VERSION diff --git a/dtool/src/prc/configPageManager.cxx b/dtool/src/prc/configPageManager.cxx index 33e2c1c4e8..d170e55085 100644 --- a/dtool/src/prc/configPageManager.cxx +++ b/dtool/src/prc/configPageManager.cxx @@ -187,6 +187,35 @@ reload_implicit_pages() { if (q == string::npos) { q = path.length(); } + Filename prc_dir_filename = Filename::from_os_specific(path.substr(p, q - p)); + if (scan_auto_prc_dir(prc_dir_filename)) { + _search_path.append_directory(prc_dir_filename); + } + p = q + 1; + } + } + } + + // PRC_PATH2_ENVVARS is a special variable that is rarely used; it + // exists primarily to support the Cygwin-based "ctattach" tools + // used by the Walt Disney VR Studio. This defines a set of + // environment variable(s) that define a search path, as above; + // except that the directory names on these search paths are + // Panda-style filenames, not Windows-style filenames; and the path + // separator is always a space character, regardless of + // DEFAULT_PATHSEP. + string prc_path2_envvars = PRC_PATH2_ENVVARS; + if (!prc_path2_envvars.empty()) { + vector_string prc_path_envvar_list; + ConfigDeclaration::extract_words(prc_path2_envvars, prc_path_envvar_list); + for (size_t i = 0; i < prc_path_envvar_list.size(); ++i) { + string path = ExecutionEnvironment::get_environment_variable(prc_path_envvar_list[i]); + size_t p = 0; + while (p < path.length()) { + size_t q = path.find_first_of(' ', p); + if (q == string::npos) { + q = path.length(); + } Filename prc_dir_filename = path.substr(p, q - p); if (scan_auto_prc_dir(prc_dir_filename)) { _search_path.append_directory(prc_dir_filename); diff --git a/dtool/src/prc/configVariableSearchPath.cxx b/dtool/src/prc/configVariableSearchPath.cxx index e3a9aae7f0..35115a2e68 100644 --- a/dtool/src/prc/configVariableSearchPath.cxx +++ b/dtool/src/prc/configVariableSearchPath.cxx @@ -43,7 +43,8 @@ reload_search_path() { } } - if (num_unique_references == 0) { + if (_prefix.is_empty() && _postfix.is_empty() && + num_unique_references == 0) { // An empty search path implicitly has the default value. _cache = _default_value; } diff --git a/dtool/src/prc/prc_parameters.h.pp b/dtool/src/prc/prc_parameters.h.pp index aaca14e912..e8dffa3180 100644 --- a/dtool/src/prc/prc_parameters.h.pp +++ b/dtool/src/prc/prc_parameters.h.pp @@ -25,6 +25,15 @@ which to search for prc files. */ # define PRC_PATH_ENVVARS "$[PRC_PATH_ENVVARS]" +/* This is a special variable that is rarely used; it exists primarily + to support the Cygwin-based "ctattach" tools used by the Walt + Disney VR Studio. This defines a set of environment variable(s) + that define a search path, as above; except that the directory + names on these search paths are Panda-style filenames, not + Windows-style filenames; and the path separator is always a space + character, regardless of DEFAULT_PATHSEP. */ +# define PRC_PATH2_ENVVARS "$[PRC_PATH2_ENVVARS]" + /* The filename(s) to search for in the above paths. Normally this is *.prc. */ # define PRC_PATTERNS "$[PRC_PATTERNS]"