chore: initialize KeyValuePairsCompiler for T6 as obj compiler

This commit is contained in:
Jan 2025-01-03 09:59:28 +01:00
parent e92797e0b8
commit 41d97c0954
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C
3 changed files with 16 additions and 8 deletions

View File

@ -1,4 +1,4 @@
#include "KeyValuePairsCreator.h"
#include "KeyValuePairsCompiler.h"
#include "Game/T6/CommonT6.h"
#include "Game/T6/T6.h"
@ -8,18 +8,23 @@
using namespace T6;
KeyValuePairsCreator::KeyValuePairsCreator(const Zone& zone, const ZoneDefinition& zoneDefinition)
KeyValuePairsCompiler::KeyValuePairsCompiler(const Zone& zone, const ZoneDefinition& zoneDefinition)
: m_zone(zone),
m_zone_definition(zoneDefinition)
{
}
AssetCreationResult KeyValuePairsCreator::CreateAsset(const std::string& assetName, AssetCreationContext& context)
std::optional<asset_type_t> KeyValuePairsCompiler::GetHandlingAssetType() const
{
return std::nullopt;
}
AssetCreationResult KeyValuePairsCompiler::CreateAsset(const std::string& assetName, AssetCreationContext& context)
{
return AssetCreationResult::NoAction();
}
void KeyValuePairsCreator::FinalizeZone(AssetCreationContext& context)
void KeyValuePairsCompiler::FinalizeZone(AssetCreationContext& context)
{
std::vector<KeyValuePair> kvpList;
auto& memory = *m_zone.GetMemory();

View File

@ -6,11 +6,12 @@
namespace T6
{
class KeyValuePairsCreator : public AssetCreator<AssetKeyValuePairs>
class KeyValuePairsCompiler final : public IAssetCreator
{
public:
KeyValuePairsCreator(const Zone& zone, const ZoneDefinition& zoneDefinition);
KeyValuePairsCompiler(const Zone& zone, const ZoneDefinition& zoneDefinition);
[[nodiscard]] std::optional<asset_type_t> GetHandlingAssetType() const override;
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override;
void FinalizeZone(AssetCreationContext& context) override;

View File

@ -3,6 +3,7 @@
#include "Game/T6/T6.h"
#include "Image/ImageIPakPostProcessor.h"
#include "Image/ImageIwdPostProcessor.h"
#include "KeyValuePairs/KeyValuePairsCompiler.h"
#include <memory>
@ -11,11 +12,11 @@ namespace fs = std::filesystem;
namespace
{
void ConfigureCompilers(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath)
void ConfigureCompilers(AssetCreatorCollection& collection, Zone& zone, const ZoneDefinitionContext& zoneDefinition, ISearchPath& searchPath)
{
auto& memory = *zone.GetMemory();
// No compilers yet
collection.AddAssetCreator(std::make_unique<KeyValuePairsCompiler>(zone, zoneDefinition.m_zone_definition));
}
void ConfigurePostProcessors(
@ -39,5 +40,6 @@ void ObjCompiler::ConfigureCreatorCollection(AssetCreatorCollection& collection,
const fs::path& outDir,
const fs::path& cacheDir) const
{
ConfigureCompilers(collection, zone, zoneDefinition, searchPath);
ConfigurePostProcessors(collection, zone, zoneDefinition, searchPath, outDir);
}