Finish add multiple inputs files support

This commit is contained in:
JackCarterSmith 2019-07-21 16:46:36 +02:00
parent 00be994dd5
commit 9999530948

View File

@ -16,6 +16,7 @@ int _options = 0x0000; // Global options settings variable
int main(int argc, char *argv[]) {
// Init buffer vars
HMT_FILE *hmt_fdatas = NULL;
int file_index;
// Check if filenames arguments exist
if (argc < 2) {
@ -26,10 +27,12 @@ int main(int argc, char *argv[]) {
if (_options == -1) return EXIT_SUCCESS;
// Do the work
hmt_fdatas = extractDatasFromHMT(argv[(_options >> 8) + 0]); //TODO: Manage multi inputs files
if (hmt_fdatas == NULL) return EXIT_FAILURE;
if (exportTextures(hmt_fdatas, argv[(_options >> 8) + 0]) == EXIT_FAILURE) return EXIT_FAILURE;
purgeHMTFromMemory(hmt_fdatas); // Clean up memory (because I'm a good boy)
for (file_index=(_options >> 8) & 0xFF; file_index<argc; file_index++) {
hmt_fdatas = extractDatasFromHMT(argv[file_index]);
if (hmt_fdatas == NULL) return EXIT_FAILURE;
if (exportTextures(hmt_fdatas, argv[file_index]) == EXIT_FAILURE) return EXIT_FAILURE;
purgeHMTFromMemory(hmt_fdatas); // Clean up memory (because I'm a good boy)
}
return EXIT_SUCCESS;
}