2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-03-25 22:13:02 +00:00

feat: add techset dumping for iw5

This commit is contained in:
Jan Laupetin
2026-03-18 21:19:22 +01:00
parent f9e4a6d34c
commit 72f285178b
11 changed files with 1567 additions and 27 deletions

View File

@@ -1,6 +1,9 @@
#include "ObjWriterIW5.h"
#include "Game/IW5/Material/MaterialJsonDumperIW5.h"
#include "Game/IW5/Techset/PixelShaderDumperIW5.h"
#include "Game/IW5/Techset/TechsetDumperIW5.h"
#include "Game/IW5/Techset/VertexShaderDumperIW5.h"
#include "Game/IW5/XModel/XModelDumperIW5.h"
#include "Image/ImageDumperIW5.h"
#include "Leaderboard/LeaderboardJsonDumperIW5.h"
@@ -25,10 +28,15 @@ void ObjWriter::RegisterAssetDumpers(AssetDumpingContext& context)
// REGISTER_DUMPER(AssetDumperXModelSurfs)
RegisterAssetDumper(std::make_unique<xmodel::DumperIW5>());
RegisterAssetDumper(std::make_unique<material::JsonDumperIW5>());
// REGISTER_DUMPER(AssetDumperMaterialPixelShader)
// REGISTER_DUMPER(AssetDumperMaterialVertexShader)
// REGISTER_DUMPER(AssetDumperMaterialVertexDeclaration)
// REGISTER_DUMPER(AssetDumperMaterialTechniqueSet)
RegisterAssetDumper(std::make_unique<techset::PixelShaderDumperIW5>());
RegisterAssetDumper(std::make_unique<techset::VertexShaderDumperIW5>());
RegisterAssetDumper(std::make_unique<techset::DumperIW5>(
#ifdef TECHSET_DEBUG
true
#else
false
#endif
));
RegisterAssetDumper(std::make_unique<image::DumperIW5>());
// REGISTER_DUMPER(AssetDumpersnd_alias_list_t)
// REGISTER_DUMPER(AssetDumperSndCurve)

View File

@@ -1,4 +1,4 @@
#options GAME(IW4)
#options GAME(IW4, IW5)
#filename "Game/" + GAME + "/Techset/PixelShaderDumper" + GAME + ".cpp"

View File

@@ -1,4 +1,4 @@
#options GAME(IW4)
#options GAME(IW4, IW5)
#filename "Game/" + GAME + "/Techset/PixelShaderDumper" + GAME + ".h"

View File

@@ -1,4 +1,4 @@
#options GAME(IW3, IW4, T5, T6)
#options GAME(IW3, IW4, IW5, T5, T6)
#filename "Game/" + GAME + "/Techset/TechsetDumper" + GAME + ".cpp"
@@ -110,7 +110,7 @@ namespace
{
std::vector<techset::CommonStreamRouting> commonRouting;
#if defined(FEATURE_IW4)
#if defined(FEATURE_IW4) || defined(FEATURE_IW5)
if (vertexDecl && vertexDecl->name && vertexDecl->name[0] != ',')
#else
if (vertexDecl)
@@ -124,7 +124,7 @@ namespace
static_cast<techset::CommonStreamDestination>(routing.dest));
}
}
#if defined(FEATURE_IW4)
#if defined(FEATURE_IW4) || defined(FEATURE_IW5)
else if (vertexDecl && vertexDecl->name)
{
auto result = techset::CreateVertexDeclFromName(&vertexDecl->name[1], commonRoutingInfos);
@@ -270,10 +270,10 @@ namespace
techset::CommonTechniqueShader ConvertToCommonShader(const MaterialVertexShader* vertexShader)
{
#if defined(FEATURE_IW4)
#if defined(FEATURE_IW4) || defined(FEATURE_IW5)
if (vertexShader && vertexShader->name && vertexShader->name[0] == ',')
{
auto* globalAsset = GameGlobalAssetPools::GetGlobalPoolsForGame(GameId::IW4)->GetAsset<AssetVertexShader>(&vertexShader->name[1]);
auto* globalAsset = GameGlobalAssetPools::GetGlobalPoolsForGame(GameId::GAME)->GetAsset<AssetVertexShader>(&vertexShader->name[1]);
if (globalAsset)
vertexShader = globalAsset->Asset();
}
@@ -303,10 +303,10 @@ namespace
techset::CommonTechniqueShader ConvertToCommonShader(const MaterialPixelShader* pixelShader)
{
#if defined(FEATURE_IW4)
#if defined(FEATURE_IW4) || defined(FEATURE_IW5)
if (pixelShader && pixelShader->name && pixelShader->name[0] == ',')
{
auto* globalAsset = GameGlobalAssetPools::GetGlobalPoolsForGame(GameId::IW4)->GetAsset<AssetPixelShader>(&pixelShader->name[1]);
auto* globalAsset = GameGlobalAssetPools::GetGlobalPoolsForGame(GameId::GAME)->GetAsset<AssetPixelShader>(&pixelShader->name[1]);
if (globalAsset)
pixelShader = globalAsset->Asset();
}

View File

@@ -1,4 +1,4 @@
#options GAME(IW3, IW4, T5, T6)
#options GAME(IW3, IW4, IW5, T5, T6)
#filename "Game/" + GAME + "/Techset/TechsetDumper" + GAME + ".h"

View File

@@ -1,4 +1,4 @@
#options GAME(IW4)
#options GAME(IW4, IW5)
#filename "Game/" + GAME + "/Techset/VertexShaderDumper" + GAME + ".cpp"

View File

@@ -1,4 +1,4 @@
#options GAME(IW4)
#options GAME(IW4, IW5)
#filename "Game/" + GAME + "/Techset/VertexShaderDumper" + GAME + ".h"