2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-07-06 19:21:52 +00:00

chore: move material compilation behind compiler flag

This commit is contained in:
Jan
2025-06-28 16:06:11 +01:00
parent b05a473e6a
commit f23b47ca13
7 changed files with 18 additions and 11 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
#pragma once
#include "Asset/IAssetCreator.h"
#include "Game/IW4/IW4.h"
#include "Gdt/IGdtQueryable.h"
#include "SearchPath/ISearchPath.h"
#include "Utils/MemoryManager.h"
namespace IW4
{
std::unique_ptr<AssetCreator<AssetMaterial>> CreateMaterialCompiler(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt);
} // namespace IW4

View File

@ -2,6 +2,7 @@
#include "Game/IW4/IW4.h"
#include "Image/ImageIwdPostProcessor.h"
#include "Material/CompilerMaterialIW4.h"
#include <memory>
@ -9,11 +10,13 @@ using namespace IW4;
namespace
{
void ConfigureCompilers(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath)
void ConfigureCompilers(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt)
{
auto& memory = zone.Memory();
// No compilers yet
#ifdef EXPERIMENTAL_MATERIAL_COMPILATION
collection.AddAssetCreator(CreateCompilingMaterialLoader(memory, searchPath, gdt));
#endif
}
void ConfigurePostProcessors(AssetCreatorCollection& collection,
@ -39,5 +42,6 @@ void ObjCompiler::ConfigureCreatorCollection(AssetCreatorCollection& collection,
IOutputPath& outDir,
IOutputPath& cacheDir) const
{
ConfigureCompilers(collection, zone, searchPath, gdt);
ConfigurePostProcessors(collection, zone, zoneDefinition, searchPath, zoneStates, outDir);
}