diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 0236aba..70ec275 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -19,9 +19,4 @@ add_executable(jsfscramble jsfscramble.cpp) target_link_libraries(jsfscramble PUBLIC europa ) -europa_target(jsfscramble) - -#add_executable(paktest paktest.cpp) -#target_link_libraries(paktest PUBLIC -# europa -# ) +europa_target(jsfscramble) \ No newline at end of file diff --git a/src/tools/paktest.cpp b/src/tools/paktest.cpp deleted file mode 100644 index c1fcf1f..0000000 --- a/src/tools/paktest.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// -// EuropaTools -// -// (C) 2021-2025 modeco80 -// -// SPDX-License-Identifier: MIT -// - -// A test utility to regurgitate a pak. - -#include -#include -#include -#include - -using namespace europa; - -int main(int argc, char** argv) { - std::ifstream ifs(argv[1], std::ifstream::binary); - std::ofstream ofs(argv[2], std::ofstream::binary); - - if(!ifs) { - std::cout << "Couldn't open input PAK file\n"; - return 1; - } - - io::PakWriter writer; - - if(argv[3] != nullptr) { - if(!strcmp(argv[3], "--jedi")) { - std::cout << "Writing Jedi Starfighter archive\n"; - writer.Init(structs::PakHeader::Version::Ver5); - } - } else { - std::cout << "Writing Starfighter archive\n"; - writer.Init(structs::PakHeader::Version::Ver4); - } - - // Read pak data and vomit it into the writer. - // This will temporarily consume 2x the memory (so about 240mb for the biggest paks I've seen), - // but the writer will contain the first copy, - // until it's cleared. - { - io::PakReader reader(ifs); - reader.ReadData(); - - if(reader.Invalid()) { - std::cout << "Invalid pak file, exiting\n"; - return 1; - } - - for(auto& [filename, file] : reader.GetFiles()) { - std::cout << "Reading \"" << filename << "\" into memory\n"; - reader.ReadFile(filename); - writer.GetFiles()[filename] = file; - } - } - - writer.Write(ofs); - - std::cout << "Wrote regurgitated archive to \"" << argv[2] << "\"!\n"; - return 0; -} \ No newline at end of file