diff --git a/README.md b/README.md index 4366dd2..b248895 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,14 @@ This repository contains different tools for A.I.M. games. 6. Models converter: AIM1/2 format -> .OBJ + .MTL. Textures are included. 7. Script to TXT convertor. 8. Texture converter: TM -> TGA. +9. MPJ loader (dummy implementation). +10. Save loader (dummy implementation). # Build instructions 1. Download and install latest CMake http://www.cmake.org/download/ +1. Download and add to PATH latest CPPAN https://cppan.org/client/ 2. Clone this repository 3. Open the source directory -4. Execute in console `cmake -H. -Bwin` -5. Run win/aim_tools.sln file (Visual Studio solution file) +4. Execute in console `cppan --generate .` +5. Open generated solution file (Visual Studio solution file) 6. Build the project diff --git a/src/mmo_extractor/mmo_extractor.cpp b/src/mmo_extractor/mmo_extractor.cpp index 45dd15e..ce1acbb 100644 --- a/src/mmo_extractor/mmo_extractor.cpp +++ b/src/mmo_extractor/mmo_extractor.cpp @@ -274,7 +274,7 @@ int main(int argc, char *argv[]) cl::opt print_mechanoids("print_mechanoids", cl::desc("print mechanoids")); cl::opt db_path("db", cl::desc("database file")); cl::alias db_pathA("d", cl::aliasopt(db_path)); - cl::opt p(cl::Positional, cl::desc(".mmo file or directory with .mmo files"), cl::value_desc("file or directory"), cl::Required); + cl::opt p(cl::Positional, cl::desc("<.mmo file or directory with .mmo files>"), cl::value_desc("file or directory"), cl::Required); cl::ParseCommandLineOptions(argc, argv); diff --git a/src/mmp_extractor/mmp.cpp b/src/mmp_extractor/mmp.cpp index d2e26a0..edcbdbe 100644 --- a/src/mmp_extractor/mmp.cpp +++ b/src/mmp_extractor/mmp.cpp @@ -363,9 +363,7 @@ void mmp::writeSplitColormap() const int i = 0; for (auto &color : colors) { - auto m = colormap; - for (auto &pixel : m) - pixel = pixel == color ? 0x0000FF00 : 0; + ++i; auto fn = filename; std::ostringstream ss; ss << "0x"; @@ -373,7 +371,12 @@ void mmp::writeSplitColormap() const ss.width(8); ss << std::hex << std::uppercase << color; fn += ".colormap." + ss.str() + ".png"; - std::cout << "\r[" << ++i << "/" << colors.size() << "] Processing color " << ss.str(); + if (fs::exists(fn)) + continue; + auto m = colormap; + for (auto &pixel : m) + pixel = pixel == color ? 0x0000FF00 : 0; + std::cout << "\r[" << i << "/" << colors.size() << "] Processing color " << ss.str(); cv::imwrite(fn.u8string(), cv::Mat(m)); } } diff --git a/src/mod_converter/mod_converter.cpp b/src/mod_converter/mod_converter.cpp index 8964c16..adf4153 100644 --- a/src/mod_converter/mod_converter.cpp +++ b/src/mod_converter/mod_converter.cpp @@ -37,7 +37,7 @@ using namespace std; // options bool silent = false; bool printMaxPolygonBlock = false; -cl::opt p(cl::Positional, cl::desc("MOD_ file or directory with MOD_ files"), cl::value_desc("file or directory"), cl::Required); +cl::opt p(cl::Positional, cl::desc(""), cl::value_desc("file or directory"), cl::Required); void convert_model(const path &fn) {