mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 02:49:19 +02:00
feat(terrain): binary terrain files (.btf) made out of text terrain files (.txtf) named by terrain directives, checked against length and checksum of the text and loaded section by section when needed; -btf command line conversion; SBT files no longer generated, only loaded
This commit is contained in:
23
EU07.cpp
23
EU07.cpp
@@ -33,6 +33,7 @@ Stele, firleju, szociu, hunter, ZiomalCl, OLI_EU and others
|
||||
#endif
|
||||
|
||||
void export_e3d_standalone(std::string in, std::string out, int flags, bool dynamic);
|
||||
int export_btf_standalone(std::string in, std::string out);
|
||||
|
||||
#include <ctime>
|
||||
#include <string>
|
||||
@@ -98,6 +99,28 @@ int main(int argc, char *argv[])
|
||||
int dynamic = std::stoi(std::string(argv[5]));
|
||||
export_e3d_standalone(in, out, flags, dynamic);
|
||||
}
|
||||
// standalone conversion of text terrain file to binary format: -btf -s <text file> [-o <binary file>]
|
||||
else if (argc >= 4 && std::string(argv[1]) == "-btf")
|
||||
{
|
||||
std::string in;
|
||||
std::string out;
|
||||
for (int i = 2; i + 1 < argc; i += 2)
|
||||
{
|
||||
std::string const option(argv[i]);
|
||||
if (option == "-s")
|
||||
{
|
||||
in = argv[i + 1];
|
||||
}
|
||||
else if (option == "-o")
|
||||
{
|
||||
out = argv[i + 1];
|
||||
}
|
||||
}
|
||||
auto const result{export_btf_standalone(in, out)};
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
std::_Exit(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user