David Rose 16 سال پیش
والد
کامیت
9b4f4aa8c6
4فایلهای تغییر یافته به همراه49 افزوده شده و 1 حذف شده
  1. 9 0
      dtool/PandaVersion.pp
  2. 29 0
      dtool/src/prc/configPageManager.cxx
  3. 2 1
      dtool/src/prc/configVariableSearchPath.cxx
  4. 9 0
      dtool/src/prc/prc_parameters.h.pp

+ 9 - 0
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 

+ 29 - 0
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);

+ 2 - 1
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;
   }

+ 9 - 0
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]"