mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 10:17:23 +01:00
Once more with feeling
This commit is contained in:
parent
889f01a724
commit
8e1745d67a
2 changed files with 2 additions and 3 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
||||||
using FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;
|
using FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;
|
||||||
using Lumina.Data.Files;
|
|
||||||
using Penumbra.GameData.Files.MaterialStructs;
|
using Penumbra.GameData.Files.MaterialStructs;
|
||||||
using Penumbra.GameData.Interop;
|
using Penumbra.GameData.Interop;
|
||||||
using Texture = FFXIVClientStructs.FFXIV.Client.Graphics.Kernel.Texture;
|
using Texture = FFXIVClientStructs.FFXIV.Client.Graphics.Kernel.Texture;
|
||||||
|
|
@ -69,7 +68,7 @@ public static unsafe class MaterialService
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var material = (MaterialResourceHandle*) model.AsCharacterBase->MaterialsSpan[index].Value;
|
var material = (MaterialResourceHandle*) model.AsCharacterBase->MaterialsSpan[index].Value;
|
||||||
if (material == null || material->DataSet == null)
|
if (material == null || material->DataSet == null || material->DataSetSize < sizeof(ColorTable.Table) || !material->HasColorTable)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return (ColorTable.Table*)material->DataSet;
|
return (ColorTable.Table*)material->DataSet;
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ public sealed unsafe class PrepareColorSet
|
||||||
public static bool TryGetColorTable(MaterialResourceHandle* material, StainIds stainIds,
|
public static bool TryGetColorTable(MaterialResourceHandle* material, StainIds stainIds,
|
||||||
out ColorTable.Table table)
|
out ColorTable.Table table)
|
||||||
{
|
{
|
||||||
if (material->DataSet == null)
|
if (material->DataSet == null || material->DataSetSize < sizeof(ColorTable.Table) || !material->HasColorTable)
|
||||||
{
|
{
|
||||||
table = default;
|
table = default;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue