2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-05-17 07:21:43 +00:00

Fix LMAP parsing and don't resolve till after ptr is ready.

This commit is contained in:
njohnson
2026-05-11 14:55:04 -04:00
committed by Jan Laupetin
parent 4208bab758
commit 336c9d8d86
10 changed files with 79 additions and 48 deletions
@@ -32,13 +32,10 @@ namespace
auto* lightDef = m_memory.Alloc<GfxLightDef>();
lightDef->name = m_memory.Dup(assetName.c_str());
context.GetZoneAssetCreationState<LightDefAssetCreationState>().SetLightDefLookupStart(lightDef, context);
AssetRegistration<AssetLightDef> registration(assetName, lightDef);
std::string imageName;
int8_t samplerState;
int8_t lmapLookupStart;
file.m_stream->read(reinterpret_cast<char*>(&samplerState), sizeof(int8_t));
std::getline(*file.m_stream, imageName, '\0');
@@ -53,6 +50,8 @@ namespace
lightDef->attenuation.samplerState = samplerState;
lightDef->attenuation.image = imageDependency->Asset();
context.GetZoneAssetCreationState<LightDefAssetCreationState>().SetLightDefLookupStart(lightDef, context);
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
}