I don't know what I'm doing

This commit is contained in:
Ottermandias 2024-04-19 15:40:12 +02:00
parent 1641166d6e
commit ef1bbb6d9d
9 changed files with 65 additions and 59 deletions

View file

@ -1,6 +1,5 @@
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
using Penumbra.GameData.Files;
using Penumbra.GameData.Interop;
using Penumbra.Interop.SafeHandles;
@ -9,7 +8,7 @@ namespace Penumbra.Interop.MaterialPreview;
public sealed unsafe class LiveColorTablePreviewer : LiveMaterialPreviewerBase
{
public const int TextureWidth = 4;
public const int TextureHeight = MtrlFile.ColorTable.NumRows;
public const int TextureHeight = GameData.Files.MaterialStructs.ColorTable.NumUsedRows;
public const int TextureLength = TextureWidth * TextureHeight * 4;
private readonly IFramework _framework;
@ -17,7 +16,7 @@ public sealed unsafe class LiveColorTablePreviewer : LiveMaterialPreviewerBase
private readonly Texture** _colorTableTexture;
private readonly SafeTextureHandle _originalColorTableTexture;
private bool _updatePending;
private bool _updatePending;
public Half[] ColorTable { get; }
@ -40,7 +39,7 @@ public sealed unsafe class LiveColorTablePreviewer : LiveMaterialPreviewerBase
if (_originalColorTableTexture == null)
throw new InvalidOperationException("Material doesn't have a color table");
ColorTable = new Half[TextureLength];
ColorTable = new Half[TextureLength];
_updatePending = true;
framework.Update += OnFrameworkUpdate;