2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-12 19:47:27 +00:00

chore: consider specified obj containers when post processing

This commit is contained in:
Jan
2025-01-02 16:26:42 +01:00
parent a7254aa11c
commit fe5d0f79ff
21 changed files with 296 additions and 53 deletions

View File

@@ -1,17 +1,43 @@
#include "IwdCreator.h"
#include "Utils/FileToZlibWrapper.h"
#include <format>
#include <iostream>
void IwdCreator::AddFile(std::string filePath)
IwdToCreate::IwdToCreate(std::string name)
: m_name(std::move(name))
{
}
void IwdToCreate::AddFile(std::string filePath)
{
m_file_paths.emplace_back(std::move(filePath));
}
void IwdCreator::Finalize(ISearchPath& searchPath, const std::filesystem::path& outPath)
void IwdToCreate::Build(ISearchPath& searchPath, const std::filesystem::path& outPath)
{
std::cout << std::format("Creating iwd with {} entries:\n", m_file_paths.size());
std::cout << std::format("Creating iwd {} with {} entries:\n", m_name, m_file_paths.size());
for (const auto& filePath : m_file_paths)
std::cout << std::format(" {}\n", filePath);
}
IwdToCreate* IwdCreator::GetOrAddIwd(const std::string& iwdName)
{
const auto existingIwd = m_iwd_lookup.find(iwdName);
if (existingIwd != m_iwd_lookup.end())
return existingIwd->second;
auto newIwd = std::make_unique<IwdToCreate>(iwdName);
auto* result = newIwd.get();
m_iwds.emplace_back(std::move(newIwd));
return result;
}
void IwdCreator::Finalize(ISearchPath& searchPath, const std::filesystem::path& outPath)
{
for (const auto& iwdToCreate : m_iwds)
iwdToCreate->Build(searchPath, outPath);
}