Browse Source

TEXATTRIB_DIR

David Rose 24 years ago
parent
commit
53c0704d7a
3 changed files with 14 additions and 1 deletions
  1. 1 0
      dmodels/Sources.pp
  2. 2 0
      dtool/pptempl/Global.pp
  3. 11 1
      dtool/pptempl/Template.models.pp

+ 1 - 0
dmodels/Sources.pp

@@ -1,3 +1,4 @@
 // This is the toplevel directory for a models tree.
 
 #define DIR_TYPE models_toplevel
+#define TEXATTRIB_DIR src/maps

+ 2 - 0
dtool/pptempl/Global.pp

@@ -37,6 +37,8 @@
 // "dconfig"--whose variable $[TARGET] was defined to be "dconfig").
 #map all_libs TARGET(*/static_lib_target */ss_lib_target */lib_target */noinst_lib_target */metalib_target)
 
+#map dir_type DIR_TYPE(*/)
+
 // These allow us to determine whether a particular local library is a
 // static or a dynamic library.  If the library name appears in the
 // static_libs map, it is a static library (i.e. libname.a);

+ 11 - 1
dtool/pptempl/Template.models.pp

@@ -15,7 +15,17 @@
   #error You need at least ppremake version 0.58 to build models.
 #endif
 
-#define texattrib_dir $[TOPDIR]/src/maps
+// Search for the texattrib dir definition.  This will be in the
+// models_topdir directory.
+#define texattrib_dir $[dir_type $[TEXATTRIB_DIR],models_toplevel]
+
+// Prefix $[TOPDIR].  If it wasn't defined, make a default.
+#if $[texattrib_dir]
+  #define texattrib_dir $[TOPDIR]/$[texattrib_dir]
+#else
+  #define texattrib_dir $[TOPDIR]/src/maps
+#endif
+
 #define texattrib_file $[texattrib_dir]/textures.txa
 
 //////////////////////////////////////////////////////////////////////