Browse Source

Allow easier bulk map conversion

master
Nico de Poel 3 years ago
parent
commit
a4c3dba734
  1. 2
      .gitignore
  2. 1
      PS1BSP.vcxproj
  3. 32
      main.cpp

2
.gitignore

@ -16,3 +16,5 @@ stuff/
*.bsp *.bsp
*.exe *.exe
*.APS *.APS
*.ents
Release/

1
PS1BSP.vcxproj

@ -118,6 +118,7 @@
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>

32
main.cpp

@ -661,14 +661,42 @@ void free_bsp(world_t* world)
free(world->entities); free(world->entities);
} }
int main(int argc, char** argv)
int convert_map(const char* filename)
{ {
world_t world = { 0 }; world_t world = { 0 };
if (!load_bsp(argv[1], &world))
if (!load_bsp(filename, &world))
return 1; return 1;
printf("Converting map %s...\n", world.name);
int result = process_bsp(&world); int result = process_bsp(&world);
free_bsp(&world); free_bsp(&world);
return !result; 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]);
//}
}
Loading…
Cancel
Save