feat: add t5 gfxlight dumper and loader

This commit is contained in:
njohnson
2026-05-16 09:54:23 +02:00
committed by Jan Laupetin
parent 3c15f8ad7e
commit 5b6a725f78
7 changed files with 133 additions and 3 deletions
@@ -0,0 +1,25 @@
#include "LightDefDumperT5.h"
#include "LightDef/LightDefCommon.h"
using namespace T5;
namespace light_def
{
void DumperT5::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetLightDef::Type>& asset)
{
const auto* lightDef = asset.Asset();
const auto assetFile = context.OpenAssetFile(GetFileNameForAsset(asset.m_name));
if (!assetFile || lightDef->attenuation.image == nullptr || lightDef->attenuation.image->name == nullptr)
return;
auto& stream = *assetFile;
const auto* imageName = lightDef->attenuation.image->name;
if (imageName[0] == ',')
imageName = &imageName[1];
stream << lightDef->attenuation.samplerState << imageName << static_cast<char>(lightDef->lmapLookupStart);
}
} // namespace light_def