mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 07:18:11 -05:00
test: add unit test for ImageIPakPostProcessor
This commit is contained in:
@ -394,6 +394,11 @@ void IPakToCreate::Build(ISearchPath& searchPath, IOutputPath& outPath)
|
||||
std::cout << std::format("Created ipak {} with {} entries\n", m_name, m_image_names.size());
|
||||
}
|
||||
|
||||
const std::vector<std::string>& IPakToCreate::GetImageNames() const
|
||||
{
|
||||
return m_image_names;
|
||||
}
|
||||
|
||||
IPakCreator::IPakCreator()
|
||||
: m_kvp_creator(nullptr)
|
||||
{
|
||||
@ -412,6 +417,7 @@ IPakToCreate* IPakCreator::GetOrAddIPak(const std::string& ipakName)
|
||||
|
||||
auto newIPak = std::make_unique<IPakToCreate>(ipakName);
|
||||
auto* result = newIPak.get();
|
||||
m_ipak_lookup.emplace(ipakName, result);
|
||||
m_ipaks.emplace_back(std::move(newIPak));
|
||||
|
||||
assert(m_kvp_creator);
|
||||
|
@ -16,6 +16,7 @@ public:
|
||||
|
||||
void AddImage(std::string imageName);
|
||||
void Build(ISearchPath& searchPath, IOutputPath& outPath);
|
||||
[[nodiscard]] const std::vector<std::string>& GetImageNames() const;
|
||||
|
||||
private:
|
||||
std::string m_name;
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include "IPak/IPakCreator.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <ranges>
|
||||
|
||||
AbstractImageIPakPostProcessor::AbstractImageIPakPostProcessor(const ZoneDefinitionContext& zoneDefinition,
|
||||
ISearchPath& searchPath,
|
||||
@ -57,7 +56,7 @@ void AbstractImageIPakPostProcessor::PostProcessAsset(XAssetInfoGeneric& assetIn
|
||||
while (m_current_ipak && m_zone_definition.m_asset_index_in_definition >= m_current_ipak_end_index)
|
||||
FindNextObjContainer();
|
||||
|
||||
if (m_current_ipak && m_zone_definition.m_asset_index_in_definition <= m_current_ipak_start_index)
|
||||
if (m_current_ipak && m_zone_definition.m_asset_index_in_definition >= m_current_ipak_start_index)
|
||||
m_current_ipak->AddImage(assetInfo.m_name);
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,7 @@ IwdToCreate* IwdCreator::GetOrAddIwd(const std::string& iwdName)
|
||||
|
||||
auto newIwd = std::make_unique<IwdToCreate>(iwdName);
|
||||
auto* result = newIwd.get();
|
||||
m_iwd_lookup.emplace(iwdName, result);
|
||||
m_iwds.emplace_back(std::move(newIwd));
|
||||
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user