diff --git a/dmodels/Sources.pp b/dmodels/Sources.pp index 47e9e89724..395f6c15a0 100644 --- a/dmodels/Sources.pp +++ b/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 diff --git a/dtool/pptempl/Global.pp b/dtool/pptempl/Global.pp index dbdf8dee24..6836f006f8 100644 --- a/dtool/pptempl/Global.pp +++ b/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); diff --git a/dtool/pptempl/Template.models.pp b/dtool/pptempl/Template.models.pp index 6e928060f4..dd88b6f074 100644 --- a/dtool/pptempl/Template.models.pp +++ b/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 //////////////////////////////////////////////////////////////////////