diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h index 38d41f6..ce09c15 100644 --- a/engine/joint/v4k.h +++ b/engine/joint/v4k.h @@ -586258,8 +586258,17 @@ bool cook_start( const char *cook_ini, const char *masks, int flags ) { char *s = strchr( ART, ';' ); if(s) *s = 0; char *w = strchr( ART, ' ' ); if(w) *w = 0; char *out = 0; const char *sep = ""; + const char *v4k_title = getenv("V4K_TITLE"); for each_substring(ART, ",", t) { - char *tmp = file_pathabs(va("%s%s", HOME, t)) + ART_LEN; + char *tt = t; + if (v4k_title && strlen(v4k_title) > 0) { + const char *symbols[] = { "{{V4K_TITLE}}", getenv("V4K_TITLE") }; + tt = (char *)strlerp(1, symbols, t); + } else if (strstri(tt, "{{V4K_TITLE}}")) { + continue; + } + char *tmp = file_pathabs(va("%s%s", HOME, tt)) + ART_LEN; + PRINTF("ART mount+=%s\n", tmp); for(int i = 0; tmp[i]; ++i) if(tmp[i]=='\\') tmp[i] = '/'; strcatf(&out, "%s%s%s", sep, tmp, strendi(tmp, "/") ? "" : "/"); assert( out[strlen(out) - 1] == '/' ); diff --git a/engine/split/v4k_cooker.c b/engine/split/v4k_cooker.c index d32becf..244bfe9 100644 --- a/engine/split/v4k_cooker.c +++ b/engine/split/v4k_cooker.c @@ -621,8 +621,17 @@ bool cook_start( const char *cook_ini, const char *masks, int flags ) { char *s = strchr( ART, ';' ); if(s) *s = 0; char *w = strchr( ART, ' ' ); if(w) *w = 0; char *out = 0; const char *sep = ""; + const char *v4k_title = getenv("V4K_TITLE"); for each_substring(ART, ",", t) { - char *tmp = file_pathabs(va("%s%s", HOME, t)) + ART_LEN; + char *tt = t; + if (v4k_title && strlen(v4k_title) > 0) { + const char *symbols[] = { "{{V4K_TITLE}}", getenv("V4K_TITLE") }; + tt = (char *)strlerp(1, symbols, t); + } else if (strstri(tt, "{{V4K_TITLE}}")) { + continue; + } + char *tmp = file_pathabs(va("%s%s", HOME, tt)) + ART_LEN; + PRINTF("ART mount+=%s\n", tmp); for(int i = 0; tmp[i]; ++i) if(tmp[i]=='\\') tmp[i] = '/'; strcatf(&out, "%s%s%s", sep, tmp, strendi(tmp, "/") ? "" : "/"); assert( out[strlen(out) - 1] == '/' ); diff --git a/engine/v4k.c b/engine/v4k.c index ad08190..6807ed1 100644 --- a/engine/v4k.c +++ b/engine/v4k.c @@ -4435,8 +4435,17 @@ bool cook_start( const char *cook_ini, const char *masks, int flags ) { char *s = strchr( ART, ';' ); if(s) *s = 0; char *w = strchr( ART, ' ' ); if(w) *w = 0; char *out = 0; const char *sep = ""; + const char *v4k_title = getenv("V4K_TITLE"); for each_substring(ART, ",", t) { - char *tmp = file_pathabs(va("%s%s", HOME, t)) + ART_LEN; + char *tt = t; + if (v4k_title && strlen(v4k_title) > 0) { + const char *symbols[] = { "{{V4K_TITLE}}", getenv("V4K_TITLE") }; + tt = (char *)strlerp(1, symbols, t); + } else if (strstri(tt, "{{V4K_TITLE}}")) { + continue; + } + char *tmp = file_pathabs(va("%s%s", HOME, tt)) + ART_LEN; + PRINTF("ART mount+=%s\n", tmp); for(int i = 0; tmp[i]; ++i) if(tmp[i]=='\\') tmp[i] = '/'; strcatf(&out, "%s%s%s", sep, tmp, strendi(tmp, "/") ? "" : "/"); assert( out[strlen(out) - 1] == '/' ); diff --git a/tools/cook.c b/tools/cook.c index d7751c9..fff3384 100644 --- a/tools/cook.c +++ b/tools/cook.c @@ -1,6 +1,7 @@ +#define V4K_IMPLEMENTATION #define COOK_ON_DEMAND 0 #define COOK_FROM_TERMINAL 1 -#include "..\engine\v4k.c" +#include "..\engine\joint\v4k.h" int main(int argc, const char **argv) { double timer = time_ss(); diff --git a/tools/cook.exe b/tools/cook.exe index 711f099..15b79c1 100644 Binary files a/tools/cook.exe and b/tools/cook.exe differ diff --git a/tools/cook.ini b/tools/cook.ini index c9ef0b0..d762020 100644 --- a/tools/cook.ini +++ b/tools/cook.ini @@ -7,7 +7,7 @@ ; syntax: symbols are defined in KEY=value form, as seen below. TOOLS=./ ; folder where our pipeline tools are located -ART=../demos/art/,../engine/art/,../depot/art/common/,../depot/art/%V4K_TITLE%/ ; comma-separated folder(s) that store all our asset files +ART=../demos/art/,../engine/art/,../depot/art/common/,../depot/art/{{V4K_TITLE}}/ ; comma-separated folder(s) that store all our asset files ; lines starting with @windows, @linux or @osx will be processed only where OS matches. ; we are defining here some symbols differently for each platform.