From a4c3dba734b28557ff659a611849123231acb774 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Wed, 8 Feb 2023 11:47:23 +0100 Subject: [PATCH] Allow easier bulk map conversion --- .gitignore | 2 ++ PS1BSP.vcxproj | 1 + main.cpp | 32 ++++++++++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d01c91b..8fa1d12 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ stuff/ *.bsp *.exe *.APS +*.ents +Release/ diff --git a/PS1BSP.vcxproj b/PS1BSP.vcxproj index 1452283..bb52a8d 100644 --- a/PS1BSP.vcxproj +++ b/PS1BSP.vcxproj @@ -118,6 +118,7 @@ true _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true + stdcpp17 Console diff --git a/main.cpp b/main.cpp index eb61223..c3c4452 100644 --- a/main.cpp +++ b/main.cpp @@ -661,14 +661,42 @@ void free_bsp(world_t* world) free(world->entities); } -int main(int argc, char** argv) +int convert_map(const char* filename) { world_t world = { 0 }; - if (!load_bsp(argv[1], &world)) + if (!load_bsp(filename, &world)) return 1; + printf("Converting map %s...\n", world.name); int result = process_bsp(&world); free_bsp(&world); return !result; } + +const char* mapNames[] = +{ + "n64start", + "n64e1m1", + "n64e1m5", + "n64e1m6", + "n64e1m8", + "n64e2m2", + "n64e2m6", + "n64e3m1", + "n64e3m2", + "n64e3m4", + "n64e4m6", + "n64e4m7", +}; +const int numMapNames = sizeof(mapNames) / sizeof(mapNames[0]); + +int main(int argc, char** argv) +{ + convert_map(argv[1]); + + //for (int i = 0; i < numMapNames; ++i) + //{ + // convert_map(mapNames[i]); + //} +}