Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into pr/322

This commit is contained in:
Eric Wasylishen 2022-01-22 16:28:14 -07:00
commit edec33ad93
4 changed files with 6 additions and 6 deletions

View File

@ -521,7 +521,7 @@ int main(int argc, char **argv)
ConvertBSPFormat(&bspdata, fmt);
WriteBSPFile(source.replace_filename(source.filename().string() + "-" + argv[i]), &bspdata);
WriteBSPFile(source.replace_filename(source.stem().string() + "-" + argv[i]), &bspdata);
} else if (!strcmp(argv[i], "--extract-entities")) {
uint32_t crc = CRC_Block((unsigned char *)bsp.dentdata.data(), bsp.dentdata.size() - 1);
@ -601,7 +601,7 @@ int main(int argc, char **argv)
const bool geomOnly = !strcmp(argv[i], "--decompile-geomonly");
source.replace_extension("");
source.replace_filename(source.filename().string() + "-decompile");
source.replace_filename(source.stem().string() + "-decompile");
source.replace_extension(".map");
fmt::print("-> writing {}...\n", source);

View File

@ -1456,7 +1456,7 @@ static void MakeSurfaceLights(const mbsp_t *bsp)
if (surflight_dump) {
surflights_dump_filename = mapfilename;
surflights_dump_filename.replace_filename(surflights_dump_filename.filename().string() + "-surflights")
surflights_dump_filename.replace_filename(surflights_dump_filename.stem().string() + "-surflights")
.replace_extension("map");
surflights_dump_file.open(surflights_dump_filename);
}

View File

@ -28,7 +28,7 @@
static std::ofstream InitObjFile(const std::string &filesuffix)
{
std::filesystem::path name = options.szBSPName;
name.replace_filename(options.szBSPName.filename().string() + "_" + filesuffix).replace_extension("obj");
name.replace_filename(options.szBSPName.stem().string() + "_" + filesuffix).replace_extension("obj");
std::ofstream objfile(name);
if (!objfile)
@ -40,7 +40,7 @@ static std::ofstream InitObjFile(const std::string &filesuffix)
static std::ofstream InitMtlFile(const std::string &filesuffix)
{
std::filesystem::path name = options.szBSPName;
name.replace_filename(options.szBSPName.filename().string() + "_" + filesuffix).replace_extension("mtl");
name.replace_filename(options.szBSPName.stem().string() + "_" + filesuffix).replace_extension("mtl");
std::ofstream file(name);
if (!file)

View File

@ -2100,7 +2100,7 @@ void ConvertMapFile(void)
}
std::filesystem::path filename = options.szBSPName;
filename.replace_filename(options.szBSPName.filename().string() + append);
filename.replace_filename(options.szBSPName.stem().string() + append);
std::ofstream f(filename);