mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-03-15 17:33:03 +00:00
feat: t5 techset compiling
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#include "ObjCompilerT5.h"
|
||||
|
||||
#include "Game/T5/T5.h"
|
||||
#include "Game/T5/Techset/TechniqueCompilerT5.h"
|
||||
#include "Game/T5/Techset/TechsetCompilerT5.h"
|
||||
#include "Game/T5/Techset/VertexDeclCompilerT5.h"
|
||||
#include "Image/ImageIwdPostProcessor.h"
|
||||
|
||||
#include <memory>
|
||||
@@ -13,7 +16,10 @@ namespace
|
||||
{
|
||||
auto& memory = zone.Memory();
|
||||
|
||||
// No compilers yet
|
||||
collection.AddAssetCreator(techset::CreateTechsetCompilerT5(memory, searchPath));
|
||||
|
||||
collection.AddSubAssetCreator(techset::CreateTechniqueCompilerT5(memory, zone, searchPath));
|
||||
collection.AddSubAssetCreator(techset::CreateVertexDeclCompilerT5(memory));
|
||||
}
|
||||
|
||||
void ConfigurePostProcessors(AssetCreatorCollection& collection,
|
||||
@@ -39,5 +45,6 @@ void ObjCompiler::ConfigureCreatorCollection(AssetCreatorCollection& collection,
|
||||
IOutputPath& outDir,
|
||||
IOutputPath& cacheDir) const
|
||||
{
|
||||
ConfigureCompilers(collection, zone, searchPath);
|
||||
ConfigurePostProcessors(collection, zone, zoneDefinition, searchPath, zoneStates, outDir);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#options GAME(IW3, IW4, T6)
|
||||
#options GAME(IW3, IW4, T5, T6)
|
||||
|
||||
#filename "Game/" + GAME + "/Techset/TechniqueCompiler" + GAME + ".cpp"
|
||||
|
||||
@@ -297,6 +297,14 @@ namespace
|
||||
|
||||
if (ShouldApplyFlag200(technique))
|
||||
technique.flags |= TECHNIQUE_FLAG_200;
|
||||
#elif defined(FEATURE_T5)
|
||||
// Not a particularly cool way to do this but...
|
||||
// the game actually does this :shrug:
|
||||
if (lowerTechniqueName == "zprepass" || lowerTechniqueName.starts_with("pimp_technique_zprepass_")
|
||||
|| lowerTechniqueName.starts_with("pimp_technique_layer_zprepass_"))
|
||||
{
|
||||
technique.flags |= MTL_TECHFLAG_ZPREPASS;
|
||||
}
|
||||
#elif defined(FEATURE_T6)
|
||||
// Not a particularly cool way to do this but...
|
||||
// the game actually does this :shrug:
|
||||
@@ -332,7 +340,7 @@ namespace
|
||||
return technique;
|
||||
}
|
||||
|
||||
#if defined(FEATURE_T6)
|
||||
#if defined(FEATURE_T5) || defined(FEATURE_T6)
|
||||
void ApplyTechFlagsFromMaterial(const Material& material, const Zone& zone)
|
||||
{
|
||||
if (!material.techniqueSet || !material.techniqueSet->name || !material.stateBitsTable)
|
||||
@@ -458,13 +466,15 @@ namespace
|
||||
|
||||
void FinalizeZone(AssetCreationContext& context) override
|
||||
{
|
||||
#if defined(FEATURE_T6)
|
||||
#if defined(FEATURE_T5) || defined(FEATURE_T6)
|
||||
const auto materials = m_zone.m_pools.PoolAssets<AssetMaterial>();
|
||||
for (auto* materialAsset : materials)
|
||||
{
|
||||
ApplyTechFlagsFromMaterial(*materialAsset->Asset(), m_zone);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEATURE_T6)
|
||||
const auto techniques = context.PoolSubAssets<SubAssetTechnique>();
|
||||
for (auto* techniqueSubAsset : techniques)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#options GAME(IW3, IW4, T6)
|
||||
#options GAME(IW3, IW4, T5, T6)
|
||||
|
||||
#filename "Game/" + GAME + "/Techset/TechniqueCompiler" + GAME + ".h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#options GAME(IW3, IW4, T6)
|
||||
#options GAME(IW3, IW4, T5, T6)
|
||||
|
||||
#filename "Game/" + GAME + "/Techset/TechsetCompiler" + GAME + ".cpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#options GAME(IW3, IW4, T6)
|
||||
#options GAME(IW3, IW4, T5, T6)
|
||||
|
||||
#filename "Game/" + GAME + "/Techset/TechsetCompiler" + GAME + ".h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#options GAME(IW3, IW4, T6)
|
||||
#options GAME(IW3, IW4, T5, T6)
|
||||
|
||||
#filename "Game/" + GAME + "/Techset/VertexDeclCompiler" + GAME + ".cpp"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#define FEATURE_IW5
|
||||
#elif GAME == "T5"
|
||||
#define FEATURE_T5
|
||||
#define IS_SUB_ASSET
|
||||
#elif GAME == "T6"
|
||||
#define FEATURE_T6
|
||||
#define IS_SUB_ASSET
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#options GAME(IW3, IW4, T6)
|
||||
#options GAME(IW3, IW4, T5, T6)
|
||||
|
||||
#filename "Game/" + GAME + "/Techset/VertexDeclCompiler" + GAME + ".h"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define FEATURE_IW5
|
||||
#elif GAME == "T5"
|
||||
#define FEATURE_T5
|
||||
#define IS_SUB_ASSET
|
||||
#elif GAME == "T6"
|
||||
#define FEATURE_T6
|
||||
#define IS_SUB_ASSET
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "Game/T5/Image/ImageLoaderEmbeddedT5.h"
|
||||
#include "Game/T5/Image/ImageLoaderExternalT5.h"
|
||||
#include "Game/T5/T5.h"
|
||||
#include "Game/T5/Techset/PixelShaderLoaderT5.h"
|
||||
#include "Game/T5/Techset/VertexShaderLoaderT5.h"
|
||||
#include "Game/T5/XModel/LoaderXModelT5.h"
|
||||
#include "Localize/LoaderLocalizeT5.h"
|
||||
#include "Material/LoaderMaterialT5.h"
|
||||
@@ -136,6 +138,9 @@ namespace
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderDDL>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderGlasses>(memory));
|
||||
// collection.AddAssetCreator(std::make_unique<AssetLoaderEmblemSet>(memory));
|
||||
|
||||
collection.AddSubAssetCreator(techset::CreateVertexShaderLoaderT5(memory, searchPath));
|
||||
collection.AddSubAssetCreator(techset::CreatePixelShaderLoaderT5(memory, searchPath));
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#options GAME(IW3, IW4, T6)
|
||||
#options GAME(IW3, IW4, T5, T6)
|
||||
|
||||
#filename "Game/" + GAME + "/Techset/PixelShaderLoader" + GAME + ".cpp"
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#elif GAME == "T5"
|
||||
#define FEATURE_T5
|
||||
#define IS_DX9
|
||||
#define IS_SUB_ASSET
|
||||
#elif GAME == "T6"
|
||||
#define FEATURE_T6
|
||||
#define IS_DX11
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#options GAME(IW3, IW4, T6)
|
||||
#options GAME(IW3, IW4, T5, T6)
|
||||
|
||||
#filename "Game/" + GAME + "/Techset/PixelShaderLoader" + GAME + ".h"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define FEATURE_IW5
|
||||
#elif GAME == "T5"
|
||||
#define FEATURE_T5
|
||||
#define IS_SUB_ASSET
|
||||
#elif GAME == "T6"
|
||||
#define FEATURE_T6
|
||||
#define IS_SUB_ASSET
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#options GAME(IW3, IW4, T6)
|
||||
#options GAME(IW3, IW4, T5, T6)
|
||||
|
||||
#filename "Game/" + GAME + "/Techset/VertexShaderLoader" + GAME + ".cpp"
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#elif GAME == "T5"
|
||||
#define FEATURE_T5
|
||||
#define IS_DX9
|
||||
#define IS_SUB_ASSET
|
||||
#elif GAME == "T6"
|
||||
#define FEATURE_T6
|
||||
#define IS_DX11
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#options GAME(IW3, IW4, T6)
|
||||
#options GAME(IW3, IW4, T5, T6)
|
||||
|
||||
#filename "Game/" + GAME + "/Techset/VertexShaderLoader" + GAME + ".h"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define FEATURE_IW5
|
||||
#elif GAME == "T5"
|
||||
#define FEATURE_T5
|
||||
#define IS_SUB_ASSET
|
||||
#elif GAME == "T6"
|
||||
#define FEATURE_T6
|
||||
#define IS_SUB_ASSET
|
||||
|
||||
Reference in New Issue
Block a user