mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-09-06 08:47:26 +00:00
chore: consider specified obj containers when post processing
This commit is contained in:
@@ -3,15 +3,39 @@
|
||||
#include <format>
|
||||
#include <iostream>
|
||||
|
||||
void IPakCreator::AddImage(std::string imageName)
|
||||
IPakToCreate::IPakToCreate(std::string name)
|
||||
: m_name(std::move(name))
|
||||
{
|
||||
}
|
||||
|
||||
void IPakToCreate::AddImage(std::string imageName)
|
||||
{
|
||||
m_image_names.emplace_back(std::move(imageName));
|
||||
}
|
||||
|
||||
void IPakCreator::Finalize(ISearchPath& searchPath, const std::filesystem::path& outPath)
|
||||
void IPakToCreate::Build(ISearchPath& searchPath, const std::filesystem::path& outPath)
|
||||
{
|
||||
std::cout << std::format("Creating ipak with {} entries:\n", m_image_names.size());
|
||||
std::cout << std::format("Creating ipak {} with {} entries:\n", m_name, m_image_names.size());
|
||||
|
||||
for (const auto& imageName : m_image_names)
|
||||
std::cout << std::format(" {}\n", imageName);
|
||||
}
|
||||
|
||||
IPakToCreate* IPakCreator::GetOrAddIPak(const std::string& ipakName)
|
||||
{
|
||||
const auto existingIPak = m_ipak_lookup.find(ipakName);
|
||||
if (existingIPak != m_ipak_lookup.end())
|
||||
return existingIPak->second;
|
||||
|
||||
auto newIPak = std::make_unique<IPakToCreate>(ipakName);
|
||||
auto* result = newIPak.get();
|
||||
m_ipaks.emplace_back(std::move(newIPak));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void IPakCreator::Finalize(ISearchPath& searchPath, const std::filesystem::path& outPath)
|
||||
{
|
||||
for (const auto& ipakToCreate : m_ipaks)
|
||||
ipakToCreate->Build(searchPath, outPath);
|
||||
}
|
||||
|
Reference in New Issue
Block a user