2023-10-10 05:55:06 +00:00
|
|
|
#define V4K_IMPLEMENTATION
|
2023-07-30 19:18:50 +00:00
|
|
|
#define COOK_ON_DEMAND 0
|
|
|
|
#define COOK_FROM_TERMINAL 1
|
2023-10-10 14:15:20 +00:00
|
|
|
#include "../engine/joint/v4k.h"
|
2023-07-30 19:18:50 +00:00
|
|
|
|
|
|
|
int main(int argc, const char **argv) {
|
|
|
|
double timer = time_ss();
|
|
|
|
|
|
|
|
if( flag("--help") || flag("-h") || flag("-?") ) {
|
|
|
|
printf("%s [/pathfiles/to/cook] [options]\n\n", argv[0]);
|
|
|
|
printf("Options:\n");
|
|
|
|
printf("\t--quiet\n\t--cook-ini=/pathfile/to/cook.ini\n\t--cook-debug\n\t--cook-additive\n\t--cook-jobs=N\n\t--cook-compressor=[level][use]");
|
|
|
|
printf("\toverride compressor (level=0..10, use=PPP,ULZ,LZ4,CRSH,DEFL,LZP,LZMA,BALZ,LZW,LZSS,BCM)\n");
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *ini_file = option("--cook-ini", COOK_INI);
|
|
|
|
|
|
|
|
unsigned num_cooked = 0;
|
|
|
|
for( int i = 1; i < argc; ++i ) {
|
|
|
|
num_cooked += argv[i][0] != '-' && cook_start(ini_file, argv[i], COOK_ASYNC) ? cook_stop(), 1 : 0;
|
|
|
|
}
|
|
|
|
if( !num_cooked ) {
|
|
|
|
if( cook_start(ini_file, "**", COOK_ASYNC) ) cook_stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !flag("--quiet") ) printf("Ok, %5.2fs.\n", time_ss() - timer);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// compiled with:
|
|
|
|
// tcc cook.c
|
|
|
|
// cl cook.c /openmp /Os /Ox /O2 /Oy /MT /DNDEBUG /GL /GF /Gw /arch:AVX2 /link /OPT:ICF /LTCG
|
|
|
|
// cc -ObjC cook.c -o cook.osx -framework Cocoa -framework IOKit -framework audiotoolbox -O3
|
|
|
|
// cc cook.c -o cook.linux -lm -lpthread -ldl -lX11 -O3
|