Skip to content

Commit

Permalink
nw2fbx: Minor log improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Arbos committed Apr 21, 2024
1 parent f03c79c commit 4c8bbe5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
4 changes: 0 additions & 4 deletions nw2fbx/export_gr2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,6 @@ void export_gr2(Export_info& export_info, const char* filename)

void print_gr2_info(GR2_file& gr2)
{
cout << endl;
cout << "===\n";
cout << "GR2\n";
cout << "===\n";
cout << "Skeletons: " << gr2.file_info->skeletons_count << endl;
cout << "Models: " << gr2.file_info->models_count << endl;
cout << "Animations: " << gr2.file_info->animations_count << endl;
Expand Down
24 changes: 16 additions & 8 deletions nw2fbx/nw2fbx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ using namespace std::filesystem;

static void print_header(const MDB_file& mdb)
{
cout << "Major Version: " << mdb.major_version() << endl;
cout << "Minor Version: " << mdb.minor_version() << endl;
cout << "Packet Count: " << mdb.packet_count() << endl;
cout << "Version: " << mdb.major_version() << '.'
<< mdb.minor_version() << endl;
cout << "Packet Count: " << mdb.packet_count() << endl;
cout << endl;
}

Expand Down Expand Up @@ -323,11 +323,6 @@ static void print_packet(const MDB_file::Packet* packet)

static void print_mdb(const MDB_file& mdb)
{
cout << endl;
cout << "===\n";
cout << "MDB\n";
cout << "===\n";

print_header(mdb);

for (uint32_t i = 0; i < mdb.packet_count(); ++i)
Expand Down Expand Up @@ -384,6 +379,9 @@ static bool extract_arg(const Config& config, const char* arg,
}

static auto& archives = model_archives(config);

cout << '\n';

auto r = archives.find_file(arg);
if (r.matches != 1)
return false;
Expand Down Expand Up @@ -480,6 +478,11 @@ static bool export_skeletons(Export_info& export_info, vector<Input>& inputs)
{
for (auto &input : inputs) {
if (input.gr2 && input.gr2->file_info->skeletons_count > 0) {
cout << '\n';
cout << "===\n";
cout << "GR2 " << path(input.filename).filename().string() << '\n';
cout << "===\n";

print_gr2_info(*input.gr2);

auto &dep = export_info.dependencies[input.filename];
Expand Down Expand Up @@ -509,6 +512,11 @@ static bool export_mdb_files(Export_info& export_info, vector<Input>& inputs)
{
for (auto &input : inputs) {
if (input.mdb) {
cout << '\n';
cout << "===\n";
cout << "MDB " << path(input.filename).filename().string() << '\n';
cout << "===\n";

print_mdb(*input.mdb);

if (!export_mdb(export_info, *input.mdb)) {
Expand Down

0 comments on commit 4c8bbe5

Please sign in to comment.