1
0
mirror of synced 2025-01-19 01:14:08 +01:00

Fix shader options not editng or saving back

This commit is contained in:
KillzXGaming 2019-05-12 11:52:36 -04:00
parent 5c605ead3f
commit 078c841190
6 changed files with 16 additions and 2 deletions

Binary file not shown.

View File

@ -266,6 +266,16 @@ namespace FirstPlugin
throw new NotImplementedException("Cannot set image data! Operation not implemented!");
}
private const uint SwizzleBase = 0x000D0000;
private uint Swizzle
{
get
{
return SwizzleBase | (byte)(SheetIndex * 2);
}
}
public override byte[] GetImageData(int ArrayLevel = 0, int MipLevel = 0)
{
uint bpp = GetBytesPerPixel(Format);
@ -286,7 +296,7 @@ namespace FirstPlugin
surf.mipOffset = new uint[0];
surf.mipData = null;
surf.tileMode = (uint)GX2.GX2TileMode.MODE_2D_TILED_THIN1;
surf.swizzle = (uint)(SheetIndex);
surf.swizzle = Swizzle;
surf.swizzle *= 2;
surf.numArray = 1;
@ -318,7 +328,8 @@ namespace FirstPlugin
prop.ArrayCount = ArrayCount;
prop.ImageSize = (uint)TextureTGLP.SheetDataList[SheetIndex].Length;
prop.Format = Format;
prop.Swizzle = (uint)(SheetIndex * 2);
prop.Swizzle = Swizzle;
editor.Text = Text;
editor.LoadProperties(prop);

View File

@ -76,6 +76,9 @@ namespace FirstPlugin.Forms
option.Name = edtior.textBoxName.Text;
option.Value = edtior.textBoxValue.Text;
material.shaderassign.options[option.Name] = option.Value;
shaderOptionsListView.Refresh();
}
}
}